Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87f5fda

Browse files
author
Bryan Henderson
committed
Make port-specific link libraries defined for linking backend more global
so you can also link pgtclsh.
1 parentbd57c3a commit87f5fda

File tree

2 files changed

+45
-180
lines changed

2 files changed

+45
-180
lines changed

‎src/Makefile.global

Lines changed: 44 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.70 1996/11/17 20:30:32 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.71 1996/11/18 02:23:16 bryanh Exp $
1111
#
1212
# NOTES
1313
# Essentially all Postgres make files include this file and use the
@@ -261,24 +261,8 @@ include $(SRCDIR)/Makefile.custom
261261
endif
262262

263263
#############################################################################
264-
# include port specific rules and variables. For instance:
264+
# include port specific rules and variables.
265265
#
266-
# signal(2) handling - this is here because it affects some of
267-
# the frontend commands as well as the backend server.
268-
#
269-
# Ultrix and SunOS provide BSD signal(2) semantics by default.
270-
#
271-
# SVID2 and POSIX signal(2) semantics differ from BSD signal(2)
272-
# semantics. We can use the POSIX sigaction(2) on systems that
273-
# allow us to request restartable signals (SA_RESTART).
274-
#
275-
# Some systems don't allow restartable signals at all unless we
276-
# link to a special BSD library.
277-
#
278-
# We devoutly hope that there aren't any systems that provide
279-
# neither POSIX signals nor BSD signals. The alternative
280-
# is to do signal-handler reinstallation, which doesn't work well
281-
# at all.
282266
#
283267
# HISTORY: Before October 1996, this file included the following line:
284268
# -include $(MKDIR)/port/postgres.mk.$(PORTNAME)
@@ -309,8 +293,6 @@ SLSUFF= .so
309293

310294
#----------------------------------------------------------------------
311295
ifeq ($(PORTNAME), BSD44_derived)
312-
MK_PORT= BSD44_derived
313-
314296
# cc is gcc, but never mind about that...
315297
CC= gcc
316298

@@ -319,7 +301,7 @@ RANLIB=/usr/bin/ranlib
319301

320302
# FreeBSD 2.1R with new Flex v2.5.2 in /usr/local
321303
LEX= flex
322-
LDADD+= -L/usr/local/lib -lfl
304+
LDADD_BE= -L/usr/local/lib -lfl
323305

324306
CFLAGS_SL= -fpic -DPIC
325307

@@ -337,13 +319,11 @@ endif
337319
#--------------------------------------------------------------------------
338320

339321
ifeq ($(PORTNAME), aix)
340-
MK_PORT= aix
341-
342322
# might want to try installbsd instead
343323
INSTALL= /usr/ucb/install
344324

345325
# the -lm is because "pow" is defined in libbsd.a and we want pow(3m)
346-
LDADD_BE= -lm -lbsd
326+
LDADD_BE= -lm -lbsd -ll -lld
347327

348328
# MAKE_EXPORTS is required for svr4 loaders that want a file of
349329
# symbol names to tell them what to export/import.
@@ -357,7 +337,7 @@ MAKE_EXPORTS= true
357337
# The HAVE_ANSI_CPP flag indicates that cc isn't ANSI but also doesn't
358338
# have a Reiser (pcc-style) cpp.
359339
#
360-
CFLAGS_BE+= -qchars=signed -qmaxmem=4000 -DHAVE_ANSI_CPP
340+
CFLAGS_BE= -qchars=signed -qmaxmem=4000
361341

362342

363343
EXPSUFF= .exp
@@ -377,29 +357,25 @@ endif
377357
#---------------------------------------------------------------------------
378358

379359
ifeq ($(PORTNAME), alpha)
380-
MK_PORT= alpha
381-
CFLAGS_BE+= -DUSE_POSIX_SIGNALS
382-
383360
# NOFIXADE disallows unaligned access.
384361
# on Ultrix and OSF/1 it invokes an explicit syscall.
385362
# on HP-UX it turns off certain compiler options.
386363
# This is defined here because a bunch of clients include tmp/c.h,
387364
# which is where the work is done on HP-UX. It only affects the
388365
# backend on Ultrix and OSF/1.
389366
ifdef ENFORCE_ALIGNMENT
390-
CFLAGS_BE+= -DNOFIXADE
367+
CFLAGS_BE= -DNOFIXADE
391368
else
392-
CFLAGS_BE+= -DNOPRINTADE
369+
CFLAGS_BE= -DNOPRINTADE
393370
endif
371+
LDADD_BE= -lln
394372

395373
# use the regex library
396374
USE_REGEX= 1
397375

398376
%.so: %.o
399377
$(LD) -shared -expect_unresolved '*' -o $@ $<
400378

401-
CLEANFILES+= so_locations
402-
403379
DASH_N=
404380
BACKSLASH_C= '\\\\c'
405381

@@ -408,8 +384,6 @@ endif
408384
#---------------------------------------------------------------------------
409385

410386
ifeq ($(PORTNAME), bsdi)
411-
MK_PORT= bsdi
412-
413387
CC= gcc
414388

