/[cvs]/eggdrop1.9/aclocal.m4
ViewVC logotype

Diff of /eggdrop1.9/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.40 by guppy, Thu Jun 28 19:06:44 2001 UTC revision 1.41 by guppy, Sun Jul 1 07:19:38 2001 UTC
# Line 38  AC_MSG_RESULT() Line 38  AC_MSG_RESULT()
38  dnl  EGG_CHECK_CC()  dnl  EGG_CHECK_CC()
39  dnl  dnl
40  dnl  FIXME: make a better test  dnl  FIXME: make a better test
41    dnl
42  AC_DEFUN(EGG_CHECK_CC, [dnl  AC_DEFUN(EGG_CHECK_CC, [dnl
43  if test "x${cross_compiling}" = "x"  if test "${cross_compiling-x}" = "x"
44  then  then
45    cat << 'EOF' >&2    cat << 'EOF' >&2
46  configure: error:  configure: error:
# Line 62  if test -z "$no_pipe" Line 63  if test -z "$no_pipe"
63  then  then
64    if test -n "$GCC"    if test -n "$GCC"
65    then    then
66      AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe,      AC_CACHE_CHECK(whether the compiler understands -pipe, egg_cv_var_ccpipe, [dnl
     [dnl  
67        ac_old_CC="$CC"        ac_old_CC="$CC"
68        CC="$CC -pipe"        CC="$CC -pipe"
69        AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")        AC_TRY_COMPILE(,, egg_cv_var_ccpipe="yes", egg_cv_var_ccpipe="no")
70        CC="$ac_old_CC"        CC="$ac_old_CC"
71      ])      ])
72      if test "x$egg_cv_var_ccpipe" = "xyes"; then      if test "$egg_cv_var_ccpipe" = "yes"
73        then
74        CC="$CC -pipe"        CC="$CC -pipe"
75      fi      fi
76    fi    fi
# Line 81  dnl  EGG_PROG_STRIP() Line 82  dnl  EGG_PROG_STRIP()
82  dnl  dnl
83  AC_DEFUN(EGG_PROG_STRIP, [dnl  AC_DEFUN(EGG_PROG_STRIP, [dnl
84  AC_CHECK_PROG(STRIP,strip,strip)  AC_CHECK_PROG(STRIP,strip,strip)
85  if test "x${STRIP}" = "x"  if test "${STRIP-x}" = "x"
86  then  then
87    STRIP=touch    STRIP=touch
88  fi  fi
# Line 93  dnl Line 94  dnl
94  AC_DEFUN(EGG_PROG_AWK, [dnl  AC_DEFUN(EGG_PROG_AWK, [dnl
95  # awk is needed for Tcl library and header checks, and eggdrop version subst  # awk is needed for Tcl library and header checks, and eggdrop version subst
96  AC_PROG_AWK  AC_PROG_AWK
97  if test "x${AWK}" = "x"  if test "${AWK-x}" = "x"
98  then  then
99    cat << 'EOF' >&2    cat << 'EOF' >&2
100  configure: error:  configure: error:
# Line 112  dnl Line 113  dnl
113  AC_DEFUN(EGG_PROG_BASENAME, [dnl  AC_DEFUN(EGG_PROG_BASENAME, [dnl
114  # basename is needed for Tcl library and header checks  # basename is needed for Tcl library and header checks
115  AC_CHECK_PROG(BASENAME, basename, basename)  AC_CHECK_PROG(BASENAME, basename, basename)
116  if test "x${BASENAME}" = "x"  if test "${BASENAME-x}" = "x"
117  then  then
118    cat << 'EOF' >&2    cat << 'EOF' >&2
119  configure: error:  configure: error:
# Line 128  fi Line 129  fi
129    
130  dnl  EGG_CHECK_OS()  dnl  EGG_CHECK_OS()
131  dnl  dnl
132    dnl  FIXME/NOTICE:
133    dnl    This function is obsolete. Any NEW code/checks should be written
134    dnl    as individual tests that will be checked on ALL operating systems.
135    dnl
136  AC_DEFUN(EGG_CHECK_OS, [dnl  AC_DEFUN(EGG_CHECK_OS, [dnl
137  LINUX=no  LINUX=no
138  IRIX=no  IRIX=no
139  SUNOS=no  SUNOS=no
140  HPUX=no  HPUX=no
141  MOD_CC="${CC}"  MOD_CC="$CC"
142  MOD_LD="${CC}"  MOD_LD="$CC"
143  MOD_STRIP="${STRIP}"  MOD_STRIP="$STRIP"
144  SHLIB_CC="${CC}"  SHLIB_CC="$CC"
145  SHLIB_LD="${CC}"  SHLIB_LD="$CC"
146  SHLIB_STRIP="${STRIP}"  SHLIB_STRIP="$STRIP"
147  NEED_DL=1  NEED_DL=1
148  DEFAULT_MAKE=debug  DEFAULT_MAKE=debug
149  MOD_EXT=so  MOD_EXT=so
150    
151  AC_MSG_CHECKING(your os)  AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
152  AC_CACHE_VAL(egg_cv_var_system, [egg_cv_var_system=`${UNAME}`])  AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
153    
154  case "$egg_cv_var_system" in  case "$egg_cv_var_system_type" in
155    BSD/OS)    BSD/OS)
156      bsd_version=`${UNAME} -r | cut -d . -f 1`      case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
     case "$bsd_version" in  
157        2)        2)
         AC_MSG_RESULT(BSD/OS 2)  
158          NEED_DL=0          NEED_DL=0
159          DEFAULT_MAKE=static          DEFAULT_MAKE=static
160        ;;        ;;
161        3)        3)
         AC_MSG_RESULT(BSD/OS 3)  
162          MOD_CC=shlicc          MOD_CC=shlicc
163          MOD_LD=shlicc          MOD_LD=shlicc
164          MOD_STRIP="${STRIP} -d"          MOD_STRIP="$STRIP -d"
165          SHLIB_LD="shlicc -r"          SHLIB_LD="shlicc -r"
166          SHLIB_STRIP=touch          SHLIB_STRIP=touch
167          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
168        ;;        ;;
169        *)        *)
         AC_MSG_RESULT(BSD/OS 4+)  
170          CFLAGS="$CFLAGS -Wall"          CFLAGS="$CFLAGS -Wall"
171          MOD_LD="${CC} "          MOD_LD="$CC"
172          MOD_STRIP="${STRIP} -d"          MOD_STRIP="$STRIP -d"
173          SHLIB_CC="${CC} -export-dynamic -fPIC"          SHLIB_CC="$CC -export-dynamic -fPIC"
174          SHLIB_LD="${CC} -shared -nostartfiles"          SHLIB_LD="$CC -shared -nostartfiles"
175          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
176        ;;        ;;
177      esac      esac
178      ;;      ;;
179    CYGWIN*)    CYGWIN*)
180      cygwin_version=`${UNAME} -r | cut -c 1-3`      case "`echo $egg_cv_var_system_release | cut -c 1-3`" in
181      case "$cygwin_version" in        1.*)
       1.1.3|1.1.4|1.1.5|1.1.6|1.1.7|1.1.8|1.3)  
         AC_MSG_RESULT(Cygwin 1.1.3 or later)  
         NEED_DL=0  
         SHLIB_LD="${CC} -shared"  
     CC="$CC -mwin32"  
     MOD_CC="${CC}"  
     MOD_LD="${CC}"  
         LIBS="${LIBS} /usr/lib/binmode.o"  
         MOD_EXT=dll  
         AC_DEFINE(MODULES_OK)dnl  
       ;;  
       1.1.*)  
         AC_MSG_RESULT(Cygwin 1.1.0-1.1.2)  
     AC_MSG_RESULT(The directory eggdrop is installed into must be mounted in binary mode)  
182          NEED_DL=0          NEED_DL=0
183          SHLIB_LD="${CC} -shared"          SHLIB_LD="$CC -shared"
184      CC="$CC -mwin32"      CC="$CC -mwin32"
185      MOD_CC="${CC}"          MOD_CC="$CC"
186      MOD_LD="${CC}"          MOD_LD="$CC"
187            AC_MSG_CHECKING(for /usr/lib/binmode.o)
188            if test -f /usr/lib/binmode.o && test -r /usr/lib/binmode.o
189            then
190              AC_MSG_RESULT(yes)
191              LIBS="$LIBS /usr/lib/binmode.o"
192            else
193              AC_MSG_RESULT(no)
194              AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
195            fi
196          MOD_EXT=dll          MOD_EXT=dll
197          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
198        ;;        ;;
199        *)        *)
         AC_MSG_RESULT(Cygwin pre 1.1.x or unknown)  
     AC_MSG_RESULT(The directory eggdrop is installed into must be mounted in binary mode)  
200          NEED_DL=0          NEED_DL=0
201          DEFAULT_MAKE=static          DEFAULT_MAKE=static
202            AC_MSG_WARN(Make sure the directory eggdrop is installed into is mounted in binary mode.)
203        ;;        ;;
204      esac      esac
205      ;;      ;;
206    HP-UX)    HP-UX)
     AC_MSG_RESULT(HP-UX)  
207      HPUX=yes      HPUX=yes
208      MOD_LD="${CC} -fPIC -shared"      MOD_LD="$CC -fPIC -shared"
209      SHLIB_CC="${CC} -fPIC"      SHLIB_CC="$CC -fPIC"
210      SHLIB_LD="ld -b"      SHLIB_LD="ld -b"
211      NEED_DL=0      NEED_DL=0
212      AC_DEFINE(MODULES_OK)dnl      AC_DEFINE(MODULES_OK)dnl
213      AC_DEFINE(HPUX_HACKS)dnl      AC_DEFINE(HPUX_HACKS)dnl
214      if test "x`${UNAME} -r | cut -d . -f 2`" = "x10"      if test "`echo $egg_cv_var_system_release | cut -d . -f 2`" = "10"
215      then      then
216        AC_DEFINE(HPUX10_HACKS)dnl        AC_DEFINE(HPUX10_HACKS)dnl
217      fi      fi
# Line 226  case "$egg_cv_var_system" in Line 220  case "$egg_cv_var_system" in
220      AC_MSG_RESULT(Dell SVR4)      AC_MSG_RESULT(Dell SVR4)
221      SHLIB_STRIP=touch      SHLIB_STRIP=touch
222      NEED_DL=0      NEED_DL=0
223      MOD_LD="${CC} -lelf -lucb"      MOD_LD="$CC -lelf -lucb"
224      ;;      ;;
225    IRIX)    IRIX)
     echo "$ac_t""IRIX (Have fun with IRIX 4.+!)" 1>&6  
