Line 0
Link Here
|
|
|
1 |
--- configure.in Tue May 15 13:48:04 2007 |
2 |
+++ configure.in Fri Jul 27 18:43:56 2007 |
3 |
@@ -475,14 +475,25 @@ |
4 |
dnl # On Some systems, we need extra pre-processor flags, to get them to |
5 |
dnl # to do the threading properly. |
6 |
dnl # |
7 |
- AC_CHECK_LIB(pthread, pthread_create, |
8 |
- [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
9 |
- LIBS="$LIBS -lpthread" ], |
10 |
- AC_CHECK_LIB(c_r, pthread_create, |
11 |
- [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ], |
12 |
- [ WITH_THREADS="no" ] |
13 |
- ) |
14 |
- ) |
15 |
+dnl # On FreeBSD, check the pthread_create function with -pthread in $CFLAGS |
16 |
+dnl # but WITHOUT -lpthread (see FreeBSD Porter's Handbook, section 12.12 |
17 |
+dnl # at http://tinyurl.com/34cya8 ) |
18 |
+ case "$host" in |
19 |
+ *-freebsd*) |
20 |
+ CFLAGS="$CFLAGS -pthread" |
21 |
+ AC_CHECK_FUNC(pthread_create, , [ WITH_THREADS="no" ]) |
22 |
+ ;; |
23 |
+ *) |
24 |
+ AC_CHECK_LIB(pthread, pthread_create, |
25 |
+ [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" |
26 |
+ LIBS="$LIBS -lpthread" ], |
27 |
+ AC_CHECK_LIB(c_r, pthread_create, |
28 |
+ [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ], |
29 |
+ [ WITH_THREADS="no" ] |
30 |
+ ) |
31 |
+ ) |
32 |
+ ;; |
33 |
+ esac |
34 |
fi |
35 |
|
36 |
dnl # |
37 |
--- src/modules/rlm_ldap/configure.in Fri Jul 27 17:51:33 2007 |
38 |
+++ src/modules/rlm_ldap/configure.in Fri Jul 27 18:10:51 2007 |
39 |
@@ -77,14 +77,27 @@ |
40 |
|
41 |
dnl pthread stuff is usually in -lpthread |
42 |
dnl or in -lc_r, on *BSD |
43 |
+ dnl FreeBSD uses -pthread |
44 |
if test "x$rlm_ldap_with_threads" = "xyes"; then |
45 |
- AC_CHECK_LIB(pthread, pthread_create, |
46 |
- [ LIBS="-lpthread $LIBS" ], |
47 |
- AC_CHECK_LIB(c_r, pthread_create, |
48 |
- [ LIBS="-lc_r $LIBS" ], |
49 |
- [ rlm_ldap_with_threads="no" ] |
50 |
- ) |
51 |
- ) |
52 |
+ case "$host" in |
53 |
+ *-freebsd*) |
54 |
+ old_CFLAGS=$CFLAGS |
55 |
+ CFLAGS="$CFLAGS -pthread" |
56 |
+ AC_CHECK_FUNC(pthread_create, , [ rlm_ldap_with_threads="no" ]) |
57 |
+ if test "x$rlm_ldap_with_threads" = "xno"; then |
58 |
+ CFLAGS=$old_CFLAGS |
59 |
+ fi |
60 |
+ ;; |
61 |
+ *) |
62 |
+ AC_CHECK_LIB(pthread, pthread_create, |
63 |
+ [ LIBS="-lpthread $LIBS" ], |
64 |
+ AC_CHECK_LIB(c_r, pthread_create, |
65 |
+ [ LIBS="-lc_r $LIBS" ], |
66 |
+ [ rlm_ldap_with_threads="no" ] |
67 |
+ ) |
68 |
+ ) |
69 |
+ ;; |
70 |
+ esac |
71 |
fi |
72 |
|
73 |
dnl Try only "-lldap_r" or "-lldap" |
74 |
--- src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.in Fri Nov 25 20:31:54 2005 |
75 |
+++ src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.in Fri Jul 27 19:11:33 2007 |
76 |
@@ -61,14 +61,27 @@ |
77 |
|
78 |
dnl pthread stuff is usually in -lpthread |
79 |
dnl or in -lc_r, on *BSD |
80 |
+ dnl FreeBSD uses -pthread |
81 |
if test "x$mysql_with_threads" = "xyes"; then |
82 |
- AC_CHECK_LIB(pthread, pthread_create, |
83 |
- [ LIBS="-lpthread $LIBS" ], |
84 |
- AC_CHECK_LIB(c_r, pthread_create, |
85 |
- [ LIBS="-lc_r $LIBS" ], |
86 |
- [ mysql_with_threads=no ] |
87 |
- ) |
88 |
- ) |
89 |
+ case "$host" in |
90 |
+ *-freebsd*) |
91 |
+ old_CFLAGS=$CFLAGS |
92 |
+ CFLAGS="$CFLAGS -pthread" |
93 |
+ AC_CHECK_FUNC(pthread_create, , [ mysql_with_threads="no" ]) |
94 |
+ if test "x$mysql_with_threads" = "xno"; then |
95 |
+ CFLAGS=$old_CFLAGS |
96 |
+ fi |
97 |
+ ;; |
98 |
+ *) |
99 |
+ AC_CHECK_LIB(pthread, pthread_create, |
100 |
+ [ LIBS="-lpthread $LIBS" ], |
101 |
+ AC_CHECK_LIB(c_r, pthread_create, |
102 |
+ [ LIBS="-lc_r $LIBS" ], |
103 |
+ [ mysql_with_threads=no ] |
104 |
+ ) |
105 |
+ ) |
106 |
+ ;; |
107 |
+ esac |
108 |
fi |
109 |
|
110 |
if test "x$mysql_with_threads" = "xyes"; then |
111 |
--- src/modules/rlm_python/configure.in Thu May 15 15:52:02 2003 |
112 |
+++ src/modules/rlm_python/configure.in Thu Aug 2 12:43:47 2007 |
113 |
@@ -84,6 +84,44 @@ |
114 |
AC_SMART_CHECK_LIB(python${PY_VERSION}, Py_Initialize) |
115 |
LIBS=$old_LIBS |
116 |
|
117 |
+dnl # If that check fails, try it again having identified threading libraries |
118 |
+dnl # in case libpython is threaded |
119 |
+ |
120 |
+ if test "x$smart_lib" = "x"; then |
121 |
+ AC_MSG_NOTICE([Checking to see if libpython may be threaded.]) |
122 |
+ dnl pthread stuff is usually in -lpthread |
123 |
+ dnl or in -lc_r, on *BSD |
124 |
+ dnl FreeBSD uses -pthread |
125 |
+ libpython_with_threads="yes" |
126 |
+ case "$host" in |
127 |
+ *-freebsd*) |
128 |
+ old_CFLAGS=$CFLAGS |
129 |
+ CFLAGS="$CFLAGS -pthread" |
130 |
+ AC_CHECK_FUNC(pthread_create, , [ libpython_with_threads="no" ]) |
131 |
+ if test "x$libpython_with_threads" = "xno"; then |
132 |
+ CFLAGS=$old_CFLAGS |
133 |
+ fi |
134 |
+ ;; |
135 |
+ *) |
136 |
+ AC_CHECK_LIB(pthread, pthread_create, |
137 |
+ [ LIBS="-lpthread $LIBS" ], |
138 |
+ AC_CHECK_LIB(c_r, pthread_create, |
139 |
+ [ LIBS="-lc_r $LIBS" ], |
140 |
+ [ libpython_with_threads="no" ] |
141 |
+ ) |
142 |
+ ) |
143 |
+ ;; |
144 |
+ esac |
145 |
+ |
146 |
+ if test "x$libpython_with_threads" = "xyes"; then |
147 |
+ old_LIBS=$LIBS |
148 |
+ LIBS="$LIBS $PY_LIB_LOC $PY_EXTRA_LIBS -lm" |
149 |
+ smart_try_dir=$PY_LIB_DIR |
150 |
+ AC_SMART_CHECK_LIB(python${PY_VERSION}, Py_Initialize) |
151 |
+ LIBS=$old_LIBS |
152 |
+ fi |
153 |
+ fi |
154 |
+ |
155 |
eval t=\${ac_cv_lib_${sm_lib_safe}_${sm_func_safe}} |
156 |
if test "x$t" = "xyes"; then |
157 |
python_ldflags="$PY_LIB_LOC $PY_EXTRA_LIBS -lpython${PY_VERSION} -lm" |