415389
PRE_BSDI_2_1= false
@@ -424,31 +398,28 @@ ifeq ($(PRE_BSDI_2_1), false)
424398
# cc is gcc v1.42
425399
# gcc is gcc v2.7.2
426400
LEX= lex
427-
LD_ADD+= -ltermcap
401+
LDADD_BE= -ltermcap -ldl -lipc
428402
else
429403
# cc is gcc v1.42
430404
# gcc is gcc v2.6.3
431405
LEX= flex
432406
# use the regex library
433407
USE_REGEX= 1
434408
CFLAGS_BE= -DPRE_BSDI_2_1
435-
LDADD_BE= -ldld -lcompat
409+
LDADD_BE= -ldld -lcompat -lipc
436410
endif
437411

438412
endif
439413

440414
#--------------------------------------------------------------------------
441415

442416
ifeq ($(PORTNAME), dgux)
443-
MK_PORT= linux
444-
445417
CFLAGS_SL= -fpic
446418
%.so: %.o
447419
$(CC) -shared -o $@ $<
448420

449421
CC= gcc
450422

451-
CFLAGS_BE= -D__USE_POSIX_SIGNALS -DUSE_POSIX_SIGNALS
452423
LDADD_BE= -ldl -lfl
453424

454425
LEX= flex
@@ -461,16 +432,25 @@ endif
461432
#----------------------------------------------------------------------------
462433

463434
ifeq ($(PORTNAME), hpux)
464-
MK_PORT= hpux
435+
# -W l,-Eexport symbols for linking with the shared libraries
436+
#dynamic loader
465437

466-
LDADD_BE= -lBSD
438+
LDADD_BE= -lBSD -ll
439+
ifeq $(CC), cc)
440+
CFLAGS_BE= -W l,-E
441+
LDFLAGS_BE= -W l,-E
442+
LDADD_BE+= -ldld
443+
endif
444+
ifeq ($(CC), gcc)
445+
LDADD_BE+= /usr/lib/libdld.sl
446+
endif
467447

468448
ifdef ENFORCE_ALIGNMENT
469-
CFLAGS_BE= -DNOFIXADE
449+
CFLAGS_BE= -DNOFIXADE
470450
else
471-
HPUX_VERS:= $(shell uname -r)
472-
HPUX_MAJOR= ${HPUX_VERS:R:E}
473-
HPUX_MINOR= ${HPUX_VERS:E}
451+
HPUX_VERS:= $(shell uname -r)
452+
HPUX_MAJOR= ${HPUX_VERS:R:E}
453+
HPUX_MINOR= ${HPUX_VERS:E}
474454
ifeq ($(HPUX_MAJOR), 08)
475455
CFLAGS_BE+= +u -DHP_S500_ALIGN
476456
LDFLAGS_BE+= +u
@@ -509,13 +489,9 @@ endif
509489
#--------------------------------------------------------------------------
510490

511491
ifeq ($(PORTNAME), i386_solaris)
512-
MK_PORT= i386_solaris
513-
514492
# cc won't work!
515493
CC= gcc
516494

517-
CFLAGS_BE+= -DUSE_POSIX_SIGNALS
518-
519495
# RANLIB is not used on solaris
520496
RANLIB= touch
521497

@@ -526,10 +502,10 @@ INSTALL= /usr/ucb/install
526502
# everything to compile. :-/
527503
#
528504
# The extra -I flag is to scoop up extra BSD-emulating headers.
529-
CFLAGS_BE+= -DSYSV_DIRENT -I$(SRCDIR)/backend/port/sparc_solaris
530-
LDADD_BE+= -lsocket -lnsl
531-
532-
LD_ADD+= $(LDADD_BE)
505+
# This needs to be fixed. Things other than thebackend should not be
506+
# accessing headers in the backend directory.
507+
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
508+
LDADD_BE= -lsocket -lnsl -ll -ldl
533509

534510
ifeq ($(CC), cc)
535511
CFLAGS_SL= -K PIC
@@ -548,9 +524,7 @@ endif
548524
#----------------------------------------------------------------------------
549525

550526
ifeq ($(PORTNAME), irix5)
551-
MK_PORT= irix5
552-
553-
CFLAGS_BE+= -DUSE_POSIX_SIGNALS
527+
LDADD_BE= -ll
554528

555529
# RANLIB is not used on IRIX 5
556530
RANLIB= touch
@@ -561,14 +535,6 @@ INSTLOPTS= -m 444
561535
INSTL_EXE_OPTS= -m 555
562536
INSTL_LIB_OPTS= -m 664
563537

564-
#
565-
# Random things that must be passed everywhere to enable
566-
# everything to compile. :-/
567-
#
568-
CFLAGS_BE+= -DSYSV_DIRENT
569-
570-
LD_ADD+= $(LDADD_BE)
571-
572538
%.so: %.o
573539
$(LD) -G -Bdynamic -o $@ $<
574540

@@ -580,13 +546,13 @@ endif
580546
#---------------------------------------------------------------------------
581547