226      SHLIB_LD="ld -n32 -shared -rdata_shared"      SHLIB_LD="ld -n32 -shared -rdata_shared"
227      IRIX=yes      IRIX=yes
228      SHLIB_STRIP=touch      SHLIB_STRIP=touch
# Line 237  case "$egg_cv_var_system" in Line 230  case "$egg_cv_var_system" in
230      DEFAULT_MAKE=static      DEFAULT_MAKE=static
231      ;;      ;;
232    Ultrix)    Ultrix)
     AC_MSG_RESULT(Ultrix)  
233      NEED_DL=0      NEED_DL=0
234      SHLIB_STRIP=touch      SHLIB_STRIP=touch
235      DEFAULT_MAKE=static      DEFAULT_MAKE=static
236      SHELL=/bin/sh5      SHELL=/bin/sh5
237      ;;      ;;
238    SINIX*)    SINIX*)
     AC_MSG_RESULT(SINIX)  
239      NEED_DL=0      NEED_DL=0
240      SHLIB_STRIP=touch      SHLIB_STRIP=touch
241      DEFAULT_MAKE=static      DEFAULT_MAKE=static
242      SHLIB_CC="cc -G"      SHLIB_CC="cc -G"
243      ;;      ;;
244    BeOS)    BeOS)
     AC_MSG_RESULT(BeOS)  
245      NEED_DL=0      NEED_DL=0
246      SHLIB_STRIP=strip      SHLIB_STRIP=strip
247      DEFAULT_MAKE=static      DEFAULT_MAKE=static
248      ;;      ;;
249    Linux)    Linux)
     AC_MSG_RESULT(Linux)  
250      LINUX=yes      LINUX=yes
251      CFLAGS="$CFLAGS -Wall"      CFLAGS="$CFLAGS -Wall"
252      MOD_LD="${CC}"      MOD_LD="$CC"
253      SHLIB_CC="${CC} -fPIC"      SHLIB_CC="$CC -fPIC"
254      SHLIB_LD="${CC} -shared -nostartfiles"      SHLIB_LD="$CC -shared -nostartfiles"
255      AC_DEFINE(MODULES_OK)dnl      AC_DEFINE(MODULES_OK)dnl
256      ;;      ;;
257    Lynx)    Lynx)
     AC_MSG_RESULT(Lynx OS)  
258      NEED_DL=0        NEED_DL=0  
259      DEFAULT_MAKE=static      DEFAULT_MAKE=static
260      SHLIB_STRIP=strip      SHLIB_STRIP=strip
261      ;;      ;;
262    OSF1)    OSF1)
263      AC_MSG_RESULT(OSF)      case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
     case `${UNAME} -r | cut -d . -f 1` in  
264        V*)        V*)
265          AC_MSG_RESULT([   Digital OSF])          # FIXME: we should check this in a seperate test
266          if test "x$AWK" = "xgawk"          # Digital OSF uses an ancient version of gawk
267            if test "$AWK" = "gawk"
268          then          then
269            AWK=awk            AWK=awk
270          fi          fi
# Line 288  case "$egg_cv_var_system" in Line 276  case "$egg_cv_var_system" in
276          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
277          ;;          ;;
278        1.0|1.1|1.2)        1.0|1.1|1.2)
         AC_MSG_RESULT([   pre 1.3])  
