One helluva mess.

Further extended Makefile.global/build/configure so that we can
have a 'template' file for each OS (and each version of OS, as in BSDi)
which is used as much as possible to generate Makefile.global

	Any future ports should look at using the template file as a basis,
before moving over to Makefile.global.

	This will most probably break alot of the ports, atho I've tried to
be very neat about it...
This commit is contained in:
Marc G. Fournier 1997-04-04 07:59:48 +00:00
parent 82a27f230a
commit f2eb14ad0d
28 changed files with 479 additions and 436 deletions

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.16 1997/04/03 21:25:59 scrappy Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.17 1997/04/04 07:57:45 scrappy Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
@ -243,60 +243,22 @@ ifneq ($(wildcard $(SRCDIR)/Makefile.custom), )
include $(SRCDIR)/Makefile.custom
endif
#############################################################################
# include port specific rules and variables.
#
#
# HISTORY: Before October 1996, this file included the following line:
# -include $(MKDIR)/port/postgres.mk.$(PORTNAME)
# Now, we instead have all the former contents of those .mk files inline
# with ifeq ($(PORTNAME) ...). This makes it easier to read the make
# files and to make certain updates. It should also help with the migration
# to autoconf. -Bryan
# Since there are no longer separate files for each platform, much of the
# commonality among the platforms ought to be factored out of the following.
##############################################################################
#
# AR
ifneq (,$(findstring /$(PORTNAME)/, /BSD44_derived/bsdi/sparc/))
AROPT = cq
else
AROPT = crs
endif
##############################################################################
#
# Shared libraries.
# This is overridden for many PORTNAMEs below.
DLSUFFIX= .so
#
# CC
#
#-------------------------------------------------------------
# See the subdirectory template for default settings for these
#-------------------------------------------------------------
CC= @CC@
#
# LEX
#
LEX= @LEX@
CFLAGS= @CPPFLAGS@
AROPT= @AROPT@
CFLAGS= @CPPFLAGS@ @ALL@
CFLAGS_SL= @SHARED_LIBS@
CFLAGS_BE= @BACKEND@
LDFLAGS= @LDFLAGS@
LDADD_BE= @LIBS@
LD_ADD= $(LDADD_BE)
DLSUFFIX= @DLSUFFIX@
#----------------------------------------------------------------------
ifeq ($(PORTNAME), BSD44_derived)
# cc is gcc, but never mind about that...
# FreeBSD 2.1R with new Flex v2.5.2 in /usr/local
CFLAGS_SL= -fpic -DPIC
%.so: %.o
$(LD) -x -r -o $<.obj $<
@echo building shared object $@
@ -316,17 +278,6 @@ ifeq ($(PORTNAME), aix)
# symbol names to tell them what to export/import.
MAKE_EXPORTS= true
#
# Random things that must be passed everywhere to enable
# everything to compile. :-/
#
# The -qmaxmem is because of optimizer limits.
# The HAVE_ANSI_CPP flag indicates that cc isn't ANSI but also doesn't
# have a Reiser (pcc-style) cpp.
#
CFLAGS_BE= -qchars=signed -qmaxmem=4000
EXPSUFF= .exp
POSTGRES_EXP= $(SRCDIR)/backend/postgres$(EXPSUFF)
@ -349,57 +300,13 @@ endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), alpha)
# NOFIXADE disallows unaligned access.
# on Ultrix and OSF/1 it invokes an explicit syscall.
# on HP-UX it turns off certain compiler options.
# This is defined here because a bunch of clients include tmp/c.h,
# which is where the work is done on HP-UX. It only affects the
# backend on Ultrix and OSF/1.
ifdef ENFORCE_ALIGNMENT
CFLAGS_BE= -DNOFIXADE
else
CFLAGS_BE= -DNOPRINTADE
endif
# use the regex library
USE_REGEX= 1
%.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $<
DASH_N=
BACKSLASH_C= '\\\\c'
endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), bsdi)
PRE_BSDI_2_1= false
ifeq ($(shell uname -r), 2.0)
PRE_BSDI_2_1= true
endif
ifeq ($(shell uname -r), 2.01)
PRE_BSDI_2_1= true
endif
ifeq ($(PRE_BSDI_2_1), true)
# cc is gcc v1.42
# gcc is gcc v2.6.3
# use the regex library
USE_REGEX= 1
CFLAGS_BE= -DPRE_BSDI_2_1
endif
DLSUFFIX= .o
endif
#--------------------------------------------------------------------------
ifeq ($(PORTNAME), dgux)
CFLAGS_SL= -fpic
%.so: %.o
$(CC) -shared -o $@ $<
@ -410,50 +317,29 @@ endif
#----------------------------------------------------------------------------
ifeq ($(PORTNAME), hpux)
# -W l,-E export symbols for linking with the shared libraries
# dynamic loader
ifeq ($(CC), cc)
CFLAGS_BE= -W l,-E
LDFLAGS_BE= -W l,-E
endif
ifeq ($(CC), gcc)
LDADD_BE+= /usr/lib/libdld.sl
endif
ifdef ENFORCE_ALIGNMENT
CFLAGS_BE= -DNOFIXADE
else
HPUX_VERS:= $(shell uname -r)
HPUX_MAJOR= ${HPUX_VERS:R:E}
HPUX_MINOR= ${HPUX_VERS:E}
ifeq ($(HPUX_MAJOR), 08)
CFLAGS_BE+= +u -DHP_S500_ALIGN
LDFLAGS_BE+= +u
else
ifeq ($(HPUX_MAJOR), 09)
ifeq ($(CC), cc)
CFLAGS_BE+= +u4
LDFLAGS_BE+= +u4
endif
endif
endif
endif
# (extended) ANSI flag for cc (-Ae is same as -Aa -D_HPUX_SOURCE)
ifeq ($(CC), cc)
CFLAGS_BE+= -Ae
endif
CFLAGS_SL= +z
DLSUFFIX= .sl
#ifdef ENFORCE_ALIGNMENT
# CFLAGS_BE= -DNOFIXADE
#else
# HPUX_VERS:= $(shell uname -r)
# HPUX_MAJOR= ${HPUX_VERS:R:E}
# HPUX_MINOR= ${HPUX_VERS:E}
# ifeq ($(HPUX_MAJOR), 08)
# CFLAGS_BE+= +u -DHP_S500_ALIGN
# LDFLAGS_BE+= +u
# else
# ifeq ($(HPUX_MAJOR), 09)
# ifeq ($(CC), cc)
# CFLAGS_BE+= +u4
# LDFLAGS_BE+= +u4
# endif
# endif
# endif
#endif
%.sl: %.o
$(LD) -b -o $@ $<
DASH_N= ''
BACKSLASH_C= '\\\\c'
endif
#--------------------------------------------------------------------------
@ -461,27 +347,9 @@ endif
ifeq ($(PORTNAME), i386_solaris)
# cc won't work!
#
# Random things that must be passed everywhere to enable
# everything to compile. :-/
#
# The extra -I flag is to scoop up extra BSD-emulating headers.
# This needs to be fixed. Things other than the backend should not be
# accessing headers in the backend directory.
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
ifeq ($(CC), cc)
CFLAGS_SL= -K PIC
else
CFLAGS_SL= -fPIC
endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
DASH_N=''
BACKSLASH_C='\\\\c'
endif
#----------------------------------------------------------------------------
@ -494,26 +362,16 @@ RANLIB= touch
%.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD_ADD)
DASH_N=''
BACKSLASH_C='\\\\c'
endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), linux)
ifndef LINUX_ELF
DLSUFFIX= .o
else
DLSUFFIX= .so
ifdef LINUX_ELF
LDFLAGS_BE= -rdynamic
endif
MK_NO_LORDER= true
# use the regex library
USE_REGEX= 1
CFLAGS_SL= -fpic
%.so: %.o
$(CC) -shared -o $@ $<
@ -522,13 +380,6 @@ endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), sunos4)
ifeq ($(CC), cc)
CFLAGS_SL= -PIC
else
CFLAGS_SL= -fPIC
endif
%.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $<
endif
@ -536,66 +387,34 @@ endif
#----------------------------------------------------------------------------
ifeq ($(PORTNAME), sparc_solaris)
#
# Random things that must be passed everywhere to enable
# everything to compile. :-/
#
# The extra -I flag is to scoop up extra BSD-emulating headers.
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
ifeq ($(CC), cc)
CFLAGS_SL= -K PIC
else
CFLAGS_SL= -fPIC
endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
DASH_N= ''
BACKSLASH_C= '\\\\c'
endif
#-----------------------------------------------------------------------------
ifeq ($(PORTNAME), svr4)
CFLAGS+= -W0
YACC= bison -y
# MAKE_EXPORTS is required for svr4 loaders that want a file of
# symbol names to tell them what to export/import.
MAKE_EXPORTS= true
#
# Random things that must be passed everywhere to enable
# everything to compile. :-/
#
# The extra -I flag is to scoop up extra BSD-emulating headers.
CFLAGS_BE+= -I$(SRCDIR)/backend/port/svr4
LDADD_BE+= /usr/ucblib/libucb.a
LDFLAGS_BE= -LD-Blargedynsym
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
DASH_N= ''
BACKSLASH_C= '\\\\c'
endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), ultrix4)
ifdef ENFORCE_ALIGNMENT
CFLAGS_BE= -DNOFIXADE
endif
# install creates intermediate directories
NO_BEFOREINSTL= true
CFLAGS_SL= -G 0
DLSUFFIX= .o
endif
@ -605,10 +424,6 @@ endif
# The univel port is almost guaranteed NOT to work yet.
#
ifeq ($(PORTNAME), univel)
#CFLAGS+= -DHAVE_RUSAGE -DTRACEDEBUG -DASYNC_DEBUG
CFLAGS+= -DHAVE_RUSAGE -m486 -Dsvr4
CFLAGS_SL= -fPIC
YACC= bison -y
#
@ -621,29 +436,13 @@ LDADD= $(LD_ADD)
# symbol names to tell them what to export/import.
#MAKE_EXPORTS= true
#
# Random things that must be passed everywhere to enable
# everything to compile. :-/
#
# The extra -I flag is to scoop up extra BSD-emulating headers.
CFLAGS_BE+= -I$(SRCDIR)/backend/port/univel
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
DASH_N= ''
BACKSLASH_C= '\\\\c'
INSTALL= /usr/ucb/install
endif
#---------------------------------------------------------------------------
ifeq ($(PORTNAME), nextstep)
AROPT= rc
DLSUFFIX= .o
endif
# This goes here so that customization in Makefile.custom is effective
##############################################################################

