Commit ca6da613 authored by Marc G. Fournier's avatar Marc G. Fournier

Have configure auto-detect more of the libraries, and shorten out

the ports section of Makefile.global as a result.
parent de2003c4
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.4 1997/01/24 03:19:48 scrappy Exp $ # $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.5 1997/01/24 03:57:14 scrappy Exp $
# #
# NOTES # NOTES
# Essentially all Postgres make files include this file and use the # Essentially all Postgres make files include this file and use the
...@@ -197,7 +197,7 @@ TK_LIB= -ltk4.1 ...@@ -197,7 +197,7 @@ TK_LIB= -ltk4.1
X11_INCDIR= /usr/include X11_INCDIR= /usr/include
X11_LIBDIR= /usr/lib X11_LIBDIR= /usr/lib
X11_LIB= -lX11 -lsocket -lnsl X11_LIB= -lX11 @SOCKET_LIB@ @NSL_LIB@
############################################################################## ##############################################################################
# #
...@@ -284,15 +284,13 @@ CC= @CC@ ...@@ -284,15 +284,13 @@ CC= @CC@
# LEX # LEX
# #
LEX= @LEX@ LEX= @LEX@
LD_ADD_BE = @LEXLIB@
LDADD_BE= @MATH_LIB@ @DL_LIB@ @LEXLIB@ @SOCKET_LIB@ @NSL_LIB@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
ifeq ($(PORTNAME), BSD44_derived) ifeq ($(PORTNAME), BSD44_derived)
# cc is gcc, but never mind about that... # cc is gcc, but never mind about that...
INSTALL= /usr/bin/install
RANLIB= /usr/bin/ranlib
# FreeBSD 2.1R with new Flex v2.5.2 in /usr/local # FreeBSD 2.1R with new Flex v2.5.2 in /usr/local
CFLAGS_SL= -fpic -DPIC CFLAGS_SL= -fpic -DPIC
...@@ -311,11 +309,9 @@ endif ...@@ -311,11 +309,9 @@ endif
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
ifeq ($(PORTNAME), aix) ifeq ($(PORTNAME), aix)
# might want to try installbsd instead
INSTALL= /usr/ucb/install
# the -lm is because "pow" is defined in libbsd.a and we want pow(3m) # the -lm is because "pow" is defined in libbsd.a and we want pow(3m)
LDADD_BE= -lm -lbsd -ll -lld LDADD_BE+= -lbsd -ll -lld
# MAKE_EXPORTS is required for svr4 loaders that want a file of # MAKE_EXPORTS is required for svr4 loaders that want a file of
# symbol names to tell them what to export/import. # symbol names to tell them what to export/import.
...@@ -348,7 +344,7 @@ $(POSTGRES_EXP): ...@@ -348,7 +344,7 @@ $(POSTGRES_EXP):
@echo Making share library $@ from $*.o, $*$(EXPSUFF), and postgres.exp @echo Making share library $@ from $*.o, $*$(EXPSUFF), and postgres.exp
$(LD) -H512 -T512 -o $@ -e _nostart \ $(LD) -H512 -T512 -o $@ -e _nostart \
-bI:$(POSTGRES_EXP) -bE:$*$(EXPSUFF) \ -bI:$(POSTGRES_EXP) -bE:$*$(EXPSUFF) \
$*.o -lm -lc 2>/dev/null $*.o @MATH_LIB@ -lc 2>/dev/null
endif endif
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -365,7 +361,7 @@ CFLAGS_BE= -DNOFIXADE ...@@ -365,7 +361,7 @@ CFLAGS_BE= -DNOFIXADE
else else
CFLAGS_BE= -DNOPRINTADE CFLAGS_BE= -DNOPRINTADE
endif endif
LDADD_BE= -lln LDADD_BE+= -lln
# use the regex library # use the regex library
USE_REGEX= 1 USE_REGEX= 1
...@@ -393,7 +389,7 @@ endif ...@@ -393,7 +389,7 @@ endif
ifeq ($(PRE_BSDI_2_1), false) ifeq ($(PRE_BSDI_2_1), false)
# cc is gcc v1.42 # cc is gcc v1.42
# gcc is gcc v2.7.2 # gcc is gcc v2.7.2
LDADD_BE= -ltermcap -ldl LDADD_BE+= -ltermcap
ifeq ($(shell uname -r), 2.1) ifeq ($(shell uname -r), 2.1)
LDADD_BE+= -lipc LDADD_BE+= -lipc
endif endif
...@@ -403,7 +399,7 @@ else ...@@ -403,7 +399,7 @@ else
# use the regex library # use the regex library
USE_REGEX= 1 USE_REGEX= 1
CFLAGS_BE= -DPRE_BSDI_2_1 CFLAGS_BE= -DPRE_BSDI_2_1
LDADD_BE= -ldld -lcompat -lipc LDADD_BE+= -ldld -lcompat -lipc
endif endif
DLSUFFIX= .o DLSUFFIX= .o
...@@ -417,12 +413,8 @@ CFLAGS_SL= -fpic ...@@ -417,12 +413,8 @@ CFLAGS_SL= -fpic
%.so: %.o %.so: %.o
$(CC) -shared -o $@ $< $(CC) -shared -o $@ $<
LDADD_BE= -ldl
YACC= bison -y YACC= bison -y
INSTALL=/usr/bin/X11/bsdinst
endif endif
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
...@@ -431,7 +423,7 @@ ifeq ($(PORTNAME), hpux) ...@@ -431,7 +423,7 @@ ifeq ($(PORTNAME), hpux)
# -W l,-E export symbols for linking with the shared libraries # -W l,-E export symbols for linking with the shared libraries
# dynamic loader # dynamic loader
LDADD_BE= -lBSD -ll LDADD_BE+= -lBSD -ll
ifeq $(CC), cc) ifeq $(CC), cc)
CFLAGS_BE= -W l,-E CFLAGS_BE= -W l,-E
LDFLAGS_BE= -W l,-E LDFLAGS_BE= -W l,-E
...@@ -465,12 +457,6 @@ ifeq ($(CC), cc) ...@@ -465,12 +457,6 @@ ifeq ($(CC), cc)
CFLAGS_BE+= -Ae CFLAGS_BE+= -Ae
endif endif
# This is a script from the MIT X11 distribution.
INSTALL= bsdinst
# RANLIB is not used on HP-UX
RANLIB= touch
CFLAGS_SL= +z CFLAGS_SL= +z
DLSUFFIX= .sl DLSUFFIX= .sl
...@@ -487,21 +473,14 @@ endif ...@@ -487,21 +473,14 @@ endif
ifeq ($(PORTNAME), i386_solaris) ifeq ($(PORTNAME), i386_solaris)
# cc won't work! # cc won't work!
# RANLIB is not used on solaris #
RANLIB= touch # Random things that must be passed everywhere to enable
# everything to compile. :-/
INSTALL= /usr/ucb/install #
# The extra -I flag is to scoop up extra BSD-emulating headers.
#
# 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 # This needs to be fixed. Things other than the backend should not be
# accessing headers in the backend directory. # accessing headers in the backend directory.
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
LDADD_BE= -lsocket -lnsl -ll -ldl
LD_ADD= -lsocket -lnsl
ifeq ($(CC), cc) ifeq ($(CC), cc)
CFLAGS_SL= -K PIC CFLAGS_SL= -K PIC
...@@ -520,23 +499,11 @@ endif ...@@ -520,23 +499,11 @@ endif
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
ifeq ($(PORTNAME), irix5) ifeq ($(PORTNAME), irix5)
LDADD_BE= -ll LDADD_BE+= -ll
# RANLIB is not used on IRIX 5 # RANLIB is not used on IRIX 5
RANLIB= touch RANLIB= touch
#If you have GNU install, by all means set CUSTOM_INSTALL to that in
#Makefile.custom. If you read the man page for /usr/bin/X11/bsdinst,
#you will see it is not intended for end user use. It chowns the files
#it installs to root.
INSTALL= /usr/bin/X11/bsdinst
IPCSDIR= /usr/sbin
INSTLOPTS= -m 444
INSTL_EXE_OPTS= -m 555
INSTL_LIB_OPTS= -m 664
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD_ADD) $(LD) -G -Bdynamic -o $@ $< $(LD_ADD)
...@@ -550,10 +517,9 @@ endif ...@@ -550,10 +517,9 @@ endif
ifeq ($(PORTNAME), linux) ifeq ($(PORTNAME), linux)
ifndef LINUX_ELF ifndef LINUX_ELF
DLSUFFIX= .o DLSUFFIX= .o
LDADD_BE= -ldld LDADD_BE+= -ldld
else else
DLSUFFIX= .so DLSUFFIX= .so
LDADD_BE= -ldl
LDFLAGS_BE= -rdynamic LDFLAGS_BE= -rdynamic
endif endif
MK_NO_LORDER= true MK_NO_LORDER= true
...@@ -574,17 +540,13 @@ endif ...@@ -574,17 +540,13 @@ endif
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ifeq ($(PORTNAME), sunos4) ifeq ($(PORTNAME), sunos4)
# cc won't work!
INSTALL= /usr/bin/install
RANLIB= /usr/bin/ranlib
ifeq ($(CC), cc) ifeq ($(CC), cc)
CFLAGS_SL= -PIC CFLAGS_SL= -PIC
else else
CFLAGS_SL= -fPIC CFLAGS_SL= -fPIC
endif endif
LDADD_BE= -lln -ldl LDADD_BE+= -lln
%.so: %.o %.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $< $(LD) -dc -dp -Bdynamic -o $@ $<
...@@ -593,23 +555,12 @@ endif ...@@ -593,23 +555,12 @@ endif
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
ifeq ($(PORTNAME), sparc_solaris) ifeq ($(PORTNAME), sparc_solaris)
# cc won't work!
LDADD_BE= -lsocket -lnsl -ll -ldl
LD_ADD= -lsocket -lnsl
# RANLIB is not used on solaris
RANLIB= touch
INSTALL= /usr/ucb/install
# #
# Random things that must be passed everywhere to enable # Random things that must be passed everywhere to enable
# everything to compile. :-/ # everything to compile. :-/
# #
# The extra -I flag is to scoop up extra BSD-emulating headers. # The extra -I flag is to scoop up extra BSD-emulating headers.
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
LDADD_BE+= -lsocket -lnsl
ifeq ($(CC), cc) ifeq ($(CC), cc)
CFLAGS_SL= -K PIC CFLAGS_SL= -K PIC
...@@ -635,19 +586,13 @@ YACC= bison -y ...@@ -635,19 +586,13 @@ YACC= bison -y
# symbol names to tell them what to export/import. # symbol names to tell them what to export/import.
MAKE_EXPORTS= true MAKE_EXPORTS= true
# RANLIB is not used on svr4
RANLIB= touch
# GNU install
INSTALL= /home/tools/bin/install
# #
# Random things that must be passed everywhere to enable # Random things that must be passed everywhere to enable
# everything to compile. :-/ # everything to compile. :-/
# #
# The extra -I flag is to scoop up extra BSD-emulating headers. # The extra -I flag is to scoop up extra BSD-emulating headers.
CFLAGS_BE+= -I$(SRCDIR)/backend/port/svr4 CFLAGS_BE+= -I$(SRCDIR)/backend/port/svr4
LDADD_BE= -lsocket -lnsl -lc /usr/ucblib/libucb.a -ll -ldl LDADD_BE+= -lc /usr/ucblib/libucb.a
LDFLAGS_BE= -LD-Blargedynsym LDFLAGS_BE= -LD-Blargedynsym
%.so: %.o %.so: %.o
...@@ -663,14 +608,11 @@ ifeq ($(PORTNAME), ultrix4) ...@@ -663,14 +608,11 @@ ifeq ($(PORTNAME), ultrix4)
ifdef ENFORCE_ALIGNMENT ifdef ENFORCE_ALIGNMENT
CFLAGS_BE= -DNOFIXADE CFLAGS_BE= -DNOFIXADE
endif endif
LDADD_BE= -ldl -lln LDADD_BE+= -lln
# install creates intermediate directories # install creates intermediate directories
NO_BEFOREINSTL= true NO_BEFOREINSTL= true
INSTALL= /usr/bin/install
RANLIB= /usr/bin/ranlib
CFLAGS_SL= -G 0 CFLAGS_SL= -G 0
DLSUFFIX= .o DLSUFFIX= .o
...@@ -687,9 +629,7 @@ endif ...@@ -687,9 +629,7 @@ endif
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# All others need -lm # All others need -lm
ifneq ($(PORTNAME), nextstep) LD_ADD+= @MATH_LIB@
LD_ADD+= -lm
endif
# This goes here so that customization in Makefile.custom is effective # This goes here so that customization in Makefile.custom is effective
############################################################################## ##############################################################################
......
This diff is collapsed.
...@@ -75,14 +75,22 @@ dnl if the library readline is present, ...@@ -75,14 +75,22 @@ dnl if the library readline is present,
dnl set the shell variable USE_READLINE dnl set the shell variable USE_READLINE
dnl to have the value USE_READLINE=true dnl to have the value USE_READLINE=true
dnl and substitute it into the makefiles dnl and substitute it into the makefiles
AC_CHECK_LIB(readline, readline, READLINE_LIB='-lreadline') AC_CHECK_LIB(readline, main, READLINE_LIB='-lreadline')
AC_SUBST(READLINE_LIB) AC_SUBST(READLINE_LIB)
AC_CHECK_LIB(history, history, HISTORY_LIB='-lhistory') AC_CHECK_LIB(history, main, HISTORY_LIB='-lhistory')
AC_SUBST(HISTORY_LIB) AC_SUBST(HISTORY_LIB)
AC_CHECK_LIB(curses, main, CURSES_LIB='-lcurses') AC_CHECK_LIB(curses, main, CURSES_LIB='-lcurses')
AC_SUBST(CURSES_LIB) AC_SUBST(CURSES_LIB)
AC_CHECK_LIB(termcap, main, TERMCAP_LIB='-ltermcap') AC_CHECK_LIB(termcap, main, TERMCAP_LIB='-ltermcap')
AC_SUBST(TERMCAP_LIB) AC_SUBST(TERMCAP_LIB)
AC_CHECK_LIB(m, main, MATH_LIB='-lm')
AC_SUBST(MATH_LIB)
AC_CHECK_LIB(dl, main, DL_LIB='-ldl')
AC_SUBST(DL_LIB)
AC_CHECK_LIB(socket, main, SOCKET_LIB='-lsocket')
AC_SUBST(SOCKET_LIB)
AC_CHECK_LIB(nsl, main, NSL_LIB='-lnsl')
AC_SUBST(NSL_LIB)
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment