Permalink
Browse files

fixed autoconf issues whereby HAVE_PTHREAD_GETATTR_NP was not being u…

…sed on Ubuntu systemd (and others, presumably) that have the function
  • Loading branch information...
1 parent 2368828 commit 981b3fc5808ff176719ed7d09a644190465768ed raw committed Aug 21, 2013
Showing with 206 additions and 146 deletions.
  1. +3 −1 Makefile.in
  2. +0 −1 README.md
  3. +6 −0 config.h.in
  4. +9 −45 config/ax_pthread.m4
  5. +46 −0 config/ax_pthread_np.m4
  6. +125 −94 configure
  7. +2 −0 configure.ac
  8. +3 −1 doc/Makefile.in
  9. +9 −3 preg_utils.c
  10. +3 −1 test/Makefile.in
View
@@ -65,7 +65,9 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/ax_lib_mysql.m4 \
$(top_srcdir)/config/ax_mysql_bin.m4 \
$(top_srcdir)/config/pcre.m4 $(top_srcdir)/config/ghmysql.m4 \
- $(top_srcdir)/config/ax_pthread.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/config/ax_pthread.m4 \
+ $(top_srcdir)/config/ax_pthread_np.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
View
@@ -92,7 +92,6 @@ Known Issues & Caveats
- Version 1.1 changes the way NULLs are handled. To restore the legacy NULL handling, use configure --enable-legacy-nulls
- pcre_study should be used (but isn't) for constant patterns;
- there is no localization or locale support
-- there is no multi-byte character set support
- some program locations that should be set in autoconf are not
- It would be nice if there were a persistent cache of compiled regexes
- It would also be nice if there were a peresistent cache of regex matches.
View
@@ -24,9 +24,15 @@
/* Do we want a BSD-like thread-attribute interface? */
#undef HAVE_PTHREAD_ATTR_GET_NP
+/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+
/* Do we want a Linux-like thread-attribute interface? */
#undef HAVE_PTHREAD_GETATTR_NP
+/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
+#undef HAVE_PTHREAD_GET_STACKSIZE_NP
+
/* Have PTHREAD_PRIO_INHERIT. */
#undef HAVE_PTHREAD_PRIO_INHERIT
View
@@ -82,7 +82,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 19
+#serial 20
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
@@ -162,6 +162,10 @@ case ${host_os} in
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
+
+ linux-gnu*) # R.A.W. Otherwise none gets chosen and that leaves the pthread_getattr_np stuff not found
+ ax_pthread_flags="pthread $ax_pthread_flags"
+ ;;
esac
if test x"$ax_pthread_ok" = xno; then
@@ -190,40 +194,6 @@ for flag in $ax_pthread_flags; do
;;
esac
-
- # from tcl.m4 http://svn.apache.org/repos/asf/trafficserver/attic/traffic/trunk/build/tcl.m4
- AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
- if test $tcl_ok = yes ; then
- AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
- [Do we want a BSD-like thread-attribute interface?])
- AC_CACHE_CHECK([for pthread_attr_get_np declaration],
- tcl_cv_grep_pthread_attr_get_np, [
- AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
- tcl_cv_grep_pthread_attr_get_np=present,
- tcl_cv_grep_pthread_attr_get_np=missing)])
- if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
- AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
- [Is pthread_attr_get_np() declared in <pthread.h>?])
- fi
- else
- AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
- if test $tcl_ok = yes ; then
- AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
- [Do we want a Linux-like thread-attribute interface?])
- AC_CACHE_CHECK([for pthread_getattr_np declaration],
- tcl_cv_grep_pthread_getattr_np, [
- AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
- tcl_cv_grep_pthread_getattr_np=present,
- tcl_cv_grep_pthread_getattr_np=missing)])
- if test $tcl_cv_grep_pthread_getattr_np = missing ; then
- AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
- [Is pthread_getattr_np declared in <pthread.h>?])
- fi
- fi
- fi
-
-
-
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
@@ -326,21 +296,15 @@ if test "x$ax_pthread_ok" = xyes; then
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
- [AS_IF([AS_EXECUTABLE_P([${CC}_r])],
- [PTHREAD_CC="${CC}_r"],[PTHREAD_CC="$CC"])],
- [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])],
- [PTHREAD_CC="$CC"])
- ;;
-
- *)
- PTHREAD_CC="$CC"
+ [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+ [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
-else
- PTHREAD_CC="$CC"
fi
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
View
@@ -0,0 +1,46 @@
+
+AC_DEFUN([AX_PTHREAD_NP], [
+
+
+ # from tcl.m4 http://svn.apache.org/repos/asf/trafficserver/attic/traffic/trunk/build/tcl.m4
+ # Does the pthread-implementation provide
+ # 'pthread_attr_setstacksize' ?
+
+ ac_saved_libs=$LIBS
+ LIBS="$LIBS $PTHREAD_LIBS"
+ AC_CHECK_FUNCS(pthread_attr_setstacksize)
+ AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
+ if test $tcl_ok = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
+ [Do we want a BSD-like thread-attribute interface?])
+ AC_CACHE_CHECK([for pthread_attr_get_np declaration],
+ tcl_cv_grep_pthread_attr_get_np, [
+ AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
+ tcl_cv_grep_pthread_attr_get_np=present,
+ tcl_cv_grep_pthread_attr_get_np=missing)])
+ if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
+ AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
+ [Is pthread_attr_get_np() declared in <pthread.h>?])
+ fi
+ else
+ AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
+ if test $tcl_ok = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
+ [Do we want a Linux-like thread-attribute interface?])
+ AC_CACHE_CHECK([for pthread_getattr_np declaration],
+ tcl_cv_grep_pthread_getattr_np, [
+ AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
+ tcl_cv_grep_pthread_getattr_np=present,
+ tcl_cv_grep_pthread_getattr_np=missing)])
+ if test $tcl_cv_grep_pthread_getattr_np = missing ; then
+ AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
+ [Is pthread_getattr_np declared in <pthread.h>?])
+ fi
+ fi
+ fi
+ if test $tcl_ok = no; then
+ # Darwin thread stacksize API
+ AC_CHECK_FUNCS(pthread_get_stacksize_np)
+ fi
+ LIBS=$ac_saved_libs
+] )
Oops, something went wrong.

0 comments on commit 981b3fc

Please sign in to comment.