@@ -11,14 +11,27 @@ ifeq ($(HAVE_POSIX_SIGNALS), no)
11
11
LIBS := -lBSD $(LIBS)
12
12
endif
13
13
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
+
14
19
# Embed 'libdir' as the shared library search path so that the executables
15
20
# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath
16
21
# switch here because you'd get rather bizarre behavior if you leave this
17
22
# 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
19
28
20
29
# 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
22
35
23
36
# set up appropriate options for shared library builds
24
37
export_dynamic = -Wl,-E
@@ -28,16 +41,24 @@ INSTALL_SHLIB_OPTS = -m 555
28
41
29
42
AROPT = crs
30
43
31
- DLSUFFIX = .sl
44
+ ifeq ($(host_cpu), ia64)
45
+ DLSUFFIX = .so
46
+ else
47
+ DLSUFFIX = .sl
48
+ endif
32
49
ifeq ($(GCC), yes)
33
- CFLAGS_SL = -fpic
50
+ CFLAGS_SL = -fpic
34
51
else
35
- CFLAGS_SL = +z
52
+ CFLAGS_SL = +z
36
53
endif
37
54
38
55
# Rule for building shared libs (currently used only for regression test
39
56
# 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
41
61
$(LD) -b -o $@ $<
62
+ endif
42
63
43
64
sqlmansect = 5
0 commit comments