summaryrefslogtreecommitdiff
path: root/src/makefiles/Makefile.hpux
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-09-02 23:06:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-09-02 23:06:43 +0000
commit346900e83b81cb29f5e948253a56ad3eca84b5e9 (patch)
tree0fe8578bade9df024adfcd313517e65f38d7b7fb /src/makefiles/Makefile.hpux
parentcb792343074d026b307cc1fdde1a679abaa27a24 (diff)
downloadpostgresql-346900e83b81cb29f5e948253a56ad3eca84b5e9.tar.gz
Fix shared library linking operations to work properly on all (or at
least more) combinations of HP-UX hardware, compiler, and linker. Shinji Teragaito and Tom Lane.
Diffstat (limited to 'src/makefiles/Makefile.hpux')
-rw-r--r--src/makefiles/Makefile.hpux33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 3f81ce3d91..2ffd791e40 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -11,14 +11,27 @@ ifeq ($(HAVE_POSIX_SIGNALS), no)
LIBS := -lBSD $(LIBS)
endif
+# Using X/Open Networking Interfaces requires to link with libxnet.
+# Without specifying this, bind(), getpeername() and so on don't work
+# correctly in the LP64 data model.
+LIBS := -lxnet $(LIBS)
+
# Embed 'libdir' as the shared library search path so that the executables
# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath
# switch here because you'd get rather bizarre behavior if you leave this
# option off.)
-LDFLAGS += -Wl,+b -Wl,$(libdir)
+ifeq ($(with_gnu_ld), yes)
+ LDFLAGS += -Wl,-rpath -Wl,$(libdir)
+else
+ LDFLAGS += -Wl,+b -Wl,$(libdir)
+endif
# catch null pointer dereferences
-LDFLAGS += -Wl,-z
+ifeq ($(with_gnu_ld), yes)
+# XXX what to put here?
+else
+ LDFLAGS += -Wl,-z
+endif
# set up appropriate options for shared library builds
export_dynamic = -Wl,-E
@@ -28,16 +41,24 @@ INSTALL_SHLIB_OPTS = -m 555
AROPT = crs
-DLSUFFIX = .sl
+ifeq ($(host_cpu), ia64)
+ DLSUFFIX = .so
+else
+ DLSUFFIX = .sl
+endif
ifeq ($(GCC), yes)
-CFLAGS_SL = -fpic
+ CFLAGS_SL = -fpic
else
-CFLAGS_SL = +z
+ CFLAGS_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)
-%.sl: %.o
+%$(DLSUFFIX): %.o
+ifeq ($(with_gnu_ld), yes)
+ $(CC) $(LDFLAGS) -shared -o $@ $<
+else
$(LD) -b -o $@ $<
+endif
sqlmansect = 5