582548
ifeq ($(PORTNAME), linux)
583-
MK_PORT= linux
584-
585549
ifndef LINUX_ELF
586550
SLSUFF= .o
551+
LDADD_BE= -ldld
587552
else
588553
SLSUFF= .so
589-
LDFLAGS+= -rdynamic
554+
LDADD_BE= -ldl
555+
LDFLAGS_BE= -rdynamic
590556
endif
591557
MK_NO_LORDER= true
592558

@@ -601,8 +567,7 @@ CFLAGS_SL= -fpic
601567

602568
# The Linux gnulib #defines the problem away for you and calls
603569
# the BSD routines if you give it the right flags.
604-
CFLAGS_BE= -D__USE_BSD -D__USE_BSD_SIGNAL
605-
LDADD_BE= -lbsd
570+
LDADD_BE+= -lbsd
606571

607572
LEX= flex
608573

@@ -611,8 +576,6 @@ endif
611576
#---------------------------------------------------------------------------
612577

613578
ifeq ($(PORTNAME), sparc)
614-
MK_PORT= sparc
615-
616579
# cc won't work!
617580
CC= gcc
618581

@@ -624,6 +587,7 @@ CFLAGS_SL= -PIC
624587
else
625588
CFLAGS_SL= -fPIC
626589
endif
590+
LDADD_BE= -lln -ldl
627591

628592
%.so: %.o
629593
$(LD) -dc -dp -Bdynamic -o $@ $<
@@ -632,12 +596,10 @@ endif
632596
#----------------------------------------------------------------------------
633597

634598
ifeq ($(PORTNAME), sparc_solaris)
635-
MK_PORT= sparc_solaris
636-
637599
# cc won't work!
638600
CC= gcc
639601

640-
CFLAGS_BE+= -DUSE_POSIX_SIGNALS
602+
LDADD_BE= -ll -ldl
641603

642604
# RANLIB is not used on solaris
643605
RANLIB= touch
@@ -649,11 +611,9 @@ INSTALL= /usr/ucb/install
649611
# everything to compile. :-/
650612
#
651613
# The extra -I flag is to scoop up extra BSD-emulating headers.
652-
CFLAGS_BE+= -DSYSV_DIRENT -I$(SRCDIR)/backend/port/sparc_solaris
614+
CFLAGS_BE= -I$(SRCDIR)/backend/port/sparc_solaris
653615
LDADD_BE+= -lsocket -lnsl
654616

655-
LD_ADD+= $(LDADD_BE)
656-
657617
ifeq ($(CC), cc)
658618
CFLAGS_SL= -K PIC
659619
else
@@ -671,13 +631,9 @@ endif
671631
#-----------------------------------------------------------------------------
672632

673633
ifeq ($(PORTNAME), svr4)
674-
MK_PORT= svr4
675-
676634
CFLAGS+= -W0
677635
YACC= bison -y
678636

679-
CFLAGS_BE+= -DUSE_POSIX_SIGNALS
680-
681637
# MAKE_EXPORTS is required for svr4 loaders that want a file of
682638
# symbol names to tell them what to export/import.
683639
MAKE_EXPORTS= true
@@ -693,16 +649,9 @@ INSTALL= /home/tools/bin/install
693649
# everything to compile. :-/
694650
#
695651
# The extra -I flag is to scoop up extra BSD-emulating headers.
696-
CFLAGS_BE+= -DSYSV_DIRENT -I$(SRCDIR)/backend/port/svr4
697-
LDADD_BE+= -lsocket -lnsl -lc /usr/ucblib/libucb.a
698-
699-
LD_ADD+= $(LDADD_BE)
700-
701-
ifeq ($(CC), cc)
702-
#CFLAGS_SL= -K PIC
703-
else
704-
#CFLAGS_SL= -fPIC
705-
endif
652+
CFLAGS_BE+= -I$(SRCDIR)/backend/port/svr4
653+
LDADD_BE= -lsocket -lnsl -lc /usr/ucblib/libucb.a -ll -ldl
654+
LDFLAGS_BE= -LD-Blargedynsym
706655

707656
%.so: %.o
708657
$(LD) -G -Bdynamic -o $@ $<
@@ -714,11 +663,10 @@ endif
714663
#---------------------------------------------------------------------------
715664

716665
ifeq ($(PORTNAME), ultrix4)
717-
MK_PORT= ultrix4
718-
719666
ifdef ENFORCE_ALIGNMENT
720667
CFLAGS_BE= -DNOFIXADE
721668
endif
669+
LDADD_BE= -ldl -lln
722670

723671
# install creates intermediate directories
724672
NO_BEFOREINSTL= true
@@ -732,6 +680,9 @@ SLSUFF= .o
732680
endif
733681

734682

683+
ifneq ($(PORTNAME), next)
684+
LDADD_BE+= -lm
685+
endif
735686

736687
# This goes here so that customization in Makefile.custom is effective
737688
##############################################################################
@@ -785,7 +736,6 @@ endif
785736

786737
ifdef COPT
787738
CFLAGS+= $(COPT)
788-
LDFLAGS+= $(COPT)
789739
else
790740
ifndef CFLAGS_OPT
791741
CFLAGS_OPT= -O

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp