From 4867a5461c9f7bf325687f32a27c9b2e68fc6213 Mon Sep 17 00:00:00 2001 From: jongfoster Date: Sun, 15 Jul 2001 19:45:33 +0000 Subject: [PATCH 1/1] Added support for linking with POSIX threads library --- Makefile.in | 16 +++++- configure | 157 ++++++++++++++++++++++++++++++++++++++++++++------- configure.in | 32 +++++++++-- 3 files changed, 177 insertions(+), 28 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3fe609c0..6dd9a26e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Note: Makefile is built automatically from Makefile.in # -# $Id: Makefile.in,v 1.14 2001/07/01 16:27:44 oes Exp $ +# $Id: Makefile.in,v 1.15 2001/07/13 13:48:07 oes Exp $ # # Written by and Copyright (C) 2001 the SourceForge # IJBSWA team. http://ijbswa.sourceforge.net @@ -28,6 +28,15 @@ # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Log: Makefile.in,v $ +# Revision 1.15 2001/07/13 13:48:07 oes +# - Moved STATIC #define for pcre to (ac)config.h +# - Made -Ipcre depandant on static pcre compilation to +# avoid version conflicts +# - Included compilation and depandancies for new deanimate.c +# - Made changes to the pcre/pcreposix/pcrs build process +# as required by the new library autodetection in +# configure.in +# # Revision 1.14 2001/07/01 16:27:44 oes # Fixed misplaced dependancy # @@ -169,7 +178,10 @@ PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcr # FIXME: This is always commented out SOCKET_LIB = @SOLARIS_ONLY@-lsocket -lnsl -LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) +# PThreads library, if needed. +PTHREAD_LIB = @PTHREAD_ONLY@@PTHREAD_LIB@ + +LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB) SRCS = $(C_SRC) $(W32_SRC) $(PCRS_SRC) $(PCRE_SRC) $(REGEX_SRC) OBJS = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS) diff --git a/configure b/configure index 399c21dd..0d478171 100755 --- a/configure +++ b/configure @@ -1052,6 +1052,34 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_safe=`echo "pcre.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for pcre.h""... $ac_c" 1>&6 +echo "configure:1059: checking for pcre.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 have_pcre=yes else @@ -1059,8 +1087,13 @@ else have_pcre=no fi +else + echo "$ac_t""no" 1>&6 +have_pcre=no +fi + echo $ac_n "checking for regcomp in -lpcreposix""... $ac_c" 1>&6 -echo "configure:1064: checking for regcomp in -lpcreposix" >&5 +echo "configure:1097: checking for regcomp in -lpcreposix" >&5 ac_lib_var=`echo pcreposix'_'regcomp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1068,7 +1101,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpcreposix -lpcre $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1093,6 +1126,34 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_safe=`echo "pcreposix.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for pcreposix.h""... $ac_c" 1>&6 +echo "configure:1133: checking for pcreposix.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 have_pcreposix=yes else @@ -1100,8 +1161,13 @@ else have_pcreposix=no fi +else + echo "$ac_t""no" 1>&6 +have_pcreposix=no +fi + echo $ac_n "checking for pcrs_compile in -lpcrs""... $ac_c" 1>&6 -echo "configure:1105: checking for pcrs_compile in -lpcrs" >&5 +echo "configure:1171: checking for pcrs_compile in -lpcrs" >&5 ac_lib_var=`echo pcrs'_'pcrs_compile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1109,7 +1175,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpcrs $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1134,8 +1200,41 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_safe=`echo "pcrs.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for pcrs.h""... $ac_c" 1>&6 +echo "configure:1207: checking for pcrs.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 have_pcrs=yes +else + echo "$ac_t""no" 1>&6 +have_pcre=no +fi + else echo "$ac_t""no" 1>&6 have_pcrs=no @@ -1143,12 +1242,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1147: checking for ANSI C header files" >&5 +echo "configure:1246: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1156,7 +1255,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1173,7 +1272,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1191,7 +1290,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1212,7 +1311,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1223,7 +1322,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1248,12 +1347,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1252: checking for working const" >&5 +echo "configure:1351: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1323,12 +1422,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1327: checking for size_t" >&5 +echo "configure:1426: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1359,12 +1458,12 @@ fi for ac_func in strerror bcopy memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1363: checking for $ac_func" >&5 +echo "configure:1462: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1413,34 +1512,41 @@ done + # Check whether --enable-mingw32 or --disable-mingw32 was given. if test "${enable_mingw32+set}" = set; then enableval="$enable_mingw32" if test $enableval = yes; then WIN_ONLY= CYGWIN_FLAGS="-mwindows -mno-cygwin" + PTHREAD_LIB=-lpthreadGC echo "Using mingw32 (Win32 GUI)" else WIN_ONLY=# if test "$CYGWIN" = "yes"; then CYGWIN_FLAGS="-mno-win32" + PTHREAD_LIB= echo "Using Cygnus (Win32 command line)" else CYGWIN_FLAGS= + PTHREAD_LIB=-lpthread fi fi else if test "$MINGW32" = "yes"; then WIN_ONLY= CYGWIN_FLAGS="-mwindows -mno-cygwin" + PTHREAD_LIB=-lpthreadGC echo "Using mingw32 (Win32 GUI)" else WIN_ONLY=# if test "$CYGWIN" = "yes"; then CYGWIN_FLAGS="-mno-win32" + PTHREAD_LIB= echo "Using Cygnus (Win32 command line)" else CYGWIN_FLAGS= + PTHREAD_LIB=-lpthread fi fi fi @@ -1449,6 +1555,7 @@ fi + SOLARIS_ONLY=# @@ -1474,19 +1581,25 @@ fi if test "${enable_pthread+set}" = set; then enableval="$enable_pthread" if test $enableval = yes; then + PTHREAD_ONLY= cat >> confdefs.h <<\EOF #define FEATURE_PTHREAD 1 EOF +else + PTHREAD_ONLY=# fi else cat >> confdefs.h <<\EOF #define FEATURE_PTHREAD 1 EOF + PTHREAD_ONLY= + fi + # Check whether --enable-gzip or --disable-gzip was given. if test "${enable_gzip+set}" = set; then enableval="$enable_gzip" @@ -1930,7 +2043,9 @@ s%@EXEEXT@%$EXEEXT%g s%@OBJEXT@%$OBJEXT%g s%@WIN_ONLY@%$WIN_ONLY%g s%@CYGWIN_FLAGS@%$CYGWIN_FLAGS%g +s%@PTHREAD_LIB@%$PTHREAD_LIB%g s%@SOLARIS_ONLY@%$SOLARIS_ONLY%g +s%@PTHREAD_ONLY@%$PTHREAD_ONLY%g s%@GNU_REGEX_ONLY@%$GNU_REGEX_ONLY%g s%@PCRE_REGEX_ONLY@%$PCRE_REGEX_ONLY%g s%@STATIC_PCRE_ONLY@%$STATIC_PCRE_ONLY%g diff --git a/configure.in b/configure.in index 49275a0b..87b0a4f8 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl $Id: configure.in,v 1.7 2001/07/13 13:58:05 oes Exp $ +dnl $Id: configure.in,v 1.8 2001/07/15 17:54:29 jongfoster Exp $ dnl dnl Written by and Copyright (C) 2001 the SourceForge dnl IJBSWA team. http://ijbswa.sourceforge.net @@ -28,6 +28,11 @@ dnl or write to the Free Software Foundation, Inc., 59 dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl dnl $Log: configure.in,v $ +dnl Revision 1.8 2001/07/15 17:54:29 jongfoster +dnl Renaming #define STATIC to STATIC_PCRE +dnl Adding new #define FEATURE_PTHREAD that will be used to enable +dnl POSIX threads support. +dnl dnl Revision 1.7 2001/07/13 13:58:05 oes dnl Completely reorganized the selection scheme for dnl pcre, pcreposix, pcrs and gnu_regex: @@ -172,9 +177,11 @@ AC_EXEEXT AC_OBJEXT dnl Checks for libraries. -AC_CHECK_LIB(pcre, pcre_compile, [have_pcre=yes], [have_pcre=no]) -AC_CHECK_LIB(pcreposix, regcomp, [have_pcreposix=yes], [have_pcreposix=no], -lpcre) -AC_CHECK_LIB(pcrs, pcrs_compile, [have_pcrs=yes], [have_pcrs=no]) +dnl Note: Some systems have the library but not the system header file, +dnl so we must check for both. +AC_CHECK_LIB(pcre, pcre_compile, [AC_CHECK_HEADER(pcre.h, [have_pcre=yes], [have_pcre=no])], [have_pcre=no]) +AC_CHECK_LIB(pcreposix, regcomp, [AC_CHECK_HEADER(pcreposix.h, [have_pcreposix=yes], [have_pcreposix=no])], [have_pcreposix=no], -lpcre) +AC_CHECK_LIB(pcrs, pcrs_compile, [AC_CHECK_HEADER(pcrs.h, [have_pcrs=yes], [have_pcre=no])], [have_pcrs=no]) dnl Checks for header files. AC_HEADER_STDC @@ -195,37 +202,46 @@ AC_CHECK_FUNCS(strerror bcopy memmove) dnl Build type +dnl Note: PTHREAD_LIB is always set, even if pthread is disabled. + AC_ARG_ENABLE(mingw32, [ --enable-mingw32 Use mingw32 for a Windows GUI], [if test $enableval = yes; then WIN_ONLY= CYGWIN_FLAGS="-mwindows -mno-cygwin" + PTHREAD_LIB=-lpthreadGC echo "Using mingw32 (Win32 GUI)" else WIN_ONLY=# if test "$CYGWIN" = "yes"; then CYGWIN_FLAGS="-mno-win32" + PTHREAD_LIB= echo "Using Cygnus (Win32 command line)" else CYGWIN_FLAGS= + PTHREAD_LIB=-lpthread fi fi], [if test "$MINGW32" = "yes"; then WIN_ONLY= CYGWIN_FLAGS="-mwindows -mno-cygwin" + PTHREAD_LIB=-lpthreadGC echo "Using mingw32 (Win32 GUI)" else WIN_ONLY=# if test "$CYGWIN" = "yes"; then CYGWIN_FLAGS="-mno-win32" + PTHREAD_LIB= echo "Using Cygnus (Win32 command line)" else CYGWIN_FLAGS= + PTHREAD_LIB=-lpthread fi fi]) AC_SUBST(WIN_ONLY) AC_SUBST(CYGWIN_FLAGS) +AC_SUBST(PTHREAD_LIB) SOLARIS_ONLY=# AC_SUBST(SOLARIS_ONLY) @@ -241,8 +257,14 @@ fi],AC_DEFINE(TOGGLE)) AC_ARG_ENABLE(pthread, [ --disable-pthread Don't use POSIX threads (pthreads)], [if test $enableval = yes; then + PTHREAD_ONLY= AC_DEFINE(FEATURE_PTHREAD) -fi],AC_DEFINE(FEATURE_PTHREAD)) +else + PTHREAD_ONLY=# +fi],[AC_DEFINE(FEATURE_PTHREAD) + PTHREAD_ONLY= +]) +AC_SUBST(PTHREAD_ONLY) AC_ARG_ENABLE(gzip, [ --enable-gzip Allow gzip'ed transfer of documents. Note that this will make content modification impossible.], -- 2.39.2