Skip to content

Commit ca6da61

Browse files
committed
Have configure auto-detect more of the libraries, and shorten out
the ports section of Makefile.global as a result.
1 parent de2003c commit ca6da61

File tree

3 files changed

+356
-208
lines changed

3 files changed

+356
-208
lines changed

src/Makefile.global.in

Lines changed: 23 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.4 1997/01/24 03:19:48 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.5 1997/01/24 03:57:14 scrappy Exp $
1111
#
1212
# NOTES
1313
# Essentially all Postgres make files include this file and use the
@@ -197,7 +197,7 @@ TK_LIB= -ltk4.1
197197

198198
X11_INCDIR= /usr/include
199199
X11_LIBDIR= /usr/lib
200-
X11_LIB= -lX11 -lsocket -lnsl
200+
X11_LIB= -lX11 @SOCKET_LIB@ @NSL_LIB@
201201

202202
##############################################################################
203203
#
@@ -284,15 +284,13 @@ CC= @CC@
284284
# LEX
285285
#
286286
LEX= @LEX@
287-
LD_ADD_BE = @LEXLIB@
287+
288+
LDADD_BE= @MATH_LIB@ @DL_LIB@ @LEXLIB@ @SOCKET_LIB@ @NSL_LIB@
288289

289290
#----------------------------------------------------------------------
290291
ifeq ($(PORTNAME), BSD44_derived)
291292
# cc is gcc, but never mind about that...
292293

293-
INSTALL= /usr/bin/install
294-
RANLIB= /usr/bin/ranlib
295-
296294
# FreeBSD 2.1R with new Flex v2.5.2 in /usr/local
297295

298296
CFLAGS_SL= -fpic -DPIC
@@ -311,11 +309,9 @@ endif
311309
#--------------------------------------------------------------------------
312310

313311
ifeq ($(PORTNAME), aix)
314-
# might want to try installbsd instead
315-
INSTALL= /usr/ucb/install
316312

317313
# the -lm is because "pow" is defined in libbsd.a and we want pow(3m)
318-
LDADD_BE= -lm -lbsd -ll -lld
314+
LDADD_BE+= -lbsd -ll -lld
319315

320316
# MAKE_EXPORTS is required for svr4 loaders that want a file of
321317
# symbol names to tell them what to export/import.
@@ -348,7 +344,7 @@ $(POSTGRES_EXP):
348344
@echo Making share library $@ from $*.o, $*$(EXPSUFF), and postgres.exp
349345
$(LD) -H512 -T512 -o $@ -e _nostart \
350346
-bI:$(POSTGRES_EXP) -bE:$*$(EXPSUFF) \
351-
$*.o -lm -lc 2>/dev/null
347+
$*.o @MATH_LIB@ -lc 2>/dev/null
352348
endif
353349

354350
#---------------------------------------------------------------------------
@@ -365,7 +361,7 @@ CFLAGS_BE= -DNOFIXADE
365361
else
366362
CFLAGS_BE= -DNOPRINTADE
367363
endif
368-
LDADD_BE= -lln
364+
LDADD_BE+= -lln
369365

370366
# use the regex library
371367
USE_REGEX= 1
@@ -393,7 +389,7 @@ endif
393389
ifeq ($(PRE_BSDI_2_1), false)
394390
# cc is gcc v1.42
395391
# gcc is gcc v2.7.2
396-
LDADD_BE= -ltermcap -ldl
392+
LDADD_BE+= -ltermcap
397393
ifeq ($(shell uname -r), 2.1)
398394
LDADD_BE+= -lipc
399395
endif
@@ -403,7 +399,7 @@ else
403399
# use the regex library
404400
USE_REGEX= 1
405401
CFLAGS_BE= -DPRE_BSDI_2_1
406-
LDADD_BE= -ldld -lcompat -lipc
402+
LDADD_BE+= -ldld -lcompat -lipc
407403
endif
408404

409405
DLSUFFIX= .o
@@ -417,12 +413,8 @@ CFLAGS_SL= -fpic
417413
%.so: %.o
418414
$(CC) -shared -o $@ $<
419415

420-
LDADD_BE= -ldl
421-
422416
YACC= bison -y
423417

424-
INSTALL=/usr/bin/X11/bsdinst
425-
426418
endif
427419

428420
#----------------------------------------------------------------------------
@@ -431,7 +423,7 @@ ifeq ($(PORTNAME), hpux)
431423
# -W l,-E export symbols for linking with the shared libraries
432424
# dynamic loader
433425

434-
LDADD_BE= -lBSD -ll
426+
LDADD_BE+= -lBSD -ll
435427
ifeq $(CC), cc)
436428
CFLAGS_BE= -W l,-E
437429
LDFLAGS_BE= -W l,-E
@@ -465,12 +457,6 @@ ifeq ($(CC), cc)
465457
CFLAGS_BE+= -Ae
466458
endif
467459

468-
# This is a script from the MIT X11 distribution.
469-
INSTALL= bsdinst
470-
471-
# RANLIB is not used on HP-UX
472-
RANLIB= touch
473-
474460
CFLAGS_SL= +z
475461
DLSUFFIX= .sl
476462

@@ -487,21 +473,14 @@ endif
487473
ifeq ($(PORTNAME), i386_solaris)
488474
# cc won't work!
489475

