193c741999-05-31Henrik Grubbström (Grubba) AC_REVISION("$Id: configure.in,v 1.298 1999/05/30 22:09:41 grubba Exp $")
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_INIT(interpret.c)
af56471996-12-03Fredrik Hübinette (Hubbe) AC_CONFIG_HEADER(machine.h)
51bd9e1996-10-09Fredrik Hübinette (Hubbe) 
ea24061997-04-01Henrik Grubbström (Grubba) # We want an absolute path to the source-dir. case "$srcdir" in /*) ;; *) oldsrcdir="$srcdir" srcdir="`cd \"$srcdir\";pwd`" AC_MSG_WARN([ Converted $oldsrcdir to $srcdir, If this does not work, please use an absolute path to the configure script. ]) ;; esac
48ae531996-10-09Fredrik Hübinette (Hubbe) if test "x${CFLAGS-}" = x ; then
51bd9e1996-10-09Fredrik Hübinette (Hubbe)  cflags_is_set=no
48ae531996-10-09Fredrik Hübinette (Hubbe) else cflags_is_set=yes
51bd9e1996-10-09Fredrik Hübinette (Hubbe) fi
c67b691996-11-16Fredrik Hübinette (Hubbe) if test "x${CPPFLAGS-}" = x ; then cppflags_is_set=no else cppflags_is_set=yes fi if test "x${LDFLAGS-}" = x ; then ldflags_is_set=no else ldflags_is_set=yes fi
7b39411997-02-06Fredrik Hübinette (Hubbe) for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then AC_MSG_WARN([You are using a site file to initialize configure, please note that this can lead to problems if anything in $ac_site_file is not correct. If Pike does not compile, or does not run, please try this to compile Pike again: rm ./config.cache ; CONFIG_SITE=x ./configure ; make]) fi done
8334e31999-01-29Fredrik Hübinette (Hubbe) if test ! -z "$pike_cv_prog_CC_save" -a ! -z "$CC" -a "$CC" != "$pike_cv_prog_CC_save"
7b39411997-02-06Fredrik Hübinette (Hubbe) then
5625661997-04-15Fredrik Hübinette (Hubbe)  AC_MSG_WARN([CC is different than last time Pike was compiled, It is probably best to delete ./config.cache before proceeding])
7b39411997-02-06Fredrik Hübinette (Hubbe) fi
8334e31999-01-29Fredrik Hübinette (Hubbe) pike_cv_prog_CC_save="$CC"
7b39411997-02-06Fredrik Hübinette (Hubbe) 
d1e3fe1999-03-06Henrik Grubbström (Grubba) # MY_AC_PROG_CC # The above has problems if the smartlink binary is removed. /grubba AC_PROG_CC
8cf37d1997-01-27Per Hedbor AC_ISC_POSIX
6900981999-05-07Fredrik Hübinette (Hubbe) ############################################################################# AC_CHECK_HEADERS(fnord/fnord/fnord.h)
54be211999-05-12Henrik Grubbström (Grubba) AC_MSG_CHECKING([if CHECK_HEADERS works])
6900981999-05-07Fredrik Hübinette (Hubbe) if test "x$ac_cv_header_fnord_fnord_fnord_h" = xyes ; then
54be211999-05-12Henrik Grubbström (Grubba)  AC_MSG_RESULT(no)
6900981999-05-07Fredrik Hübinette (Hubbe)  exit 1 fi
54be211999-05-12Henrik Grubbström (Grubba) AC_MSG_RESULT(yes)
6900981999-05-07Fredrik Hübinette (Hubbe)  #############################################################################
8cf37d1997-01-27Per Hedbor AC_MINIX
e48c381998-07-29Marcus Comstedt if test $ac_cv_prog_gcc = yes; then AC_MSG_CHECKING(for libgcc file name) AC_CACHE_VAL(pike_cv_libgcc_filename, [ pike_cv_libgcc_filename="`${CC-cc} -print-libgcc-file-name`" if test -z "$pike_cv_libgcc_filename"; then pike_cv_libgcc_filename=no else if test -f "$pike_cv_libgcc_filename"; then : else pike_cv_libgcc_filename=no fi fi ]) AC_MSG_RESULT($pike_cv_libgcc_filename) if test x"$pike_cv_libgcc_filename" = xno; then LIBGCC="" else LIBGCC="$pike_cv_libgcc_filename" fi else LIBGCC="" fi AC_SUBST(LIBGCC)
2565f41997-02-26Fredrik Hübinette (Hubbe) ############################################################################# LIBDIR=`(cd $srcdir/../lib ; pwd)` BINDIR=`(cd $srcdir/../bin ; pwd)` BUILDDIR=`pwd` AC_SUBST(LIBDIR) AC_SUBST(BINDIR) AC_SUBST(BUILDDIR)
d1e3fe1999-03-06Henrik Grubbström (Grubba) ############################################################################# ## Build smartlink
af5ef81999-05-28Henrik Grubbström (Grubba) AC_CHECK_HEADERS(stdlib.h string.h unistd.h sys/stat.h sys/types.h sys/errno.h)
d1e3fe1999-03-06Henrik Grubbström (Grubba)  if test -x /usr/bin/uname 2>/dev/null; then UNAME=`/usr/bin/uname -sr` elif test -x /bin/uname 2>/dev/null; then UNAME=`/bin/uname -sr` else UNAME=unknown fi
9041271999-03-06Henrik Grubbström (Grubba) # FIXME: Add proper tests
d1e3fe1999-03-06Henrik Grubbström (Grubba) case "$UNAME" in OSF1\ V4.*) AC_DEFINE(USE_RPATH) ;; IRIX\ 6.*) AC_DEFINE(USE_RPATH) ;; IRIX\ 5.*) AC_DEFINE(USE_RPATH) ;; SunOS\ 5.*)
f2e4c51999-05-12Henrik Grubbström (Grubba)  if test "$TCC" = "yes"; then # tcc doesn't know about -R AC_DEFINE(USE_Wl_R) else AC_DEFINE(USE_R) fi
d1e3fe1999-03-06Henrik Grubbström (Grubba)  ;; Linux\ 2.*) AC_DEFINE(USE_Wl) ;; *) AC_DEFINE(USE_LD_LIBRARY_PATH) ;;
2565f41997-02-26Fredrik Hübinette (Hubbe) esac
d1e3fe1999-03-06Henrik Grubbström (Grubba) # Strip smartlink from $CC REALCC="`echo $CC|sed -e 's/.*smartlink //'`" # Fix a smartlink SMARTLINK="$BUILDDIR/smartlink"
9041271999-03-06Henrik Grubbström (Grubba) AC_MSG_CHECKING(if $SMARTLINK exists is up to date and works)
ba012d1999-04-25Henrik Grubbström (Grubba) if ls -1tr "$SMARTLINK${ac_exeext}" "$srcdir/smartlink.$ac_ext" 2>/dev/null | head -1 | grep "smartlink.$ac_ext" >/dev/null 2>&5 && "$SMARTLINK" -v >/dev/null 2>&5; then
d1e3fe1999-03-06Henrik Grubbström (Grubba)  AC_MSG_RESULT(yes) else AC_MSG_RESULT(no)
53486d1999-03-06Henrik Grubbström (Grubba)  if echo foo "$CC" | grep rntcc >/dev/null; then
02d7881999-03-06Henrik Grubbström (Grubba)  echo Warning: rntcc detected. Using the smartlink /bin/sh script.
53486d1999-03-06Henrik Grubbström (Grubba)  SMARTLINK="$BINDIR/smartlink" else rm -f "$SMARTLINK"
d1e3fe1999-03-06Henrik Grubbström (Grubba) 
53486d1999-03-06Henrik Grubbström (Grubba)  AC_MSG_CHECKING(whether smartlink compiles)
d1e3fe1999-03-06Henrik Grubbström (Grubba) 
53486d1999-03-06Henrik Grubbström (Grubba)  link_cmd='${REALCC-cc} -o smartlink${ac_exeext} $CFLAGS -I. $CPPFLAGS $LDFLAGS $srcdir/smartlink.$ac_ext $LIBS 2>&5' if { (eval echo Compiling smartlink: \"$link_cmd\") 1>&5; (eval $link_cmd) 2>&5; } && "$BUILDDIR/smartlink" -v >/dev/null 2>&5; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no - use the sh script)
d1e3fe1999-03-06Henrik Grubbström (Grubba) 
53486d1999-03-06Henrik Grubbström (Grubba)  SMARTLINK="$BINDIR/smartlink" fi
d1e3fe1999-03-06Henrik Grubbström (Grubba)  fi fi CC="$SMARTLINK $REALCC" pike_cv_prog_CC="$CC"
d5efba1998-01-23Henrik Grubbström (Grubba) 
424d9c1999-05-02Fredrik Hübinette (Hubbe) AC_SUBST(SMARTLINK) AC_SUBST(REALCC)
d5efba1998-01-23Henrik Grubbström (Grubba) export REALCC SMARTLINK
2565f41997-02-26Fredrik Hübinette (Hubbe) #############################################################################
565c361997-01-27Fredrik Hübinette (Hubbe) AC_AIX AC_MINIX
5267b71995-08-09Fredrik Hübinette (Hubbe) 
de575a1999-05-29Henrik Grubbström (Grubba) #############################################################################
5c8e891995-10-29Fredrik Hübinette (Hubbe) # We need some special hacks when running slowaris AC_PATH_PROG(uname_prog,uname,no) AC_MSG_CHECKING(operating system)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_sys_os,
5c8e891995-10-29Fredrik Hübinette (Hubbe) [ if test "$uname_prog" != "no"; then
06983f1996-09-22Fredrik Hübinette (Hubbe)  pike_cv_sys_os="`uname`"
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
334e3d1997-04-16Fredrik Hübinette (Hubbe)  case "$pike_cv_sys_os" in SunOS) case "`uname -r`" in
d561d61999-03-07Fredrik Hübinette (Hubbe)  5.*) pike_cv_sys_os="Solaris" ;;
334e3d1997-04-16Fredrik Hübinette (Hubbe)  esac ;; esac
5c8e891995-10-29Fredrik Hübinette (Hubbe) else
06983f1996-09-22Fredrik Hübinette (Hubbe)  pike_cv_sys_os="Not Solaris"
5c8e891995-10-29Fredrik Hübinette (Hubbe) fi ])
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_sys_os)
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
2901d31998-08-05Fredrik Hübinette (Hubbe) LD='$(CC) $(CFLAGS)'
0809711998-02-27Marcus Comstedt 
de16081997-06-03Fredrik Hübinette (Hubbe) case "$pike_cv_sys_os" in SCO*)
77b2821997-10-04Henrik Grubbström (Grubba)  case "$CFLAGS" in
de16081997-06-03Fredrik Hübinette (Hubbe)  *-belf*) ;; *)
77b2821997-10-04Henrik Grubbström (Grubba)  echo "Adding -belf option." CFLAGS="$CFLAGS -belf" ;; esac case "$LDFLAGS" in *-belf*) ;; *) echo "Adding -belf option." LDFLAGS="$LDFLAGS -belf"
de16081997-06-03Fredrik Hübinette (Hubbe)  ;; esac ;;
2b49031998-03-05Henrik Grubbström (Grubba)  SunOS*) # gcc on SunOS 4 forgets to define this: echo "SunOS. Adding -D__USE_FIXED_PROTOTYPES__" CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" ;;
0809711998-02-27Marcus Comstedt  BSD/OS*) LD="$BINDIR/smartlink shlicc" ;;
9ab4461998-11-06Honza Petrous  UnixWare*) if test "$GCC" != "yes"; then # We are using built-in inline function CFLAGS="$CFLAGS -Kalloca" fi ;;
de16081997-06-03Fredrik Hübinette (Hubbe) esac
dcad551996-08-03Fredrik Hübinette (Hubbe) 
0809711998-02-27Marcus Comstedt AC_SUBST(LD)
de16081997-06-03Fredrik Hübinette (Hubbe) #############################################################################
f6c3371998-09-29Henrik Grubbström (Grubba) 
348fca1999-05-29Henrik Grubbström (Grubba) # Some sanity checks. if test "$GCC" = "yes" -a "$pike_cv_sys_os" = "Solaris" -a "`uname -p`" = "sparc"; then # Solaris/sparc: # Check that gnu ld isn't used. # It's usually hidden in $prefix/sparc-sun-solaris2.?/bin/. # NOTE: M4 uses [] as quotes. gcc_ld_path="`$CC -v 2>&1 | sed -e '1,1s/[[^\/]]*\(\/.*\/\)[[^\/]]*$/\1/p;d' | sed -e '/lib\/gcc-lib\//s/lib\/gcc-lib\///;s/\/[[0-9]]*\.[[0-9]]*\.[[0-9]]*\/$/\/bin/'`" if test "x$gcc_ld_path" = "x"; then :; else if "$gcc_ld_path/ld" -v 2>&1 | grep -i GNU >/dev/null; then AC_MSG_WARN([GNU ld found on Solaris sparc system ($gcc_ld_path/ld).]) AC_MSG_WARN([This may cause the dynamic module support to fail.]) else :; fi fi unset gcc_ld_path
9998151999-05-30Henrik Grubbström (Grubba)  # Watch out for gcc-2.8.1 on Solaris 7 sparc machines. It generates # assembler code which contains .uaword directives, which in turn # generates code with R_SPARC_UA32 relocations, which /usr/bin/ld.so # has buggy support for (it doesn't relocate the MSB). # Check that gcc doesn't generate uaword opcodes AC_MSG_CHECKING(if your gcc generates uaword opcodes) AC_CACHE_VAL(pike_cv_gcc_uaword, [ cat > conftest.c <<EOF char *foo[[]] = { "bar" }; EOF pike_compile='${CC-cc} -S $CFLAGS $CPPFLAGS conftest.c 1>&5' pike_cv_gcc_uaword=no if { (eval echo configure: \"$pike_compile\") >&5; (eval $pike_compile) 2>&5; }; then if grep ".uaword" conftest.s 2>&5 >/dev/null; then echo "configure: result contains .uaword:" >&5 cat conftest.s >&5 pike_cv_gcc_uaword=yes else :; fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest.* ])
cfd7c91999-05-30Henrik Grubbström (Grubba)  AC_MSG_RESULT($pike_cv_gcc_uaword)
9998151999-05-30Henrik Grubbström (Grubba)  # Check if as generates R_SPARC_UA32 relocations from .uaword. if test "$pike_cv_gcc_uaword" = "yes"; then AC_MSG_CHECKING([if your as generates R_SPARC_UA32 relocations]) AC_CACHE_VAL(pike_cv_as_r_sparc_ua32, [ AC_TRY_ASSEMBLE([ .section ".rodata" .align 8 .STRING: .asciz "String" .section ".data" .align 4 .type string,#object .size string,4 string: .uaword .STRING ],[ if /usr/ccs/bin/elfdump -r conftest.o | grep -i R_SPARC_UA32 >/dev/null 2>&AC_FD_CC; then pike_cv_ac_r_sparc_ua32=yes else pike_cv_ac_r_sparc_ua32=no fi ],[ pike_cv_ac_r_sparc_ua32=no ]) ]) AC_MSG_RESULT($pike_cv_ac_r_sparc_ua32) if test "$pike_cv_ac_r_sparc_ua32" = "yes"; then
f594b71999-05-30Henrik Grubbström (Grubba)  AC_MSG_WARN([Your gcc/as combo may generate R_SPARC_UA32 relocations.]) AC_MSG_WARN([R_SPARC_UA32 relocations are unsupported in Solaris >= 2.3,]) AC_MSG_WARN([and have broken support in Solaris 7.])
193c741999-05-31Henrik Grubbström (Grubba)  if test -d "/var/sadm/patch/107058-01/."; then AC_MSG_WARN([Back out patch 107058-01, or]) AC_MSG_WARN([recompile gcc with a modified config/sparc/sol2.h.]) else AC_MSG_WARN([Recompile gcc with a modified config/sparc/sol2.h.]) fi
9998151999-05-30Henrik Grubbström (Grubba)  exit 1 else :; fi else :; fi
348fca1999-05-29Henrik Grubbström (Grubba) else :; fi #############################################################################
f6c3371998-09-29Henrik Grubbström (Grubba)  AC_ARG_WITH(dynamic_modules, [ --without-dynamic-modules link modules statically],[],[with_dynamic_modules=yes])
8334e31999-01-29Fredrik Hübinette (Hubbe) AC_ARG_WITH(static_linking, [ --with-static-linking link statically, if possible],[with_static_linking=yes],[])
f6c3371998-09-29Henrik Grubbström (Grubba) AC_ARG_WITH(include-path,[ --with-include-path A list of paths to search for include files.]) AC_ARG_WITH(lib-path, [ --with-lib-path A list of paths to search for libraries.]) AC_ARG_WITH(gdbm, [ --without-gdbm no GNU database manager support ]) AC_ARG_WITH(gmp, [ --without-gmp no Support bignums]) AC_ARG_WITH(debug, [ --without-debug disable run debugging],[],[with_debug=]) AC_ARG_WITH(rtldebug, [ --without-rtldebug disable run time self tests],[],[with_rtldebug=]) AC_ARG_WITH(cdebug, [ --without-cdebug disable -g],[],[with_cdebug=]) AC_ARG_WITH(threads, [ --without-threads no threads support],[],[with_threads=yes]) AC_ARG_WITH(zlib, [ --without-zlib no gz compression support],[],[with_zlib=yes]) AC_ARG_WITH(ssleay, [ --without-ssleay no support for the secure socket protocol],[],[with_ssleay=yes]) AC_ARG_WITH(mysql, [ --without-mysql no support for the Mysql database],[],[with_mysql=yes])
a630be1999-05-30Mirar (Pontus Hagland) AC_ARG_WITH(gif-rle, [ --with-gif-rle use kind-of-rle packing instead of lzw],[],[])
f6c3371998-09-29Henrik Grubbström (Grubba) AC_ARG_WITH(dmalloc, [ --with-dmalloc enable memory-leak tests],[AC_DEFINE(DEBUG_MALLOC,10)],[])
bf61b91999-02-06Henrik Grubbström (Grubba) AC_ARG_WITH(checker, [ --with-checker add extra memory checking overhead (Purify)])
f6c3371998-09-29Henrik Grubbström (Grubba) AC_ARG_WITH(profiling, [ --with-profiling add code used to profile pike code ],[AC_DEFINE(PROFILING)],[]) AC_ARG_WITH(poll, [ --with-poll use poll instead of select],[],[
78a69c1998-09-29Henrik Grubbström (Grubba)  # Neither --with-poll nor --without-poll was specified case "$pike_cv_sys_os" in
d0be141999-05-27Fredrik Hübinette (Hubbe)  Solaris|HP-UX|OSF1|IRIX)
d7bcfd1998-09-29Henrik Grubbström (Grubba)  AC_MSG_WARN([Defaulting to --with-poll since the OS is $pike_cv_sys_os.]) with_poll=yes
f6c3371998-09-29Henrik Grubbström (Grubba)  ;;
d0be141999-05-27Fredrik Hübinette (Hubbe)  AIX)
085ac61999-05-27Henrik Grubbström (Grubba)  # poll(2) is broken on AIX 4.1 and earlier.
d0be141999-05-27Fredrik Hübinette (Hubbe)  if test "`uname -r`" -ge 2 -a "`uname -v`" -ge 4 ; then with_poll=yes
085ac61999-05-27Henrik Grubbström (Grubba)  else if test "`uname -v`" -gt 4 ; then
d5614e1999-05-27Henrik Grubbström (Grubba)  with_poll=yes else :; fi fi
085ac61999-05-27Henrik Grubbström (Grubba)  if test "$with_poll" = "yes" ; then AC_MSG_WARN([Defaulting to --with-poll since the OS AIX 4.2 or later.]) else :; fi
d0be141999-05-27Fredrik Hübinette (Hubbe)  ;;
f6c3371998-09-29Henrik Grubbström (Grubba)  esac ]) AC_ARG_WITH(max-fd, [ --with-max-fd=X set how many filedescriptors can be used at once],[pike_cv_max_open_fd=$withval],[]) AC_ARG_WITH(oob, [ --with-oob enable out-of-band data handling],[AC_DEFINE(WITH_OOB)],[]) AC_ARG_WITH(thread-trace,[ --with-trace-threads enable individual tracing of threads],[AC_DEFINE(TRACE_THREADS)],[]) AC_ARG_WITH(compiler-trace,[ --with-compiler-trace enable tracing of the compiler],[AC_DEFINE(YYDEBUG)],[])
b7bc5c1999-01-21Henrik Grubbström (Grubba) AC_ARG_WITH(security, [ --with-security enable internal pike security system],[AC_DEFINE(PIKE_SECURITY)],[])
f6c3371998-09-29Henrik Grubbström (Grubba)  if test "x$with_poll" = "xyes"; then AC_DEFINE(HAVE_AND_USE_POLL) else :; fi
bf61b91999-02-06Henrik Grubbström (Grubba) if test "x$with_checker" = "xyes"; then AC_DEFINE(__CHECKER__) else :; fi
f6c3371998-09-29Henrik Grubbström (Grubba) # # Allow --with(out)-debug to toggle both cdebug and rtldebug, but # let --with(out)-{c,rtl}debug take precedence. # if test "x$with_cdebug" = x ; then with_cdebug="$with_debug" fi if test "x$with_rtldebug" = x ; then with_rtldebug="$with_debug" fi # # Defaults for cdebug and rtldebug here: # if test "x$with_cdebug" = x ; then with_cdebug=yes fi if test "x$with_rtldebug" = x ; then with_rtldebug=yes fi if test "x$with_rtldebug" = xyes ; then
71f3a21998-11-22Fredrik Hübinette (Hubbe)  AC_DEFINE(PIKE_DEBUG)
f6c3371998-09-29Henrik Grubbström (Grubba) fi #############################################################################
48ae531996-10-09Fredrik Hübinette (Hubbe) 
8cf37d1997-01-27Per Hedbor 
e8ab9c1997-11-03Henrik Grubbström (Grubba) # option, cache_name, variable
8cf37d1997-01-27Per Hedbor AC_DEFUN(AC_SYS_COMPILER_FLAG, [ AC_MSG_CHECKING($1)
565c361997-01-27Fredrik Hübinette (Hubbe)  OLD_CFLAGS="[$]CFLAGS"
8cf37d1997-01-27Per Hedbor  AC_CACHE_VAL(pike_cv_option_$2,
06983f1996-09-22Fredrik Hübinette (Hubbe)  [
8cf37d1997-01-27Per Hedbor  CFLAGS="[$]OLD_CFLAGS $1"
75920f1997-12-28Fredrik Hübinette (Hubbe)  AC_TRY_RUN([int main(){exit(0);}],pike_cv_option_$2=yes,pike_cv_option_$2=no,pike_cv_option_$2=no)
06983f1996-09-22Fredrik Hübinette (Hubbe)  ])
51bd9e1996-10-09Fredrik Hübinette (Hubbe) 
8cf37d1997-01-27Per Hedbor  CFLAGS="[$]OLD_CFLAGS"
51bd9e1996-10-09Fredrik Hübinette (Hubbe) 
8cf37d1997-01-27Per Hedbor  if test x"[$]pike_cv_option_$2" = "xyes" ; then
e8ab9c1997-11-03Henrik Grubbström (Grubba)  $3="[$]$3 $1"
8cf37d1997-01-27Per Hedbor  AC_MSG_RESULT(yes)
71b44e1998-06-05Fredrik Hübinette (Hubbe)  $5
06983f1996-09-22Fredrik Hübinette (Hubbe)  else
8cf37d1997-01-27Per Hedbor  AC_MSG_RESULT(no)
50adc31998-04-17Fredrik Hübinette (Hubbe)  $4
06983f1996-09-22Fredrik Hübinette (Hubbe)  fi
8cf37d1997-01-27Per Hedbor ])
e8ab9c1997-11-03Henrik Grubbström (Grubba) # arch, option, cache_name, variable
8cf37d1997-01-27Per Hedbor AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG, [ if test "`uname -m 2>/dev/null`" = "$1" ; then
8334e31999-01-29Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG($2,$3,$4,$5,$6) $7
8cf37d1997-01-27Per Hedbor  fi ])
e8ab9c1997-11-03Henrik Grubbström (Grubba) # os, option, cache_name, variable
d9b39e1997-08-27Fredrik Hübinette (Hubbe) AC_DEFUN(AC_SYS_OS_COMPILER_FLAG, [ if test "x$pike_cv_sys_os" = "x$1" ; then
8334e31999-01-29Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG($2,$3,$4,$5,$6) $7
d9b39e1997-08-27Fredrik Hübinette (Hubbe)  fi ])
8334e31999-01-29Fredrik Hübinette (Hubbe) define([DO_IF_OS], [ if test "x$pike_cv_sys_os" = "x$1" ; then $2 fi ]) define([DO_IF_CPU], [ if test "`uname -m 2>/dev/null`" = "$1" ; then $2 fi ])
8cf37d1997-01-27Per Hedbor WARN="" OPTIMIZE="" if test $cflags_is_set = no; then
2901d31998-08-05Fredrik Hübinette (Hubbe)  if test "x$with_cdebug" = "xno" ; then CFLAGS=`echo " $CFLAGS " | sed -e 's@ -g @ @g'` else : fi
8cf37d1997-01-27Per Hedbor  if test "x${GCC-}" = xyes ; then
9c6f7d1997-04-15Fredrik Hübinette (Hubbe)  WARN="-W -Wall -Wpointer-arith -Wno-unused"
9c5a5e1997-12-20Henrik Grubbström (Grubba) 
34251a1999-02-05Martin Stjernholm  if test "x${with_static_linking-}" = "xyes" ; then
8334e31999-01-29Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG(-static,link_static,CFLAGS) else : fi
989adb1998-12-20Fredrik Hübinette (Hubbe)  ## ## -fomit-frame-pointer does not work with egcs 1.1.1 ## /Hubbe 1998-12-20 ## #if test "x$with_cdebug" = "xno" ; then # AC_SYS_COMPILER_FLAG(-fomit-frame-pointer,fomit_frame_pointer,OPTIMIZE) #else # : #fi
9c5a5e1997-12-20Henrik Grubbström (Grubba) 
8cf37d1997-01-27Per Hedbor ### Optimize for different SUN machines. If there is no working 'uname' ### no extra optimization will be done, but nothing should break either.
50adc31998-04-17Fredrik Hübinette (Hubbe)  case "`uname -m 2>/dev/null`" in sun4c)
e65d8d1998-07-17Henrik Grubbström (Grubba)  # The -sparclite option seems to generate assembler that /bin/as doesn't # understand. /grubba 1998-07-17 # AC_SYS_COMPILER_FLAG(-msparclite,sparclite,OPTIMIZE)
50adc31998-04-17Fredrik Hübinette (Hubbe)  ;; sun4m) AC_SYS_COMPILER_FLAG(-mv8,microsparc,OPTIMIZE) ;; sun4d) AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,OPTIMIZE) ;; sun4u)
e65d8d1998-07-17Henrik Grubbström (Grubba)  # FIXME: Optimize for V9
50adc31998-04-17Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG(-msupersparc,ultrasparc,OPTIMIZE) ;; i586) AC_SYS_COMPILER_FLAG(-mpentium,pentium,OPTIMIZE) ;; i686) AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,OPTIMIZE,[ AC_SYS_COMPILER_FLAG(-mpentium,pentium,OPTIMIZE) ]) ;; esac
5866e01999-04-25Henrik Grubbström (Grubba)  else if test "x${TCC-}" = xyes ; then # Yikes! We're using the TenDRA compiler! # Make sure we can use the system headerfiles... AC_SYS_COMPILER_FLAG(-Ysystem, ysystem, CFLAGS) # Use lenient ANSI compliance... AC_SYS_COMPILER_FLAG(-Xa, xa, CFLAGS)
6077101999-05-15Henrik Grubbström (Grubba)  # Find out where libtdf.a is hidden. AC_MSG_CHECKING(for machine dependant library directory) AC_CACHE_VAL(pike_cv_tcc_lib_path, [
4d5d021999-05-15Henrik Grubbström (Grubba)  pike_cv_tcc_lib_path="`${CC-cc} -dry conftest.c -i 2>&1 | sed -e '/tdfc/s/bin\/tdfc.*/lib\/sys/p' -ed| head -1`"
6077101999-05-15Henrik Grubbström (Grubba)  if test -d "$pike_cv_tcc_lib_path/." ; then :; else # Failed. pike_cv_tcc_lib_path="no" fi ]) AC_MSG_RESULT($pike_cv_tcc_lib_path) if test "$pike_cv_tcc_lib_path" = "no" ; then :; else LDFLAGS="$LDFLAGS -L$pike_cv_tcc_lib_path" # This library is needed for 64bit support on 32bit machines/OS's. AC_CHECK_LIB(tdf, __TDFUnot) fi
8cf37d1997-01-27Per Hedbor  else
5866e01999-04-25Henrik Grubbström (Grubba)  # Assume system compiler "cc".
8334e31999-01-29Fredrik Hübinette (Hubbe) 
34251a1999-02-05Martin Stjernholm  if test "x${with_static_linking-}" = "xyes" ; then
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(AIX, [
5866e01999-04-25Henrik Grubbström (Grubba)  AC_SYS_COMPILER_FLAG([-Wl,-bstatic],wl_link_static,CFLAGS)
8334e31999-01-29Fredrik Hübinette (Hubbe)  LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -bstatic" ]) DO_IF_OS(OSF1, [ AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -non_shared" ]) DO_IF_OS(IRIX, [ AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -B static" ]) # how do you link statically on HP-UX ? else : fi
8cf37d1997-01-27Per Hedbor ### Non-gcc thingies. This should probably be enhanced...
fde5a61997-09-05Henrik Grubbström (Grubba) 
d93ff51997-11-02Henrik Grubbström (Grubba)  # Solaris
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(Solaris, [ AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE) AC_SYS_COMPILER_FLAG(-xdepend,xdepend,OPTIMIZE) AC_SYS_COMPILER_FLAG(-xs,xs,CFLAGS) # Causes __STDC__ to be 1 which causes several headerfiles to behave # differently. # AC_SYS_OS_COMPILER_FLAG(-Xc,Xc,WARN) ])
d93ff51997-11-02Henrik Grubbström (Grubba) 
de386f1998-08-06Henrik Grubbström (Grubba)  # AIX
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(AIX, [ # This one is needed to get the compiler to fail on errors, # which is needed for several configure-scripts. AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS) AC_SYS_COMPILER_FLAG(-qro,qro,OPTIMIZE) ])
de386f1998-08-06Henrik Grubbström (Grubba) 
fde5a61997-09-05Henrik Grubbström (Grubba)  # HP-UX
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(HP-UX, [ AC_SYS_COMPILER_FLAG(-D__STDC_EXT__,stdc_ext,CFLAGS) AC_SYS_COMPILER_FLAG(+ESlit,plus_ESlit,OPTIMIZE) AC_SYS_COMPILER_FLAG(+Odataprefetch,plus_Odataprefetch,OPTIMIZE) AC_SYS_COMPILER_FLAG(+Ofailsafe,plus_Ofailsafe,OPTIMIZE) AC_SYS_COMPILER_FLAG(+O3,plus_O3,OPTIMIZE) # Ignore the following warnings if you enable +w1 # 414 Optimization reduced to +O2 for compatibility with Debug. # 530 Casting from loose to strict alignment # 558 Empty declaration. # AC_SYS_COMPILER_FLAG(+w1,plus_w1,WARN) ])
fde5a61997-09-05Henrik Grubbström (Grubba)  # OSF/1
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(OSF1, [ AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE) # The need for -ieee is not detected properly by the FPE tests below. # AC_SYS_COMPILER_FLAG(-ieee,ieee,CFLAGS) AC_SYS_COMPILER_FLAG(-readonly_strings,readonly_strings,OPTIMIZE) AC_SYS_COMPILER_FLAG(-assume trusted_short_alignment, assume_trusted_short_alignment,OPTIMIZE) AC_SYS_COMPILER_FLAG(-assume aligned_objects, assume_aligned_objects,OPTIMIZE) AC_SYS_COMPILER_FLAG(-no_misalign,no_misalign,OPTIMIZE) if test "x$with_cdebug" = "xyes" ; then # FIXME: # Maybe should remove the -g flag if this succeeds. AC_SYS_COMPILER_FLAG(-g3,g3,OPTIMIZE) AC_SYS_COMPILER_FLAG(-trapuv,trapuv,WARN) fi AC_SYS_COMPILER_FLAG(-host,host,OPTIMIZE)
633b031998-07-16Fredrik Hübinette (Hubbe) 
8334e31999-01-29Fredrik Hübinette (Hubbe)  # Flags that cause errors or change compiler behaviour # must go in CFLAGS, they can not go in WARN # /Hubbe AC_SYS_COMPILER_FLAG(-std1,std1,CFLAGS) AC_SYS_COMPILER_FLAG(-warnprotos,warnprotos,WARN) ])
a897001997-04-10Fredrik Hübinette (Hubbe) 
fde5a61997-09-05Henrik Grubbström (Grubba)  # IRIX
8334e31999-01-29Fredrik Hübinette (Hubbe)  DO_IF_OS(IRIX, [ # sopt disabled since it takes too long time on interpret.c (>45min on an O²) # AC_SYS_COMPILER_FLAG(-sopt,sopt,OPTIMIZE) # -n32 moved to smartlink so it will affekt cc as well as linker # this way the user can override it by setting LDFLAGS and/or CFLAGS # AC_SYS_COMPILER_FLAG(-n32,n32,CFLAGS) AC_SYS_COMPILER_FLAG(-fullwarn,fullwarn,WARN) if test x$with_cdebug = xyes ; then AC_SYS_COMPILER_FLAG(-g3,g3,OPTIMIZE) fi if test x$with_rtldebug = xyes ; then AC_SYS_COMPILER_FLAG(-trapuw,trapuw,WARN) fi ])
fde5a61997-09-05Henrik Grubbström (Grubba) 
a897001997-04-10Fredrik Hübinette (Hubbe) dnl
a9d05c1997-04-10Fredrik Hübinette (Hubbe) dnl This does not work with Digital UNIX cc/ld (cc thinks it is ok, ld does not)
a897001997-04-10Fredrik Hübinette (Hubbe) dnl
e8ab9c1997-11-03Henrik Grubbström (Grubba) dnl AC_SYS_COMPILER_FLAG(-native,native,OPTIMIZE)
a9d05c1997-04-10Fredrik Hübinette (Hubbe) dnl
300af11997-04-15Fredrik Hübinette (Hubbe) 
a9d05c1997-04-10Fredrik Hübinette (Hubbe) dnl ### Ok. This is for apcc...
300af11997-04-15Fredrik Hübinette (Hubbe) case "$CC" in *apcc)
e8ab9c1997-11-03Henrik Grubbström (Grubba)  AC_SYS_COMPILER_FLAG(-XO=5,apcc_opt,OPTIMIZE) AC_SYS_COMPILER_FLAG(-Xcallmod=2,apcc_opt_2,OPTIMIZE)
300af11997-04-15Fredrik Hübinette (Hubbe)  ;; esac
8cf37d1997-01-27Per Hedbor 
b582fe1997-11-23Per Hedbor # Old cc for solaris. # AC_SYS_CPU_COMPILER_FLAG(sun4m,-Xpipe=micro,microsparc,OPTIMIZE) # AC_SYS_CPU_COMPILER_FLAG(sun4d,-Xpipe=super,supersparc,OPTIMIZE) # AC_SYS_CPU_COMPILER_FLAG(sun4u,-Xpipe=super,ultrasparc,OPTIMIZE)
8cf37d1997-01-27Per Hedbor 
fde5a61997-09-05Henrik Grubbström (Grubba)  case "${CFLAGS-} $OPTIMIZE" in
8cf37d1997-01-27Per Hedbor  *-O*) ;;
fde5a61997-09-05Henrik Grubbström (Grubba)  *+O*) ;;
437a661997-08-27Fredrik Hübinette (Hubbe)  *-fast*) ;;
8cf37d1997-01-27Per Hedbor  *)
e8ab9c1997-11-03Henrik Grubbström (Grubba)  AC_SYS_COMPILER_FLAG(-O2,O2,OPTIMIZE)
c8099b1997-09-06Henrik Grubbström (Grubba)  if test "x$pike_cv_option_O2" != "xyes"; then
e8ab9c1997-11-03Henrik Grubbström (Grubba)  AC_SYS_COMPILER_FLAG(-O,O,OPTIMIZE)
c8099b1997-09-06Henrik Grubbström (Grubba)  fi
8cf37d1997-01-27Per Hedbor  ;; esac
9925681996-10-11Fredrik Hübinette (Hubbe)  fi
7e663c1999-04-25Henrik Grubbström (Grubba)  fi
5267b71995-08-09Fredrik Hübinette (Hubbe) fi
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
51bd9e1996-10-09Fredrik Hübinette (Hubbe) 
5c8e891995-10-29Fredrik Hübinette (Hubbe) if test "$GCC" = "yes"; then
48ae531996-10-09Fredrik Hübinette (Hubbe)  if test $cflags_is_set = no; then
e8ab9c1997-11-03Henrik Grubbström (Grubba)  AC_SYS_COMPILER_FLAG(-pipe, pipe, CFLAGS)
d10ed51995-11-15Fredrik Hübinette (Hubbe)  fi
5c8e891995-10-29Fredrik Hübinette (Hubbe) else # # Special hack for HP-UX stupid cc #
06983f1996-09-22Fredrik Hübinette (Hubbe)  if test "$pike_cv_sys_os" = "HP-UX"; then
658f1a1997-01-26Fredrik Hübinette (Hubbe)  AC_TRY_COMPILE([int foo(int bar);],[],[],
2f6cc61996-12-05Fredrik Hübinette (Hubbe)  [ OLD_CC="${CC-cc}"
f2328f1997-09-17Henrik Grubbström (Grubba)  OLD_CFLAGS="$CFLAGS"
5625661997-04-15Fredrik Hübinette (Hubbe)  if test "$CC" = "$BINDIR/smartlink cc" -a -x /usr/bin/cc ; then
8334e31999-01-29Fredrik Hübinette (Hubbe)  CC="$SMARTLINK /usr/bin/cc"
2f6cc61996-12-05Fredrik Hübinette (Hubbe)  fi
fec6251998-03-25Fredrik Hübinette (Hubbe)  CFLAGS="-Ae +Olibcalls $CFLAGS"
f2328f1997-09-17Henrik Grubbström (Grubba)  AC_TRY_COMPILE([int foo(int bar);],[],[],[ CC="$OLD_CC" CFLAGS="$OLD_CFLAGS" ])
8334e31999-01-29Fredrik Hübinette (Hubbe)  pike_cv_prog_CC="${CC}"
2f6cc61996-12-05Fredrik Hübinette (Hubbe)  ])
5c8e891995-10-29Fredrik Hübinette (Hubbe)  fi fi
092a0e1997-03-05Henrik Grubbström (Grubba) if test "$pike_cv_sys_os" = "Solaris" ; then
2565f41997-02-26Fredrik Hübinette (Hubbe)  AC_DEFINE(SOLARIS)
d561d61999-03-07Fredrik Hübinette (Hubbe) else
1192761999-05-26Fredrik Hübinette (Hubbe)  :
565c361997-01-27Fredrik Hübinette (Hubbe) fi
57535e1997-01-11Henrik Grubbström (Grubba) 
2565f41997-02-26Fredrik Hübinette (Hubbe) if test ! -d modules/. ; then
cb728c1997-01-12Henrik Grubbström (Grubba)  mkdir modules fi
c0911b1997-10-03Henrik Grubbström (Grubba)  ############################################################################# ## Search for some popular places where libraries may be hidden. #############################################################################
a12f271998-01-10Fredrik Hübinette (Hubbe) if test x$pike_cv_sys_os != xWindows_NT ; then
d93ff51997-11-02Henrik Grubbström (Grubba) echo Searching for include-file directories...
8a947f1998-09-01Fredrik Hübinette (Hubbe) 
c0911b1997-10-03Henrik Grubbström (Grubba) if test $cppflags_is_set = no -a x${C_INCLUDE_PATH-} = x ; then
8a947f1998-09-01Fredrik Hübinette (Hubbe)  real_include_dirs=''
c96ea21998-04-04Henrik Grubbström (Grubba)  for d in `echo ${with_include_path} | sed 's/:/ /g'` \ `echo $prefix | sed "s@^NONE@$ac_default_prefix@g"`/include \ /usr/local/include /sw/local/include /usr/gnu/include /opt/gnu/include \ /sw/gnu/include /sw/include /usr/freeware/include \
8a947f1998-09-01Fredrik Hübinette (Hubbe)  `echo /usr/X11*/include | sort -r` $srcdir `pwd`
900def1997-01-12Henrik Grubbström (Grubba)  do
04a9251998-03-21Fredrik Hübinette (Hubbe)  AC_MSG_CHECKING($d)
d3e25e1998-07-15Fredrik Hübinette (Hubbe)  case x$d in x/usr/include | x/usr//include) ;; *) if test -d "$d/." ; then
8a947f1998-09-01Fredrik Hübinette (Hubbe)  REALDIR="`cd $d/. ; /bin/pwd`" if test "x$REALDIR" = x ; then REALDIR=UNKNOWN else : fi case " $CPPFLAGS $real_include_dirs " in *\ -I$d\ * | *\ -I$REALDIR\ *) AC_MSG_RESULT(already added) ;; *) AC_MSG_RESULT(added) CPPFLAGS="${CPPFLAGS} -I$d" if test "x$REALDIR" != xUNKNOWN; then real_include_dirs="${real_include_dirs} -I$REALDIR" else : fi ;; esac
d3e25e1998-07-15Fredrik Hübinette (Hubbe)  else AC_MSG_RESULT(no) fi ;; esac
900def1997-01-12Henrik Grubbström (Grubba)  done
cb728c1997-01-12Henrik Grubbström (Grubba) else :
900def1997-01-12Henrik Grubbström (Grubba) fi
d93ff51997-11-02Henrik Grubbström (Grubba) 
8a947f1998-09-01Fredrik Hübinette (Hubbe) #CPPFLAGS="${CPPFLAGS} -I$srcdir -I`pwd`"
0c73e91998-05-22Henrik Grubbström (Grubba) 
d93ff51997-11-02Henrik Grubbström (Grubba) echo Searching for library directories...
c0911b1997-10-03Henrik Grubbström (Grubba) if test $ldflags_is_set = no ; then
22f9511998-04-04Henrik Grubbström (Grubba)  for d in `echo ${with_lib_path} | sed 's/:/ /g'` \
943f851998-04-13Henrik Grubbström (Grubba)  `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
22f9511998-04-04Henrik Grubbström (Grubba)  /usr/local/lib /sw/local/lib /sw/lib \ /usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib \ `echo /usr/X11*/lib | sort -r`
c0911b1997-10-03Henrik Grubbström (Grubba)  do
04a9251998-03-21Fredrik Hübinette (Hubbe)  AC_MSG_CHECKING($d) if test -d "$d/." ; then
8a947f1998-09-01Fredrik Hübinette (Hubbe)  case " $LDFLAGS " in *\ -L$d\ -R$d\ * | *\ -R$d\ -L$d\ *) AC_MSG_RESULT(already added) ;; *) AC_MSG_RESULT(added) LDFLAGS="${LDFLAGS} -R$d -L$d" ;; esac
c0911b1997-10-03Henrik Grubbström (Grubba)  else
6fa2281997-11-04Henrik Grubbström (Grubba)  AC_MSG_RESULT(no)
c0911b1997-10-03Henrik Grubbström (Grubba)  fi done else : fi
c67b691996-11-16Fredrik Hübinette (Hubbe) 
6fa2281997-11-04Henrik Grubbström (Grubba) echo Searching for binary directories...
c96ea21998-04-04Henrik Grubbström (Grubba) for d in `echo $exec_prefix | sed "s@^NONE@$prefix@g" | sed "s@^NONE@$ac_default_prefix@g"` \ "" /usr /usr/ccs /usr/local /sw/local /usr/gnu /opt/gnu /sw/gnu \ /sw /usr/freeware
6fa2281997-11-04Henrik Grubbström (Grubba) do AC_MSG_CHECKING($d/bin) if test -d "$d/bin/." ; then AC_MSG_RESULT(added) EXTRA_PATH="${EXTRA_PATH}:$d/bin" else AC_MSG_RESULT(no) fi done export EXTRA_PATH
a12f271998-01-10Fredrik Hübinette (Hubbe) else : # We are running NT fi
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
bf622c1997-09-19Henrik Grubbström (Grubba) ## At this point we have at last initialized the compiler! #############################################################################
c411dc1997-04-21Fredrik Hübinette (Hubbe) if test ! -f confdefs.h ; then AC_MSG_WARN([Warning, lost confdefs.h, testing will be flawed!! You might need to use bash instead of /bin/sh to get correct results. To do this, please type the following at an sh prompt: \$ rm ./config.cache \$ CONFIG_SHELL=/path/to/bash \$ export CONFIG_SHELL \$ $CONFIG_SHELL ./configure ]) fi #############################################################################
99ed771997-06-03Fredrik Hübinette (Hubbe) AC_DEFINE(POSIX_SOURCE)
5c8e891995-10-29Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(ansi prototype capability)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_sys_ansi_prototypes,
5267b71995-08-09Fredrik Hübinette (Hubbe) [
658f1a1997-01-26Fredrik Hübinette (Hubbe)  AC_TRY_COMPILE([int foo(int bar);],[],
06983f1996-09-22Fredrik Hübinette (Hubbe)  [pike_cv_sys_ansi_prototypes=yes], [pike_cv_sys_ansi_prototypes=no])
5267b71995-08-09Fredrik Hübinette (Hubbe) ])
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_sys_ansi_prototypes" = "yes"; then
5c8e891995-10-29Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(yes) else AC_MSG_RESULT(no, giving up...) exit 1 fi
5267b71995-08-09Fredrik Hübinette (Hubbe) 
9925681996-10-11Fredrik Hübinette (Hubbe) 
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
7ac9c11998-12-03Henrik Grubbström (Grubba) # The AC_PROG_INSTALL test is broken if $INSTALL is specified by hand. # The FreeBSD ports system does this... # Workaround: if test "x$INSTALL" = "x"; then :; else # $INSTALL overrides ac_cv_path_install anyway... ac_cv_path_install="$INSTALL" fi
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_PROG_INSTALL AC_PROG_CPP AC_PROG_RANLIB AC_SET_MAKE
6fa2281997-11-04Henrik Grubbström (Grubba) AC_PATH_PROG(AR, ar, ar, $PATH:$EXTRA_PATH) export AR AC_SUBST(AR)
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
9fe0a01997-08-16Henrik Grubbström (Grubba) # installbsd seems to be broken on some versions of AIX # # /grubba 1997-08-16 case "$ac_cv_path_install" in *installbsd*) AC_MSG_CHECKING(if $ac_cv_path_install works) AC_CACHE_VAL(pike_cv_install_works, [ if $ac_cv_path_install "$srcdir/configure.in" ./conftest >/dev/null 2>&1 then if cmp "$srcdir/configure.in" ./conftest >/dev/null 2>&1; then pike_cv_install_works=yes; else pike_cv_install_works=no; fi else pike_cv_install_works=no; fi if test -f ./conftest; then rm -f ./conftest fi ]) AC_MSG_RESULT($pike_cv_install_works) if test "$pike_cv_install_works" = "no"; then echo "Warning: Falling back to $ac_install_sh" INSTALL="$ac_install_sh" fi ;; esac #############################################################################
26e7e71996-04-23Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(for yacc clone that handles %pure_parser)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_prog_working_yacc,
26e7e71996-04-23Fredrik Hübinette (Hubbe) [
4e2e071998-11-16Fredrik Hübinette (Hubbe) for YACC in pyacc byacc "bison -y" yacc "None"; do
26e7e71996-04-23Fredrik Hübinette (Hubbe)  set dummy $YACC; ac_word=$2 has_it=no IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then has_it="yes" break
8f42881996-03-01Fredrik Hübinette (Hubbe)  fi
26e7e71996-04-23Fredrik Hübinette (Hubbe)  done IFS="$ac_save_ifs" if test "$has_it" = "yes"; then cat >conftest.y<<\EOF %pure_parser %{ void parse(); void yyerror(char *); %} %% all: foo bar foo: 'f' 'o' 'o' { parse(); } ; bar: 'b' 'a' 'r' ; %% int context;
8f42881996-03-01Fredrik Hübinette (Hubbe) 
26e7e71996-04-23Fredrik Hübinette (Hubbe) int yylex(YYSTYPE *yylval) { switch(context++) { case 0: return 'f'; case 1: return 'o'; case 2: return 'o'; case 3: return 'b'; case 4: return 'a'; case 5: return 'r'; default: return 0; } } int depth=0; void parse() { int tmp; if(depth++>5) return; tmp=context; context=0; yyparse(); context=tmp; } int errors=0; void yyerror(char *fel) { errors++; } int main() { parse(); exit(errors); } EOF if $YACC -d conftest.y 1>&5 2>&5; then AC_TRY_RUN([ #include "y.tab.c"
75920f1997-12-28Fredrik Hübinette (Hubbe) ],pure_parser_works=yes,pure_parser_works=no,pure_parser_works=no)
26e7e71996-04-23Fredrik Hübinette (Hubbe)  if test "$pure_parser_works" = "yes"; then break fi fi
8f42881996-03-01Fredrik Hübinette (Hubbe)  fi
26e7e71996-04-23Fredrik Hübinette (Hubbe) done
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_prog_working_yacc="$YACC"
26e7e71996-04-23Fredrik Hübinette (Hubbe) ])
06983f1996-09-22Fredrik Hübinette (Hubbe) YACC="$pike_cv_prog_working_yacc"
4943ca1997-04-21Fredrik Hübinette (Hubbe)  if test "x$YACC" = "xNone" ; then AC_MSG_RESULT('Get bison if you want to do "make export"') YACC="bison -y" else AC_MSG_RESULT($YACC) fi
5267b71995-08-09Fredrik Hübinette (Hubbe) 
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
bf622c1997-09-19Henrik Grubbström (Grubba) ## At this point we have found all binaries we are going to use. ############################################################################# AC_C_CONST
3bb83a1997-09-22Henrik Grubbström (Grubba) # The above doesn't find IBM C's buggy const. if test "$ac_cv_c_const" = "yes"; then AC_MSG_CHECKING(if const really does work)
8976531997-12-22Fredrik Hübinette (Hubbe)  AC_CACHE_VAL(pike_cv_c_really_const,[ AC_TRY_COMPILE([
3bb83a1997-09-22Henrik Grubbström (Grubba) const int foo(int bar) { return bar; }
8976531997-12-22Fredrik Hübinette (Hubbe)  ], [ return bar(0); ], [ pike_cv_c_really_const=yes ], [ pike_cv_c_really_const=no ])
3bb83a1997-09-22Henrik Grubbström (Grubba)  ])
8976531997-12-22Fredrik Hübinette (Hubbe)  AC_MSG_RESULT($pike_cv_c_really_const) if test "x$pike_cv_c_really_const" = xno ; then AC_DEFINE(const, []) else : fi
3bb83a1997-09-22Henrik Grubbström (Grubba) fi
82c04f1999-04-25Henrik Grubbström (Grubba) AC_MSG_CHECKING(if we can cast void * to a function pointer) AC_CACHE_VAL(pike_cv_function_cast, [ AC_TRY_COMPILE([ void *foo = 0; ],[ void (*bar)(void) = (void (*)(void)) foo; ],[ pike_cv_function_cast="yes" ], [ pike_cv_function_cast="no" ]) ]) if test "$pike_cv_function_cast" = "yes"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_DEFINE(NO_CAST_TO_FUN) fi
bf622c1997-09-19Henrik Grubbström (Grubba) #############################################################################
6930181996-02-25Fredrik Hübinette (Hubbe) AC_HEADER_TIME AC_HEADER_STDC
5ebdb51996-09-22Fredrik Hübinette (Hubbe) AC_CHECK_HEADERS(sys/rusage.h time.h sys/time.h sys/types.h unistd.h stdlib.h \
d4debf1997-05-19Henrik Grubbström (Grubba) memory.h values.h string.h strings.h fcntl.h sys/filio.h sys/sockio.h crypt.h \ locale.h sys/resource.h sys/select.h sys/mman.h setjmp.h limits.h pthread.h \
4238391998-07-09Francesco Chemolli thread.h dlfcn.h dld.h dl.h sys/times.h sched.h sys/procfs.h sys/param.h \ winsock.h sys/ioct.h sys/socket.h malloc.h netinet/in.h sys/wait.h winbase.h \ grp.h pwd.h passwd.h group.h winsock2.h signal.h sys/file.h poll.h sys/poll.h \
ea959d1999-02-01Per Hedbor socket.h ieeefp.h fp_class.h floatingpoint.h sys/priocntl.h sched.h )
5267b71995-08-09Fredrik Hübinette (Hubbe) 
75920f1997-12-28Fredrik Hübinette (Hubbe) AC_CHECK_SIZEOF(char *,4) AC_CHECK_SIZEOF(long,4) AC_CHECK_SIZEOF(int,4) AC_CHECK_SIZEOF(short,2) AC_CHECK_SIZEOF(float,4) AC_CHECK_SIZEOF(double,8)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
6930181996-02-25Fredrik Hübinette (Hubbe) AC_TYPE_SIZE_T AC_TYPE_PID_T AC_TYPE_UID_T AC_TYPE_SIGNAL
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_CHECK_TYPE(time_t,INT32)
dcad551996-08-03Fredrik Hübinette (Hubbe) dnl AC_CHECK_LIB(PW, alloca)
b04d5f1996-07-08Fredrik Hübinette (Hubbe) 
5c8e891995-10-29Fredrik Hübinette (Hubbe) AC_CHECK_LIB(m, floor)
dc5da71997-11-03Henrik Grubbström (Grubba)  AC_CHECK_LIB(socket, socket)
a12f271998-01-10Fredrik Hübinette (Hubbe)  if test x$pike_cv_sys_os = xWindows_NT ; then
7734c61998-02-19Fredrik Hübinette (Hubbe)  LIBS="-lkernel32 $LIBS"
a12f271998-01-10Fredrik Hübinette (Hubbe) fi
dc5da71997-11-03Henrik Grubbström (Grubba) AC_CHECK_LIB(nsl, gethostbyname)
ca74dd1996-10-08Fredrik Hübinette (Hubbe) AC_CHECK_LIB(dl, dlopen)
4238391998-07-09Francesco Chemolli AC_CHECK_LIB(dld, shl_load)
59bc1b1997-01-22Bernhard Fastenrath AC_CHECK_LIB(dld, dld_link)
07513e1996-10-04Fredrik Hübinette (Hubbe) 
d98e0d1997-01-15Fredrik Hübinette (Hubbe)  if test "${pike_cv_sys_os}" = "Linux"; then
7b39411997-02-06Fredrik Hübinette (Hubbe)  if test "${ac_cv_lib_m_floor}" = "no"; then
d98e0d1997-01-15Fredrik Hübinette (Hubbe)  AC_MSG_WARN(I will compensate for this by adding -lc -lm) LIBS="${LIBS} -lc -lm" fi
f8663d1997-09-16Henrik Grubbström (Grubba)  if test "$ac_cv_header_sched_h" = "yes"; then AC_MSG_CHECKING(if sched.h has a typo) AC_CACHE_VAL(pike_cv_broken_sched_h, [ AC_TRY_COMPILE([ #include <sched.h> ],[ ],[ pike_cv_broken_shed_h=no ], [ OLDCPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_P=__P" AC_TRY_COMPILE([ #include <sched.h> ],[ ],[ pike_cv_broken_sched_h=yes ],[ pike_cv_broken_sched_h="very broken" ]) CPPFLAGS="$OLDCPPFLAGS" ]) ]) AC_MSG_RESULT($pike_cv_broken_sched_h) if test "$pike_cv_broken_sched_h" = "yes"; then AC_MSG_WARN(Applying workaround) CPPFLAGS="$CPPFLAGS -D_P=__P" fi fi
d10ed51995-11-15Fredrik Hübinette (Hubbe) fi
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
eec1371996-11-02Fredrik Hübinette (Hubbe) if test x$with_threads = xyes ; then
50b0391997-01-27Henrik Grubbström (Grubba)  OLDLIBS="$LIBS"
284e061998-11-09Fredrik Hübinette (Hubbe)  OLDCFLAGS="$CFLAGS"
07513e1996-10-04Fredrik Hübinette (Hubbe) 
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) if test "x$pike_cv_sys_os" = "xWindows_NT" ; then # NT has threads... AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) AC_DEFINE(_UNIX_THREADS) AC_DEFINE(NT_THREADS) else
9ab4461998-11-06Honza Petrous  # Test for POSIX threads
50b0391997-01-27Henrik Grubbström (Grubba)  case "x$pike_cv_sys_os" in
9ab4461998-11-06Honza Petrous  xOSF1) LIBS="${OLDLIBS} -lpthread -lmach -lexc -lc" ;; xBSD/OS*) LIBS="${OLDLIBS}" ;;
9022241998-08-27Honza Petrous  xUnixWare) if test "$GCC" = yes ; then LIBS="${LIBS} -lthread" else
9ab4461998-11-06Honza Petrous  CFLAGS="${CFLAGS} -Kthread"
9022241998-08-27Honza Petrous  fi
50b0391997-01-27Henrik Grubbström (Grubba)  ;;
0809711998-02-27Marcus Comstedt 
9ab4461998-11-06Honza Petrous  xFreeBSD*) # Threads on FreeBSD earlier than 1998-06-07 are broken. LIBS="${OLDLIBS}" AC_MSG_CHECKING(if this version of FreeBSD may have working threads) AC_CACHE_VAL(pike_cv_freebsd_threads, [ AC_TRY_RUN([
54905d1998-06-16Henrik Grubbström (Grubba) #include <osreldate.h> int main(int argc, char **argv) {
fc84cc1998-12-03Henrik Grubbström (Grubba)  /* FreeBSD before 228000 and 300000 - 300005 have broken threads.
8e48421998-06-17Henrik Grubbström (Grubba)  */
fc84cc1998-12-03Henrik Grubbström (Grubba)  if (__FreeBSD_version < 228000)
54905d1998-06-16Henrik Grubbström (Grubba)  return(1); if (__FreeBSD_version < 300000) return(0);
fc84cc1998-12-03Henrik Grubbström (Grubba)  if (__FreeBSD_version < 300006)
54905d1998-06-16Henrik Grubbström (Grubba)  return(1); return(0); }
9ab4461998-11-06Honza Petrous  ], pike_cv_freebsd_threads=yes, pike_cv_freebsd_threads=no, pike_cv_freebsd_threads=yes) ]) if test "x$pike_cv_freebsd_threads" = "xno"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes)
284e061998-11-09Fredrik Hübinette (Hubbe)  CFLAGS="${CFLAGS} -pthread" LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS-} -lc_r"
9ab4461998-11-06Honza Petrous  fi ;;
c371d41998-06-07Simon Coggins 
9ab4461998-11-06Honza Petrous  xAIX*) LIBS="${OLDLIBS} -lpthreads -lc_r" ;;
b1335c1998-07-03Francesco Chemolli 
9ab4461998-11-06Honza Petrous  *) LIBS="${OLDLIBS} -lpthread" ;; esac
50b0391997-01-27Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  AC_CHECK_FUNCS(pthread_init) AC_CHECK_FUNCS(pthread_mutexattr_init)
8b14071997-10-03Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  AC_MSG_CHECKING(posix threads)
b27ea31997-10-25Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  AC_CACHE_VAL(pike_cv_posix_threads, [ AC_TRY_RUN([
aeafe11997-01-26Per Hedbor #define _REENTRANT #define _THREAD_SAFE
f147421997-03-12Fredrik Hübinette (Hubbe) #define _MIT_POSIX_THREADS 1
aeafe11997-01-26Per Hedbor 
07513e1996-10-04Fredrik Hübinette (Hubbe) #include <pthread.h>
eea7c21997-09-11Henrik Grubbström (Grubba) void *foo(void *bar) { pthread_exit(0); return 0; }
158e9f1997-03-10Henrik Grubbström (Grubba) pthread_mutexattr_t attr;
07513e1996-10-04Fredrik Hübinette (Hubbe) pthread_mutex_t tmp; pthread_t gazonk; int main() { void *sune;
8b14071997-10-03Henrik Grubbström (Grubba) #ifdef HAVE_PTHREAD_INIT pthread_init(); #endif /* HAVE_PTHREAD_INIT */
0809711998-02-27Marcus Comstedt #ifdef HAVE_PTHREAD_MUTEXATTR_INIT
158e9f1997-03-10Henrik Grubbström (Grubba)  pthread_mutexattr_init(&attr);
0809711998-02-27Marcus Comstedt #else memset(&attr, 0, sizeof(attr));
f601ac1998-03-06Francesco Chemolli #endif /* HAVE_PTHREAD_MUTEXATTR_INIT */
158e9f1997-03-10Henrik Grubbström (Grubba)  pthread_mutex_init(&tmp, &attr); pthread_mutex_lock(&tmp);
07513e1996-10-04Fredrik Hübinette (Hubbe)  pthread_create(&gazonk,0,foo,0); pthread_join(gazonk,&sune); exit(0); }
9ab4461998-11-06Honza Petrous  ],pike_cv_posix_threads=yes,pike_cv_posix_threads=no,pike_cv_posix_threads=no) ])
07513e1996-10-04Fredrik Hübinette (Hubbe) 
9ab4461998-11-06Honza Petrous  if test $pike_cv_posix_threads = yes ; then AC_MSG_RESULT(yes) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) AC_DEFINE(_MIT_POSIX_THREADS,1) AC_MSG_CHECKING(for pthread_attr_setstacksize) AC_CACHE_VAL(pike_cv_have_pthread_attr_setstacksize,[ AC_TRY_LINK([#include <pthread.h> void foo(pthread_attr_t*x) { pthread_attr_setstacksize(x, 1024*1024); } ],[],[ pike_cv_have_pthread_attr_setstacksize=yes ],[ pike_cv_have_pthread_attr_setstacksize=no
8d4ce81997-04-10Fredrik Hübinette (Hubbe)  ])
9ab4461998-11-06Honza Petrous  ]) AC_MSG_RESULT($pike_cv_have_pthread_attr_setstacksize) if test x$pike_cv_have_pthread_attr_setstacksize = xyes ; then AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE) else : fi
8d4ce81997-04-10Fredrik Hübinette (Hubbe) 
9ab4461998-11-06Honza Petrous  AC_MSG_CHECKING(for pthread_yield) AC_CACHE_VAL(pike_cv_have_pthread_yield,[ AC_TRY_LINK([#include <pthread.h> void foo(void) { pthread_yield(); } ],[],[ pike_cv_have_pthread_yield=yes ],[ pike_cv_have_pthread_yield=no
8d4ce81997-04-10Fredrik Hübinette (Hubbe)  ])
9ab4461998-11-06Honza Petrous  ]) AC_MSG_RESULT($pike_cv_have_pthread_yield) if test x$pike_cv_have_pthread_yield = xyes ; then AC_DEFINE(HAVE_PTHREAD_YIELD) else : fi
8d4ce81997-04-10Fredrik Hübinette (Hubbe) 
9ab4461998-11-06Honza Petrous  AC_MSG_CHECKING(for pthread_cond_init) AC_CACHE_VAL(pike_cv_have_pthread_cond_init,[ AC_TRY_LINK([#include <pthread.h> void foo(pthread_cond_t*x, pthread_condattr_t*y) { pthread_cond_init(x,y); } ],[],[ pike_cv_have_pthread_cond_init=yes ],[ pike_cv_have_pthread_cond_init=no
8d4ce81997-04-10Fredrik Hübinette (Hubbe)  ])
9ab4461998-11-06Honza Petrous  ]) AC_MSG_RESULT($pike_cv_have_pthread_cond_init) if test x$pike_cv_have_pthread_cond_init = xyes ; then AC_DEFINE(HAVE_PTHREAD_COND_INIT) else : fi
0a40e91997-04-10Fredrik Hübinette (Hubbe) 
9ab4461998-11-06Honza Petrous  AC_MSG_CHECKING(if pthread_condattr_default is defined) AC_CACHE_VAL(pike_cv_have_pthread_condattr_default,[ AC_TRY_LINK([#include <pthread.h> void foo(pthread_cond_t *bar) { pthread_cond_init(bar, pthread_condattr_default); } ],[],[ pike_cv_have_pthread_condattr_default=yes ],[ pike_cv_have_pthread_condattr_default=no
5377b91997-02-01Henrik Grubbström (Grubba)  ])
9ab4461998-11-06Honza Petrous  ])
5377b91997-02-01Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  AC_MSG_RESULT($pike_cv_have_pthread_condattr_default)
5377b91997-02-01Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  if test x$pike_cv_have_pthread_condattr_default = xyes ; then AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT) else : fi
afbcda1998-08-31Henrik Grubbström (Grubba) 
752e101999-04-30Fredrik Hübinette (Hubbe) 
9ab4461998-11-06Honza Petrous  # # FreeBSD doesn't like the &, while AIX requires it... # AC_MSG_CHECKING(if pthread_condattr_default is needs an & (AIX)) AC_CACHE_VAL(pike_cv_have_pthread_condattr_default_aix,[ AC_TRY_LINK([#include <pthread.h> void foo(pthread_cond_t *bar) { pthread_cond_init(bar, &pthread_condattr_default); } ],[],[ pike_cv_have_pthread_condattr_default_aix=yes ],[ pike_cv_have_pthread_condattr_default_aix=no
afbcda1998-08-31Henrik Grubbström (Grubba)  ])
9ab4461998-11-06Honza Petrous  ])
afbcda1998-08-31Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  AC_MSG_RESULT($pike_cv_have_pthread_condattr_default_aix)
afbcda1998-08-31Henrik Grubbström (Grubba) 
9ab4461998-11-06Honza Petrous  if test x$pike_cv_have_pthread_condattr_default_aix = xyes ; then AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT_AIX) else : fi
afbcda1998-08-31Henrik Grubbström (Grubba) 
752e101999-04-30Fredrik Hübinette (Hubbe)  AC_MSG_CHECKING(for __pthread_initial_thread_bos) AC_CACHE_VAL(pike_cv_have_pthread_initial_thread_bos,[ AC_TRY_LINK([#include <pthread.h> char *foo(void) { extern char *__pthread_initial_thread_bos; return __pthread_initial_thread_bos; } ],[],[ pike_cv_have_pthread_initial_thread_bos=yes ],[ pike_cv_have_pthread_initial_thread_bos=no ]) ]) AC_MSG_RESULT($pike_cv_have_pthread_initial_thread_bos) if test x$pike_cv_have_pthread_initial_thread_bos = xyes ; then AC_DEFINE(HAVE_PTHREAD_INITIAL_THREAD_BOS) else : fi
9ab4461998-11-06Honza Petrous  else AC_MSG_RESULT(no) LIBS="$OLDLIBS"
284e061998-11-09Fredrik Hübinette (Hubbe)  CFLAGS="$OLDCFLAGS"
9ab4461998-11-06Honza Petrous  # No POSIX threads. # Try UNIX threads instead AC_MSG_CHECKING(unix threads) case "x$pike_cv_sys_os" in xUnixWare) if test "$GCC" = yes ; then LIBS="${LIBS} -lthread" else CFLAGS="${CFLAGS} -Kthread" fi CFLAGS="${CFLAGS} -D_UNIXWARE_THREADS_" ;; *) LIBS="${LIBS} -lthread" ;; esac AC_CACHE_VAL(pike_cv_unix_threads, [ AC_TRY_RUN([ #define _REENTRANT #define _THREAD_SAFE #define _MIT_POSIX_THREADS 1 #include <thread.h> #ifdef _UNIXWARE_THREADS_ #include <synch.h> #endif void *foo(void *bar) { thr_exit(0); return 0; } mutex_t tmp; thread_t gazonk; int main() { void *sune; mutex_lock(& tmp); thr_create(0,0,foo,0,0,&gazonk); thr_join(gazonk,0,&sune); exit(0); } ],pike_cv_unix_threads=yes,pike_cv_unix_threads=no,pike_cv_unix_threads=no) ]) if test x$pike_cv_unix_threads = xyes ; then AC_MSG_RESULT(yes) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) AC_DEFINE(_UNIX_THREADS)
50b0391997-01-27Henrik Grubbström (Grubba)  else AC_MSG_RESULT(no) LIBS="$OLDLIBS"
284e061998-11-09Fredrik Hübinette (Hubbe)  CFLAGS="$OLDCFLAGS"
07513e1996-10-04Fredrik Hübinette (Hubbe) 
50b0391997-01-27Henrik Grubbström (Grubba)  # Now we've sunk really low -- test for proprietary threads # SGI old-style shared group processes
43032e1997-10-09Henrik Grubbström (Grubba)  # AC_CHECK_FUNCS(sproc oserror) # # AC_MSG_CHECKING(Fallback to sproc) # # if test x$ac_cv_func_sproc$ac_cv_func_oserror = xyesyes; then # AC_MSG_RESULT(yes) # AC_DEFINE(_REENTRANT) # AC_DEFINE(_THREAD_SAFE) # AC_DEFINE(_SGI_SPROC_THREADS) # AC_DEFINE(_SGI_MP_SOURCE) # else # AC_MSG_RESULT(no) # : # fi
9ab4461998-11-06Honza Petrous  fi # UNIX threads fi # POSIX threads
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) fi # NT
50b0391997-01-27Henrik Grubbström (Grubba) else # Without threads :
eec1371996-11-02Fredrik Hübinette (Hubbe) fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_FUNC_MEMCMP if test "${OLD_LIBOBJS}" = "${LIBOBJS}" ; then AC_DEFINE(HAVE_MEMCMP) fi LIBOBJS="${OLD_LIBOBJS}"
dcad551996-08-03Fredrik Hübinette (Hubbe) AC_FUNC_MMAP
6930181996-02-25Fredrik Hübinette (Hubbe) 
75920f1997-12-28Fredrik Hübinette (Hubbe) AC_CHECK_FUNCS( \
cb22561995-10-11Fredrik Hübinette (Hubbe)  _crypt \
063fe31998-03-10Per Hedbor  poll \
cb22561995-10-11Fredrik Hübinette (Hubbe)  bcopy \ bzero \ clock \ crypt \ fchmod \
9548a81997-05-07Per Hedbor  gethrtime \ gethrvtime \
cb22561995-10-11Fredrik Hübinette (Hubbe)  getenv \ getrlimit \ getrusage \
067bc11996-06-21Fredrik Hübinette (Hubbe)  gettimeofday \
cb22561995-10-11Fredrik Hübinette (Hubbe)  index \
dcad551996-08-03Fredrik Hübinette (Hubbe)  localtime \
fe91501998-07-26Peter J. Holzer  gmtime \
cb22561995-10-11Fredrik Hübinette (Hubbe)  memchr \ memcpy \ memset \
565c361997-01-27Fredrik Hübinette (Hubbe)  mktime \
5539c51998-06-08Henrik Grubbström (Grubba)  perror \
cb22561995-10-11Fredrik Hübinette (Hubbe)  rindex \ setlocale \ setrlimit \
3605b81998-09-18Peter J. Holzer  setresuid \
93b8081995-11-02Fredrik Hübinette (Hubbe)  sigaction \
5740881998-01-01Fredrik Hübinette (Hubbe)  sigblock \ sigprocmask \
93b8081995-11-02Fredrik Hübinette (Hubbe)  sigvec \
cb22561995-10-11Fredrik Hübinette (Hubbe)  strcasecmp \ strchr \ strcspn \
2b25831997-01-31Fredrik Hübinette (Hubbe)  strerror \
cb22561995-10-11Fredrik Hübinette (Hubbe)  strrchr \ strtod \ strtok \ strtol \
5740881998-01-01Fredrik Hübinette (Hubbe)  time \
cb22561995-10-11Fredrik Hübinette (Hubbe)  times \ vfprintf \ vsprintf \
cd96811998-05-15Henrik Grubbström (Grubba)  vsnprintf \
6930181996-02-25Fredrik Hübinette (Hubbe)  wait3 \
65887d1995-11-15Fredrik Hübinette (Hubbe)  wait4 \ waitpid \
dcad551996-08-03Fredrik Hübinette (Hubbe)  munmap \
4238391998-07-09Francesco Chemolli  shl_load \
59bc1b1997-01-22Bernhard Fastenrath  dld_link \ dld_get_func \
3e84d61997-04-16Fredrik Hübinette (Hubbe)  pipe \
75920f1997-12-28Fredrik Hübinette (Hubbe)  strdup \ kill \ alarm \
85f59e1998-01-08Fredrik Hübinette (Hubbe)  fork1 \
d386e61998-03-20Fredrik Hübinette (Hubbe)  flock \
e6f98c1998-05-22David Hedbor  lockf \
0d52dd1998-01-16Fredrik Hübinette (Hubbe)  setuid getuid seteuid geteuid \ setgid getgid setegid getegid \
f087c41998-02-04Fredrik Hübinette (Hubbe)  getpwent getpwnam getpwuid \ getgrent getgrnam \
d386e61998-03-20Fredrik Hübinette (Hubbe)  initgroups setgroups \
9c50201998-03-26Fredrik Hübinette (Hubbe)  socketpair \
5ff14f1998-05-25Marcus Comstedt  fpclass \ fp_class_d \ isinf \ isnan \ iszero \ finite \ signbit \
70c9c11998-05-05Fredrik Hübinette (Hubbe)  nice \
ea959d1999-02-01Per Hedbor  __priocntl \ sched_setscheduler \ setpriority \
cb22561995-10-11Fredrik Hübinette (Hubbe) )
5267b71995-08-09Fredrik Hübinette (Hubbe) 
11ceb01998-08-07Henrik Grubbström (Grubba) AC_MSG_CHECKING(if the last argument to accept is a size_t *) AC_CACHE_VAL(pike_cv_accept_size_t, [ AC_TRY_COMPILE([ #ifndef _LARGEFILE_SOURCE # define _FILE_OFFSET_BITS 64 # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE 1 #endif /* HPUX needs these too... */ #ifndef __STDC_EXT__ # define __STDC_EXT__ #endif /* !__STDC_EXT__ */ #include <sys/types.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif
3e82a71998-09-01Fredrik Hübinette (Hubbe) /* NT */ #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif
11ceb01998-08-07Henrik Grubbström (Grubba) /* Here's the actual test: */ int accept(int, struct sockaddr *, size_t *); ], [ /* EMPTY */ ], pike_cv_accept_size_t=size_t, pike_cv_accept_size_t=int) ])
efad7a1998-10-28Henrik Grubbström (Grubba) AC_MSG_RESULT($pike_cv_accept_size_t)
11ceb01998-08-07Henrik Grubbström (Grubba) AC_DEFINE_UNQUOTED(ACCEPT_SIZE_T, $pike_cv_accept_size_t)
9649491998-02-27Fredrik Hübinette (Hubbe) if test x$pike_cv_sys_os = xWindows_NT ; then AC_DEFINE(HAVE_LOADLIBRARY) AC_DEFINE(HAVE_FREELIBRARY) AC_DEFINE(HAVE_GETPROCADDRESS) AC_DEFINE(DL_EXPORT, _dlspec(export)) else AC_DEFINE(DL_EXPORT, []) fi
e78abd1996-11-21Fredrik Hübinette (Hubbe) if test $ac_cv_func_crypt$ac_cv_func__crypt = nono ; then
905bb11998-01-31Fredrik Hübinette (Hubbe)  AC_CHECK_LIB(crypt,crypt,[LIBS="${LIBS} -lcrypt" ; AC_DEFINE(HAVE_CRYPT)], [ if test -f "$srcdir/crypt.c"; then AC_MSG_RESULT(Using crypt.c for BSD style crypt()) EXTRA_OBJS="${EXTRA_OBJS} crypt.o" AC_DEFINE(HAVE_CRYPT) else : fi ])
e78abd1996-11-21Fredrik Hübinette (Hubbe) fi
5539c51998-06-08Henrik Grubbström (Grubba) ############################################################################# # FreeBSD 3.0 has broken F_SETFD when running with threads. AC_MSG_CHECKING(whether F_SETFD exists and works) AC_CACHE_VAL(pike_cv_broken_f_setfd, [ AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif /* HAVE_SYS_TYPES_H */ #include <sys/stat.h> #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif /* HAVE_FCNTL_H */ #include <stdio.h> #ifndef FD_CLOEXEC #define FD_CLOEXEC 1 #endif /* FD_CLOEXEC */ int main(int argc, char **argv) { int fd = 0; if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) { exit(1); } if (fcntl(fd, F_GETFD) != FD_CLOEXEC) { exit(1); } exit(0); } ], pike_cv_broken_f_setfd=no, pike_cv_broken_f_setfd=yes, pike_cv_broken_f_setfd=no) ]) if test "x$pike_cv_broken_f_setfd" = "xyes"; then AC_MSG_RESULT(no) AC_DEFINE(HAVE_BROKEN_F_SETFD) else AC_MSG_RESULT(yes) fi #############################################################################
067bc11996-06-21Fredrik Hübinette (Hubbe) AC_STRUCT_TM
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
067bc11996-06-21Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(extern int timezone)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_has_external_timezone,[
067bc11996-06-21Fredrik Hübinette (Hubbe) AC_TRY_LINK([ #include <time.h> ],[ int _tz; _tz=timezone;
a05f921998-05-05Fredrik Hübinette (Hubbe)  timezone=_tz;
06983f1996-09-22Fredrik Hübinette (Hubbe) ],pike_cv_has_external_timezone=yes,pike_cv_has_external_timezone=no)
067bc11996-06-21Fredrik Hübinette (Hubbe) ])
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_has_external_timezone" = "yes"; then
067bc11996-06-21Fredrik Hübinette (Hubbe)  AC_DEFINE(HAVE_EXTERNAL_TIMEZONE) fi
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_has_external_timezone)
dcad551996-08-03Fredrik Hübinette (Hubbe)  #############################################################################
e0b9561996-07-02Fredrik Hübinette (Hubbe) # No test for this yet... AC_DEFINE(HAVE_STRUCT_TIMEVAL)
dcad551996-08-03Fredrik Hübinette (Hubbe) #############################################################################
067bc11996-06-21Fredrik Hübinette (Hubbe) 
63a6e01998-05-29Henrik Grubbström (Grubba) if test "x$ac_cv_func_strtol" = "xyes"; then AC_MSG_CHECKING(if strtol works for large hexadecimal constants) AC_CACHE_VAL(pike_cv_func_strtol_works, [ AC_TRY_RUN([ #include <stdlib.h> int main(int argc, char **argv) { /* On some OS's strtol() rounds this to 0x7fffffff. */ return(strtol("0xffffffff", NULL, 0) != 0xffffffff); } ], pike_cv_func_strtol_works=yes, pike_cv_func_strtol_works=no, pike_cv_func_strtol_works=no) ]) AC_MSG_RESULT($pike_cv_func_strtol_works) if test "x$pike_cv_func_strtol_works" = "xyes"; then AC_DEFINE(HAVE_WORKING_STRTOL) else :; fi else :; fi #############################################################################
e0b9561996-07-02Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(if gettimeofday takes two arguments)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_func_gettimeofday_has_two_args,
e0b9561996-07-02Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([ #if TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> #else # if HAVE_SYS_TIME_H # include <sys/time.h> # else # if HAVE_TIME_H # include <time.h> # endif # endif #endif #ifndef HAVE_STRUCT_TIMEVAL struct timeval { long tv_sec; long tv_usec; }; #endif int main() { struct timeval tv; gettimeofday(&tv,(void *)0); exit(0); } ],
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_func_gettimeofday_has_two_args=yes,
75920f1997-12-28Fredrik Hübinette (Hubbe) pike_cv_func_gettimeofday_has_two_args=no,
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_func_gettimeofday_has_two_args=no)])
e0b9561996-07-02Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) if test $pike_cv_func_gettimeofday_has_two_args = yes; then
e0b9561996-07-02Fredrik Hübinette (Hubbe)  AC_DEFINE(GETTIMEOFDAY_TAKES_TWO_ARGS) fi
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_func_gettimeofday_has_two_args)
067bc11996-06-21Fredrik Hübinette (Hubbe)  AC_MSG_CHECKING(if struct tm has tm_gmtoff)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_struct_tm_has_gmtoff,[
658f1a1997-01-26Fredrik Hübinette (Hubbe) AC_TRY_COMPILE([
067bc11996-06-21Fredrik Hübinette (Hubbe) #ifdef TM_IN_SYS_TIME #include <sys/time.h> #else
a285921998-09-27Henrik Grubbström (Grubba) #include <time.h> #endif
067bc11996-06-21Fredrik Hübinette (Hubbe) ],[ int _tz; struct tm foo; _tz=foo->tm_gmtoff;
06983f1996-09-22Fredrik Hübinette (Hubbe) ],pike_cv_struct_tm_has_gmtoff=yes,pike_cv_struct_tm_has_gmtoff=no)
067bc11996-06-21Fredrik Hübinette (Hubbe) ])
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_struct_tm_has_gmtoff" = "yes"; then
067bc11996-06-21Fredrik Hübinette (Hubbe)  AC_DEFINE(STRUCT_TM_HAS_GMTOFF) fi
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_struct_tm_has_gmtoff)
067bc11996-06-21Fredrik Hübinette (Hubbe) 
c69eb51996-09-29Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(for USHRT_MAX definition) AC_CACHE_VAL(pike_cv_ushrt_max_is_defined,[ AC_EGREP_CPP(yes,[ #include <limits.h> #ifdef USHRT_MAX yes #endif ],pike_cv_ushrt_max_is_defined=yes,pike_cv_ushrt_max_is_defined=no) ]) if test "$pike_cv_ushrt_max_is_defined" = "no" ; then AC_DEFINE(USHRT_MAX,65535) fi AC_MSG_RESULT($pike_cv_ushrt_max_is_defined)
067bc11996-06-21Fredrik Hübinette (Hubbe) 
5267b71995-08-09Fredrik Hübinette (Hubbe) define(MY_CHECK_HEADERS, [ AC_MSG_CHECKING(for $1 declaration)
06983f1996-09-22Fredrik Hübinette (Hubbe)  AC_CACHE_VAL(pike_cv_decl_$1,
5267b71995-08-09Fredrik Hübinette (Hubbe)  [
06983f1996-09-22Fredrik Hübinette (Hubbe)  pike_cv_decl_$1=nonexistant
5267b71995-08-09Fredrik Hübinette (Hubbe)  for a in $2 do
9af34a1997-11-30Henrik Grubbström (Grubba)  AC_EGREP_HEADER($1,$a,[ pike_cv_decl_$1=existant; break ])
5267b71995-08-09Fredrik Hübinette (Hubbe)  done ])
06983f1996-09-22Fredrik Hübinette (Hubbe)  AC_MSG_RESULT($pike_cv_decl_$1) if test "$pike_cv_decl_$1" = nonexistant; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_DEFINE(translit($1,[a-z],[A-Z])[]_DECL_MISSING) fi ]) MY_CHECK_HEADERS(strchr,string.h unistd.h stdlib.h) MY_CHECK_HEADERS(malloc,memory.h unistd.h stdlib.h)
2043ba1998-02-10Fredrik Hübinette (Hubbe) MY_CHECK_HEADERS(getpeername,sys/socket.h sys/socketvar.h sys/socketio.h winsock.h winsock2.h)
5267b71995-08-09Fredrik Hübinette (Hubbe) MY_CHECK_HEADERS(popen,stdio.h unistd.h) MY_CHECK_HEADERS(getenv,unistd.h stdlib.h)
2043ba1998-02-10Fredrik Hübinette (Hubbe) MY_CHECK_HEADERS(gethostname,unistd.h netdb.h winsock.h winsock2.h)
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_ALLOCA
6930181996-02-25Fredrik Hübinette (Hubbe) AC_C_CONST AC_C_INLINE
5267b71995-08-09Fredrik Hübinette (Hubbe) 
9b372f1998-09-05Henrik Grubbström (Grubba) AC_CHECK_FUNCS(ualarm setitimer)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
9b372f1998-09-05Henrik Grubbström (Grubba) if test "x$ac_cv_func_ualarm" = "xyes"; then AC_MSG_CHECKING(no of arguments to ualarm) AC_CACHE_VAL(pike_cv_ualarm_takes_two_args, [ AC_TRY_COMPILE([ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ ],[
e16ff51996-12-05Fredrik Hübinette (Hubbe)  ualarm(0,0);
9b372f1998-09-05Henrik Grubbström (Grubba)  ],pike_cv_ualarm_takes_two_args=yes,pike_cv_ualarm_takes_two_args=no) ]) if test "$pike_cv_ualarm_takes_two_args" = yes; then AC_MSG_RESULT(2) AC_DEFINE(UALARM_TAKES_TWO_ARGS) else AC_MSG_RESULT(1) fi fi
5267b71995-08-09Fredrik Hübinette (Hubbe) 
07513e1996-10-04Fredrik Hübinette (Hubbe) OLD_LIBOBJS="${LIBOBJS}"
d7be5b1997-01-28Fredrik Hübinette (Hubbe) ########################################################################
2ee6691999-01-07Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(stack direction) AC_CACHE_VAL(pike_cv_hardware_stack_direction, [ AC_TRY_RUN([ static int find_stack_direction(void *foo) { if(!foo) { return find_stack_direction((void *)&foo); } if (((void *)&foo) > foo) { return 1; } else { return -1; } } int main() { exit( find_stack_direction(0) + 1); } ],pike_cv_hardware_stack_direction=down,pike_cv_hardware_stack_direction=up) ]) AC_MSG_RESULT($pike_cv_hardware_stack_direction) if grep STACK_DIRECTION confdefs.h >/dev/null 2>&1; then : else if test "x$pike_cv_hardware_stack_direction" = "xup" ; then AC_DEFINE(STACK_DIRECTION, 1) else AC_DEFINE(STACK_DIRECTION, -1) fi fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(byteorder)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_hardware_byteorder,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([ #include <stdio.h> int main() {
5c8e891995-10-29Fredrik Hübinette (Hubbe) #if SIZEOF_INT == 4
5267b71995-08-09Fredrik Hübinette (Hubbe) #define T int #else #define T long #endif FILE *f; T a; int e; for(e=0;e<sizeof(T);e++) ((char *)&a)[e]=(e+1) % 10; f=fopen("conftest.out.2","w"); for(e=0;e<sizeof(T);e++) { fprintf(f,"%d",(int)(a & 255)); a>>=8; } fprintf(f,"\n"); fclose(f); return 0; }],
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_hardware_byteorder=`cat conftest.out.2`
5267b71995-08-09Fredrik Hübinette (Hubbe) ,
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_hardware_byteorder=0
75920f1997-12-28Fredrik Hübinette (Hubbe) , pike_cv_hardware_byteorder=0
5267b71995-08-09Fredrik Hübinette (Hubbe) )])
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_hardware_byteorder)
71f3a21998-11-22Fredrik Hübinette (Hubbe) AC_DEFINE_UNQUOTED(PIKE_BYTEORDER,$pike_cv_hardware_byteorder)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
c411dc1997-04-21Fredrik Hübinette (Hubbe) dnl##################################################################### define(MY_CHECK_FUNCTION,[ AC_MSG_CHECKING(for working $1)
febbc81997-04-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_func_$1,[
75920f1997-12-28Fredrik Hübinette (Hubbe) AC_TRY_RUN([$2],pike_cv_func_$1=yes,pike_cv_func_$1=no,pike_cv_func_$1=no)
94e2fa1997-05-19Fredrik Hübinette (Hubbe) ])
c411dc1997-04-21Fredrik Hübinette (Hubbe) AC_MSG_RESULT([$]pike_cv_func_$1) if test [$]pike_cv_func_$1 = yes; then AC_DEFINE(translit(HAVE_$1,[a-z],[A-Z]))
94e2fa1997-05-19Fredrik Hübinette (Hubbe) fi])
c411dc1997-04-21Fredrik Hübinette (Hubbe) 
05030b1998-11-18Marcus Comstedt ######################################################################## MY_CHECK_FUNCTION(fork, [ #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif int main() { exit(fork()==-1); } ]);
4bcc441998-07-22Fredrik Hübinette (Hubbe) ######################################################################## MY_CHECK_FUNCTION(fpsetmask, [ #include <math.h> #ifdef HAVE_FLOATINGPOINT_H #include <floatingpoint.h> #endif #ifdef HAVE_IEEEFP_H #include <ieeefp.h> #endif int main() { fpsetmask(0); exit(0); } ]);
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
de16081997-06-03Fredrik Hübinette (Hubbe) MY_CHECK_FUNCTION(dlopen, [ #include <dlfcn.h> int main() { dlopen(0, 0); exit(0); }])
4bcc441998-07-22Fredrik Hübinette (Hubbe) ########################################################################
de16081997-06-03Fredrik Hübinette (Hubbe) 
c411dc1997-04-21Fredrik Hübinette (Hubbe) MY_CHECK_FUNCTION(ldexp, [ #include <math.h> int main() { double x; int p; for(x=0.0;x<2.0;x+=1.0/64.0) for(p=-6;p<7;p++) if(ldexp(x,p) != x*pow(2.0, (double)p)) exit(1); exit(0); }]) ######################################################################## MY_CHECK_FUNCTION(frexp, [ #include <math.h> int main() { double x,y;
1a631e1997-04-22Fredrik Hübinette (Hubbe)  int p,e;
c411dc1997-04-21Fredrik Hübinette (Hubbe) 
1a631e1997-04-22Fredrik Hübinette (Hubbe)  x=frexp(1.0, &e);
3b7ea31998-07-22Fredrik Hübinette (Hubbe)  if(x * pow(2.0,(double)e) != 1.0) exit(3);
1a631e1997-04-22Fredrik Hübinette (Hubbe)  p=-7;
c411dc1997-04-21Fredrik Hübinette (Hubbe)  for(x=3.0/4.0*pow(2.0,(double)p);x<50000.0;x*=2.0,p++) { if(frexp(x, &e)!=3.0/4.0) exit(1);
1a631e1997-04-22Fredrik Hübinette (Hubbe)  if(e!=p) exit(2);
c411dc1997-04-21Fredrik Hübinette (Hubbe)  } exit(0); }])
9649491998-02-27Fredrik Hübinette (Hubbe) ############################################################################# MY_CHECK_FUNCTION(GetSystemTimeAsFileTime, [ #include <windows.h> #include <winbase.h> int main() { FILETIME f; GetSystemTimeAsFileTime(&f); exit(0); } ]) ############################################################################# MY_CHECK_FUNCTION(gethostname, [ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif int main(int argc, char **argv) { char buffer[10000]; char *x=gethostname(buffer,sizeof(buffer)); exit(0); } ]) ############################################################################# MY_CHECK_FUNCTION(strcoll, [ #include <string.h> #include <locale.h> int main() { setlocale(LC_CTYPE, "ISO-8859-1"); exit(strcoll("abc", "def") >= 0 || strcoll("ABC", "DEF") >= 0 || strcoll("ABC", "ABCD") >= 0 || strcoll("ABCD", "ABC") <= 0 || strcoll("*^#", "*^#") != 0 || strcoll("123", "456") >= 0); } ])
c411dc1997-04-21Fredrik Hübinette (Hubbe) ######################################################################## MY_CHECK_FUNCTION(memmem,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ #include <string.h> char *a="foo bar gazonk"; char *b="foo"; char *c="bar"; char *d="gazonk";
cb22561995-10-11Fredrik Hübinette (Hubbe) int main()
5267b71995-08-09Fredrik Hübinette (Hubbe) {
c463961998-09-27Henrik Grubbström (Grubba)  if(((char *)memmem(b,strlen(b),a,strlen(a)))!=a || ((char *)memmem(c,strlen(c),a,strlen(a)))!=(a+4) || ((char *)memmem(d,strlen(d),a,strlen(a)))!=(a+8) || ((char *)memmem(d,0,a,strlen(a)))!=a ||
5267b71995-08-09Fredrik Hübinette (Hubbe)  memmem(d,strlen(d)+1,a,strlen(a))!=0) exit(1); exit(0); }
c411dc1997-04-21Fredrik Hübinette (Hubbe) ])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
c411dc1997-04-21Fredrik Hübinette (Hubbe) ########################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) 
c411dc1997-04-21Fredrik Hübinette (Hubbe) MY_CHECK_FUNCTION(memmove,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ #include <string.h> char buf[100];
cb22561995-10-11Fredrik Hübinette (Hubbe) int main()
5267b71995-08-09Fredrik Hübinette (Hubbe) { strcpy(buf,"foo bar gazonk elefantsnabel."); if(strcmp(buf,"foo bar gazonk elefantsnabel.")) exit(1);
cb22561995-10-11Fredrik Hübinette (Hubbe)  memmove(buf,buf+1,7);
5267b71995-08-09Fredrik Hübinette (Hubbe)  if(strcmp(buf,"oo bar gazonk elefantsnabel.")) exit(1); memmove(buf+1,buf+1,9); if(strcmp(buf,"oo bar gazonk elefantsnabel.")) exit(1); memmove(buf+1,buf,11); if(strcmp(buf,"ooo bar gaznk elefantsnabel.")) exit(1); exit(0); }
c411dc1997-04-21Fredrik Hübinette (Hubbe) ])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
c411dc1997-04-21Fredrik Hübinette (Hubbe) MY_CHECK_FUNCTION(isspace, [ #include <ctype.h> int main() { if(isspace(' ')) exit(0); exit(1); } ]) #############################################################################
85f59e1998-01-08Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(if we can declare environ) AC_CACHE_VAL(pike_cv_declare_environ,[ AC_TRY_COMPILE([ #include <stdlib.h> ],[ extern char **environ; exit(0); ],pike_cv_declare_environ=yes,pike_cv_declare_environ=no,pike_cv_declare_environ=yes) ]) AC_MSG_RESULT($pike_cv_declare_environ) if test "x$pike_cv_declare_environ" = xyes ; then AC_DEFINE(DECLARE_ENVIRON) fi #############################################################################
c411dc1997-04-21Fredrik Hübinette (Hubbe) 
9dd2201998-05-17Henrik Grubbström (Grubba) AC_MSG_CHECKING([for union wait (old BSD convention)]) AC_CACHE_VAL(pike_cv_union_wait, [ AC_TRY_COMPILE([ #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h>
d6980f1998-05-17Henrik Grubbström (Grubba) #endif /* HAVE_SYS_WAIT_H */
9dd2201998-05-17Henrik Grubbström (Grubba) ], [ union wait status; exit(0); ], pike_cv_union_wait=yes, pike_cv_union_wait=no) ]) AC_MSG_RESULT($pike_cv_union_wait) if test "x$pike_cv_union_wait" = "xyes" ; then
f376171998-05-22Henrik Grubbström (Grubba)  AC_MSG_CHECKING([whether union wait is really needed]) AC_CACHE_VAL(pike_cv_union_wait_needed, [ AC_TRY_COMPILE([ #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> #endif /* HAVE_SYS_WAIT_H */ ], [ int status; return WIFEXITED(status) || 0; ], pike_cv_union_wait_needed=no, pike_cv_union_wait_needed=yes) ])
efad7a1998-10-28Henrik Grubbström (Grubba)  AC_MSG_RESULT($pike_cv_union_wait_needed)
f376171998-05-22Henrik Grubbström (Grubba)  if test "x$pike_cv_union_wait_needed" = "xyes" ; then AC_DEFINE(HAVE_UNION_WAIT) else :; fi else :; fi
9dd2201998-05-17Henrik Grubbström (Grubba)  #############################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(how to extract an unsigned char)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_method_extract_uchar,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([
cb22561995-10-11Fredrik Hübinette (Hubbe) int main()
5267b71995-08-09Fredrik Hübinette (Hubbe) { char i,*p; i=-10; p=&i; if(*(unsigned char *)(p)!= 0x100 - 10) exit(1); exit(0); }
06983f1996-09-22Fredrik Hübinette (Hubbe) ],pike_cv_method_extract_uchar=by_cast,
75920f1997-12-28Fredrik Hübinette (Hubbe) pike_cv_method_extract_uchar=not_by_cast,
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_method_extract_uchar=not_by_cast)])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_method_extract_uchar" = by_cast; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(by cast) AC_DEFINE(EXTRACT_UCHAR_BY_CAST) else AC_MSG_RESULT(not by cast) fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(how to extract a signed char)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_method_extract_char,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([
cb22561995-10-11Fredrik Hübinette (Hubbe) int main()
5267b71995-08-09Fredrik Hübinette (Hubbe) { char i,*p; i=-10; p=&i; if(*(signed char *)(p)!= -10) exit(1); exit(0); }
06983f1996-09-22Fredrik Hübinette (Hubbe) ],pike_cv_method_extract_char=by_cast,
75920f1997-12-28Fredrik Hübinette (Hubbe) pike_cv_method_extract_char=not_by_cast,
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_method_extract_char=not_by_cast)])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_method_extract_char" = by_cast; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(by cast) AC_DEFINE(EXTRACT_CHAR_BY_CAST) else AC_MSG_RESULT(not by cast) fi
d300821998-02-27Marcus Comstedt #############################################################################
71b44e1998-06-05Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(if float conversion can cause SIGFPE) AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe, [ AC_TRY_RUN([ #include <math.h>
3b7ea31998-07-22Fredrik Hübinette (Hubbe) #ifdef HAVE_FLOATINGPOINT_H #include <floatingpoint.h> #endif #ifdef HAVE_IEEEFP_H #include <ieeefp.h> #endif
c371d41998-06-07Simon Coggins float foo_float = 0.0;
71b44e1998-06-05Fredrik Hübinette (Hubbe) int main(int argc, char **argv) {
c371d41998-06-07Simon Coggins  float x=2.0, y=-128.0;
3b7ea31998-07-22Fredrik Hübinette (Hubbe) #ifdef HAVE_FPSETMASK fpsetmask(0); #endif
c371d41998-06-07Simon Coggins  x = pow(2.0, -128.0); foo_float = x; if (x == 2.0) exit(1); x = pow(2.0, 1024.0); foo_float = x; if(x == 2.0) exit(1);
71b44e1998-06-05Fredrik Hübinette (Hubbe)  exit(0); }
e33f4c1998-06-28Henrik Grubbström (Grubba) ],pike_cv_sys_idiot_sigfpe=no,pike_cv_sys_idiot_sigfpe=yes, pike_cv_sys_idiot_sigfpe=yes)
71b44e1998-06-05Fredrik Hübinette (Hubbe) ]) if test $pike_cv_sys_idiot_sigfpe = yes ; then AC_MSG_RESULT(yes)
c371d41998-06-07Simon Coggins  IEEE_FLAG=no if test "x${GCC-}" = xyes ; then
71b44e1998-06-05Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG(-mieee, mieee, CFLAGS,[],IEEE_FLAG=yes)
c371d41998-06-07Simon Coggins  else
71b44e1998-06-05Fredrik Hübinette (Hubbe)  AC_SYS_COMPILER_FLAG(-ieee, ieee, CFLAGS,[],IEEE_FLAG=yes)
c371d41998-06-07Simon Coggins  fi TEST_IGNORE_SIGFPE=yes
71b44e1998-06-05Fredrik Hübinette (Hubbe) 
c371d41998-06-07Simon Coggins  if test $IEEE_FLAG = yes; then AC_MSG_CHECKING(if float conversion is still broken) AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe_with_ieee,
71b44e1998-06-05Fredrik Hübinette (Hubbe) [
8aa31a1998-06-07Henrik Grubbström (Grubba)  OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $OPTIMIZE"
71b44e1998-06-05Fredrik Hübinette (Hubbe)  AC_TRY_RUN([ #include <math.h>
c371d41998-06-07Simon Coggins 
3b7ea31998-07-22Fredrik Hübinette (Hubbe) #ifdef HAVE_FLOATINGPOINT_H #include <floatingpoint.h> #endif #ifdef HAVE_IEEEFP_H #include <ieeefp.h> #endif
c371d41998-06-07Simon Coggins float foo_float = 0.0;
71b44e1998-06-05Fredrik Hübinette (Hubbe) int main(int argc, char **argv) {
c371d41998-06-07Simon Coggins  float x=2.0, y=-128.0;
3b7ea31998-07-22Fredrik Hübinette (Hubbe) #ifdef HAVE_FPSETMASK fpsetmask(0); #endif
c371d41998-06-07Simon Coggins  x = pow(2.0, -128.0); foo_float = x; if (x == 2.0) exit(1); x = pow(2.0, 1024.0); foo_float = x; if(x == 2.0) exit(1);
71b44e1998-06-05Fredrik Hübinette (Hubbe)  exit(0); }
e33f4c1998-06-28Henrik Grubbström (Grubba) ],pike_cv_sys_idiot_sigfpe_with_ieee=no,pike_cv_sys_idiot_sigfpe_with_ieee=yes, pike_cv_sys_idiot_sigfpe_with_ieee=yes)
8aa31a1998-06-07Henrik Grubbström (Grubba)  CFLAGS="$OLD_CFLAGS"
71b44e1998-06-05Fredrik Hübinette (Hubbe) ])
c371d41998-06-07Simon Coggins  if test $pike_cv_sys_idiot_sigfpe_with_ieee = yes ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) TEST_IGNORE_SIGFPE=no fi
71b44e1998-06-05Fredrik Hübinette (Hubbe) fi # IEEE_FLAG if test $TEST_IGNORE_SIGFPE = yes; then AC_MSG_CHECKING(if ignoring SIGFPE helps) AC_CACHE_VAL(pike_cv_sys_ignore_sigfpe, [
8aa31a1998-06-07Henrik Grubbström (Grubba)  OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $OPTIMIZE"
71b44e1998-06-05Fredrik Hübinette (Hubbe) AC_TRY_RUN([
8aa31a1998-06-07Henrik Grubbström (Grubba) #include <signal.h>
71b44e1998-06-05Fredrik Hübinette (Hubbe) #include <math.h> int counter=0; RETSIGTYPE func(void) { if(counter++>10) exit(7); signal(SIGFPE,func); }
c371d41998-06-07Simon Coggins float foo_float = 0.0;
71b44e1998-06-05Fredrik Hübinette (Hubbe) int main(int argc, char **argv) {
c371d41998-06-07Simon Coggins  float x=2.0, y=-128.0;
71b44e1998-06-05Fredrik Hübinette (Hubbe)  signal(SIGFPE,func);
c371d41998-06-07Simon Coggins  x = pow(2.0, -128.0); foo_float = x; if (x == 2.0) exit(1); x = pow(2.0, 1024.0); foo_float = x; if(x == 2.0) exit(1);
71b44e1998-06-05Fredrik Hübinette (Hubbe)  exit(0); }
e33f4c1998-06-28Henrik Grubbström (Grubba) ],pike_cv_sys_ignore_sigfpe=yes,pike_cv_sys_ignore_sigfpe=no, pike_cv_sys_ignore_sigfpe=yes)
8aa31a1998-06-07Henrik Grubbström (Grubba)  CFLAGS="$OLD_CFLAGS"
71b44e1998-06-05Fredrik Hübinette (Hubbe) ]) if test "$pike_cv_sys_ignore_sigfpe" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(IGNORE_SIGFPE) else AC_MSG_RESULT(no) fi fi # TEST_IGNORE_SIGFPE else AC_MSG_RESULT(no) fi # pike_cv_sys_idiot_sigfpe #############################################################################
5ff14f1998-05-25Marcus Comstedt define(float_check, [[ #include <math.h> #define TY $1 #define TEST_$1 #define TEST_$2 #define EXPECTED_SIZE_float 4 #define EXPECTED_SIZE_double 8 void check(TY n, char *pf, char *pd) { int i; char *p, *p2 = (char*)&n; #ifdef TEST_float p = pf; #else p = pd; #endif for(i=0; i<sizeof(TY); i++) #ifdef TEST_BIG if(p[i] != p2[i]) exit(1); #else if(p[i] != p2[sizeof(TY)-i-1]) exit(1); #endif } int main() { if(sizeof(TY)!=EXPECTED_SIZE_$1) exit(1); check((TY)0.0, "\000\000\000\000", "\000\000\000\000\000\000\000\000"); check((TY)1.0, "\077\200\000\000", "\077\360\000\000\000\000\000\000"); check((TY)-1.0, "\277\200\000\000", "\277\360\000\000\000\000\000\000"); check((TY)2.0, "\100\000\000\000", "\100\000\000\000\000\000\000\000"); check((TY)1.5, "\077\300\000\000", "\077\370\000\000\000\000\000\000"); check((TY)0.032999999821186065673828125, "\075\007\053\002", "\077\240\345\140\100\000\000\000"); exit(0); } ]]) AC_MSG_CHECKING(for type of float) AC_CACHE_VAL(pike_cv_float_type, [AC_TRY_RUN(float_check(float,BIG),pike_cv_float_type=ieee_big, [AC_TRY_RUN(float_check(float,LITTLE),pike_cv_float_type=ieee_little, pike_cv_float_type=not_ieee)],pike_cv_float_type=not_ieee)]) if test "$pike_cv_float_type" = ieee_big; then AC_MSG_RESULT(IEEE big endian) AC_DEFINE(FLOAT_IS_IEEE_BIG) else if test "$pike_cv_float_type" = ieee_little; then AC_MSG_RESULT(IEEE little endian) AC_DEFINE(FLOAT_IS_IEEE_LITTLE) else AC_MSG_RESULT(not IEEE) fi fi AC_MSG_CHECKING(for type of double) AC_CACHE_VAL(pike_cv_double_type, [AC_TRY_RUN(float_check(double,BIG),pike_cv_double_type=ieee_big, [AC_TRY_RUN(float_check(double,LITTLE),pike_cv_double_type=ieee_little, pike_cv_double_type=not_ieee)],pike_cv_double_type=not_ieee)]) if test "$pike_cv_double_type" = ieee_big; then AC_MSG_RESULT(IEEE big endian) AC_DEFINE(DOUBLE_IS_IEEE_BIG) else if test "$pike_cv_double_type" = ieee_little; then AC_MSG_RESULT(IEEE little endian) AC_DEFINE(DOUBLE_IS_IEEE_LITTLE) else AC_MSG_RESULT(not IEEE) fi fi #############################################################################
d300821998-02-27Marcus Comstedt AC_MSG_CHECKING(for volatile) AC_CACHE_VAL(pike_cv_volatile, [ AC_TRY_COMPILE([],[ volatile int foo=1;], pike_cv_volatile=yes,pike_cv_volatile=no) ]) if test "$pike_cv_volatile" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(VOLATILE,volatile) else AC_MSG_RESULT(no) AC_DEFINE(VOLATILE,) fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
93b8081995-11-02Fredrik Hübinette (Hubbe) 
61d3cf1998-02-27Marcus Comstedt AC_MSG_CHECKING(for sig_atomic_t) AC_CACHE_VAL(ac_cv_type_sig_atomic_t, [ AC_EGREP_CPP(sig_atomic_t, [ #ifdef HAVE_SIGNAL_H #include <signal.h> #endif #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> #endif], ac_cv_type_sig_atomic_t=yes, ac_cv_type_sig_atomic_t=no)]) AC_MSG_RESULT($ac_cv_type_sig_atomic_t) if test x"$ac_cv_type_sig_atomic_t" = xno; then AC_DEFINE(sig_atomic_t, int) else : fi
c8a4ce1995-11-20Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(if signal handlers reset automatically)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_sys_signal_oneshot,
93b8081995-11-02Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([
61d3cf1998-02-27Marcus Comstedt #ifdef HAVE_SIGNAL_H
93b8081995-11-02Fredrik Hübinette (Hubbe) #include <signal.h>
61d3cf1998-02-27Marcus Comstedt #endif #include <sys/types.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> #endif
d300821998-02-27Marcus Comstedt VOLATILE sig_atomic_t sigrun=0;
6077101999-05-15Henrik Grubbström (Grubba) RETSIGTYPE func(int sig) { write(2, "func called\n", sizeof("func called\n") - sizeof("")); sigrun=1; }
93b8081995-11-02Fredrik Hübinette (Hubbe)  int main() { #define sig SIGSEGV #ifdef HAVE_SIGACTION { struct sigaction action; action.sa_handler= func; sigfillset(&action.sa_mask); #ifdef SA_INTERRUPT action.sa_flags=SA_INTERRUPT; #endif sigaction(sig,&action,0); } #else #ifdef HAVE_SIGVEC { struct sigvec action; action.sv_handler= func; action.sv_mask=-1; #ifdef SV_INTERRUPT action.sv_flags=SV_INTERRUPT; #endif sigvec(sig,&action,0); } #else signal(sig, func); #endif #endif kill(getpid(), sig); while(!sigrun) sleep(1); sigrun=0; kill(getpid(), sig); while(!sigrun) sleep(1); sigrun=0; exit(0); }
75920f1997-12-28Fredrik Hübinette (Hubbe) ],pike_cv_sys_signal_oneshot=no,pike_cv_sys_signal_oneshot=yes,pike_cv_sys_signal_oneshot=yes)])
93b8081995-11-02Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_sys_signal_oneshot" = yes; then
93b8081995-11-02Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(yes) AC_DEFINE(SIGNAL_ONESHOT) else AC_MSG_RESULT(no) fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
93b8081995-11-02Fredrik Hübinette (Hubbe) 
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(available file descriptors)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_max_open_fd,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([ #include <stdio.h> #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #ifndef MAX_FD #define MAX_FD 256 #endif int main() { FILE *f;
f90e541995-08-17Fredrik Hübinette (Hubbe)  long limit;
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
2a50961995-08-23Fredrik Hübinette (Hubbe) #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE)
f90e541995-08-17Fredrik Hübinette (Hubbe) #define RLIMIT_NOFILE RLIMIT_OFILE #endif
5c8e891995-10-29Fredrik Hübinette (Hubbe) 
cb22561995-10-11Fredrik Hübinette (Hubbe) #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
5267b71995-08-09Fredrik Hübinette (Hubbe)  struct rlimit lim; if(getrlimit(RLIMIT_NOFILE,&lim)) { limit = MAX_FD; }else{
f90e541995-08-17Fredrik Hübinette (Hubbe)  if(lim.rlim_max == RLIM_INFINITY) {
dd425b1998-09-29Henrik Grubbström (Grubba)  limit=131072; /* Noone needs more :-) */
f90e541995-08-17Fredrik Hübinette (Hubbe)  }else{ limit=lim.rlim_max;
dd425b1998-09-29Henrik Grubbström (Grubba)  if(limit > 131072) limit=131072;
f90e541995-08-17Fredrik Hübinette (Hubbe)  }
5267b71995-08-09Fredrik Hübinette (Hubbe)  } #else limit = MAX_FD; #endif f=fopen("conftest.out.2","w");
f90e541995-08-17Fredrik Hübinette (Hubbe)  fprintf(f,"%ld\n",(long)limit);
5267b71995-08-09Fredrik Hübinette (Hubbe)  fclose(f); return 0; } ],
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_max_open_fd=`cat conftest.out.2`
5267b71995-08-09Fredrik Hübinette (Hubbe) ,
06983f1996-09-22Fredrik Hübinette (Hubbe) pike_cv_max_open_fd=256
75920f1997-12-28Fredrik Hübinette (Hubbe) , pike_cv_max_open_fd=256
5267b71995-08-09Fredrik Hübinette (Hubbe) )])
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_max_open_fd) AC_DEFINE_UNQUOTED(MAX_OPEN_FILEDESCRIPTORS,$pike_cv_max_open_fd)
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_MSG_CHECKING(full availability of struct rusage members)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_func_getrusage_full,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_LINK([ #include <sys/time.h> #ifdef HAVE_SYS_RUSAGE_H #include <sys/rusage.h> #endif #include <sys/resource.h> #ifndef RUSAGE_SELF #define RUSAGE_SELF 0 #endif ],[ struct rusage rus; long *v = (long *)main; getrusage(RUSAGE_SELF, &rus); *v++ = rus.ru_maxrss; *v++ = rus.ru_ixrss; *v++ = rus.ru_idrss; *v++ = rus.ru_isrss; *v++ = rus.ru_minflt; *v++ = rus.ru_majflt; *v++ = rus.ru_nswap; *v++ = rus.ru_inblock; *v++ = rus.ru_oublock; *v++ = rus.ru_msgsnd; *v++ = rus.ru_msgrcv; *v++ = rus.ru_nsignals; *v++ = rus.ru_nvcsw; *v++ = rus.ru_nivcsw; ],
06983f1996-09-22Fredrik Hübinette (Hubbe)  pike_cv_func_getrusage_full=yes
5267b71995-08-09Fredrik Hübinette (Hubbe) ,
06983f1996-09-22Fredrik Hübinette (Hubbe)  pike_cv_func_getrusage_full=no
5267b71995-08-09Fredrik Hübinette (Hubbe) )])
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "$pike_cv_func_getrusage_full" = yes; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(all there) else AC_MSG_RESULT(getrusage is restricted) AC_DEFINE(GETRUSAGE_RESTRICTED) fi
07513e1996-10-04Fredrik Hübinette (Hubbe) ########################################################################
d203541998-06-10Fredrik Hübinette (Hubbe) # # IRIX also has procfs support, but it it different, a separate test # should be made. /Hubbe #
07513e1996-10-04Fredrik Hübinette (Hubbe) 
2213471997-09-16Henrik Grubbström (Grubba) if test "$ac_cv_header_sys_procfs_h" = "yes"; then AC_MSG_CHECKING(getrusage() through procfs) AC_CACHE_VAL(pike_cv_getrusage_procfs, [ AC_TRY_COMPILE([
c5f17c1998-06-04Henrik Grubbström (Grubba) #ifndef _LARGEFILE_SOURCE # define _FILE_OFFSET_BITS 64 # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE 1 #endif
5267b71995-08-09Fredrik Hübinette (Hubbe) #include <sys/procfs.h> #include <sys/fcntl.h> int proc_fd;
d203541998-06-10Fredrik Hübinette (Hubbe) long tmp;
5267b71995-08-09Fredrik Hübinette (Hubbe) char proc_name[20];
c5f17c1998-06-04Henrik Grubbström (Grubba) prusage_t pru; prstatus_t prs;
2213471997-09-16Henrik Grubbström (Grubba)  ],[ sprintf(proc_name, "/proc/%05d", getpid()); proc_fd = open(proc_name, O_RDONLY); ioctl(proc_fd, PIOCUSAGE, &pru); ioctl(proc_fd, PIOCSTATUS, &prs);
d203541998-06-10Fredrik Hübinette (Hubbe)  tmp=pru.pr_utime.tv_sec;
2213471997-09-16Henrik Grubbström (Grubba)  ], pike_cv_getrusage_procfs=yes , pike_cv_getrusage_procfs=no ) ])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
eb42e81997-09-16Henrik Grubbström (Grubba)  if test "$pike_cv_getrusage_procfs" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(GETRUSAGE_THROUGH_PROCFS) else AC_MSG_RESULT(no) fi
5267b71995-08-09Fredrik Hübinette (Hubbe) fi
c411dc1997-04-21Fredrik Hübinette (Hubbe) #############################################################################
bdb5091996-09-25Fredrik Hübinette (Hubbe) 
3711761998-05-18Henrik Grubbström (Grubba) AC_MSG_CHECKING(for isgraph)
b2018d1998-10-23Henrik Grubbström (Grubba) AC_CACHE_VAL(pike_cv_func_isgraph, [ AC_TRY_LINK([
3711761998-05-18Henrik Grubbström (Grubba) #include <ctype.h> ], [ return(!isgraph('A')); ], pike_cv_func_isgraph=yes, pike_cv_func_isgraph=no) ]) AC_MSG_RESULT($pike_cv_func_isgraph) if test "x$pike_cv_func_isgraph" = "xyes" ; then AC_DEFINE(HAVE_ISGRAPH) else :; fi
94cf721998-07-11Henrik Grubbström (Grubba) ############################################################################# # # __func__ is new in ISO C 9x # # It should expand to the name of the current function, and is # useful for debug. AC_MSG_CHECKING(if __func__ exists and works) AC_CACHE_VAL(pike_cv_have_working___func__, [ AC_TRY_RUN([ #ifdef HAVE_STRING_H #include <string.h> #else /* !HAVE_STRING_H */ #ifdef HAVE_STRINGS_H #include <strings.h> #endif /* HAVE_STRIGNS_H */ #endif /* HAVE_STRING_H */ int main() { exit(strcmp("main", __func__)); } ], pike_cv_have_working___func__=yes, pike_cv_have_working___func__=no, pike_cv_have_working___func__=no) ]) AC_MSG_RESULT($pike_cv_have_working___func__) if test "$pike_cv_have_working___func__" = yes; then AC_DEFINE(HAVE_WORKING___FUNC__) else :; fi
7f41951998-07-11Henrik Grubbström (Grubba) # gcc has __FUNCTION__ instead. AC_MSG_CHECKING(if __FUNCTION__ exists and works) AC_CACHE_VAL(pike_cv_have_working___FUNCTION__, [ AC_TRY_RUN([ #ifdef HAVE_STRING_H #include <string.h> #else /* !HAVE_STRING_H */ #ifdef HAVE_STRINGS_H #include <strings.h> #endif /* HAVE_STRIGNS_H */ #endif /* HAVE_STRING_H */ int main() { exit(strcmp("main", __FUNCTION__)); } ], pike_cv_have_working___FUNCTION__=yes, pike_cv_have_working___FUNCTION__=no, pike_cv_have_working___FUNCTION__=no) ]) AC_MSG_RESULT($pike_cv_have_working___FUNCTION__) if test "$pike_cv_have_working___FUNCTION__" = yes; then AC_DEFINE(HAVE_WORKING___FUNCTION__) else :; fi
3711761998-05-18Henrik Grubbström (Grubba) #############################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(for gcc function attributes)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_gcc_attributes,
5267b71995-08-09Fredrik Hübinette (Hubbe) [ AC_TRY_RUN([ #include <stdarg.h> void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2))); int sqr(int x) __attribute__ ((const)); int sqr(int x) { return x*x; } void fatal(char *foo,...) { va_list args; va_start(foo,args); printf(foo,args); va_end(args); exit(2); }
efad7a1998-10-28Henrik Grubbström (Grubba)  int main() { exit(0); }
5267b71995-08-09Fredrik Hübinette (Hubbe) 
75920f1997-12-28Fredrik Hübinette (Hubbe) ], pike_cv_gcc_attributes=yes, pike_cv_gcc_attributes=no, pike_cv_gcc_attributes=no)])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_MSG_RESULT($pike_cv_gcc_attributes) if test "$pike_cv_gcc_attributes" = yes; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_DEFINE(HAVE_FUNCTION_ATTRIBUTES) fi
68debd1997-09-12Henrik Grubbström (Grubba) AC_MSG_CHECKING(how to concatenate two symbols) AC_CACHE_VAL(pike_cv_cpp_symbol_concat, [ AC_TRY_COMPILE([
8976531997-12-22Fredrik Hübinette (Hubbe) int AABB=0;
68debd1997-09-12Henrik Grubbström (Grubba) #define CONCAT(X,Y) X##Y ], [ return CONCAT(AA,BB); ], pike_cv_cpp_symbol_concat=ANSI, [ AC_TRY_COMPILE([
8976531997-12-22Fredrik Hübinette (Hubbe) int AABB=0;
68debd1997-09-12Henrik Grubbström (Grubba) #define CONCAT(X,Y) X/**/Y ], [ return CONCAT(AA,BB); ], pike_cv_cpp_symbol_concat=KR, [ pike_cv_cpp_symbol_concat=Unknown ]) ]) ]) AC_MSG_RESULT($pike_cv_cpp_symbol_concat) case "$pike_cv_cpp_symbol_concat" in "ANSI") AC_DEFINE(HAVE_ANSI_CONCAT) ;; "KR") AC_DEFINE(HAVE_KR_CONCAT) ;; esac
c411dc1997-04-21Fredrik Hübinette (Hubbe) #############################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(how to set things nonblocking)
06983f1996-09-22Fredrik Hübinette (Hubbe) AC_CACHE_VAL(pike_cv_sys_nonblock,
5267b71995-08-09Fredrik Hübinette (Hubbe) [
59bc1b1997-01-22Bernhard Fastenrath  # Kludge needed for AmigaOS
092a0e1997-03-05Henrik Grubbström (Grubba)  if test "$pike_cv_sys_os" = "AmigaOS" ; then
59bc1b1997-01-22Bernhard Fastenrath  pike_cv_sys_nonblock=USE_FCNTL_O_NONBLOCK else AC_TRY_RUN([
5267b71995-08-09Fredrik Hübinette (Hubbe) #define TESTING #define USE_FCNTL_FNDELAY #include "$srcdir/fd_control.c"
59bc1b1997-01-22Bernhard Fastenrath ], pike_cv_sys_nonblock=USE_FCNTL_FNDELAY, AC_TRY_RUN([
5267b71995-08-09Fredrik Hübinette (Hubbe) #define TESTING #define USE_FCNTL_O_NDELAY #include "$srcdir/fd_control.c"
59bc1b1997-01-22Bernhard Fastenrath ], pike_cv_sys_nonblock=USE_FCNTL_O_NDELAY, AC_TRY_RUN([
5267b71995-08-09Fredrik Hübinette (Hubbe) #define TESTING #define USE_FCNTL_O_NONBLOCK #include "$srcdir/fd_control.c"
59bc1b1997-01-22Bernhard Fastenrath ], pike_cv_sys_nonblock=USE_FCNTL_O_NONBLOCK, AC_TRY_RUN([
5267b71995-08-09Fredrik Hübinette (Hubbe) #define TESTING #define USE_IOCTL_FIONBIO #include "$srcdir/fd_control.c"
59bc1b1997-01-22Bernhard Fastenrath ], pike_cv_sys_nonblock=USE_IOCTL_FIONBIO,
bdfb861997-12-22Fredrik Hübinette (Hubbe)  AC_TRY_RUN([ #define TESTING #define USE_IOCTLSOCKET_FIONBIO #include "$srcdir/fd_control.c" ], pike_cv_sys_nonblock=USE_IOCTLSOCKET_FIONBIO,
75920f1997-12-28Fredrik Hübinette (Hubbe) unset pike_cv_sys_nonblock, unset pike_cv_sys_nonblock), unset pike_cv_sys_nonblock), unset pike_cv_sys_nonblock), unset pike_cv_sys_nonblock), unset pike_cv_sys_nonblock)
59bc1b1997-01-22Bernhard Fastenrath  fi ])
5267b71995-08-09Fredrik Hübinette (Hubbe) 
06983f1996-09-22Fredrik Hübinette (Hubbe) if test "${pike_cv_sys_nonblock}" = ""; then
5267b71995-08-09Fredrik Hübinette (Hubbe)  AC_MSG_RESULT(none found) else
06983f1996-09-22Fredrik Hübinette (Hubbe)  AC_MSG_RESULT($pike_cv_sys_nonblock) AC_DEFINE_UNQUOTED($pike_cv_sys_nonblock)
5267b71995-08-09Fredrik Hübinette (Hubbe) fi rm -f core
bcf9461998-01-27Fredrik Hübinette (Hubbe) ##########################################################################
7b39411997-02-06Fredrik Hübinette (Hubbe)  # Set info about shared libraries. AC_SUBST(SO) AC_SUBST(LDSHARED) AC_SUBST(CCSHARED) AC_SUBST(LINKFORSHARED) # SO is the extension of shared libraries
e1195f1997-03-23Fredrik Hübinette (Hubbe) # -- usually so, sl on HP-UX
7b39411997-02-06Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(SO) if test -z "$SO" then
092a0e1997-03-05Henrik Grubbström (Grubba)  case "$pike_cv_sys_os" in
7b39411997-02-06Fredrik Hübinette (Hubbe)  hp*|HP*) SO=sl;; *) SO=so;; esac fi AC_MSG_RESULT($SO) # LDSHARED is the ld *command* used to create shared library # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 AC_MSG_CHECKING(LDSHARED)
9ab4461998-11-06Honza Petrous if test -z "$LDSHARED" ; then case "$pike_cv_sys_os" in AIX*) if test "$GCC" = yes ; then if test "`uname -r`" -ge 2 -a "`uname -v`" -ge 4 ; then LDSHARED="ld -G -bexpall" else if test "`uname -v`" -gt 4 ; then # Extra forward compatibility... # AIX 5+ LDSHARED="ld -G -bexpall"
e0a6aa1997-12-12Henrik Grubbström (Grubba)  else
9ab4461998-11-06Honza Petrous  # AIX 4.1 and earlier don't have/have unreliable # handling of dlopen et al. # # Even AIX 4.2.1 has buggy dlopen -- NEVER attempt # to dlopen a file that hasn't been linked with -G. pike_cv_sys_dynamic_loading=no LDSHARED="ld"
e0a6aa1997-12-12Henrik Grubbström (Grubba)  fi
9ab4461998-11-06Honza Petrous  fi else # Dynamic linking turned off for AIX-cc # # In addition, the dynamic loading test seems to # cause our RS/6000 to hang, which causes the # watchdog-timer to PANIC. pike_cv_sys_dynamic_loading=no LDSHARED="ld" fi ;; IRIX*) if test "$GCC" = yes ; then # egcs defaults to building -n32 objects LDSHARED="ld -shared -n32" else LDSHARED="ld -shared" fi # -woff isn't understood by ld on Irix 5. if test "`uname -r`" -ge 6 ; then LDSHARED="$LDSHARED -woff 84,85,134" else :; fi ;; SunOS*) LDSHARED="ld";; Solaris) LDSHARED="/usr/ccs/bin/ld -G";; hp*|HP*) LDSHARED="ld -b";; OSF*) LDSHARED="ld -expect_unresolved '*' -shared -msym -O3";; DYNIX/ptx*) LDSHARED="ld -G";; next) LDSHARED="$CC $CFLAGS -nostdlib -r";; Linux*) LDSHARED="$CC -shared";; GNU*) LDSHARED="ld -Bshareable";; FreeBSD*) LDSHARED="ld -Bshareable";; NetBSD) LDSHARED="ld -Bshareable";; OpenBSD*) LDSHARED="ld -Bshareable";; BSD/OS*) LDSHARED="shlicc -r";; SCO_SV*) LDSHARED="cc -G -KPIC -Wl,-Bexport";; UNIX_SV) LDSHARED="ld -G";; UnixWare) if test "$GCC" = yes ; then LDSHARED="ld -G" else LDSHARED="cc -G -KPIC -Wl,-Bexport" fi ;; Windows_NT*) LDSHARED="$CC -shared";; *) LDSHARED="ld";; esac
7b39411997-02-06Fredrik Hübinette (Hubbe) fi AC_MSG_RESULT($LDSHARED) # CCSHARED are the C *flags* used to create objects to go into a shared # library -- this is only needed for a few systems AC_MSG_CHECKING(CCSHARED)
371f751999-04-29Martin Stjernholm AC_CACHE_VAL(pike_cv_sys_ccshared,[ if test -z "$CCSHARED" ; then if test "$GCC" = yes ; then case $pike_cv_sys_os in BSD/OS*) CCSHARED="" ;; Solaris*) # The Image module runs out of symbol reference space unless we # use the large PIC model: # ld: fatal: too many symbols require `small' PIC references: # have 2205, maximum 2048 -- recompile some modules -K PIC. CCSHARED="-fPIC" ;; *) CCSHARED="-fpic" ;; esac else case $pike_cv_sys_os in hp*|HP*) CCSHARED="+z"; ;; FreeBSD*) CCSHARED="-fpic";; SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";; Solaris*) CCSHARED="-KPIC -Bdynamic";; Windows_NT*) CCSHARED="-shared" ;; esac fi
7b39411997-02-06Fredrik Hübinette (Hubbe)  fi
371f751999-04-29Martin Stjernholm  OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $CCSHARED" AC_TRY_COMPILE([], [int main() { exit(0); }], pike_cv_sys_ccshared="$CCSHARED", pike_cv_sys_ccshared='') CFLAGS="$OLD_CFLAGS" ]) CCSHARED="$pike_cv_sys_ccshared"
7b39411997-02-06Fredrik Hübinette (Hubbe) AC_MSG_RESULT($CCSHARED)
334e3d1997-04-16Fredrik Hübinette (Hubbe) AC_MSG_CHECKING(LINKFORSHARED) AC_CACHE_VAL(pike_cv_sys_linkforshared,[
7b39411997-02-06Fredrik Hübinette (Hubbe) # LINKFORSHARED are the flags passed to the $(CC) command that links
e1195f1997-03-23Fredrik Hübinette (Hubbe) # the pike executable -- this is only needed for a few systems
7b39411997-02-06Fredrik Hübinette (Hubbe) if test -z "$LINKFORSHARED" then
9649491998-02-27Fredrik Hübinette (Hubbe)  LINKFORSHARED=""
bb55f81997-03-16Fredrik Hübinette (Hubbe)  if test "$GCC" = yes ; then case $pike_cv_sys_os in
9ab4461998-11-06Honza Petrous  AIX*) LINKFORSHARED="-Wl,-bexpall -Wl,-brtl";; hp*|HP*) LINKFORSHARED="-Wl,-E";; Linux*) LINKFORSHARED="-rdynamic";; GNU*) LINKFORSHARED="-rdynamic";; next) LINKFORSHARED="-u libsys_s";; SCO_SV*) LINKFORSHARED="-fpic -Wl,-Bexport";; # What about UNIX_SV? UnixWare) LINKFORSHARED="-fpic -Wl,-Bexport";; FreeBSD) AC_TRY_RUN([int main(){exit(
9db92d1998-11-06Fredrik Hübinette (Hubbe) #ifdef __ELF__ 0 #else 1 #endif );}
9ab4461998-11-06Honza Petrous  ],LINKFORSHARED=-rdynamic) ;;
bb55f81997-03-16Fredrik Hübinette (Hubbe)  esac else
7b39411997-02-06Fredrik Hübinette (Hubbe)  case $pike_cv_sys_os in
9ab4461998-11-06Honza Petrous  AIX*) LINKFORSHARED="-Wl,-bexpall -Wl,-brtl";; hp*|HP*) LINKFORSHARED="-Wl,-E";; Linux*) LINKFORSHARED="-rdynamic";; GNU*) LINKFORSHARED="-rdynamic";; next) LINKFORSHARED="-u libsys_s";; SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; # What about UNIX_SV? UnixWare) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
7b39411997-02-06Fredrik Hübinette (Hubbe)  esac
bb55f81997-03-16Fredrik Hübinette (Hubbe)  fi
7b39411997-02-06Fredrik Hübinette (Hubbe) fi
334e3d1997-04-16Fredrik Hübinette (Hubbe)  OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LINKFORSHARED"
b298e01997-04-16Fredrik Hübinette (Hubbe)  AC_TRY_RUN([int main() { exit(0); }],
75920f1997-12-28Fredrik Hübinette (Hubbe)  pike_cv_sys_linkforshared="$LINKFORSHARED", pike_cv_sys_linkforshared='', pike_cv_sys_linkforshared='')
334e3d1997-04-16Fredrik Hübinette (Hubbe)  CFLAGS="$OLD_CFLAGS" ]) LINKFORSHARED="$pike_cv_sys_linkforshared"
7b39411997-02-06Fredrik Hübinette (Hubbe) AC_MSG_RESULT($LINKFORSHARED) #############################################################################
e1195f1997-03-23Fredrik Hübinette (Hubbe) cat >conftest.c <<EOF
a991451997-07-08Fredrik Hübinette (Hubbe) #include <stdio.h> void testfunc(void) { fprintf(stderr,"Calling testfunc2\n"); testfunc2(); fprintf(stderr,"testfunc2 returned!\n"); exit(1); }
e1195f1997-03-23Fredrik Hübinette (Hubbe) EOF AC_MSG_CHECKING(if dynamic loading works) AC_CACHE_VAL(pike_cv_sys_dynamic_loading, [
334e3d1997-04-16Fredrik Hübinette (Hubbe)  echo $CC -c $CFLAGS $CCSHARED conftest.c -o conftest.o 1>&5 $CC -c $CFLAGS $CCSHARED conftest.c -o conftest.o 1>&5 2>&5 echo $BINDIR/smartlink $LDSHARED $LDFLAGS conftest.o -o conftest.$SO 1>&5 $BINDIR/smartlink $LDSHARED $LDFLAGS conftest.o -o conftest.$SO 1>&5 2>&5 if test -f conftest.$SO ; then mv conftest.$SO myconftest.so OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LINKFORSHARED"
0809711998-02-27Marcus Comstedt  OLD_CC="$CC" case "$LD" in
633b031998-07-16Fredrik Hübinette (Hubbe)  *shlicc) CC="$BINDIR/smartlink shlicc" ;;
0809711998-02-27Marcus Comstedt  esac
e1195f1997-03-23Fredrik Hübinette (Hubbe)  AC_TRY_RUN([ #define TESTING #include "$srcdir/dynamic_load.c"
b298e01997-04-16Fredrik Hübinette (Hubbe) void testfunc2(void) { exit(0); }
75920f1997-12-28Fredrik Hübinette (Hubbe) ], pike_cv_sys_dynamic_loading=yes, pike_cv_sys_dynamic_loading=no, pike_cv_sys_dynamic_loading=no)
334e3d1997-04-16Fredrik Hübinette (Hubbe)  CFLAGS="$OLD_CFLAGS"
0809711998-02-27Marcus Comstedt  CC="$OLD_CC"
633b031998-07-16Fredrik Hübinette (Hubbe)  else
75920f1997-12-28Fredrik Hübinette (Hubbe)  pike_cv_sys_dynamic_loading=no
334e3d1997-04-16Fredrik Hübinette (Hubbe)  fi rm -f myconftest.so >/dev/null 2>/dev/null
e1195f1997-03-23Fredrik Hübinette (Hubbe) ]) AC_MSG_RESULT($pike_cv_sys_dynamic_loading) if test x$pike_cv_sys_dynamic_loading = xno ; then with_dynamic_modules=no fi
284e061998-11-09Fredrik Hübinette (Hubbe) # # Since configure doesn't always know if we will be linking with ld or cc, # We use this little code snippet to add flags to ld that would otherwise # be given automatically by $(CC) $(CFLAGS) # /Hubbe # case "x$LD" in $CC*) # Options in CFLAGS, no stuff needs to be added ;; *) LD="${LD} ${LD_FALLBACK_FLAGS-}" ;; esac
1192761999-05-26Fredrik Hübinette (Hubbe) case "x$pike_cv_sys_os" in xSolaris | xAIX) AC_DEFINE(USE_WAIT_THREAD) ;;
d0be141999-05-27Fredrik Hübinette (Hubbe)  xWindows_NT)
1192761999-05-26Fredrik Hübinette (Hubbe)  ;; *) AC_DEFINE(USE_SIGCHILD) ;; esac
284e061998-11-09Fredrik Hübinette (Hubbe) 
e1195f1997-03-23Fredrik Hübinette (Hubbe) 
6052f61998-06-06Henrik Grubbström (Grubba) ############################################################################# echo echo "Compiler summary:" echo echo "C Compiler: $CC" echo "Linker: $LD" echo "Shared linker: $LDSHARED" echo echo "Shared object extension: $SO" echo echo "CPPFLAGS: $CPPFLAGS" echo "CFLAGS: $CFLAGS" echo "CCSHARED: $CCSHARED" echo "LINKFORSHARED: $LINKFORSHARED"
e48c381998-07-29Marcus Comstedt echo "LIBGCC: $LIBGCC"
6052f61998-06-06Henrik Grubbström (Grubba) echo "WARN: $WARN" echo "OPTIMIZE: $OPTIMIZE" echo "LDFLAGS: $LDFLAGS"
c371d41998-06-07Simon Coggins echo "LIBS: $LIBS"
ab0bfa1998-07-06Martin Stjernholm echo "prefix: $prefix"
6052f61998-06-06Henrik Grubbström (Grubba) echo
e1195f1997-03-23Fredrik Hübinette (Hubbe) #############################################################################
5267b71995-08-09Fredrik Hübinette (Hubbe) 
f2328f1997-09-17Henrik Grubbström (Grubba) export LDFLAGS CFLAGS CPPFLAGS LIBS
b5d9291997-01-30Henrik Grubbström (Grubba) 
067bc11996-06-21Fredrik Hübinette (Hubbe) AC_CONFIG_SUBDIRS(modules)
5267b71995-08-09Fredrik Hübinette (Hubbe) 
c37c7e1999-03-26Fredrik Hübinette (Hubbe) default_master=$prefix/pike/%d.%d.%d/lib/master.pike
af56471996-12-03Fredrik Hübinette (Hubbe) AC_DEFINE_UNQUOTED(DEFAULT_MASTER,"$default_master")
6265aa1997-01-18Fredrik Hübinette (Hubbe) AC_SUBST_FILE(dependencies) dependencies=$srcdir/dependencies
26e7e71996-04-23Fredrik Hübinette (Hubbe) AC_SUBST(YACC)
5267b71995-08-09Fredrik Hübinette (Hubbe) AC_SUBST(INSTALL) AC_SUBST(WARN) AC_SUBST(OPTIMIZE) AC_SUBST(EXTRA_OBJS) AC_SUBST(RANLIB)
51bd9e1996-10-09Fredrik Hübinette (Hubbe) AC_SUBST(DEBUGDEF)
a4f7de1998-01-13Fredrik Hübinette (Hubbe) AC_SUBST(ac_configure_args)
8334e31999-01-29Fredrik Hübinette (Hubbe) pike_cv_prog_CC="${CC}"
5267b71995-08-09Fredrik Hübinette (Hubbe) 
4c99d11999-04-23Marcus Comstedt if test x$pike_cv_func_dlopen$ac_cv_func_dld_link$ac_cv_func_shl_load = xnonono;
4238391998-07-09Francesco Chemolli then
9649491998-02-27Fredrik Hübinette (Hubbe)  if test x$pike_cv_sys_os != xWindows_NT ; then with_dynamic_modules=no fi
7b39411997-02-06Fredrik Hübinette (Hubbe) fi if test x$with_dynamic_modules = xyes ; then dmmsrc="modules/dynamic_module_makefile.in" else dmmsrc="modules/static_module_makefile.in" fi
6fa2281997-11-04Henrik Grubbström (Grubba) AC_SUBST(dmmsrc)
7b39411997-02-06Fredrik Hübinette (Hubbe) AC_OUTPUT(Makefile modules/static_module_makefile modules/dynamic_module_makefile:$dmmsrc,[echo foo >stamp-h])
5267b71995-08-09Fredrik Hübinette (Hubbe)