Use -fPIC not -fpic for BSDen on Sparc. Also switch from
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Oct 2004 23:27:23 +0000 (23:27 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Oct 2004 23:27:23 +0000 (23:27 +0000)
$(LD) -x -Bshareable to $(CC) -shared on OpenBSD (I suspect this
should be carried over to the other two as well, but will refrain
pending suggestions from people who actually use those platforms).
Per Stefan Kaltenbrunner.

src/makefiles/Makefile.freebsd
src/makefiles/Makefile.netbsd
src/makefiles/Makefile.openbsd

index 90543b7016a3f4184215f84d0f22010ec5a00466..a9e59604d5a4448c5da0cee8835f685db805ae75 100644 (file)
@@ -7,7 +7,13 @@ shlib_symbolic = -Wl,-Bsymbolic -lc
 endif
 
 DLSUFFIX = .so
+
+ifeq ($(findstring sparc,$(host_cpu)), sparc)
+CFLAGS_SL = -fPIC -DPIC
+else
 CFLAGS_SL = -fpic -DPIC
+endif
+
 
 %.so: %.o
 ifdef ELF_SYSTEM
index 59ab7a791fd42438459919c5673516513f3403d9..531fc1356b5f77433e7013f9298239634bfa7a20 100644 (file)
@@ -9,7 +9,13 @@ rpath = -R$(libdir)
 endif
 
 DLSUFFIX = .so
+
+ifeq ($(findstring sparc,$(host_cpu)), sparc)
+CFLAGS_SL = -fPIC -DPIC
+else
 CFLAGS_SL = -fpic -DPIC
+endif
+
 
 %.so: %.o
 ifdef ELF_SYSTEM
@@ -21,8 +27,7 @@ else
    @${AR} cq $@.pic `lorder $<.obj | tsort`
    ${RANLIB} $@.pic
    @rm -f $@
-   $(LD) -x -Bshareable -Bforcearchive \
-     -o $@ $@.pic
+   $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
 endif
 
 sqlmansect = 7
index 3709d24bdc28ef8819f4934abf5fb8fb040e9886..66671e675fb074a64dc5c5b1c1e16586d8c23ed7 100644 (file)
@@ -7,11 +7,17 @@ shlib_symbolic = -Wl,-Bsymbolic
 endif
 
 DLSUFFIX = .so
+
+ifeq ($(findstring sparc,$(host_cpu)), sparc)
+CFLAGS_SL = -fPIC -DPIC
+else
 CFLAGS_SL = -fpic -DPIC
+endif
+
 
 %.so: %.o
 ifdef ELF_SYSTEM
-   $(LD) -x -Bshareable -o $@ $<
+   $(CC) -shared -o $@ $<
 else
    $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
    @echo building shared object $@
@@ -19,8 +25,7 @@ else
    @${AR} cq $@.pic `lorder $<.obj | tsort`
    ${RANLIB} $@.pic
    @rm -f $@
-   $(LD) -x -Bshareable -Bforcearchive \
-     -o $@ $@.pic
+   $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
 endif
 
 sqlmansect = 7