@@ -11,14 +11,27 @@ ifeq ($(HAVE_POSIX_SIGNALS), no)
1111 LIBS := -lBSD $(LIBS)
1212endif
1313
14+ # Using X/Open Networking Interfaces requires to link with libxnet.
15+ # Without specifying this, bind(), getpeername() and so on don't work
16+ # correctly in the LP64 data model.
17+ LIBS := -lxnet $(LIBS)
18+
1419# Embed 'libdir' as the shared library search path so that the executables
1520# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath
1621# switch here because you'd get rather bizarre behavior if you leave this
1722# option off.)
18- LDFLAGS += -Wl,+b -Wl,$(libdir)
23+ ifeq ($(with_gnu_ld), yes)
24+ LDFLAGS += -Wl,-rpath -Wl,$(libdir)
25+ else
26+ LDFLAGS += -Wl,+b -Wl,$(libdir)
27+ endif
1928
2029# catch null pointer dereferences
21- LDFLAGS += -Wl,-z
30+ ifeq ($(with_gnu_ld), yes)
31+ # XXX what to put here?
32+ else
33+ LDFLAGS += -Wl,-z
34+ endif
2235
2336# set up appropriate options for shared library builds
2437export_dynamic = -Wl,-E
@@ -28,16 +41,24 @@ INSTALL_SHLIB_OPTS = -m 555
2841
2942AROPT = crs
3043
31- DLSUFFIX = .sl
44+ ifeq ($(host_cpu), ia64)
45+ DLSUFFIX = .so
46+ else
47+ DLSUFFIX = .sl
48+ endif
3249ifeq ($(GCC), yes)
33- CFLAGS_SL = -fpic
50+ CFLAGS_SL = -fpic
3451else
35- CFLAGS_SL = +z
52+ CFLAGS_SL = +z
3653endif
3754
3855# Rule for building shared libs (currently used only for regression test
3956# shlib ... should go away, since this is not really enough knowledge)
40- %.sl: %.o
57+ %$(DLSUFFIX): %.o
58+ ifeq ($(with_gnu_ld), yes)
59+ $(CC) $(LDFLAGS) -shared -o $@ $<
60+ else
4161 $(LD) -b -o $@ $<
62+ endif
4263
4364sqlmansect = 5
0 commit comments