From 21191c3eede6868a5cc5d7a8dd92ebf00890a1f6 Mon Sep 17 00:00:00 2001 From: pavet Date: Thu, 7 Oct 2004 10:16:40 +0000 Subject: passage v0.6 swig 1.3.x --- aclocal.m4 | 526 +++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 339 insertions(+), 187 deletions(-) (limited to 'aclocal.m4') diff --git a/aclocal.m4 b/aclocal.m4 index 261d5a4..37f59ca 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1921,9 +1921,11 @@ fi PYTHON_INCLUDEDIR=$mv_tmp/include PYTHON_LIBDIR=$mv_tmp/lib +PYTHON_COMPILER=$PYTHON_LIBDIR/python$PYTHON_VERSION/compileall.py AC_SUBST(PYTHON_INCLUDEDIR) AC_SUBST(PYTHON_LIBDIR) +AC_SUBST(PYTHON_COMPILER) dnl # A FAIRE: dnl # S'assurer de bien utiliser cette version de la bibliotheque python! @@ -2262,6 +2264,7 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR +# TCL_INC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ @@ -2286,6 +2289,7 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [ AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) + AC_SUBST(TCL_INC_DIR) AC_SUBST(TCL_LIB_FILE) ]) @@ -2317,6 +2321,7 @@ AC_DEFUN(SC_LOAD_TKCONFIG, [ AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) + AC_SUBST(TK_LIB_DIR) AC_SUBST(TK_LIB_FILE) ]) @@ -2372,7 +2377,7 @@ AC_DEFUN(SC_ENABLE_GCC, [ AC_DEFUN(SC_ENABLE_SHARED, [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --disable-shared build and link without shared libraries [--disable-shared]], + [ --enable-shared build and link with shared libraries [--enable-shared]], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then @@ -2411,6 +2416,7 @@ AC_DEFUN(SC_ENABLE_SHARED, [ # Defines the following vars: # TCL_THREADS # _REENTRANT +# _THREAD_SAFE # #------------------------------------------------------------------------ @@ -2424,20 +2430,42 @@ AC_DEFUN(SC_ENABLE_THREADS, [ TCL_THREADS=1 AC_DEFINE(TCL_THREADS) AC_DEFINE(_REENTRANT) - + AC_DEFINE(_THREAD_SAFE) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread,__pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + fi + if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else - TCL_THREADS=0 - AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") + AC_CHECK_LIB(pthreads,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + TCL_THREADS=0 + AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") + fi + fi fi + + # Does the pthread-implementation provide + # 'pthread_attr_setstacksize' ? + + AC_CHECK_FUNCS(pthread_attr_setstacksize) else TCL_THREADS=0 - AC_MSG_RESULT(no (default)) + AC_MSG_RESULT([no (default)]) fi - ]) #------------------------------------------------------------------------ @@ -2470,15 +2498,15 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--enable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then - CFLAGS_DEFAULT='${CFLAGS_DEBUG}' - LDFLAGS_DEFAULT='${LDFLAGS_DEBUG}' + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" DBGX=g AC_MSG_RESULT([yes]) else - CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}' - LDFLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}' + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" DBGX="" AC_MSG_RESULT([no]) fi @@ -2567,19 +2595,32 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_DEFUN(SC_CONFIG_CFLAGS, [ - # Step 0: Enable 64 bit support? + # Step 0.a: Enable 64 bit support? - AC_MSG_CHECKING([if 64bit support is enabled]) - AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support],,enableval="no") + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") if test "$enableval" = "yes"; then - AC_MSG_RESULT(Will compile with 64bit support) do64bit=yes else do64bit=no fi AC_MSG_RESULT($do64bit) - + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") + + if test "$enableval" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + do64bitVIS=yes + else + do64bitVIS=no + fi + AC_MSG_RESULT($do64bitVIS) + # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. @@ -2606,6 +2647,15 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ fi fi + AC_MSG_CHECKING([if gcc is being used]) + if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + using_gcc="yes" + else + using_gcc="no" + fi + + AC_MSG_RESULT([$using_gcc ($CC)]) + # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. @@ -2622,43 +2672,103 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O2 + CFLAGS_OPTIMIZE=-O + if test "$using_gcc" = "yes" ; then + CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" STLIB_LD="ar cr" case $system in - AIX-4.[[2-9]]) + AIX-5.*) + if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then + # AIX requires the _r compiler when gcc isn't being used + if test "${CC}" != "cc_r" ; then + CC=${CC}_r + fi + AC_MSG_RESULT(Using $CC for compiling with threads) + fi + # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" - DL_LIBS="-ldl" + DL_OBJS="tclLoadDl.o" + # AIX-5 has dl* in libc.so + DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + if test "$using_gcc" = "yes" ; then + LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + + if test "$do64bit" = "yes" ; then + if test "$using_gcc" = "no" ; then + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + else + AC_MSG_WARN("64bit mode not supported with GCC on $system") + fi + fi ;; AIX-*) + if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then + # AIX requires the _r compiler when gcc isn't being used + if test "${CC}" != "cc_r" ; then + CC=${CC}_r + fi + AC_MSG_RESULT(Using $CC for compiling with threads) + fi SHLIB_CFLAGS="" SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" - LIBOBJS="$LIBOBJS tclLoadAix.o" - DL_LIBS="-lld" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + LIBOBJS="$LIBOBJS tclLoadAix.o" + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ) + fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2668,7 +2778,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS="" @@ -2678,7 +2788,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2707,15 +2817,26 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; - IRIX-5.*|IRIX-6.*|IRIX64-6.5*) + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + EXTRA_CFLAGS="" + LDFLAGS="" + ;; + IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then EXTRA_CFLAGS="-mabi=n32" LDFLAGS="-mabi=n32" else @@ -2736,7 +2857,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="ld -32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' @@ -2754,10 +2875,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-rdynamic" - #LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='' else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" @@ -2798,7 +2919,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2808,7 +2929,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" @@ -2816,15 +2937,26 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -Bshareable -x" + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS="" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + AC_MSG_CHECKING(for ELF) + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], + AC_MSG_RESULT(yes) + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.so', + AC_MSG_RESULT(no) + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.so.1.0' + ) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" @@ -2836,22 +2968,33 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="-export-dynamic" + LD_SEARCH_FLAGS="" # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -Bshareable -x" + Rhapsody-*|Darwin-*) + SHLIB_CFLAGS="-fno-common" + SHLIB_LD="cc -dynamiclib \${LDFLAGS} -compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE}" SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="" + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" + CFLAGS_OPTIMIZE="-O3" ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -2881,11 +3024,11 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fpic" + SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2896,10 +3039,25 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD='ld -shared -expect_unresolved "*"' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="-DHAVE_TZSET -std1" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread" + LDFLAGS="-pthread" + else + LIBS=`echo $LIBS | sed s/-lpthreads//` + LIBS="$LIBS -lpthread -lmach -lexc" + fi + fi + ;; RISCos-*) SHLIB_CFLAGS="-G 0" @@ -2912,16 +3070,21 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - SHLIB_CFLAGS="-Kpic -belf" + if test "$using_gcc" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="-melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="-belf -Wl,-Bexport" + fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="-belf -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) @@ -2929,7 +3092,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2939,7 +3102,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' @@ -2962,7 +3125,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -2972,20 +3135,24 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" - do64bit_ok=no if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then - do64bit_ok=yes - EXTRA_CFLAGS="-xarch=v9" - LDFLAGS="-xarch=v9" - else - AC_MSG_WARN("64bit mode not supported using GCC on $system") + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$using_gcc" = "no" ; then + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + EXTRA_CFLAGS="-xarch=v9a" + LDFLAGS="-xarch=v9a" + else + EXTRA_CFLAGS="-xarch=v9" + LDFLAGS="-xarch=v9" + fi + else + AC_MSG_WARN("64bit mode not supported with GCC on $system") + fi + else + AC_MSG_WARN("64bit mode only supported sparcv9 system") fi - else - AC_MSG_WARN("64bit mode only supported sparcv9 system") - fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's @@ -2993,9 +3160,9 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' @@ -3010,13 +3177,16 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="-DHAVE_TZSET -std1" + fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. @@ -3036,7 +3206,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN("64bit support being disabled -- not supported on this platform") + AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform") fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic @@ -3124,7 +3294,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ DL_OBJS="" fi - if test "x$SHLIB_LD" != "x" ; then + if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" @@ -3144,7 +3314,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then case $system in AIX-*) ;; @@ -3154,8 +3324,12 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; + Rhapsody-*|Darwin-*) + ;; RISCos-*) ;; + SCO_SV-3.2*) + ;; ULTRIX-4.*) ;; *) @@ -3166,7 +3340,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ fi if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}.1' + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' @@ -3175,6 +3349,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) ]) #-------------------------------------------------------------------- @@ -3245,11 +3420,71 @@ main() } return 1; }], tk_ok=sgtty, tk_ok=none, tk_ok=none) + + if test $tk_ok = sgtty; then + AC_DEFINE(USE_SGTTY) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tk_ok=termios, tk_ok=no, tk_ok=no) + + if test $tk_ok = termios; then + AC_DEFINE(USE_TERMIOS) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tk_ok=termio, tk_ok=no, tk_ok=no) + + if test $tk_ok = termio; then + AC_DEFINE(USE_TERMIO) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tk_ok=sgtty, tk_ok=none, tk_ok=none) + if test $tk_ok = sgtty; then AC_DEFINE(USE_SGTTY) fi fi fi + fi + fi + fi AC_MSG_RESULT($tk_ok) ]) @@ -3313,10 +3548,10 @@ closedir(d); fi AC_MSG_RESULT($tcl_ok) - AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H)) - AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H)) - AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H)) - AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H)) + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)]) + AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) @@ -3335,8 +3570,8 @@ closedir(d); AC_DEFINE(NO_STRING_H) fi - AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H)) - AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H)) + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). @@ -3498,68 +3733,6 @@ AC_DEFUN(SC_BLOCKING_STYLE, [ ]) #-------------------------------------------------------------------- -# SC_HAVE_VFORK -# -# Check to see whether the system provides a vfork kernel call. -# If not, then use fork instead. Also, check for a problem with -# vforks and signals that can cause core dumps if a vforked child -# resets a signal handler. If the problem exists, then use fork -# instead of vfork. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# vfork (=fork) -# -#-------------------------------------------------------------------- - -AC_DEFUN(SC_HAVE_VFORK, [ - AC_TYPE_SIGNAL() - AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0) - if test "$tcl_ok" = 1; then - AC_MSG_CHECKING([vfork/signal bug]); - AC_TRY_RUN([ -#include -#include -#include -int gotSignal = 0; -sigProc(sig) - int sig; -{ - gotSignal = 1; -} -main() -{ - int pid, sts; - (void) signal(SIGCHLD, sigProc); - pid = vfork(); - if (pid < 0) { - exit(1); - } else if (pid == 0) { - (void) signal(SIGCHLD, SIG_DFL); - _exit(0); - } else { - (void) wait(&sts); - } - exit((gotSignal) ? 0 : 1); -}], tcl_ok=1, tcl_ok=0, tcl_ok=0) - - if test "$tcl_ok" = 1; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT([buggy, using fork instead]) - fi - fi - rm -f core - if test "$tcl_ok" = 0; then - AC_DEFINE(vfork, fork) - fi -]) - -#-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures @@ -3624,19 +3797,6 @@ AC_DEFUN(SC_TIME_HANDLER, [ AC_MSG_RESULT(no)) fi - # - # AIX does not have a timezone field in struct tm. When the AIX bsd - # library is used, the timezone global and the gettimeofday methods are - # to be avoided for timezone deduction instead, we deduce the timezone - # by comparing the localtime result on a known GMT value. - # - - if test "`uname -s`" = "AIX" ; then - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) - if test $libbsd = yes; then - AC_DEFINE(USE_DELTA_FOR_TZ) - fi - fi ]) #-------------------------------------------------------------------- @@ -3646,6 +3806,8 @@ AC_DEFUN(SC_TIME_HANDLER, [ # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none @@ -3658,25 +3820,31 @@ AC_DEFUN(SC_TIME_HANDLER, [ #-------------------------------------------------------------------- AC_DEFUN(SC_BUGGY_STRTOD, [ - AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0) - if test "$tk_strtod" = 1; then - AC_MSG_CHECKING([for Solaris 2.4 strtod bug]) + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) AC_TRY_RUN([ extern double strtod(); int main() { - char *string = "NaN"; + char *string = "NaN", *spaceString = " "; char *term; - strtod(string, &term); + double value; + value = strtod(string, &term); if ((term != string) && (term[-1] == 0)) { exit(1); } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } exit(0); - }], tk_ok=1, tk_ok=0, tk_ok=0) - if test "$tk_ok" = 1; then + }], tcl_ok=1, tcl_ok=0, tcl_ok=0) + if test "$tcl_ok" = 1; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(buggy) + LIBOBJS="$LIBOBJS fixstrtod.o" AC_DEFINE(strtod, fixstrtod) fi fi @@ -3721,29 +3889,12 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- - # On AIX systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - #-------------------------------------------------------------------- - - libbsd=no - if test "`uname -s`" = "AIX" ; then - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - fi - fi - - - #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H)) + AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. @@ -3766,15 +3917,16 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then - AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tcl_checkBoth=1) + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi - AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, - [LIBS="$LIBS -lnsl"])) + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call SC_CONFIG_CFLAGS -- cgit v1.1