279          SHLIB_LD="ld -R -export $@:"          SHLIB_LD="ld -R -export $@:"
280          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
281          AC_DEFINE(OSF1_HACKS)dnl          AC_DEFINE(OSF1_HACKS)dnl
282          ;;          ;;
283        1.*)        1.*)
284          AC_MSG_RESULT([   1.3+])          SHLIB_CC="$CC -fpic"
         SHLIB_CC="${CC} -fpic"  
285          SHLIB_LD="ld -shared"          SHLIB_LD="ld -shared"
286          AC_DEFINE(MODULES_OK)dnl          AC_DEFINE(MODULES_OK)dnl
287          AC_DEFINE(OSF1_HACKS)dnl          AC_DEFINE(OSF1_HACKS)dnl
288          ;;          ;;
289        *)        *)
         AC_MSG_RESULT([   Some other weird OSF! No modules for you...])  
290          NEED_DL=0          NEED_DL=0
291          DEFAULT_MAKE=static          DEFAULT_MAKE=static
292          ;;          ;;
# Line 309  case "$egg_cv_var_system" in Line 294  case "$egg_cv_var_system" in
294      AC_DEFINE(STOP_UAC)dnl      AC_DEFINE(STOP_UAC)dnl
295      ;;      ;;
296    SunOS)    SunOS)
297      if test "x`${UNAME} -r | cut -d . -f 1`" = "x5"      if test "`echo $egg_cv_var_system_release | cut -d . -f 1`" = "5"
298      then      then
299        AC_MSG_RESULT(Solaris)        # Solaris
300        if test -n "$GCC"        if test -n "$GCC"
301        then        then
302          SHLIB_CC="${CC} -fPIC"          SHLIB_CC="$CC -fPIC"
303      SHLIB_LD="${CC}"          SHLIB_LD="$CC"
304        else          else  
305        SHLIB_CC="${CC} -KPIC"          SHLIB_CC="$CC -KPIC"
306          SHLIB_LD="${CC} -G -z text"          SHLIB_LD="$CC -G -z text"
307        fi        fi
308      else      else
309        AC_MSG_RESULT(SunOS)        # SunOS 4
310        SUNOS=yes        SUNOS=yes
311        SHLIB_LD=ld        SHLIB_LD=ld
312        SHLIB_CC="${CC} -PIC"        SHLIB_CC="$CC -PIC"
313        AC_DEFINE(DLOPEN_1)dnl        AC_DEFINE(DLOPEN_1)dnl
314      fi      fi
315      AC_DEFINE(MODULES_OK)dnl      AC_DEFINE(MODULES_OK)dnl
316      ;;      ;;
317    *BSD)    *BSD)
318      AC_MSG_RESULT(FreeBSD/NetBSD/OpenBSD - choose your poison)      # FreeBSD/OpenBSD/NetBSD
319      SHLIB_CC="${CC} -fPIC"      SHLIB_CC="$CC -fPIC"
320      SHLIB_LD="ld -Bshareable -x"      SHLIB_LD="ld -Bshareable -x"
321      AC_DEFINE(MODULES_OK)dnl      AC_DEFINE(MODULES_OK)dnl
322      ;;      ;;
323    *)    *)
324      if test -r "/mach"      AC_MSG_CHECKING(if system is Mach based)
325        if test -r /mach
326      then      then
327        AC_MSG_RESULT(Something Mach based)        AC_MSG_RESULT(yes)
328        NEED_DL=0        NEED_DL=0
329        DEFAULT_MAKE=static        DEFAULT_MAKE=static
330        AC_DEFINE(BORGCUBES)dnl        AC_DEFINE(BORGCUBES)dnl
331      else      else
332        if test -r "/cmds"        AC_MSG_RESULT(no)
333          AC_MSG_CHECKING(if system is QNX)
334          if test -r /cmds
335        then        then
336          AC_MSG_RESULT(QNX)          AC_MSG_RESULT(yes)
337          SHLIB_STRIP=touch          SHLIB_STRIP=touch
338          NEED_DL=0          NEED_DL=0
339          DEFAULT_MAKE=static          DEFAULT_MAKE=static
340        else        else
341            AC_MSG_RESULT(no)
342          AC_MSG_RESULT(Something unknown!)          AC_MSG_RESULT(Something unknown!)
343          AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])          AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
344          NEED_DL=0          NEED_DL=0
# Line 366  AC_SUBST(SHLIB_CC)dnl Line 355  AC_SUBST(SHLIB_CC)dnl
355  AC_SUBST(SHLIB_STRIP)dnl  AC_SUBST(SHLIB_STRIP)dnl
356  AC_SUBST(DEFAULT_MAKE)dnl  AC_SUBST(DEFAULT_MAKE)dnl
357  AC_SUBST(MOD_EXT)dnl  AC_SUBST(MOD_EXT)dnl
358  AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "${MOD_EXT}")dnl  AC_DEFINE_UNQUOTED(EGG_MOD_EXT, "$MOD_EXT")dnl
359  ])dnl  ])dnl
360    
361    
362  dnl  EGG_CHECK_LIBS()  dnl  EGG_CHECK_LIBS()
363  dnl  dnl
364  AC_DEFUN(EGG_CHECK_LIBS, [dnl  AC_DEFUN(EGG_CHECK_LIBS, [dnl
365    # FIXME: this needs to be fixed so that it works on IRIX
366  if test "$IRIX" = "yes"  if test "$IRIX" = "yes"
367  then  then
368    AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)    AC_MSG_WARN(Skipping library tests because they CONFUSE Irix.)
# Line 383  else Line 373  else
373    AC_CHECK_LIB(dl, dlopen)    AC_CHECK_LIB(dl, dlopen)
374    AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")    AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
375    # This is needed for Tcl libraries compiled with thread support    # This is needed for Tcl libraries compiled with thread support
376    AC_CHECK_LIB(pthread, pthread_mutex_init,    AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
377      ac_cv_lib_pthread_pthread_mutex_init=yes,    ac_cv_lib_pthread_pthread_mutex_init=yes
378      ac_cv_lib_pthread_pthread_mutex_init=no)    ac_cv_lib_pthread="-lpthread"], [dnl
379    if test "$ac_cv_lib_pthread_pthread_mutex_init" = "no"; then      AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
380      AC_CHECK_LIB(pthread,__pthread_mutex_init,      ac_cv_lib_pthread_pthread_mutex_init=yes
381        ac_cv_lib_pthread_pthread_mutex_init=yes,      ac_cv_lib_pthread="-lpthread"], [dnl
382        ac_cv_lib_pthread_pthread_mutex_init=no)        AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
383    fi        ac_cv_lib_pthread_pthread_mutex_init=yes
384    if test "$ac_cv_lib_pthread_pthread_mutex_init" = "no"; then        ac_cv_lib_pthread="-lpthreads"], [dnl
385      AC_CHECK_LIB(pthreads,pthread_mutex_init,          AC_CHECK_FUNC(pthread_mutex_init, [dnl
386        ac_cv_lib_pthreads_pthread_mutex_init=yes,          ac_cv_lib_pthread_pthread_mutex_init=yes
387        ac_cv_lib_pthreads_pthread_mutex_init=no)          ac_cv_lib_pthread=""],
388    fi          ac_cv_lib_pthread_pthread_mutex_init=no)])])])
   if test "$ac_cv_lib_pthread_pthread_mutex_init" = "no"; then  
     AC_CHECK_FUNC(pthread_mutex_init,  
       ac_cv_lib_pthreads_pthread_mutex_init=yes,  
       ac_cv_lib_pthreads_pthread_mutex_init=no)  
   fi  
389    if test "$SUNOS" = "yes"    if test "$SUNOS" = "yes"
390    then    then
391      # For suns without yp or something like that      # For suns without yp or something like that
# Line 419  dnl  EGG_CHECK_FUNC_VSPRINTF() Line 404  dnl  EGG_CHECK_FUNC_VSPRINTF()
404  dnl  dnl
405  AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl  AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
406  AC_CHECK_FUNCS(vsprintf)  AC_CHECK_FUNCS(vsprintf)
407  if test "x${ac_cv_func_vsprintf}" = "xno"  if test "$ac_cv_func_vsprintf" = "no"
408  then  then
409    cat << 'EOF' >&2    cat << 'EOF' >&2
410  configure: error:  configure: error:
# Line 432  EOF Line 417  EOF
417  fi  fi
418  ])dnl  ])dnl
419    
420    
421  dnl  EGG_HEADER_STDC()  dnl  EGG_HEADER_STDC()
422  dnl  dnl
423  AC_DEFUN(EGG_HEADER_STDC, [dnl  AC_DEFUN(EGG_HEADER_STDC, [dnl
424  if test "x${ac_cv_header_stdc}" = "xno"  if test "$ac_cv_header_stdc" = "no"
425  then  then
426    cat << 'EOF' >&2    cat << 'EOF' >&2
427  configure: error:  configure: error:
# Line 448  EOF Line 434  EOF
434  fi  fi
435  ])dnl  ])dnl
436    
437    
438  dnl  EGG_CHECK_LIBSAFE_SSCANF()  dnl  EGG_CHECK_LIBSAFE_SSCANF()
439  dnl  dnl
440  AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl  AC_DEFUN(EGG_CHECK_LIBSAFE_SSCANF, [dnl
441  AC_CACHE_CHECK(whether libsafe broke sscanf, egg_cv_var_libsafe_sscanf,  AC_CACHE_CHECK(for broken libsafe sscanf, egg_cv_var_libsafe_sscanf, [dnl
442  [dnl    AC_TRY_RUN([
443    AC_TRY_RUN([#include <stdio.h>  #include <stdio.h>
444    
445    int main()    int main()
446    {    {
447      char *src = "0x001,guppyism\n";      char *src = "0x001,guppyism\n";
# Line 462  AC_CACHE_CHECK(whether libsafe broke ssc Line 450  AC_CACHE_CHECK(whether libsafe broke ssc
450      if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)      if (sscanf(src, "0x%x,%10c", &idx, dst) == 1)
451        exit(1);        exit(1);
452      return 0;      return 0;
453    }],egg_cv_var_libsafe_sscanf="no",egg_cv_var_libsafe_sscanf="yes",  }
454    ], egg_cv_var_libsafe_sscanf="no", egg_cv_var_libsafe_sscanf="yes",
455    egg_cv_var_libsafe_sscanf="no")    egg_cv_var_libsafe_sscanf="no")
456  ])  ])
457  if test "x$egg_cv_var_libsafe_sscanf" = "xyes"; then  if test "$egg_cv_var_libsafe_sscanf" = "yes"
458    then
459    AC_DEFINE(LIBSAFE_HACKS)dnl    AC_DEFINE(LIBSAFE_HACKS)dnl
460  fi  fi
461  ])dnl  ])dnl
462    
463    
464  dnl  EGG_CYGWIN()  dnl  EGG_CYGWIN()
465  dnl  dnl
466  dnl  Check for Cygwin support.  dnl  Check for Cygwin support.
467  AC_DEFUN(EGG_CYGWIN, [dnl  AC_DEFUN(EGG_CYGWIN, [dnl
468  AC_CYGWIN  AC_CYGWIN
469  if test ! "x${CYGWIN}" = "x"  if test "$ac_cv_cygwin" = "yes"
470  then  then
471    AC_DEFINE(CYGWIN_HACKS)dnl    AC_DEFINE(CYGWIN_HACKS)dnl
472  fi  fi
# Line 489  dnl  accordingly. Line 480  dnl  accordingly.
480  AC_DEFUN(EGG_EXEEXT, [dnl  AC_DEFUN(EGG_EXEEXT, [dnl
481  EGGEXEC=eggdrop  EGGEXEC=eggdrop
482  AC_EXEEXT  AC_EXEEXT
483  if test ! "x${EXEEXT}" = "x"  if test ! "${EXEEXT-x}" = "x"
484  then  then
485    EGGEXEC=eggdrop${EXEEXT}    EGGEXEC="eggdrop$EXEEXT"
486  fi  fi
487  AC_SUBST(EGGEXEC)dnl  AC_SUBST(EGGEXEC)dnl
488  ])dnl  ])dnl
# Line 501  dnl  EGG_TCL_ARG_WITH() Line 492  dnl  EGG_TCL_ARG_WITH()
492  dnl  dnl
493  AC_DEFUN(EGG_TCL_ARG_WITH, [dnl  AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
494  # oohh new configure --variables for those with multiple tcl libs  # oohh new configure --variables for those with multiple tcl libs
495  AC_ARG_WITH(tcllib, [  --with-tcllib=PATH      full path to tcl library], tcllibname=$withval)  AC_ARG_WITH(tcllib, [  --with-tcllib=PATH      full path to tcl library], tcllibname="$withval")
496  AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to tcl header], tclincname=$withval)  AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to tcl header], tclincname="$withval")
497    
498  WARN=0  WARN=0
499  # Make sure either both or neither $tcllibname and $tclincname are set  # Make sure either both or neither $tcllibname and $tclincname are set
500  if test ! "x${tcllibname}" = "x"  if test ! "${tcllibname-x}" = "x"
501  then  then
502    if test "x${tclincname}" = "x"    if test "${tclincname-x}" = "x"
503    then    then
504      WARN=1      WARN=1
505      tcllibname=""      tcllibname=""
# Line 516  then Line 507  then
507      TCLINC=""      TCLINC=""
508    fi    fi
509  else  else
510    if test ! "x${tclincname}" = "x"    if test ! "${tclincname-x}" = "x"
511    then    then
512      WARN=1      WARN=1
513      tclincname=""      tclincname=""
# Line 524  else Line 515  else
515      TCLINC=""      TCLINC=""
516    fi    fi
517  fi  fi
518  if test ${WARN} = 1  if test "$WARN" = 1
519  then  then
520    cat << 'EOF' >&2    cat << 'EOF' >&2
521  configure: warning:  configure: warning:
# Line 542  dnl Line 533  dnl
533  AC_DEFUN(EGG_TCL_ENV, [dnl  AC_DEFUN(EGG_TCL_ENV, [dnl
534  WARN=0  WARN=0
535  # Make sure either both or neither $TCLLIB and $TCLINC are set  # Make sure either both or neither $TCLLIB and $TCLINC are set
536  if test ! "x${TCLLIB}" = "x"  if test ! "${TCLLIB-x}" = "x"
537  then  then
538    if test "x${TCLINC}" = "x"    if test "${TCLINC-x}" = "x"
539    then    then
540      WARN=1      WARN=1
541      WVAR1=TCLLIB      WVAR1=TCLLIB
# Line 552  then Line 543  then
543      TCLLIB=""      TCLLIB=""
544    fi    fi
545  else  else
546    if test ! "x${TCLINC}" = "x"    if test ! "${TCLINC-x}" = "x"
547    then    then
548      WARN=1      WARN=1
549      WVAR1=TCLINC      WVAR1=TCLINC
# Line 560  else Line 551  else
551      TCLINC=""      TCLINC=""
552    fi    fi
553  fi  fi
554  if test ${WARN} = 1  if test "$WARN" = 1
555  then  then
556    cat << EOF >&2    cat << EOF >&2
557  configure: warning:  configure: warning:
558    
559    Environment variable ${WVAR1} was set, but I did not detect ${WVAR2}.    Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
560    Please set both TCLLIB and TCLINC correctly if you wish to use them.    Please set both TCLLIB and TCLINC correctly if you wish to use them.
561    configure will now attempt to autodetect both the Tcl library and header...    configure will now attempt to autodetect both the Tcl library and header...
562    
# Line 578  dnl  EGG_TCL_WITH_TCLLIB() Line 569  dnl  EGG_TCL_WITH_TCLLIB()
569  dnl  dnl
570  AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl  AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
571  # Look for Tcl library: if $tcllibname is set, check there first  # Look for Tcl library: if $tcllibname is set, check there first
572  if test ! "x${tcllibname}" = "x"  if test ! "${tcllibname-x}" = "x"
573  then  then
574    if test -f "$tcllibname" && test -r "$tcllibname"    if test -f "$tcllibname" && test -r "$tcllibname"
575    then    then
# Line 609  dnl  EGG_TCL_WITH_TCLINC() Line 600  dnl  EGG_TCL_WITH_TCLINC()
600  dnl  dnl
601  AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl  AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
602  # Look for Tcl header: if $tclincname is set, check there first  # Look for Tcl header: if $tclincname is set, check there first
603  if test ! "x${tclincname}" = "x"  if test ! "${tclincname-x}" = "x"
604  then  then
605    if test -f "$tclincname" && test -r "$tclincname"    if test -f "$tclincname" && test -r "$tclincname"
606    then    then
# Line 638  dnl  EGG_TCL_FIND_LIBRARY() Line 629  dnl  EGG_TCL_FIND_LIBRARY()
629  dnl  dnl
630  AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl  AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
631  # Look for Tcl library: if $TCLLIB is set, check there first  # Look for Tcl library: if $TCLLIB is set, check there first
632  if test "x${TCLLIBFN}" = "x"  if test "${TCLLIBFN-x}" = "x"
633  then  then
634    if test ! "x${TCLLIB}" = "x"    if test ! "${TCLLIB-x}" = "x"
635    then    then
636      if test -d "${TCLLIB}"      if test -d "$TCLLIB"
637      then      then
638        for tcllibfns in $tcllibnames        for tcllibfns in $tcllibnames
639        do        do
# Line 650  then Line 641  then
641          do          do
642            if test -r "$TCLLIB/lib$tcllibfns$tcllibext"            if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
643            then            then
644              TCLLIBFN=$tcllibfns$tcllibext              TCLLIBFN="$tcllibfns$tcllibext"
645              TCLLIBEXT=$tcllibext              TCLLIBEXT="$tcllibext"
646              TCLLIBFNS=$tcllibfns              TCLLIBFNS="$tcllibfns"
647              break 2              break 2
648            fi            fi
649          done          done
650        done        done
651      fi      fi
652      if test "x${TCLLIBFN}" = "x"      if test "${TCLLIBFN-x}" = "x"
653      then      then
654        cat << 'EOF' >&2        cat << 'EOF' >&2
655  configure: warning:  configure: warning:
# Line 682  dnl  EGG_TCL_FIND_HEADER() Line 673  dnl  EGG_TCL_FIND_HEADER()
673  dnl  dnl
674  AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl  AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
675  # Look for Tcl header: if $TCLINC is set, check there first  # Look for Tcl header: if $TCLINC is set, check there first
676  if test "x${TCLINCFN}" = "x"  if test "${TCLINCFN-x}" = "x"
677  then  then
678    if test ! "x${TCLINC}" = "x"    if test ! "${TCLINC-x}" = "x"
679    then    then
680      if test -d "${TCLINC}"      if test -d "$TCLINC"
681      then      then
682        for tclheaderfn in $tclheadernames        for tclheaderfn in $tclheadernames
683        do        do
684          if test -r "$TCLINC/$tclheaderfn"          if test -r "$TCLINC/$tclheaderfn"
685          then          then
686            TCLINCFN=$tclheaderfn            TCLINCFN="$tclheaderfn"
687            break            break
688          fi          fi
689        done        done
690      fi      fi
691      if test "x${TCLINCFN}" = "x"      if test "${TCLINCFN-x}" = "x"
692      then      then
693        cat << 'EOF' >&2        cat << 'EOF' >&2
694  configure: warning:  configure: warning:
# Line 723  AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl Line 714  AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
714  AC_MSG_CHECKING(for Tcl library)  AC_MSG_CHECKING(for Tcl library)
715    
716  # Attempt autodetect for $TCLLIBFN if it's not set  # Attempt autodetect for $TCLLIBFN if it's not set
717  if test ! "x${TCLLIBFN}" = "x"  if test ! "${TCLLIBFN-x}" = "x"
718  then  then
719    AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)    AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
720  else  else
# Line 736  else Line 727  else
727          if test -r "$tcllibpath/lib$tcllibfns$tcllibext"          if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
728          then          then
729            AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)            AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
730            TCLLIB=$tcllibpath            TCLLIB="$tcllibpath"
731            TCLLIBFN=$tcllibfns$tcllibext            TCLLIBFN="$tcllibfns$tcllibext"
732            TCLLIBEXT=$tcllibext            TCLLIBEXT="$tcllibext"
733            TCLLIBFNS=$tcllibfns            TCLLIBFNS="$tcllibfns"
734            break 3            break 3
735          fi          fi
736        done        done
# Line 748  else Line 739  else
739  fi  fi
740    
741  # Show if $TCLLIBFN wasn't found  # Show if $TCLLIBFN wasn't found
742  if test "x${TCLLIBFN}" = "x"  if test "${TCLLIBFN-x}" = "x"
743  then  then
744    AC_MSG_RESULT(not found)    AC_MSG_RESULT(not found)
745  fi  fi
# Line 763  AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl Line 754  AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
754  AC_MSG_CHECKING(for Tcl header)  AC_MSG_CHECKING(for Tcl header)
755    
756  # Attempt autodetect for $TCLINCFN if it's not set  # Attempt autodetect for $TCLINCFN if it's not set
757  if test ! "x${TCLINCFN}" = "x"  if test ! "${TCLINCFN-x}" = "x"
758  then  then
759    AC_MSG_RESULT(using $TCLINC/$TCLINCFN)    AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
760  else  else
# Line 774  else Line 765  else
765        if test -r "$tclheaderpath/$tclheaderfn"        if test -r "$tclheaderpath/$tclheaderfn"
766        then        then
767          AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)          AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
768          TCLINC=$tclheaderpath          TCLINC="$tclheaderpath"
769          TCLINCFN=$tclheaderfn          TCLINCFN="$tclheaderfn"
770          break 2          break 2
771        fi        fi
772      done      done
773    done    done
774    # FreeBSD hack ...    # FreeBSD hack ...
775    if test "x${TCLINCFN}" = "x"    if test "${TCLINCFN-x}" = "x"
776    then    then
777      for tcllibfns in $tcllibnames      for tcllibfns in $tcllibnames
778      do      do
# Line 792  else Line 783  else
783            if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"            if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
784            then            then
785              AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)              AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
786              TCLINC=$tclheaderpath/$tcllibfns              TCLINC="$tclheaderpath/$tcllibfns"
787              TCLINCFN=$tclheaderfn              TCLINCFN="$tclheaderfn"
788              break 3              break 3
789            fi            fi
790          done          done
# Line 803  else Line 794  else
794  fi  fi
795    
796  # Show if $TCLINCFN wasn't found  # Show if $TCLINCFN wasn't found
797  if test "x${TCLINCFN}" = "x"  if test "${TCLINCFN-x}" = "x"
798  then  then
799    AC_MSG_RESULT(not found)    AC_MSG_RESULT(not found)
800  fi  fi
# Line 831  dnl  checks as soon as egg_tcl_changed i Line 822  dnl  checks as soon as egg_tcl_changed i
822  AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl  AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
823    AC_MSG_CHECKING(whether the tcl system has changed)    AC_MSG_CHECKING(whether the tcl system has changed)
824    egg_tcl_changed=yes    egg_tcl_changed=yes
825    egg_tcl_id="${TCLLIB}:${TCLLIBFN}:${TCLINC}:${TCLINCFN}"    egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
826    if test "${egg_tcl_id}" != ":::"; then    if test ! "$egg_tcl_id" = ":::"
827      then
828      egg_tcl_cached=yes      egg_tcl_cached=yes
829      AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl      AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
830        egg_cv_var_tcl_id="$egg_tcl_id"        egg_cv_var_tcl_id="$egg_tcl_id"
831        egg_tcl_cached=no        egg_tcl_cached=no
832      ])      ])
833      if test "${egg_tcl_cached}" = "yes"; then      if test "$egg_tcl_cached" = "yes"
834        if test "x${egg_cv_var_tcl_id}" = "x${egg_tcl_id}"; then      then
835          if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
836          then
837          egg_tcl_changed=no          egg_tcl_changed=no
838        else        else
839          egg_cv_var_tcl_id="$egg_tcl_id"          egg_cv_var_tcl_id="$egg_tcl_id"
840        fi        fi
841      fi      fi
842    fi    fi
843    if test "$egg_tcl_changed" = "yes"; then    if test "$egg_tcl_changed" = "yes"
844      then
845      AC_MSG_RESULT(yes)      AC_MSG_RESULT(yes)
846    else    else
847      AC_MSG_RESULT(no)      AC_MSG_RESULT(no)
# Line 859  dnl Line 854  dnl
854  AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl  AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
855  # Both TCLLIBFN & TCLINCFN must be set, or we bail  # Both TCLLIBFN & TCLINCFN must be set, or we bail
856  TCL_FOUND=0  TCL_FOUND=0
857  if test "x${TCLLIBFN}" != "x" && test "x${TCLINCFN}" != "x"  if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
858  then  then
859    TCL_FOUND=1    TCL_FOUND=1
860    
861    # Check Tcl's version    # Check Tcl's version
862    if test "$egg_tcl_changed" = "yes"; then    if test "$egg_tcl_changed" = "yes"
863      then
864      EGG_CACHE_UNSET(egg_cv_var_tcl_version)      EGG_CACHE_UNSET(egg_cv_var_tcl_version)
865    fi    fi
866    AC_MSG_CHECKING(for Tcl version)    AC_MSG_CHECKING(for Tcl version)
867    AC_CACHE_VAL(egg_cv_var_tcl_version, [    AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
868      egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`      egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
869    ])    ])
870    
871    if test ! "x${egg_cv_var_tcl_version}" = "x"    if test ! "${egg_cv_var_tcl_version-x}" = "x"
872    then    then
873      AC_MSG_RESULT($egg_cv_var_tcl_version)      AC_MSG_RESULT($egg_cv_var_tcl_version)
874    else    else
# Line 881  then Line 877  then
877    fi    fi
878    
879    # Check Tcl's patch level (if avaliable)    # Check Tcl's patch level (if avaliable)
880    if test "$egg_tcl_changed" = "yes"; then    if test "$egg_tcl_changed" = "yes"
881      then
882      EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)      EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
883    fi    fi
884    AC_MSG_CHECKING(for Tcl patch level)    AC_MSG_CHECKING(for Tcl patch level)
885    AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [    AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
886      eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"      eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | head -1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
887    ])    ])
888    
889    if test ! "x${egg_cv_var_tcl_patch_level}" = "x"    if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
890    then    then
891      AC_MSG_RESULT($egg_cv_var_tcl_patch_level)      AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
892    else    else
# Line 899  then Line 896  then
896  fi  fi
897    
898  # Check if we found Tcl's version  # Check if we found Tcl's version
899  if test $TCL_FOUND = 0  if test "$TCL_FOUND" = 0
900  then  then
901    cat << 'EOF' >&2    cat << 'EOF' >&2
902  configure: error:  configure: error:
# Line 926  dnl Line 923  dnl
923  AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl  AC_DEFUN(EGG_TCL_CHECK_PRE70, [dnl
924  # Is this version of Tcl too old for us to use ?  # Is this version of Tcl too old for us to use ?
925  TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`  TCL_VER_PRE70=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 7) print "yes"; else print "no"}'`
926  if test "x$TCL_VER_PRE70" = "xyes"  if test "$TCL_VER_PRE70" = "yes"
927  then  then
928    cat << EOF >&2    cat << EOF >&2
929  configure: error:  configure: error:
# Line 947  dnl Line 944  dnl
944  AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl  AC_DEFUN(EGG_TCL_CHECK_PRE75, [dnl
945  # Are we using a pre 7.5 Tcl version ?  # Are we using a pre 7.5 Tcl version ?
946  TCL_VER_PRE75=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 5)) || (i[[1]] < 7)) print "yes"; else print "no"}'`  TCL_VER_PRE75=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 5)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
947  if test "x${TCL_VER_PRE75}" = "xyes"  if test "$TCL_VER_PRE75" = "yes"
948  then  then
949    AC_DEFINE(HAVE_PRE7_5_TCL)dnl    AC_DEFINE(HAVE_PRE7_5_TCL)dnl
950  fi  fi
# Line 957  fi Line 954  fi
954  dnl  EGG_TCL_TESTLIBS()  dnl  EGG_TCL_TESTLIBS()
955  dnl  dnl
956  AC_DEFUN(EGG_TCL_TESTLIBS, [dnl  AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
957  # Setup TCL_TESTLIBS for Tcl library tests  # Set variables for Tcl library tests
958  if test ! "x${TCLLIBEXT}" = "x.a"  TCL_TEST_LIB="$TCLLIBFNS"
959  then  TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB $LIBS"
960    TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"  
961  else  if test ! "${ac_cv_lib_pthread-x}" = "x"
   if test ! "x${tcllibname}" = "x"  
   then  
     TCL_TESTLIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB $LIBS"  
   else  
     TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB $LIBS"  
   fi  
 fi  
 if test "x${CYGWIN}" = "x"  
962  then  then
963    if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"; then    TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
     TCL_TESTLIBS="-lpthread $TCL_TESTLIBS"  
   else  
     if text "x${ac_cv_lib_pthreads_pthread_mutex_init}" = "xyes"; then  
       TCL_TESTLIBS="-lpthreads $TCL_TESTLIBS"  
     fi  
   fi  
964  fi  fi
965  ])dnl  ])dnl
966    
# Line 985  fi Line 968  fi
968  dnl  EGG_TCL_CHECK_FREE()  dnl  EGG_TCL_CHECK_FREE()
969  dnl  dnl
970  AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl  AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
971  # Check for Tcl_Free()  if test "$egg_tcl_changed" = "yes"
972  if test "$egg_tcl_changed" = "yes"; then  then
973    EGG_CACHE_UNSET(egg_cv_var_tcl_free)    EGG_CACHE_UNSET(egg_cv_var_tcl_free)
974  fi  fi
 AC_CACHE_CHECK(if Tcl library has Tcl_Free, [egg_cv_var_tcl_free], [  
   ac_save_LIBS="$LIBS"  
   LIBS="$TCL_TESTLIBS"  
   cat > conftest.$ac_ext << EOF  
 #include "confdefs.h"  
 char Tcl_Free();  
975    
976  int main() {  # Check for Tcl_Free()
977    Tcl_Free();  AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS)
   return 0;  
 }  
 EOF  
   if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}  
   then  
     rm -rf conftest*  
     egg_cv_var_tcl_free=yes  
   else  
     echo "configure: failed program was:" >&5  
     cat conftest.$ac_ext >&5  
     rm -rf conftest*  
     egg_cv_var_tcl_free=no  
   fi  
   rm -f conftest*  
   LIBS="$ac_save_LIBS"  
 ])  
978    
979  if test "x${egg_cv_var_tcl_free}" = "xyes"  if test "$egg_cv_var_tcl_free" = "yes"
980  then  then
981    AC_DEFINE(HAVE_TCL_FREE)dnl    AC_DEFINE(HAVE_TCL_FREE)dnl
982  fi  fi
# Line 1028  AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl Line 989  AC_DEFUN(EGG_TCL_ENABLE_THREADS, [dnl
989  AC_ARG_ENABLE(tcl-threads,  AC_ARG_ENABLE(tcl-threads,
990  [  --disable-tcl-threads   Disable threaded tcl support if detected. (Ignore this  [  --disable-tcl-threads   Disable threaded tcl support if detected. (Ignore this
991                            option unless you know what you are doing)],                            option unless you know what you are doing)],
992  enable_tcl_threads=$enableval,  enable_tcl_threads="$enableval",
993  enable_tcl_threads=yes)  enable_tcl_threads=yes)
994  ])dnl  ])dnl
995    
# Line 1036  enable_tcl_threads=yes) Line 997  enable_tcl_threads=yes)
997  dnl  EGG_TCL_CHECK_THREADS()  dnl  EGG_TCL_CHECK_THREADS()
998  dnl  dnl
999  AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl  AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
1000  # Check for TclpFinalizeThreadData()  if test "$egg_tcl_changed" = "yes"
1001  if test "$egg_tcl_changed" = "yes"; then  then
1002    EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)    EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
1003  fi  fi
 AC_CACHE_CHECK(if Tcl library is threaded, egg_cv_var_tcl_threaded, [  
   ac_save_LIBS="$LIBS"  
   LIBS="$TCL_TESTLIBS"  
   cat > conftest.$ac_ext << EOF  
 #include "confdefs.h"  
 char TclpFinalizeThreadData();  
1004    
1005  int main() {  # Check for TclpFinalizeThreadData()
1006    TclpFinalizeThreadData();  AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS)
   return 0;  
 }  
 EOF  
   if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}  
   then  
     rm -rf conftest*  
     egg_cv_var_tcl_threaded=yes  
   else  
     echo "configure: failed program was:" >&5  
     cat conftest.$ac_ext >&5  
     rm -rf conftest*  
     egg_cv_var_tcl_threaded=no  
   fi  
   rm -f conftest*  
   LIBS="$ac_save_LIBS"  
 ])  
1007    
1008  if test "x${egg_cv_var_tcl_threaded}" = "xyes"  if test "$egg_cv_var_tcl_threaded" = "yes"
1009  then  then
1010    if test "x$enable_tcl_threads" = "xno"    if test "$enable_tcl_threads" = "no"
1011    then    then
1012    
1013      cat << 'EOF' >&2      cat << 'EOF' >&2
# Line 1082  EOF Line 1021  EOF
1021      AC_DEFINE(HAVE_TCL_THREADS)dnl      AC_DEFINE(HAVE_TCL_THREADS)dnl
1022    fi    fi
1023    
1024    # Add -lpthread to $LIBS if we have it    # Add pthread library to $LIBS if we need it
1025    if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"; then    if test ! "${ac_cv_lib_pthread-x}" = "x"
1026      LIBS="-lpthread $LIBS"    then
1027    else      LIBS="$ac_cv_lib_pthread $LIBS"
     if text "x${ac_cv_lib_pthreads_pthread_mutex_init}" = "xyes"; then  
       TCL_TESTLIBS="-lpthreads $TCL_TESTLIBS"  
     fi    
1028    fi    fi
1029  fi  fi
1030  ])dnl  ])dnl
# Line 1097  fi Line 1033  fi
1033  dnl  EGG_TCL_LIB_REQS()  dnl  EGG_TCL_LIB_REQS()
1034  dnl  dnl
1035  AC_DEFUN(EGG_TCL_LIB_REQS, [dnl  AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
1036  if test ! "x${TCLLIBEXT}" = "x.a"  if test ! "$TCLLIBEXT" = ".a"
1037  then  then
1038    TCL_REQS="$TCLLIB/lib$TCLLIBFN"    TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1039    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
# Line 1119  EOF Line 1055  EOF
1055    
1056    # Are we using a pre 7.4 Tcl version ?    # Are we using a pre 7.4 Tcl version ?
1057    TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`    TCL_VER_PRE74=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (((i[[1]] == 7) && (i[[2]] < 4)) || (i[[1]] < 7)) print "yes"; else print "no"}'`
1058    if test "x${TCL_VER_PRE74}" = "xno"    if test "$TCL_VER_PRE74" = "no"
1059    then    then
1060    
1061      # Was the --with-tcllib option given ?      # Was the --with-tcllib option given ?
1062      if test ! "x${tcllibname}" = "x"      if test ! "${tcllibname-x}" = "x"
1063      then      then
1064        TCL_REQS="$TCLLIB/lib$TCLLIBFN"        TCL_REQS="$TCLLIB/lib$TCLLIBFN"
1065        TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"        TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
# Line 1151  AC_SUBST(TCL_LIBS)dnl Line 1087  AC_SUBST(TCL_LIBS)dnl
1087  dnl  EGG_FUNC_DLOPEN()  dnl  EGG_FUNC_DLOPEN()
1088  dnl  dnl
1089  AC_DEFUN(EGG_FUNC_DLOPEN, [dnl  AC_DEFUN(EGG_FUNC_DLOPEN, [dnl
1090  if test $NEED_DL = 1 && test "x${ac_cv_func_dlopen}" = "xno"  if test "$NEED_DL" = 1 && test "$ac_cv_func_dlopen" = "no"
1091  then  then
1092    if test "$LINUX" = "yes"    if test "$LINUX" = "yes"
1093    then    then
# Line 1202  fi Line 1138  fi
1138  dnl  EGG_SUBST_EGGVERSION()  dnl  EGG_SUBST_EGGVERSION()
1139  dnl  dnl
1140  AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl  AC_DEFUN(EGG_SUBST_EGGVERSION, [dnl
1141  EGGVERSION=`grep 'char.egg_version' ${srcdir}/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`  EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", [$]4); print [$]4}'`
1142  egg_version_num=`echo ${EGGVERSION} | $AWK 'BEGIN { FS = "."; } { printf("%d%02d%02d", [$]1, [$]2, [$]3); }'`  egg_version_num=`echo $EGGVERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
1143  AC_SUBST(EGGVERSION)dnl  AC_SUBST(EGGVERSION)dnl
1144  AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl  AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_version_num)dnl
1145  ])dnl  ])dnl
# Line 1212  AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_ver Line 1148  AC_DEFINE_UNQUOTED(EGG_VERSION, $egg_ver
1148  dnl  EGG_SUBST_DEST()  dnl  EGG_SUBST_DEST()
1149  dnl  dnl
1150  AC_DEFUN(EGG_SUBST_DEST, [dnl  AC_DEFUN(EGG_SUBST_DEST, [dnl
1151  if test "x$DEST" = "x"  if test "${DEST-x}" = "x"
1152  then  then
1153    DEST=\${prefix}    DEST=\${prefix}
1154  fi  fi
# Line 1228  dnl  path "calculation", we need to keep Line 1164  dnl  path "calculation", we need to keep
1164  dnl  (which don't need a "../" pre-pended).  dnl  (which don't need a "../" pre-pended).
1165  AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl  AC_DEFUN(EGG_SUBST_MOD_UPDIR, [dnl
1166  case "$srcdir" in  case "$srcdir" in
1167    [[\\/]]* | ?:[[\\/]]* ) MOD_UPDIR="" ;;    [[\\/]]* | ?:[[\\/]]*)
1168    * )                     MOD_UPDIR="../" ;;      MOD_UPDIR=""
1169      ;;
1170      *)
1171        MOD_UPDIR="../"
1172      ;;
1173  esac  esac
1174  AC_SUBST(MOD_UPDIR)dnl  AC_SUBST(MOD_UPDIR)dnl
1175  ])dnl  ])dnl
# Line 1243  dnl  recompiles. Line 1183  dnl  recompiles.
1183  dnl  dnl
1184  define(EGG_REPLACE_IF_CHANGED, [dnl  define(EGG_REPLACE_IF_CHANGED, [dnl
1185    AC_OUTPUT_COMMANDS([    AC_OUTPUT_COMMANDS([
1186  egg_replace_file=$1  egg_replace_file="$1"
1187  echo "creating $1"  echo "creating $1"
1188  $2  $2
1189  if test -f ${egg_replace_file} && cmp -s conftest.out ${egg_replace_file}  if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file
1190  then  then
1191    echo "$1 is unchanged"    echo "$1 is unchanged"
1192  else  else
1193    mv conftest.out ${egg_replace_file}    mv conftest.out $egg_replace_file
1194  fi  fi
1195  rm -f conftest.out], [$3])dnl  rm -f conftest.out], [$3])dnl
1196  ])dnl  ])dnl
# Line 1263  AC_DEFUN(EGG_TCL_LUSH, [dnl Line 1203  AC_DEFUN(EGG_TCL_LUSH, [dnl
1203  cat > conftest.out <<EGGEOF  cat > conftest.out <<EGGEOF
1204  /* Ignore me but do not erase me.  I am a kludge. */  /* Ignore me but do not erase me.  I am a kludge. */
1205    
1206  #include "${egg_tclinc}/${egg_tclincfn}"  #include "$egg_tclinc/$egg_tclincfn"
1207  EGGEOF], [egg_tclinc=${TCLINC}; egg_tclincfn=${TCLINCFN}])dnl  EGGEOF], [
1208        egg_tclinc="$TCLINC"
1209        egg_tclincfn="$TCLINCFN"])dnl
1210  ])dnl  ])dnl
1211    
1212    
# Line 1272  dnl  EGG_CATCH_MAKEFILE_REBUILD() Line 1214  dnl  EGG_CATCH_MAKEFILE_REBUILD()
1214  dnl  dnl
1215  AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl  AC_DEFUN(EGG_CATCH_MAKEFILE_REBUILD, [dnl
1216    AC_OUTPUT_COMMANDS([    AC_OUTPUT_COMMANDS([
1217  if test -f .modules; then  if test -f .modules
1218    ${ac_given_srcdir}/misc/modconfig --top_srcdir=${ac_given_srcdir} Makefile  then
1219      $ac_given_srcdir/misc/modconfig --top_srcdir="$ac_given_srcdir" Makefile
1220  fi])  fi])
1221  ])dnl  ])dnl
1222    
1223    
1224  dnl  EGG_SAVE_PARAMETERS()  dnl  EGG_SAVE_PARAMETERS()
1225  dnl  dnl
1226  AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl  AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23