# Copyright (c) 1998, Regents of the University of California
#
# 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 $
#
#-------------------------------------------------------------------------
# Try to keep the sections in some kind of order, folks...
-# XXX fix Makefile.aix
-ifneq ($(PORTNAME), aix)
- ifndef cplusplus
- override CFLAGS += $(CFLAGS_SL)
- else
- override CXXFLAGS += $(CFLAGS_SL)
+ifndef cplusplus
+ override CFLAGS += $(CFLAGS_SL)
+else
+ ifndef CXXFLAGS_SL
+ CXXFLAGS_SL = $(CFLAGS_SL)
endif
+ override CXXFLAGS += $(CXXFLAGS_SL)
endif
DLSUFFIX = .so
ifneq ($(GCC), yes)
ifeq ($(host_os), aix3.2.5)
- CFLAGS_SL = -e _nostart
+ LDFLAGS_SL = -e _nostart
endif
ifeq ($(host_os), aix4.1)
- CFLAGS_SL = -bnoentry
+ LDFLAGS_SL = -bnoentry
endif
endif
-CFLAGS_SL += -lc
EXPSUFF= .exp
%$(DLSUFFIX): %.o %$(EXPSUFF)
@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
else
CFLAGS_SL = +z
endif
+ifeq ($(GXX), yes)
+CXXFLAGS_SL = -fPIC
+else
+CXXFLAGS_SL = +z
+endif
# Rule for building shared libs (currently used only for regression test
# 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
else
CFLAGS_SL = -KPIC
endif
+ifeq ($(GXX), yes)
+CXXFLAGS_SL = -fPIC
+else
+CXXFLAGS_SL = -KPIC
+endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<
else
CFLAGS_SL = -PIC
endif
+ifeq ($(GXX), yes)
+CXXFLAGS_SL = -fPIC
+else
+CXXFLAGS_SL = -PIC
+endif
%.so: %.o
$(LD) -dc -dp -Bdynamic -o $@ $<
else
CFLAGS_SL = -K PIC
endif
+ifeq ($(GXX), yes)
+CXXFLAGS_SL = -fpic
+else
+CXXFLAGS_SL = -K PIC
+endif
%.so: %.o
$(LD) -G -Bdynamic -o $@ $<