490-
# RANLIB is not used on solaris
491-
RANLIB= touch
492-
493-
INSTALL= /usr/ucb/install
494-
495-
#
496-
# Random things that must be passed everywhere to enable
497-
# everything to compile. :-/
498-
#
499-
# The extra -I flag is to scoop up extra BSD-emulating headers.
476+
#
477+
# Random things that must be passed everywhere to enable
478+
# everything to compile. :-/
479+
#
480+
# The extra -I flag is to scoop up extra BSD-emulating headers.
500481
# This needs to be fixed. Things other than the backend should not be
501-
# accessing headers in the backend directory.
502-
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
503-
LDADD_BE= -lsocket -lnsl -ll -ldl
504-
LD_ADD= -lsocket -lnsl
482+
# accessing headers in the backend directory.
483+
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
505484

506485
ifeq ($(CC), cc)
507486
CFLAGS_SL= -K PIC
@@ -520,23 +499,11 @@ endif
520499
#----------------------------------------------------------------------------
521500

522501
ifeq ($(PORTNAME), irix5)
523-
LDADD_BE= -ll
502+
LDADD_BE+= -ll
524503

525504
# RANLIB is not used on IRIX 5
526505
RANLIB= touch
527506

528-
#If you have GNU install, by all means set CUSTOM_INSTALL to that in
529-
#Makefile.custom. If you read the man page for /usr/bin/X11/bsdinst,
530-
#you will see it is not intended for end user use. It chowns the files
531-
#it installs to root.
532-
INSTALL= /usr/bin/X11/bsdinst
533-
534-
IPCSDIR= /usr/sbin
535-
536-
INSTLOPTS= -m 444
537-
INSTL_EXE_OPTS= -m 555
538-
INSTL_LIB_OPTS= -m 664
539-
540507
%.so: %.o
541508
$(LD) -G -Bdynamic -o $@ $< $(LD_ADD)
542509

@@ -550,10 +517,9 @@ endif
550517
ifeq ($(PORTNAME), linux)
551518
ifndef LINUX_ELF
552519
DLSUFFIX= .o
553-
LDADD_BE= -ldld
520+
LDADD_BE+= -ldld
554521
else
555522
DLSUFFIX= .so
556-
LDADD_BE= -ldl
557523
LDFLAGS_BE= -rdynamic
558524
endif
559525
MK_NO_LORDER= true
@@ -574,17 +540,13 @@ endif
574540
#---------------------------------------------------------------------------
575541

576542
ifeq ($(PORTNAME), sunos4)
577-
# cc won't work!
578-
579-
INSTALL= /usr/bin/install
580-
RANLIB= /usr/bin/ranlib
581543

582544
ifeq ($(CC), cc)
583545
CFLAGS_SL= -PIC
584546
else
585547
CFLAGS_SL= -fPIC
586548
endif
587-
LDADD_BE= -lln -ldl
549+
LDADD_BE+= -lln
588550

589551
%.so: %.o
590552
$(LD) -dc -dp -Bdynamic -o $@ $<
@@ -593,23 +555,12 @@ endif
593555
#----------------------------------------------------------------------------
594556

595557
ifeq ($(PORTNAME), sparc_solaris)
596-
# cc won't work!
597-
598-
LDADD_BE= -lsocket -lnsl -ll -ldl
599-
LD_ADD= -lsocket -lnsl
600-
601-
# RANLIB is not used on solaris
602-
RANLIB= touch
603-
604-
INSTALL= /usr/ucb/install
605-
606558
#
607559
# Random things that must be passed everywhere to enable
608560
# everything to compile. :-/
609561
#
610562
# The extra -I flag is to scoop up extra BSD-emulating headers.
611563
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
612-
LDADD_BE+= -lsocket -lnsl
613564

614565
ifeq ($(CC), cc)
615566
CFLAGS_SL= -K PIC
@@ -635,19 +586,13 @@ YACC= bison -y
635586
# symbol names to tell them what to export/import.
636587
MAKE_EXPORTS= true
637588

638-
# RANLIB is not used on svr4
639-
RANLIB= touch
640-
641-
# GNU install
642-
INSTALL= /home/tools/bin/install
643-
644589
#
645590
# Random things that must be passed everywhere to enable
646591
# everything to compile. :-/
647592
#
648593
# The extra -I flag is to scoop up extra BSD-emulating headers.
649594
CFLAGS_BE+= -I$(SRCDIR)/backend/port/svr4
650-
LDADD_BE= -lsocket -lnsl -lc /usr/ucblib/libucb.a -ll -ldl
595+
LDADD_BE+= -lc /usr/ucblib/libucb.a
651596
LDFLAGS_BE= -LD-Blargedynsym
652597

653598
%.so: %.o
@@ -663,14 +608,11 @@ ifeq ($(PORTNAME), ultrix4)
663608
ifdef ENFORCE_ALIGNMENT
664609
CFLAGS_BE= -DNOFIXADE
665610
endif
666-
LDADD_BE= -ldl -lln
611+
LDADD_BE+= -lln
667612

668613
# install creates intermediate directories
669614
NO_BEFOREINSTL= true
670615

671-
INSTALL= /usr/bin/install
672-
RANLIB= /usr/bin/ranlib
673-
674616
CFLAGS_SL= -G 0
675617
DLSUFFIX= .o
676618

@@ -687,9 +629,7 @@ endif
687629
#---------------------------------------------------------------------------
688630
# All others need -lm
689631

690-
ifneq ($(PORTNAME), nextstep)
691-
LD_ADD+= -lm
692-
endif
632+
LD_ADD+= @MATH_LIB@
693633

694634
# This goes here so that customization in Makefile.custom is effective
695635
##############################################################################

0 commit comments

Comments
 (0)