From cd3fc908fa5149247e09d63036e6b838a28b2e41 Mon Sep 17 00:00:00 2001 From: Andreas Kupries Date: Thu, 6 Feb 2003 23:09:32 +0000 Subject: [PATCH] * tclconfig/tcl.m4: Added SC_TCL_EARLY_FLAGS and * configure.in: SC_TCL64BIT_FLAGS, copied from the Tcl * configure: configuration. Usage prevents mismatch between tcl core and tclvfs with regard to the selected types for wide integer and Tcl_StatBuf. Regenerated configure. --- ChangeLog | 9 ++ configure | 387 ++++++++++++++++++++++++++++++++++++++++------- configure.in | 5 + tclconfig/tcl.m4 | 113 ++++++++++++++ 4 files changed, 462 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b040e8..21320d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-02-06 Andreas Kupries + + * tclconfig/tcl.m4: Added SC_TCL_EARLY_FLAGS and + * configure.in: SC_TCL64BIT_FLAGS, copied from the Tcl + * configure: configuration. Usage prevents mismatch + between tcl core and tclvfs with regard + to the selected types for wide integer + and Tcl_StatBuf. Regenerated configure. + 2003-02-04 Vince Darley * doc/vfs.n: diff --git a/configure b/configure index eaaf0da..0d1f91a 100755 --- a/configure +++ b/configure @@ -566,7 +566,7 @@ CONFIGDIR=${srcdir}/tclconfig PACKAGE=vfs MAJOR_VERSION=1 -MINOR_VERSION=0 +MINOR_VERSION=2 PATCHLEVEL= VERSION=${MAJOR_VERSION}.${MINOR_VERSION}${PATCHLEVEL} @@ -1783,8 +1783,291 @@ EOF + + echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 +echo "configure:1789: checking for required early compiler flags" >&5 + tcl_flags="" + + if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +char *p = (char *)strtoll; char *q = (char *)strtoull; +; return 0; } +EOF +if { (eval echo configure:1803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__isoc99_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +int main() { +char *p = (char *)strtoll; char *q = (char *)strtoull; +; return 0; } +EOF +if { (eval echo configure:1819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__isoc99_source=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_flag__isoc99_source=no +fi +rm -f conftest* +fi +rm -f conftest* +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define _ISOC99_SOURCE 1 +EOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +struct stat64 buf; int i = stat64("/", &buf); +; return 0; } +EOF +if { (eval echo configure:1852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__largefile64_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +int main() { +struct stat64 buf; int i = stat64("/", &buf); +; return 0; } +EOF +if { (eval echo configure:1868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_flag__largefile64_source=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_flag__largefile64_source=no +fi +rm -f conftest* +fi +rm -f conftest* +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define _LARGEFILE64_SOURCE 1 +EOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + if test "x${tcl_flags}" = "x" ; then + echo "$ac_t""none" 1>&6 + else + echo "$ac_t""${tcl_flags}" 1>&6 + fi + + echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 +echo "configure:1896: checking for 64-bit integer type" >&5 + if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_type_64bit=__int64 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_type_64bit="long long" +fi +rm -f conftest* + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < + int main() {exit(!(sizeof(${tcl_type_64bit}) > sizeof(long)));} + +EOF +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + : +fi +rm -fr conftest* +fi + +fi + + if test "${tcl_cv_type_64bit}" = none ; then + cat >> confdefs.h <<\EOF +#define TCL_WIDE_INT_IS_LONG 1 +EOF + + echo "$ac_t""using long" 1>&6 + else + cat >> confdefs.h <&6 + + # Now check for auxiliary declarations + echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 +echo "configure:1963: checking for struct dirent64" >&5 + if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include +int main() { +struct dirent64 p; +; return 0; } +EOF +if { (eval echo configure:1977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_struct_dirent64=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_struct_dirent64=no +fi +rm -f conftest* +fi + + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_DIRENT64 1 +EOF + + fi + echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 + + echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 +echo "configure:1998: checking for struct stat64" >&5 + if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +struct stat64 p; + +; return 0; } +EOF +if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_struct_stat64=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_struct_stat64=no +fi +rm -f conftest* +fi + + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_STAT64 1 +EOF + + fi + echo "$ac_t""${tcl_cv_struct_stat64}" 1>&6 + + echo $ac_n "checking for off64_t""... $ac_c" 1>&6 +echo "configure:2033: checking for off64_t" >&5 + if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +off64_t offset; + +; return 0; } +EOF +if { (eval echo configure:2047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_cv_type_off64_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_type_off64_t=no +fi +rm -f conftest* +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_TYPE_OFF64_T 1 +EOF + + fi + echo "$ac_t""${tcl_cv_type_off64_t}" 1>&6 + fi + + + echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1788: checking how to build libraries" >&5 +echo "configure:2071: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1816,7 +2099,7 @@ EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1820: checking how to run the C preprocessor" >&5 +echo "configure:2103: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1831,13 +2114,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1848,13 +2131,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1865,13 +2148,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1904,7 +2187,7 @@ echo "$ac_t""$CPP" 1>&6 # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is enabled""... $ac_c" 1>&6 -echo "configure:1908: checking if 64bit support is enabled" >&5 +echo "configure:2191: checking if 64bit support is enabled" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1918,7 +2201,7 @@ fi # Step 0.b: Enable Solaris 64 bit VIS support? echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 -echo "configure:1922: checking if 64bit Sparc VIS support is requested" >&5 +echo "configure:2205: checking if 64bit Sparc VIS support is requested" >&5 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" @@ -1939,7 +2222,7 @@ fi # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:1943: checking system version (for dynamic loading)" >&5 +echo "configure:2226: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -1968,7 +2251,7 @@ echo "configure:1943: checking system version (for dynamic loading)" >&5 # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1972: checking for dlopen in -ldl" >&5 +echo "configure:2255: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1976,7 +2259,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2031,7 +2314,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2035: checking for $ac_word" >&5 +echo "configure:2318: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2188,7 +2471,7 @@ fi # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:2192: checking for gettimeofday in -lbsd" >&5 +echo "configure:2475: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2196,7 +2479,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2289,7 +2572,7 @@ EOF SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2293: checking for shl_load in -ldld" >&5 +echo "configure:2576: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2297,7 +2580,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2368,7 +2651,7 @@ fi HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2372: checking for shl_load in -ldld" >&5 +echo "configure:2655: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2376,7 +2659,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2507,17 +2790,17 @@ fi else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2511: checking for dld.h" >&5 +echo "configure:2794: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2574,17 +2857,17 @@ fi else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2578: checking for dld.h" >&5 +echo "configure:2861: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2639,17 +2922,17 @@ fi # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2643: checking for dlfcn.h" >&5 +echo "configure:2926: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2676,9 +2959,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2680: checking for ELF" >&5 +echo "configure:2963: checking for ELF" >&5 cat > conftest.$ac_ext <&5 | else rm -rf conftest* echo "$ac_t""no" 1>&6 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.2' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' fi rm -f conftest* @@ -2900,7 +3183,7 @@ EOF # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.2' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; @@ -3013,17 +3296,17 @@ EOF # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 -echo "configure:3017: checking for ld accepts -Bexport flag" >&5 +echo "configure:3300: checking for ld accepts -Bexport flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-Bexport" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -3069,9 +3352,9 @@ rm -f conftest* if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:3073: checking sys/exec.h" >&5 +echo "configure:3356: checking sys/exec.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3089,7 +3372,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3107,9 +3390,9 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3111: checking a.out.h" >&5 +echo "configure:3394: checking a.out.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3127,7 +3410,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3145,9 +3428,9 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3149: checking sys/exec_aout.h" >&5 +echo "configure:3432: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3165,7 +3448,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3285,7 +3568,7 @@ fi fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:3289: checking for build with symbols" >&5 +echo "configure:3572: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -3403,7 +3686,7 @@ EOF echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:3407: checking for tclsh" >&5 +echo "configure:3690: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/configure.in b/configure.in index 1942a56..756e8e0 100644 --- a/configure.in +++ b/configure.in @@ -82,6 +82,11 @@ AC_SUBST(CLEANFILES) TEA_ENABLE_THREADS + +SC_TCL_EARLY_FLAGS +SC_TCL_64BIT_FLAGS + + TEA_ENABLE_SHARED TEA_CONFIG_CFLAGS diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4 index ee80de9..ab2dfdc 100644 --- a/tclconfig/tcl.m4 +++ b/tclconfig/tcl.m4 @@ -3172,3 +3172,116 @@ AC_DEFUN(TEA_LOAD_CONFIG, [ AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) + +#-------------------------------------------------------------------- +# SC_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# +#-------------------------------------------------------------------- + +AC_DEFUN(SC_TCL_EARLY_FLAG,[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1) + tcl_flags="$tcl_flags $1" + fi]) + +AC_DEFUN(SC_TCL_EARLY_FLAGS,[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT(none) + else + AC_MSG_RESULT(${tcl_flags}) + fi]) + +#-------------------------------------------------------------------- +# SC_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN(SC_TCL_64BIT_FLAGS, [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_RUN([#include + int main() {exit(!(sizeof(]${tcl_type_64bit}[) > sizeof(long)));} + ], tcl_cv_type_64bit=${tcl_type_64bit},:,:)]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG) + AC_MSG_RESULT(using long) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}) + AC_MSG_RESULT(${tcl_cv_type_64bit}) + + # Now check for auxiliary declarations + AC_MSG_CHECKING([for struct dirent64]) + AC_CACHE_VAL(tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64) + fi + AC_MSG_RESULT(${tcl_cv_struct_dirent64}) + + AC_MSG_CHECKING([for struct stat64]) + AC_CACHE_VAL(tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64) + fi + AC_MSG_RESULT(${tcl_cv_struct_stat64}) + + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + if test "x${tcl_cv_type_off64_t}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T) + fi + AC_MSG_RESULT(${tcl_cv_type_off64_t}) + fi]) -- 2.23.0