summaryrefslogtreecommitdiffstats
path: root/threadlib/configure.in
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /threadlib/configure.in
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'threadlib/configure.in')
-rw-r--r--threadlib/configure.in84
1 files changed, 84 insertions, 0 deletions
diff --git a/threadlib/configure.in b/threadlib/configure.in
new file mode 100644
index 0000000..6962099
--- /dev/null
+++ b/threadlib/configure.in
@@ -0,0 +1,84 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(threadlib, 0.10, [courier-users@lists.sourceforge.net])
+
+>confdefs.h # Kill PACKAGE_ macros
+
+AC_CONFIG_SRCDIR(pthread.c)
+AC_CONFIG_AUX_DIR(../..)
+AM_INIT_AUTOMAKE([foreign no-define])
+
+AM_CONFIG_HEADER(config.h)
+
+dnl Checks for programs.
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_AWK
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_RANLIB
+AC_PROG_CC
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h pthread.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+dnl Checks for library functions.
+
+THREADLIB=""
+save_LIBS="$LIBS"
+
+AC_CHECK_LIB(pthread, pthread_cond_wait, [
+ THREADLIB="-lpthread" ; LIBS="-lpthread $LIBS" ], [
+
+LIBS="-pthread $save_LIBS"
+AC_TRY_LINK([
+void pthread_cond_wait();
+],[
+ pthread_cond_wait();
+],
+ THREADLIB="-pthread"
+)
+]
+)
+
+LIBS="$THREADLIB $save_LIBS"
+
+have_pthreads=no
+
+AC_CHECK_HEADER(pthread.h, [
+ AC_CHECK_FUNC(pthread_cond_wait, have_pthreads=yes)
+]
+)
+
+LIBS="$save_LIBS"
+
+AC_ARG_WITH(pthreads, [--without-pthreads - do not use Posix threads ],
+ if test "$withval" = "no"
+ then
+ have_pthreads=no
+ fi
+ )
+
+if test "$have_pthreads" = "no"
+then
+ THREADLIB=""
+else
+ AC_DEFINE_UNQUOTED(HAVE_PTHREADS,1,
+ [ Whether pthreads are available ])
+fi
+
+AM_CONDITIONAL(HAVE_PTHREADS, test "$have_pthreads" != "no")
+
+AC_SUBST(THREADLIB)
+
+AC_CHECK_LIB(m, sqrt)
+
+if test "$GCC" = "yes"
+then
+ CFLAGS="-Wall $CFLAGS"
+fi
+AC_OUTPUT(Makefile)