From: wessels <> Date: Wed, 8 Jan 1997 03:05:31 +0000 (+0000) Subject: Created USE_GNUREGEX define to fix forcing GNU regex on Solaris and NeXTStep. X-Git-Tag: SQUID_3_0_PRE1~5229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74946a0fed1a00492e11ded4691bb45f165da8bd;p=thirdparty%2Fsquid.git Created USE_GNUREGEX define to fix forcing GNU regex on Solaris and NeXTStep. --- diff --git a/ChangeLog b/ChangeLog index a642e7adee..908ed034ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ + - Created USE_GNUREGEX define to fix forcing GNU regex on + Solaris and NeXTStep. + Changes to squid-1.1.3 (January 7, 1997): - Changed inet_addr("X") to inet_addr("255.255.255.255") diff --git a/configure b/configure index 4897531627..69f897b38f 100755 --- a/configure +++ b/configure @@ -514,7 +514,7 @@ fi -# From configure.in Revision: 1.62 +# From configure.in Revision: 1.63 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then @@ -2675,19 +2675,26 @@ done echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 if test "$ac_cv_func_regcomp" = "no" ; then - COMPILE_GNUREGEX="yes" + USE_GNUREGEX="yes" else - COMPILE_GNUREGEX="no" + USE_GNUREGEX="no" fi case "$host" in *-sun-solaris2.[0-4]) - COMPILE_GNUREGEX="yes" - ;; + USE_GNUREGEX="yes" + ;; + *-next-nextstep*) + USE_GNUREGEX="yes" + ;; esac -echo "$ac_t""$COMPILE_GNUREGEX" 1>&6 -if test "$COMPILE_GNUREGEX" = "yes"; then +echo "$ac_t""$USE_GNUREGEX" 1>&6 +if test "$USE_GNUREGEX" = "yes"; then REGEXLIB="-lregex" LIBREGEX="libregex.a" + cat >> confdefs.h <<\EOF +#define USE_GNUREGEX 1 +EOF + fi @@ -2701,7 +2708,7 @@ 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; }; then +if { (eval echo configure:2736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2751,7 +2758,7 @@ if test "$cross_compiling" = yes; then SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -2803,7 +2810,7 @@ main() { } EOF -{ (eval echo configure:2807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then SQUID_MAXFD=`cat conftestval` else @@ -2822,7 +2829,7 @@ if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -2841,7 +2848,7 @@ main () } EOF -{ (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -2860,7 +2867,7 @@ if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -2879,7 +2886,7 @@ main () } EOF -{ (eval echo configure:2883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -2898,7 +2905,7 @@ if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -2917,7 +2924,7 @@ main () } EOF -{ (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -2936,7 +2943,7 @@ if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -2955,7 +2962,7 @@ main () } EOF -{ (eval echo configure:2959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -2971,7 +2978,7 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2979,7 +2986,7 @@ int t() { char *s = sys_errlist[0]; ; return 0; } EOF -if { (eval echo configure:2983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2995,7 +3002,7 @@ rm -f conftest* echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF diff --git a/configure.in b/configure.in index 899656f088..dd0c49b164 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.63 1997/01/03 22:59:08 wessels Exp $ +dnl $Id: configure.in,v 1.64 1997/01/07 20:05:33 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.63 $)dnl +AC_REVISION($Revision: 1.64 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(aux) @@ -322,19 +322,23 @@ AC_CHECK_FUNCS(\ AC_MSG_CHECKING(if GNUregex needs to be compiled) if test "$ac_cv_func_regcomp" = "no" ; then - COMPILE_GNUREGEX="yes" + USE_GNUREGEX="yes" else - COMPILE_GNUREGEX="no" + USE_GNUREGEX="no" fi case "$host" in [*-sun-solaris2.[0-4]]) - COMPILE_GNUREGEX="yes" - ;; + USE_GNUREGEX="yes" + ;; + [*-next-nextstep*]) + USE_GNUREGEX="yes" + ;; esac -AC_MSG_RESULT($COMPILE_GNUREGEX) -if test "$COMPILE_GNUREGEX" = "yes"; then +AC_MSG_RESULT($USE_GNUREGEX) +if test "$USE_GNUREGEX" = "yes"; then REGEXLIB="-lregex" LIBREGEX="libregex.a" + AC_DEFINE(USE_GNUREGEX) fi AC_SUBST(REGEXLIB) AC_SUBST(LIBREGEX) diff --git a/include/autoconf.h.in b/include/autoconf.h.in index 6d7a91a4a1..88ea178d75 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -79,6 +79,9 @@ /* Define if your compiler supports prototyping */ #undef HAVE_ANSI_PROTOTYPES +/* Define if we should use GNU regex */ +#undef USE_GNUREGEX + /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/src/debug.cc b/src/debug.cc index 499adad93f..d8dbeacc9d 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,5 +1,5 @@ /* - * $Id: debug.cc,v 1.39 1997/01/03 22:59:15 wessels Exp $ + * $Id: debug.cc,v 1.40 1997/01/07 20:05:42 wessels Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -105,9 +105,6 @@ #include "squid.h" -const char *volatile _db_file = __FILE__; -volatile int _db_line = 0; - FILE *debug_log = NULL; static char *debug_log_file = NULL; static const char *const w_space = " \t\n\r"; @@ -137,34 +134,26 @@ _db_print(va_alist) LOCAL_ARRAY(char, tmpbuf, BUFSIZ); #endif - if (debug_log == NULL) - return; - #ifdef __STDC__ + if (level > debugLevels[section]) + return; va_start(args, format); #else va_start(args); section = va_arg(args, int); level = va_arg(args, int); - format = va_arg(args, const char *); -#endif - if (level > debugLevels[section]) { va_end(args); return; } -#ifdef LOG_FILE_AND_LINE - sprintf(f, "%s %-10.10s %4d| %s", - accessLogTime(squid_curtime), - _db_file, - _db_line, - format); -#else + format = va_arg(args, const char *); +#endif + + if (debug_log == NULL) + return; sprintf(f, "%s| %s", accessLogTime(squid_curtime), format); -#endif - #if HAVE_SYSLOG /* level 0 go to syslog */ if (level == 0 && opt_syslog_enable) { @@ -174,7 +163,6 @@ _db_print(va_alist) syslog(LOG_ERR, "%s", tmpbuf); } #endif /* HAVE_SYSLOG */ - /* write to log file */ vfprintf(debug_log, f, args); if (unbuffered_logs) diff --git a/src/squid.h b/src/squid.h index 92f96a0cdb..50169674ab 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.89 1997/01/03 22:59:17 wessels Exp $ + * $Id: squid.h,v 1.90 1997/01/07 20:05:44 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -245,11 +245,11 @@ typedef unsigned long u_num32; #include "ansiproto.h" -#if HAVE_REGEX_H && !defined(_SQUID_NEXT_) -#include -#else /* HAVE_REGEX_H */ +#ifdef USE_GNUREGEX #include "GNUregex.h" -#endif /* HAVE_REGEX_H */ +#elif HAVE_REGEX_H +#include +#endif /* * So if FD_SETSIZE is less than SQUID_MAXFD we'd probably better