Commit c7a79499 authored by Peter Eisentraut's avatar Peter Eisentraut

Separate CFLAGS_SL and CXXFLAGS_SL, to allow building with C and C++

compilers from different providers.  (Especially important since the
C++ compiler that goes with your favourite C compiler might not work.)
parent 1fdf2edc
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.31 2000/10/31 19:55:18 petere Exp $ # $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.32 2000/11/04 16:35:54 petere Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -88,13 +88,13 @@ ifeq ($(enable_shared), yes) ...@@ -88,13 +88,13 @@ ifeq ($(enable_shared), yes)
# Try to keep the sections in some kind of order, folks... # Try to keep the sections in some kind of order, folks...
# XXX fix Makefile.aix ifndef cplusplus
ifneq ($(PORTNAME), aix)
ifndef cplusplus
override CFLAGS += $(CFLAGS_SL) override CFLAGS += $(CFLAGS_SL)
else else
override CXXFLAGS += $(CFLAGS_SL) ifndef CXXFLAGS_SL
CXXFLAGS_SL = $(CFLAGS_SL)
endif endif
override CXXFLAGS += $(CXXFLAGS_SL)
endif endif
......
...@@ -9,13 +9,12 @@ AROPT = crs ...@@ -9,13 +9,12 @@ AROPT = crs
DLSUFFIX = .so DLSUFFIX = .so
ifneq ($(GCC), yes) ifneq ($(GCC), yes)
ifeq ($(host_os), aix3.2.5) ifeq ($(host_os), aix3.2.5)
CFLAGS_SL = -e _nostart LDFLAGS_SL = -e _nostart
endif endif
ifeq ($(host_os), aix4.1) ifeq ($(host_os), aix4.1)
CFLAGS_SL = -bnoentry LDFLAGS_SL = -bnoentry
endif endif
endif endif
CFLAGS_SL += -lc
EXPSUFF= .exp EXPSUFF= .exp
...@@ -35,4 +34,4 @@ $(POSTGRES_IMP): ...@@ -35,4 +34,4 @@ $(POSTGRES_IMP):
%$(DLSUFFIX): %.o %$(EXPSUFF) %$(DLSUFFIX): %.o %$(EXPSUFF)
@echo Making shared library $@ from $*.o, $*$(EXPSUFF), and installed postgres.imp @echo Making shared library $@ from $*.o, $*$(EXPSUFF), and installed postgres.imp
$(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(libdir)/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(CFLAGS_SL) $(CC) -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:$(libdir)/$(POSTGRES_IMP) -Wl,-bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(LDFLAGS_SL) -lc
...@@ -38,6 +38,11 @@ CFLAGS_SL = -fPIC ...@@ -38,6 +38,11 @@ CFLAGS_SL = -fPIC
else else
CFLAGS_SL = +z CFLAGS_SL = +z
endif endif
ifeq ($(GXX), yes)
CXXFLAGS_SL = -fPIC
else
CXXFLAGS_SL = +z
endif
# Rule for building shared libs (currently used only for regression test # Rule for building shared libs (currently used only for regression test
# shlib ... should go away, since this is not really enough knowledge) # shlib ... should go away, since this is not really enough knowledge)
......
# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.4 2000/10/27 23:59:39 petere Exp $ # $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.5 2000/11/04 16:35:55 petere Exp $
AROPT = crs AROPT = crs
...@@ -16,6 +16,11 @@ CFLAGS_SL = -fPIC ...@@ -16,6 +16,11 @@ CFLAGS_SL = -fPIC
else else
CFLAGS_SL = -KPIC CFLAGS_SL = -KPIC
endif endif
ifeq ($(GXX), yes)
CXXFLAGS_SL = -fPIC
else
CXXFLAGS_SL = -KPIC
endif
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD) -G -Bdynamic -o $@ $<
...@@ -6,6 +6,11 @@ CFLAGS_SL = -fPIC ...@@ -6,6 +6,11 @@ CFLAGS_SL = -fPIC
else else
CFLAGS_SL = -PIC CFLAGS_SL = -PIC
endif endif
ifeq ($(GXX), yes)
CXXFLAGS_SL = -fPIC
else
CXXFLAGS_SL = -PIC
endif
%.so: %.o %.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $< $(LD) -dc -dp -Bdynamic -o $@ $<
...@@ -7,6 +7,11 @@ CFLAGS_SL = -fpic ...@@ -7,6 +7,11 @@ CFLAGS_SL = -fpic
else else
CFLAGS_SL = -K PIC CFLAGS_SL = -K PIC
endif endif
ifeq ($(GXX), yes)
CXXFLAGS_SL = -fpic
else
CXXFLAGS_SL = -K PIC
endif
%.so: %.o %.so: %.o
$(LD) -G -Bdynamic -o $@ $< $(LD) -G -Bdynamic -o $@ $<
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