View File

@ -13,23 +13,53 @@ else
ECHO_C='\c'
fi
$ECHO_N "Additional directories to search for .h files []: $ECHO_C"
ls template
TEMPLATE=generic
$ECHO_N "Appropriate template file [$TEMPLATE]: $ECHO_C"
read a
if [ "$a." = "." ]
if [ "$a." = " ." ]
then
ADD_INC_DIRS=
echo "You must choose an appropriate template file"
exit
else
ADD_INC_DIRS=`echo "$a" | sed 's@ *@ @g; s@^\([^ ]\)@-I\1@; s@ \([^ ]\)@ -I\1@g'`
INC_CFLAGS="$ADD_INC_DIRS"
CPPFLAGS="$ADD_INC_DIRS" ; export CPPFLAGS
if [ "$a." = "." ]; then
TEMPLATE=template/$TEMPLATE
else
TEMPLATE=template/$a
fi
AROPT=`grep AROPT $TEMPLATE | awk -F: '{print $2}'`
SHARED_LIBS=`grep SHARED_LIBS $TEMPLATE | awk -F: '{print $2}'`
ALL=`grep ALL $TEMPLATE | awk -F: '{print $2}'`
BACKEND=`grep BACKEND $TEMPLATE | awk -F: '{print $2}'`
SRCH_INC=`grep SRCH_INC $TEMPLATE | awk -F: '{print $2}'`
SRCH_LIB=`grep SRCH_LIB $TEMPLATE | awk -F: '{print $2}'`
USE_LOCALE=`grep USE_LOCALE $TEMPLATE | awk -F: '{print $2}'`
fi
$ECHO_N "Additional directories to search for library files []: $ECHO_C"
$ECHO_N "Additional directories to search for .h files [$SRCH_INC]: $ECHO_C"
read a
if [ "$a." != "." ]
if [ "$a." = " ." ]
then
ADD_LIB_DIRS=`echo "$a" | sed 's@ *@ @g; s@^\([^ ]\)@-L\1@; s@ \([^ ]\)@ -L\1@g'`
LDFLAGS="$ADD_LIB_DIRS" ; export LDFLAGS
CPPFLAGS=
else
if [ "$a." != "." ]; then
SRCH_INC = $a
fi
echo $a
CPPFLAGS=`echo "$SRCH_INC" | sed 's@ *@ @g; s@^\([^ ]\)@-I\1@; s@ \([^ ]\)@ -I\1@g'`
fi
echo ""
$ECHO_N "Additional directories to search for library files [$SRCH_LIB]: $ECHO_C"
read a
if [ "$a." != " ." ]
then
LDFLAGS=
else
if [ "$a." != "." ]; then
SRCH_LIB = $a
fi
LDFLAGS=`echo "$SRCH_LIB" | sed 's@ *@ @g; s@^\([^ ]\)@-L\1@; s@ \([^ ]\)@ -L\1@g'`
fi
IDIR=/usr/local/pgsql
@ -40,13 +70,16 @@ then
IDIR=${a}
fi
USE_LOCALE=no
echo "Define USE_LOCALE to get Postgres work (sort, search)"
$ECHO_N "with national alphabet. [$USE_LOCALE]: $ECHO_C"
read a
if [ "$a." != "." ]
if [ "$a." != " ." ]
then
USE_LOCALE=${a}
USE_LOCALE=no
else
if [ "$a." != "." ]; then
USE_LOCALE=$a
fi
fi
DEF_PGPORT=5432
@ -72,7 +105,8 @@ then
NOHBA=${a}
fi
export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA
export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA AROPT
export SHARED_LIBS CFLAGS CPPFLAGS LDFLAGS
./configure --prefix=${IDIR}

378
src/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -43,19 +43,24 @@ nextstep*) PORTNAME='nextstep';;
echo ""
exit;;
esac
AC_LINK_FILES(port/${PORTNAME}.h, include/os.h)
AC_SUBST(PORTNAME)
AC_SUBST(TR)
AC_SUBST(LDFLAGS)
AC_SUBST(CPPFLAGS)
AC_CONFIG_HEADER(include/config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_LINK_FILES(port/${PORTNAME}.h, include/os.h)
AC_SUBST(PORTNAME)
AC_SUBST(TR)
AC_SUBST(LDFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(AROPT)
AC_SUBST(SHARED_LIBS)
AC_SUBST(ALL)
AC_SUBST(BACKEND)
dnl ****************************************************************
dnl Hold off on the C++ stuff until we can figure out why it doesn't
dnl work under Solaris..

8
src/template/aix Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-qchars=signed -qmaxmem=4000
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

14
src/template/alpha Normal file
View File

@ -0,0 +1,14 @@
AROPT:cq
# NOFIXADE disallows unaligned access.
# on Ultrix and OSF/1 it invokes an explicit syscall.
# on HP-UX it turns off certain compiler options.
# This is defined here because a bunch of clients include tmp/c.h,
# which is where the work is done on HP-UX. It only affects the
# backend on Ultrix and OSF/1.
BACKEND:-DNOFIXADE
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/bsdi Normal file
View File

@ -0,0 +1,8 @@
AROPT:crs
BACKEND:-DPRE_BSDI_2_1
SHARED_LIB:
ALL:
SRCH_INC:/usr/local/include
SRCH_LIB:/usr/local/lib
USE_LOCALE:no
DLSUFFIX:.o

8
src/template/bsdi-2.1 Normal file
View File

@ -0,0 +1,8 @@
AROPT:crs
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:/usr/local/include
SRCH_LIB:/usr/local/lib
USE_LOCALE:no
DLSUFFIX:.o

8
src/template/dgux Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:-fpic
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/freebsd Normal file
View File

@ -0,0 +1,8 @@
AROPT:crs
BACKEND:
SHARED_LIB:-fpic -DPIC
ALL:-O2 -m486 -pipe
SRCH_INC:/usr/local/include
SRCH_LIB:/usr/local/lib
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/generic Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/hpux-cc Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-W l,-E -Ae -DNOFIXADE
SHARED_LIB:+z
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.sl

9
src/template/hpux-gcc Normal file
View File

@ -0,0 +1,9 @@
AROPT:cq
BACKEND:-DNOFIXADE
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DL_LIB:/usr/lib/libdld.sl
DLSUFFIX:.sl

View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/sparc_solaris
SHARED_LIB:-K PIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/sparc_solaris
SHARED_LIB:-fPIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/irix5 Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/linux Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:-fpic
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/linux-elf Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:-fpic
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX=.o

8
src/template/nextstep Normal file
View File

@ -0,0 +1,8 @@
AROPT:rc
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.o

8
src/template/sparc Normal file
View File

@ -0,0 +1,8 @@
AROPT:crs
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/sparc_solaris
SHARED_LIB:-K PIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/sparc_solaris
SHARED_LIB:-fPIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/sunos4-cc Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:-PIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/sunos4-gcc Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:
SHARED_LIB:-fPIC
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/svr4 Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/svr4
SHARED_LIB:
ALL:+W0
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so

8
src/template/ultrix4 Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-DNOFIXADE
SHARED_LIB:-G 0
ALL:
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.o

8
src/template/univel Normal file
View File

@ -0,0 +1,8 @@
AROPT:cq
BACKEND:-I$(SRCDIR)/backend/port/univel
SHARED_LIB:-fPIC
ALL:-DHAVE_RUSAGE -m486 -Dsvr4
SRCH_INC:
SRCH_LIB:
USE_LOCALE:no
DLSUFFIX:.so