]> granicus.if.org Git - postgresql/blobdiff - src/makefiles/Makefile.freebsd
Partial fix for contrib vpath breakage.
[postgresql] / src / makefiles / Makefile.freebsd
index 4a852a4b04ec45bb1a17459eb7d9f3d71e23937a..201dcd6f4cd7703773fb685b4166b70ba7b9afd1 100644 (file)
@@ -1,13 +1,30 @@
+AROPT = cr
+
+ifdef ELF_SYSTEM
+export_dynamic = -Wl,-export-dynamic
+rpath = -Wl,-R'$(rpathdir)'
+endif
+
+DLSUFFIX = .so
+
+CFLAGS_SL = -fPIC -DPIC
+
+ifeq ($(findstring i386,$(host_cpu)), i386)
+allow_nonpic_in_shlib = yes
+endif
+
+
 %.so: %.o
-       $(LD) -x -r -o $<.obj $<
+ifdef ELF_SYSTEM
+       $(CC) $(CFLAGS) -shared -o $@ $<
+else
+       $(LD) $(LDREL) $(LDOUT) $<.obj -x $<
        @echo building shared object $@
        @rm -f $@.pic
-       @${AR} cq $@.pic `lorder $<.obj | tsort`
+       @${AR} cq $@.pic $<.obj
        ${RANLIB} $@.pic
        @rm -f $@
-       ifdef ELF_SYSTEM
-               $(LD) -x -Bshareable -o $@ $@.pic
-       else
-               $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
-       endif
+       $(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
+endif
 
+sqlmansect = 7