1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
diff --git a/c-sdk/config/FreeBSD.mk b/c-sdk/config/FreeBSD.mk
--- ldap/sdks/c-sdk/config/FreeBSD.mk
+++ ldap/sdks/c-sdk/config/FreeBSD.mk
@@ -79,8 +79,8 @@ DLL_SUFFIX = so.1.0
endif
DSO_CFLAGS = -fPIC
-DSO_LDOPTS = -Bshareable
+DSO_LDOPTS = -shared -Wl,-soname,$(notdir $@)
-MKSHLIB = $(LD) $(DSO_LDOPTS)
+MKSHLIB = $(CC) $(DSO_LDOPTS)
G++INCLUDES = -I/usr/include/g++
diff --git a/c-sdk/configure b/c-sdk/configure
--- ldap/sdks/c-sdk/configure
+++ ldap/sdks/c-sdk/configure
@@ -4241,8 +4241,10 @@ EOF
#define DRAGONFLY 1
EOF
+ LD='$(CC)'
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS='-shared'
+ DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
;;
*-freebsd*)
@@ -4261,6 +4263,7 @@ EOF
#define HAVE_BSD_FLOCK 1
EOF
+ LD='$(CC)'
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
if test "$MOZ_OBJFORMAT" = "elf"; then
@@ -4268,8 +4271,9 @@ EOF
else
DLL_SUFFIX=so.1.0
fi
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS=-Bshareable
+ DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
;;
*-hpux*)
@@ -6512,8 +6516,15 @@ echo "configure:6510: checking whether $
if test $? -eq 0; then
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
ac_cv_have_dash_pthread=yes
- CFLAGS="$CFLAGS -pthread"
- CXXFLAGS="$CXXFLAGS -pthread"
+ case "$target_os" in
+ dragonfly*|freebsd*)
+# Freebsd doesn't use -pthread for compiles, it uses them for linking
+ ;;
+ *)
+ CFLAGS="$CFLAGS -pthread"
+ CXXFLAGS="$CXXFLAGS -pthread"
+ ;;
+ esac
fi
fi
rm -f conftest*
@@ -6542,7 +6553,22 @@ echo "configure:6526: checking whether $
_PTHREAD_LDFLAGS=
fi
;;
- *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*)
+ *-dragonfly*|*-freebsd*)
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _THREAD_SAFE 1
+EOF
+
+ if test "$ac_cv_have_dash_pthread" = "yes"; then
+ _PTHREAD_LDFLAGS="-pthread"
+ else
+ _PTHREAD_LDFLAGS="-lc_r"
+ fi
+ ;;
+ *-openbsd*|*-bsdi*|*-netbsd*)
cat >> confdefs.h <<\EOF
#define _THREAD_SAFE 1
EOF
diff --git a/c-sdk/configure.in b/c-sdk/configure.in
--- ldap/sdks/c-sdk/configure.in
+++ ldap/sdks/c-sdk/configure.in
@@ -1225,8 +1225,10 @@ tools are selected during the Xcode/Deve
fi
AC_DEFINE(XP_UNIX)
AC_DEFINE(DRAGONFLY)
+ LD='$(CC)'
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS='-shared'
+ DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
;;
*-freebsd*)
@@ -1236,6 +1238,7 @@ tools are selected during the Xcode/Deve
AC_DEFINE(XP_UNIX)
AC_DEFINE(FREEBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
+ LD='$(CC)'
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
if test "$MOZ_OBJFORMAT" = "elf"; then
@@ -1243,8 +1246,9 @@ tools are selected during the Xcode/Deve
else
DLL_SUFFIX=so.1.0
fi
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
- DSO_LDOPTS=-Bshareable
+ DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
;;
*-hpux*)
@@ -2329,8 +2333,15 @@ if test -n "$USE_PTHREADS"; then
if test $? -eq 0; then
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
ac_cv_have_dash_pthread=yes
- CFLAGS="$CFLAGS -pthread"
- CXXFLAGS="$CXXFLAGS -pthread"
+ case "$target_os" in
+ dragonfly*|freebsd*)
+# Freebsd doesn't use -pthread for compiles, it uses them for linking
+ ;;
+ *)
+ CFLAGS="$CFLAGS -pthread"
+ CXXFLAGS="$CXXFLAGS -pthread"
+ ;;
+ esac
fi
fi
rm -f conftest*
@@ -2361,7 +2372,17 @@ if test -n "$USE_PTHREADS"; then
_PTHREAD_LDFLAGS=
fi
;;
- *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*)
+ *-dragonfly*|*-freebsd*)
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ dnl -pthread links in -lc_r, so don't specify it explicitly.
+ if test "$ac_cv_have_dash_pthread" = "yes"; then
+ _PTHREAD_LDFLAGS="-pthread"
+ else
+ _PTHREAD_LDFLAGS="-lc_r"
+ fi
+ ;;
+ *-openbsd*|*-bsdi*|*-netbsd*)
AC_DEFINE(_THREAD_SAFE)
dnl -pthread links in -lc_r, so don't specify it explicitly.
if test "$ac_cv_have_dash_pthread" = "yes"; then
|