Skip to content

Commit 981b3fc

Browse files
author
raw
committed
fixed autoconf issues whereby HAVE_PTHREAD_GETATTR_NP was not being used on Ubuntu systemd (and others, presumably) that have the function
1 parent 2368828 commit 981b3fc

File tree

10 files changed

+206
-146
lines changed

10 files changed

+206
-146
lines changed

Makefile.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
6565
am__aclocal_m4_deps = $(top_srcdir)/config/ax_lib_mysql.m4 \
6666
$(top_srcdir)/config/ax_mysql_bin.m4 \
6767
$(top_srcdir)/config/pcre.m4 $(top_srcdir)/config/ghmysql.m4 \
68-
$(top_srcdir)/config/ax_pthread.m4 $(top_srcdir)/configure.ac
68+
$(top_srcdir)/config/ax_pthread.m4 \
69+
$(top_srcdir)/config/ax_pthread_np.m4 \
70+
$(top_srcdir)/configure.ac
6971
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
7072
$(ACLOCAL_M4)
7173
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Known Issues & Caveats
9292
- Version 1.1 changes the way NULLs are handled. To restore the legacy NULL handling, use configure --enable-legacy-nulls
9393
- pcre_study should be used (but isn't) for constant patterns;
9494
- there is no localization or locale support
95-
- there is no multi-byte character set support
9695
- some program locations that should be set in autoconf are not
9796
- It would be nice if there were a persistent cache of compiled regexes
9897
- It would also be nice if there were a peresistent cache of regex matches.

config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@
2424
/* Do we want a BSD-like thread-attribute interface? */
2525
#undef HAVE_PTHREAD_ATTR_GET_NP
2626

27+
/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
28+
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
29+
2730
/* Do we want a Linux-like thread-attribute interface? */
2831
#undef HAVE_PTHREAD_GETATTR_NP
2932

33+
/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
34+
#undef HAVE_PTHREAD_GET_STACKSIZE_NP
35+
3036
/* Have PTHREAD_PRIO_INHERIT. */
3137
#undef HAVE_PTHREAD_PRIO_INHERIT
3238

config/ax_pthread.m4

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
# modified version of the Autoconf Macro, you may extend this special
8383
# exception to the GPL to apply to your modified version as well.
8484

85-
#serial 19
85+
#serial 20
8686

8787
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
8888
AC_DEFUN([AX_PTHREAD], [
@@ -162,6 +162,10 @@ case ${host_os} in
162162
darwin*)
163163
ax_pthread_flags="-pthread $ax_pthread_flags"
164164
;;
165+
166+
linux-gnu*) # R.A.W. Otherwise none gets chosen and that leaves the pthread_getattr_np stuff not found
167+
ax_pthread_flags="pthread $ax_pthread_flags"
168+
;;
165169
esac
166170
167171
if test x"$ax_pthread_ok" = xno; then
@@ -190,40 +194,6 @@ for flag in $ax_pthread_flags; do
190194
;;
191195
esac
192196
193-
194-
# from tcl.m4 http://svn.apache.org/repos/asf/trafficserver/attic/traffic/trunk/build/tcl.m4
195-
AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
196-
if test $tcl_ok = yes ; then
197-
AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
198-
[Do we want a BSD-like thread-attribute interface?])
199-
AC_CACHE_CHECK([for pthread_attr_get_np declaration],
200-
tcl_cv_grep_pthread_attr_get_np, [
201-
AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
202-
tcl_cv_grep_pthread_attr_get_np=present,
203-
tcl_cv_grep_pthread_attr_get_np=missing)])
204-
if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
205-
AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
206-
[Is pthread_attr_get_np() declared in <pthread.h>?])
207-
fi
208-
else
209-
AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
210-
if test $tcl_ok = yes ; then
211-
AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
212-
[Do we want a Linux-like thread-attribute interface?])
213-
AC_CACHE_CHECK([for pthread_getattr_np declaration],
214-
tcl_cv_grep_pthread_getattr_np, [
215-
AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
216-
tcl_cv_grep_pthread_getattr_np=present,
217-
tcl_cv_grep_pthread_getattr_np=missing)])
218-
if test $tcl_cv_grep_pthread_getattr_np = missing ; then
219-
AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
220-
[Is pthread_getattr_np declared in <pthread.h>?])
221-
fi
222-
fi
223-
fi
224-
225-
226-
227197
save_LIBS="$LIBS"
228198
save_CFLAGS="$CFLAGS"
229199
LIBS="$PTHREAD_LIBS $LIBS"
@@ -326,21 +296,15 @@ if test "x$ax_pthread_ok" = xyes; then
326296
[#handle absolute path differently from PATH based program lookup
327297
AS_CASE(["x$CC"],
328298
[x/*],
329-
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],
330-
[PTHREAD_CC="${CC}_r"],[PTHREAD_CC="$CC"])],
331-
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])],
332-
[PTHREAD_CC="$CC"])
333-
;;
334-
335-
*)
336-
PTHREAD_CC="$CC"
299+
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
300+
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
337301
;;
338302
esac
339303
fi
340-
else
341-
PTHREAD_CC="$CC"
342304
fi
343305
306+
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
307+
344308
AC_SUBST(PTHREAD_LIBS)
345309
AC_SUBST(PTHREAD_CFLAGS)
346310
AC_SUBST(PTHREAD_CC)

config/ax_pthread_np.m4

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
AC_DEFUN([AX_PTHREAD_NP], [
3+
4+
5+
# from tcl.m4 http://svn.apache.org/repos/asf/trafficserver/attic/traffic/trunk/build/tcl.m4
6+
# Does the pthread-implementation provide
7+
# 'pthread_attr_setstacksize' ?
8+
9+
ac_saved_libs=$LIBS
10+
LIBS="$LIBS $PTHREAD_LIBS"
11+
AC_CHECK_FUNCS(pthread_attr_setstacksize)
12+
AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
13+
if test $tcl_ok = yes ; then
14+
AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
15+
[Do we want a BSD-like thread-attribute interface?])
16+
AC_CACHE_CHECK([for pthread_attr_get_np declaration],
17+
tcl_cv_grep_pthread_attr_get_np, [
18+
AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
19+
tcl_cv_grep_pthread_attr_get_np=present,
20+
tcl_cv_grep_pthread_attr_get_np=missing)])
21+
if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
22+
AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
23+
[Is pthread_attr_get_np() declared in <pthread.h>?])
24+
fi
25+
else
26+
AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
27+
if test $tcl_ok = yes ; then
28+
AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
29+
[Do we want a Linux-like thread-attribute interface?])
30+
AC_CACHE_CHECK([for pthread_getattr_np declaration],
31+
tcl_cv_grep_pthread_getattr_np, [
32+
AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
33+
tcl_cv_grep_pthread_getattr_np=present,
34+
tcl_cv_grep_pthread_getattr_np=missing)])
35+
if test $tcl_cv_grep_pthread_getattr_np = missing ; then
36+
AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
37+
[Is pthread_getattr_np declared in <pthread.h>?])
38+
fi
39+
fi
40+
fi
41+
if test $tcl_ok = no; then
42+
# Darwin thread stacksize API
43+
AC_CHECK_FUNCS(pthread_get_stacksize_np)
44+
fi
45+
LIBS=$ac_saved_libs
46+
] )

0 commit comments

Comments
 (0)