From c918210ee55ae018cc40f8a8b411feed5af07de4 Mon Sep 17 00:00:00 2001 From: das Date: Sat, 30 Jul 2005 07:58:11 +0000 Subject: * unix/configure, unix/tcl.m4: revert 2005-07-28 change. * unix/tclLoadDyld.c (TclpDlopen, TclpLoadMemory): workarounds for bugs/changes in behaviour in Mac OS X 10.4 Tiger, sync formatting changes from HEAD. --- ChangeLog | 8 + unix/configure | 512 +++++++++++++++++++++++---------------------- unix/tcl.m4 | 4 +- unix/tclLoadDyld.c | 594 +++++++++++++++++++++++++++++------------------------ 4 files changed, 595 insertions(+), 523 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b1b01d..f96fcbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-07-30 Daniel Steffen + + * unix/configure, unix/tcl.m4: revert 2005-07-28 change. + + * unix/tclLoadDyld.c (TclpDlopen, TclpLoadMemory): workarounds + for bugs/changes in behaviour in Mac OS X 10.4 Tiger, sync + formatting changes from HEAD. + 2005-07-29 Donal K. Fellows * generic/tclCmdIL.c (InfoGlobalsCmd): Even in high-speed mode, diff --git a/unix/configure b/unix/configure index fcce633..6da3455 100755 --- a/unix/configure +++ b/unix/configure @@ -3110,21 +3110,19 @@ EOF #define TCL_DEFAULT_ENCODING "utf-8" EOF - if test "$SHARED_BUILD" = "1" ; then - cat >> confdefs.h <<\EOF + cat >> confdefs.h <<\EOF #define TCL_LOAD_FROM_MEMORY 1 EOF - fi # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: echo $ac_n "checking for realpath""... $ac_c" 1>&6 -echo "configure:3123: checking for realpath" >&5 +echo "configure:3121: checking for realpath" >&5 if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_realpath=yes" else @@ -3458,17 +3456,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:3462: checking for ld accepts -Bexport flag" >&5 +echo "configure:3460: 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:3470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -3509,9 +3507,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:3513: checking sys/exec.h" >&5 +echo "configure:3511: checking sys/exec.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3529,7 +3527,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3547,9 +3545,9 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3551: checking a.out.h" >&5 +echo "configure:3549: checking a.out.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3567,7 +3565,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3585,9 +3583,9 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3589: checking sys/exec_aout.h" >&5 +echo "configure:3587: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3605,7 +3603,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3756,7 +3754,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:3760: checking for build with symbols" >&5 +echo "configure:3758: 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" @@ -3817,21 +3815,21 @@ TCL_DBGX=${DBGX} echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 -echo "configure:3821: checking for required early compiler flags" >&5 +echo "configure:3819: 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:3835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=no else @@ -3839,7 +3837,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -3847,7 +3845,7 @@ int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:3851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=yes else @@ -3873,14 +3871,14 @@ EOF 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:3884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=no else @@ -3888,7 +3886,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -3896,7 +3894,7 @@ int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:3900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=yes else @@ -3925,7 +3923,7 @@ EOF echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 -echo "configure:3929: checking for 64-bit integer type" >&5 +echo "configure:3927: 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 @@ -3933,14 +3931,14 @@ 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 +if { (eval echo configure:3942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_type_64bit=__int64 else @@ -3954,7 +3952,7 @@ rm -f conftest* # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_64bit=${tcl_type_64bit} else @@ -3988,13 +3986,13 @@ EOF # Now check for auxiliary declarations echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 -echo "configure:3992: checking for struct dirent64" >&5 +echo "configure:3990: 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 @@ -4002,7 +4000,7 @@ int main() { struct dirent64 p; ; return 0; } EOF -if { (eval echo configure:4006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_dirent64=yes else @@ -4023,13 +4021,13 @@ EOF echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:4027: checking for struct stat64" >&5 +echo "configure:4025: 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() { @@ -4037,7 +4035,7 @@ struct stat64 p; ; return 0; } EOF -if { (eval echo configure:4041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_stat64=yes else @@ -4060,12 +4058,12 @@ EOF for ac_func in open64 lseek64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4064: checking for $ac_func" >&5 +echo "configure:4062: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4113,13 +4111,13 @@ fi done echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:4117: checking for off64_t" >&5 +echo "configure:4115: 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() { @@ -4127,7 +4125,7 @@ off64_t offset; ; return 0; } EOF -if { (eval echo configure:4131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_off64_t=yes else @@ -4158,14 +4156,14 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4162: checking whether byte ordering is bigendian" >&5 +echo "configure:4160: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4176,11 +4174,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4191,7 +4189,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4211,7 +4209,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4257,12 +4255,12 @@ fi for ac_func in getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4261: checking for $ac_func" >&5 +echo "configure:4259: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4319,12 +4317,12 @@ done for ac_func in opendir strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4323: checking for $ac_func" >&5 +echo "configure:4321: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4377,12 +4375,12 @@ done for ac_func in strtol strtoll strtoull tmpnam waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4381: checking for $ac_func" >&5 +echo "configure:4379: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4432,12 +4430,12 @@ done echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:4436: checking for strerror" >&5 +echo "configure:4434: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -4484,12 +4482,12 @@ EOF fi echo $ac_n "checking for getwd""... $ac_c" 1>&6 -echo "configure:4488: checking for getwd" >&5 +echo "configure:4486: checking for getwd" >&5 if eval "test \"`echo '$''{'ac_cv_func_getwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getwd=yes" else @@ -4536,12 +4534,12 @@ EOF fi echo $ac_n "checking for wait3""... $ac_c" 1>&6 -echo "configure:4540: checking for wait3" >&5 +echo "configure:4538: checking for wait3" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_wait3=yes" else @@ -4588,12 +4586,12 @@ EOF fi echo $ac_n "checking for uname""... $ac_c" 1>&6 -echo "configure:4592: checking for uname" >&5 +echo "configure:4590: checking for uname" >&5 if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_uname=yes" else @@ -4640,12 +4638,12 @@ EOF fi echo $ac_n "checking for realpath""... $ac_c" 1>&6 -echo "configure:4644: checking for realpath" >&5 +echo "configure:4642: checking for realpath" >&5 if eval "test \"`echo '$''{'ac_cv_func_realpath'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_realpath=yes" else @@ -4703,12 +4701,12 @@ fi echo $ac_n "checking dirent.h""... $ac_c" 1>&6 -echo "configure:4707: checking dirent.h" >&5 +echo "configure:4705: checking dirent.h" >&5 if eval "test \"`echo '$''{'tcl_cv_dirent_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4734,7 +4732,7 @@ closedir(d); ; return 0; } EOF -if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_dirent_h=yes else @@ -4757,17 +4755,17 @@ EOF echo "$ac_t""$tcl_ok" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:4761: checking for errno.h" >&5 +echo "configure:4759: checking for errno.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:4771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4769: \"$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* @@ -4794,17 +4792,17 @@ fi ac_safe=`echo "float.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for float.h""... $ac_c" 1>&6 -echo "configure:4798: checking for float.h" >&5 +echo "configure:4796: checking for float.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:4808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4806: \"$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* @@ -4831,17 +4829,17 @@ fi ac_safe=`echo "values.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for values.h""... $ac_c" 1>&6 -echo "configure:4835: checking for values.h" >&5 +echo "configure:4833: checking for values.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:4845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4843: \"$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* @@ -4868,17 +4866,17 @@ fi ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for limits.h""... $ac_c" 1>&6 -echo "configure:4872: checking for limits.h" >&5 +echo "configure:4870: checking for limits.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:4882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4880: \"$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* @@ -4908,17 +4906,17 @@ fi ac_safe=`echo "stdlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stdlib.h""... $ac_c" 1>&6 -echo "configure:4912: checking for stdlib.h" >&5 +echo "configure:4910: checking for stdlib.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:4922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4920: \"$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* @@ -4941,7 +4939,7 @@ tcl_ok=0 fi cat > conftest.$ac_ext < EOF @@ -4955,7 +4953,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4969,7 +4967,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4990,17 +4988,17 @@ EOF fi ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for string.h""... $ac_c" 1>&6 -echo "configure:4994: checking for string.h" >&5 +echo "configure:4992: checking for string.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:5004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5002: \"$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* @@ -5023,7 +5021,7 @@ tcl_ok=0 fi cat > conftest.$ac_ext < EOF @@ -5037,7 +5035,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -5063,17 +5061,17 @@ EOF ac_safe=`echo "sys/wait.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/wait.h""... $ac_c" 1>&6 -echo "configure:5067: checking for sys/wait.h" >&5 +echo "configure:5065: checking for sys/wait.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:5077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5075: \"$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* @@ -5100,17 +5098,17 @@ fi ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5104: checking for dlfcn.h" >&5 +echo "configure:5102: 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:5114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5112: \"$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* @@ -5142,17 +5140,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5146: checking for $ac_hdr" >&5 +echo "configure:5144: checking for $ac_hdr" >&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:5156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5154: \"$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* @@ -5192,17 +5190,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5196: checking for $ac_hdr" >&5 +echo "configure:5194: checking for $ac_hdr" >&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:5206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5204: \"$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* @@ -5229,7 +5227,7 @@ fi done echo $ac_n "checking termios vs. termio vs. sgtty""... $ac_c" 1>&6 -echo "configure:5233: checking termios vs. termio vs. sgtty" >&5 +echo "configure:5231: checking termios vs. termio vs. sgtty" >&5 if eval "test \"`echo '$''{'tcl_cv_api_serial'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5238,7 +5236,7 @@ else tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5253,7 +5251,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termios else @@ -5270,7 +5268,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5284,7 +5282,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termio else @@ -5302,7 +5300,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5317,7 +5315,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=sgtty else @@ -5335,7 +5333,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5352,7 +5350,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termios else @@ -5370,7 +5368,7 @@ fi tcl_cv_api_serial=no else cat > conftest.$ac_ext < @@ -5386,7 +5384,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=termio else @@ -5404,7 +5402,7 @@ fi tcl_cv_api_serial=none else cat > conftest.$ac_ext < @@ -5421,7 +5419,7 @@ int main() { return 1; } EOF -if { (eval echo configure:5425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_api_serial=sgtty else @@ -5464,19 +5462,19 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for fd_set in sys/types""... $ac_c" 1>&6 -echo "configure:5468: checking for fd_set in sys/types" >&5 +echo "configure:5466: checking for fd_set in sys/types" >&5 if eval "test \"`echo '$''{'tcl_cv_type_fd_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fd_set readMask, writeMask; ; return 0; } EOF -if { (eval echo configure:5480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_fd_set=yes else @@ -5492,12 +5490,12 @@ echo "$ac_t""$tcl_cv_type_fd_set" 1>&6 tk_ok=$tcl_cv_type_fd_set if test $tcl_cv_type_fd_set = no; then echo $ac_n "checking for fd_mask in sys/select""... $ac_c" 1>&6 -echo "configure:5496: checking for fd_mask in sys/select" >&5 +echo "configure:5494: checking for fd_mask in sys/select" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -5534,12 +5532,12 @@ fi #------------------------------------------------------------------------------ echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5538: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5536: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5547,7 +5545,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5572,17 +5570,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5576: checking for $ac_hdr" >&5 +echo "configure:5574: checking for $ac_hdr" >&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:5586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5584: \"$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* @@ -5609,12 +5607,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5613: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5611: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5623,7 +5621,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5644,12 +5642,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5648: checking for tm_zone in struct tm" >&5 +echo "configure:5646: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -5657,7 +5655,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5677,12 +5675,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5681: checking for tzname" >&5 +echo "configure:5679: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -5692,7 +5690,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5717,12 +5715,12 @@ fi for ac_func in gmtime_r localtime_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5721: checking for $ac_func" >&5 +echo "configure:5719: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5771,19 +5769,19 @@ done echo $ac_n "checking tm_tzadj in struct tm""... $ac_c" 1>&6 -echo "configure:5775: checking tm_tzadj in struct tm" >&5 +echo "configure:5773: checking tm_tzadj in struct tm" >&5 if eval "test \"`echo '$''{'tcl_cv_member_tm_tzadj'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct tm tm; tm.tm_tzadj; ; return 0; } EOF -if { (eval echo configure:5787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_member_tm_tzadj=yes else @@ -5804,19 +5802,19 @@ EOF fi echo $ac_n "checking tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:5808: checking tm_gmtoff in struct tm" >&5 +echo "configure:5806: checking tm_gmtoff in struct tm" >&5 if eval "test \"`echo '$''{'tcl_cv_member_tm_gmtoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct tm tm; tm.tm_gmtoff; ; return 0; } EOF -if { (eval echo configure:5820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_member_tm_gmtoff=yes else @@ -5841,12 +5839,12 @@ EOF # (like convex) have timezone functions, etc. # echo $ac_n "checking long timezone variable""... $ac_c" 1>&6 -echo "configure:5845: checking long timezone variable" >&5 +echo "configure:5843: checking long timezone variable" >&5 if eval "test \"`echo '$''{'tcl_cv_var_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -5855,7 +5853,7 @@ extern long timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:5859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_timezone_long=yes else @@ -5878,12 +5876,12 @@ EOF # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # echo $ac_n "checking time_t timezone variable""... $ac_c" 1>&6 -echo "configure:5882: checking time_t timezone variable" >&5 +echo "configure:5880: checking time_t timezone variable" >&5 if eval "test \"`echo '$''{'tcl_cv_timezone_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -5892,7 +5890,7 @@ extern time_t timezone; exit (0); ; return 0; } EOF -if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_timezone_time=yes else @@ -5919,12 +5917,12 @@ EOF # in struct stat. But we might be able to use fstatfs instead. #-------------------------------------------------------------------- echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:5923: checking for st_blksize in struct stat" >&5 +echo "configure:5921: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5932,7 +5930,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:5936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -5953,12 +5951,12 @@ EOF fi echo $ac_n "checking for fstatfs""... $ac_c" 1>&6 -echo "configure:5957: checking for fstatfs" >&5 +echo "configure:5955: checking for fstatfs" >&5 if eval "test \"`echo '$''{'ac_cv_func_fstatfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_fstatfs=yes" else @@ -6010,7 +6008,7 @@ fi # data, this checks it and add memcmp.o to LIBOBJS if needed #-------------------------------------------------------------------- echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:6014: checking for 8-bit clean memcmp" >&5 +echo "configure:6012: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6018,7 +6016,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -6052,12 +6050,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" # {The replacement define is in compat/string.h} #-------------------------------------------------------------------- echo $ac_n "checking for memmove""... $ac_c" 1>&6 -echo "configure:6056: checking for memmove" >&5 +echo "configure:6054: checking for memmove" >&5 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_memmove=yes" else @@ -6113,12 +6111,12 @@ fi #-------------------------------------------------------------------- if test "x${ac_cv_func_strstr}" = "xyes"; then echo $ac_n "checking proper strstr implementation""... $ac_c" 1>&6 -echo "configure:6117: checking proper strstr implementation" >&5 +echo "configure:6115: checking proper strstr implementation" >&5 if test "$cross_compiling" = yes; then tcl_ok=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_ok=yes else @@ -6155,12 +6153,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtoul""... $ac_c" 1>&6 -echo "configure:6159: checking for strtoul" >&5 +echo "configure:6157: checking for strtoul" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtoul=yes" else @@ -6207,7 +6205,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6246,12 +6244,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:6250: checking for strtod" >&5 +echo "configure:6248: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -6298,7 +6296,7 @@ if test "$cross_compiling" = yes; then tcl_ok=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6340,12 +6338,12 @@ fi echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:6344: checking for strtod" >&5 +echo "configure:6342: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -6390,7 +6388,7 @@ fi if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:6394: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:6392: checking for Solaris2.4/Tru64 strtod bugs" >&5 if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6399,7 +6397,7 @@ else tcl_cv_strtod_buggy=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_strtod_buggy=1 else @@ -6455,12 +6453,12 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:6459: checking for ANSI C header files" >&5 +echo "configure:6457: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6468,7 +6466,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6470: \"$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* @@ -6485,7 +6483,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6503,7 +6501,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6524,7 +6522,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -6535,7 +6533,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:6539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -6559,12 +6557,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6563: checking for mode_t" >&5 +echo "configure:6561: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6592,12 +6590,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6596: checking for pid_t" >&5 +echo "configure:6594: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6625,12 +6623,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6629: checking for size_t" >&5 +echo "configure:6627: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6658,12 +6656,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:6662: checking for uid_t in sys/types.h" >&5 +echo "configure:6660: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -6693,12 +6691,12 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:6697: checking for socklen_t" >&5 +echo "configure:6695: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6737,12 +6735,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for opendir""... $ac_c" 1>&6 -echo "configure:6741: checking for opendir" >&5 +echo "configure:6739: checking for opendir" >&5 if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_opendir=yes" else @@ -6798,12 +6796,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking union wait""... $ac_c" 1>&6 -echo "configure:6802: checking union wait" >&5 +echo "configure:6800: checking union wait" >&5 if eval "test \"`echo '$''{'tcl_cv_union_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6815,7 +6813,7 @@ WIFEXITED(x); /* Generates compiler error if WIFEXITED ; return 0; } EOF -if { (eval echo configure:6819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_union_wait=yes else @@ -6842,12 +6840,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for strncasecmp""... $ac_c" 1>&6 -echo "configure:6846: checking for strncasecmp" >&5 +echo "configure:6844: checking for strncasecmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strncasecmp=yes" else @@ -6892,7 +6890,7 @@ fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -lsocket""... $ac_c" 1>&6 -echo "configure:6896: checking for strncasecmp in -lsocket" >&5 +echo "configure:6894: checking for strncasecmp in -lsocket" >&5 ac_lib_var=`echo socket'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6900,7 +6898,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6913: \"$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 @@ -6935,7 +6933,7 @@ fi fi if test "$tcl_ok" = 0; then echo $ac_n "checking for strncasecmp in -linet""... $ac_c" 1>&6 -echo "configure:6939: checking for strncasecmp in -linet" >&5 +echo "configure:6937: checking for strncasecmp in -linet" >&5 ac_lib_var=`echo inet'_'strncasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6943,7 +6941,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6956: \"$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 @@ -6992,12 +6990,12 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6 -echo "configure:6996: checking for BSDgettimeofday" >&5 +echo "configure:6994: checking for BSDgettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_BSDgettimeofday=yes" else @@ -7042,12 +7040,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:7046: checking for gettimeofday" >&5 +echo "configure:7044: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else @@ -7097,12 +7095,12 @@ fi fi echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6 -echo "configure:7101: checking for gettimeofday declaration" >&5 +echo "configure:7099: checking for gettimeofday declaration" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -7133,14 +7131,14 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:7137: checking whether char is unsigned" >&5 +echo "configure:7135: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -7196,12 +7194,12 @@ EOF fi echo $ac_n "checking signed char declarations""... $ac_c" 1>&6 -echo "configure:7200: checking signed char declarations" >&5 +echo "configure:7198: checking signed char declarations" >&5 if eval "test \"`echo '$''{'tcl_cv_char_signed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_char_signed=yes else @@ -7236,7 +7234,7 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for a putenv() that copies the buffer""... $ac_c" 1>&6 -echo "configure:7240: checking for a putenv() that copies the buffer" >&5 +echo "configure:7238: checking for a putenv() that copies the buffer" >&5 if eval "test \"`echo '$''{'tcl_cv_putenv_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7244,7 +7242,7 @@ else tcl_cv_putenv_copy=no else cat > conftest.$ac_ext < @@ -7266,7 +7264,7 @@ else } EOF -if { (eval echo configure:7270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_putenv_copy=no else @@ -7308,17 +7306,17 @@ fi if test "$langinfo_ok" = "yes"; then ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6 -echo "configure:7312: checking for langinfo.h" >&5 +echo "configure:7310: checking for langinfo.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:7322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7320: \"$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* @@ -7343,17 +7341,17 @@ fi fi fi echo $ac_n "checking whether to use nl_langinfo""... $ac_c" 1>&6 -echo "configure:7347: checking whether to use nl_langinfo" >&5 +echo "configure:7345: checking whether to use nl_langinfo" >&5 if test "$langinfo_ok" = "yes"; then cat > conftest.$ac_ext < int main() { nl_langinfo(CODESET); ; return 0; } EOF -if { (eval echo configure:7357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* langinfo_ok=yes else @@ -7388,17 +7386,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7392: checking for $ac_hdr" >&5 +echo "configure:7390: checking for $ac_hdr" >&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:7402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7400: \"$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* @@ -7428,17 +7426,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7432: checking for $ac_hdr" >&5 +echo "configure:7430: checking for $ac_hdr" >&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:7442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7440: \"$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* @@ -7465,7 +7463,7 @@ fi done echo $ac_n "checking FIONBIO vs. O_NONBLOCK for nonblocking I/O""... $ac_c" 1>&6 -echo "configure:7469: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 +echo "configure:7467: checking FIONBIO vs. O_NONBLOCK for nonblocking I/O" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -7545,7 +7543,7 @@ HTML_DIR='$(DISTDIR)/html' if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 -echo "configure:7549: checking how to package libraries" >&5 +echo "configure:7547: checking how to package libraries" >&5 # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 1ea2f5f..a48c114 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1454,9 +1454,7 @@ dnl AC_CHECK_TOOL(AR, ar) AC_DEFINE(MAC_OSX_TCL) AC_DEFINE(USE_VFORK) AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8") - if test "$SHARED_BUILD" = "1" ; then - AC_DEFINE(TCL_LOAD_FROM_MEMORY) - fi + AC_DEFINE(TCL_LOAD_FROM_MEMORY) # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: AC_CHECK_FUNC(realpath) diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 10afad7..1796307 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.c @@ -1,17 +1,18 @@ -/* +/* * tclLoadDyld.c -- * - * This procedure provides a version of the TclLoadFile that - * works with Apple's dyld dynamic loading. This file - * provided by Wilfredo Sanchez (wsanchez@apple.com). - * This works on Mac OS X. + * This procedure provides a version of the TclLoadFile that works with + * Apple's dyld dynamic loading. + * Original version of his file (now superseded long ago) provided by + * Wilfredo Sanchez (wsanchez@apple.com). * * Copyright (c) 1995 Apple Computer, Inc. + * Copyright (c) 2005 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadDyld.c,v 1.14.2.3 2005/06/04 07:05:14 das Exp $ + * RCS: @(#) $Id: tclLoadDyld.c,v 1.14.2.4 2005/07/30 07:58:16 das Exp $ */ #include "tclInt.h" @@ -21,18 +22,18 @@ #include typedef struct Tcl_DyldModuleHandle { - struct Tcl_DyldModuleHandle *nextModuleHandle; + struct Tcl_DyldModuleHandle *nextPtr; NSModule module; } Tcl_DyldModuleHandle; typedef struct Tcl_DyldLoadHandle { - CONST struct mach_header *dyld_lib; - Tcl_DyldModuleHandle *firstModuleHandle; + CONST struct mach_header *dyldLibHeader; + Tcl_DyldModuleHandle *modulePtr; } Tcl_DyldLoadHandle; #ifdef TCL_LOAD_FROM_MEMORY typedef struct ThreadSpecificData { - int haveLoadMemory; + int haveLoadMemory; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -43,44 +44,36 @@ static Tcl_ThreadDataKey dataKey; * * DyldOFIErrorMsg -- * - * Converts a numerical NSObjectFileImage error into an - * error message string. + * Converts a numerical NSObjectFileImage error into an error message + * string. * * Results: - * Error message string. + * Error message string. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------- */ -static CONST char* DyldOFIErrorMsg(int err) { - CONST char *ofi_msg = NULL; - - if (err != NSObjectFileImageSuccess) { - switch(err) { - case NSObjectFileImageFailure: - ofi_msg = "object file setup failure"; - break; - case NSObjectFileImageInappropriateFile: - ofi_msg = "not a Mach-O MH_BUNDLE file"; - break; - case NSObjectFileImageArch: - ofi_msg = "no object for this architecture"; - break; - case NSObjectFileImageFormat: - ofi_msg = "bad object file format"; - break; - case NSObjectFileImageAccess: - ofi_msg = "can't read object file"; - break; - default: - ofi_msg = "unknown error"; - break; - } +static CONST char* +DyldOFIErrorMsg(int err) { + switch(err) { + case NSObjectFileImageSuccess: + return NULL; + case NSObjectFileImageFailure: + return "object file setup failure"; + case NSObjectFileImageInappropriateFile: + return "not a Mach-O MH_BUNDLE file"; + case NSObjectFileImageArch: + return "no object for this architecture"; + case NSObjectFileImageFormat: + return "bad object file format"; + case NSObjectFileImageAccess: + return "can't read object file"; + default: + return "unknown error"; } - return ofi_msg; } /* @@ -88,15 +81,15 @@ static CONST char* DyldOFIErrorMsg(int err) { * * TclpDlopen -- * - * Dynamically loads a binary code file into memory and returns - * a handle to the new code. + * Dynamically loads a binary code file into memory and returns a handle + * to the new code. * * Results: - * A standard Tcl completion code. If an error occurs, an error - * message is left in the interpreter's result. + * A standard Tcl completion code. If an error occurs, an error message + * is left in the interpreter's result. * * Side effects: - * New code suddenly appears in memory. + * New code suddenly appears in memory. * *---------------------------------------------------------------------- */ @@ -107,90 +100,108 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) Tcl_Obj *pathPtr; /* Name of the file containing the desired * code (UTF-8). */ Tcl_LoadHandle *loadHandle; /* Filled with token for dynamically loaded - * file which will be passed back to + * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr; + Tcl_FSUnloadFileProc **unloadProcPtr; /* Filled with address of Tcl_FSUnloadFileProc - * function which should be used for - * this file. */ + * function which should be used for this + * file. */ { Tcl_DyldLoadHandle *dyldLoadHandle; - CONST struct mach_header *dyld_lib; - NSObjectFileImage dyld_ofi = NULL; - Tcl_DyldModuleHandle *dyldModuleHandle = NULL; + CONST struct mach_header *dyldLibHeader; + NSObjectFileImage dyldObjFileImage = NULL; + Tcl_DyldModuleHandle *modulePtr = NULL; CONST char *native; - /* - * First try the full path the user gave us. This is particularly - * important if the cwd is inside a vfs, and we are trying to load - * using a relative path. + /* + * First try the full path the user gave us. This is particularly + * important if the cwd is inside a vfs, and we are trying to load using a + * relative path. */ + native = Tcl_FSGetNativePath(pathPtr); - dyld_lib = NSAddImage(native, - NSADDIMAGE_OPTION_WITH_SEARCHING | - NSADDIMAGE_OPTION_RETURN_ON_ERROR); - - if (!dyld_lib) { - NSLinkEditErrors editError; - CONST char *name, *msg, *ofi_msg = NULL; - - NSLinkEditError(&editError, &errno, &name, &msg); - if (editError == NSLinkEditFileAccessError) { - /* The requested file was not found: - * let the OS loader examine the binary search path for - * whatever string the user gave us which hopefully refers - * to a file on the binary path - */ - Tcl_DString ds; - char *fileName = Tcl_GetString(pathPtr); - CONST char *native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds); - dyld_lib = NSAddImage(native, - NSADDIMAGE_OPTION_WITH_SEARCHING | - NSADDIMAGE_OPTION_RETURN_ON_ERROR); - Tcl_DStringFree(&ds); - if (!dyld_lib) { - NSLinkEditError(&editError, &errno, &name, &msg); - } - } else if ((editError == NSLinkEditFileFormatError && errno == EBADMACHO)) { - /* The requested file was found but was not of type MH_DYLIB, - * attempt to load it as a MH_BUNDLE: */ - NSObjectFileImageReturnCode err; - err = NSCreateObjectFileImageFromFile(native, &dyld_ofi); - ofi_msg = DyldOFIErrorMsg(err); - } - if (!dyld_lib && !dyld_ofi) { - Tcl_AppendResult(interp, msg, (char *) NULL); - if (ofi_msg) { - Tcl_AppendResult(interp, "NSCreateObjectFileImageFromFile() error: ", - ofi_msg, (char *) NULL); - } - return TCL_ERROR; - } + dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_WITH_SEARCHING | + NSADDIMAGE_OPTION_RETURN_ON_ERROR); + + if (!dyldLibHeader) { + NSLinkEditErrors editError; + int errorNumber; + CONST char *name, *msg, *objFileImageErrMsg = NULL; + + NSLinkEditError(&editError, &errorNumber, &name, &msg); + + if (editError == NSLinkEditFileAccessError) { + /* + * The requested file was not found. Let the OS loader examine the + * binary search path for whatever string the user gave us which + * hopefully refers to a file on the binary path. + */ + + Tcl_DString ds; + char *fileName = Tcl_GetString(pathPtr); + CONST char *native = + Tcl_UtfToExternalDString(NULL, fileName, -1, &ds); + + dyldLibHeader = NSAddImage(native, NSADDIMAGE_OPTION_WITH_SEARCHING + | NSADDIMAGE_OPTION_RETURN_ON_ERROR); + Tcl_DStringFree(&ds); + if (!dyldLibHeader) { + NSLinkEditError(&editError, &errorNumber, &name, &msg); + } + } else if ((editError==NSLinkEditFileFormatError && errorNumber==EBADMACHO) + || editError == NSLinkEditOtherError){ + /* + * The requested file was found but was not of type MH_DYLIB, + * attempt to load it as a MH_BUNDLE. + */ + + NSObjectFileImageReturnCode err = + NSCreateObjectFileImageFromFile(native, &dyldObjFileImage); + objFileImageErrMsg = DyldOFIErrorMsg(err); + } + + if (!dyldLibHeader && !dyldObjFileImage) { + Tcl_AppendResult(interp, msg, (char *) NULL); + if (msg && *msg) { + Tcl_AppendResult(interp, "\n", (char *) NULL); + } + if (objFileImageErrMsg) { + Tcl_AppendResult(interp, + "NSCreateObjectFileImageFromFile() error: ", + objFileImageErrMsg, (char *) NULL); + } + return TCL_ERROR; + } } - - if (dyld_ofi) { - NSModule module; - module = NSLinkModule(dyld_ofi, native, NSLINKMODULE_OPTION_BINDNOW | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); - NSDestroyObjectFileImage(dyld_ofi); - if (module) { - dyldModuleHandle = (Tcl_DyldModuleHandle *) - ckalloc(sizeof(Tcl_DyldModuleHandle)); - if (!dyldModuleHandle) return TCL_ERROR; - dyldModuleHandle->module = module; - dyldModuleHandle->nextModuleHandle = NULL; - } else { - NSLinkEditErrors editError; - CONST char *name, *msg; - NSLinkEditError(&editError, &errno, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); - return TCL_ERROR; - } + + if (dyldObjFileImage) { + NSModule module; + + module = NSLinkModule(dyldObjFileImage, native, + NSLINKMODULE_OPTION_BINDNOW + | NSLINKMODULE_OPTION_RETURN_ON_ERROR); + NSDestroyObjectFileImage(dyldObjFileImage); + + if (!module) { + NSLinkEditErrors editError; + int errorNumber; + CONST char *name, *msg; + + NSLinkEditError(&editError, &errorNumber, &name, &msg); + Tcl_AppendResult(interp, msg, (char *) NULL); + return TCL_ERROR; + } + + modulePtr = (Tcl_DyldModuleHandle *) + ckalloc(sizeof(Tcl_DyldModuleHandle)); + modulePtr->module = module; + modulePtr->nextPtr = NULL; } - dyldLoadHandle = (Tcl_DyldLoadHandle *) ckalloc(sizeof(Tcl_DyldLoadHandle)); - if (!dyldLoadHandle) return TCL_ERROR; - dyldLoadHandle->dyld_lib = dyld_lib; - dyldLoadHandle->firstModuleHandle = dyldModuleHandle; + + dyldLoadHandle = (Tcl_DyldLoadHandle *) + ckalloc(sizeof(Tcl_DyldLoadHandle)); + dyldLoadHandle->dyldLibHeader = dyldLibHeader; + dyldLoadHandle->modulePtr = modulePtr; *loadHandle = (Tcl_LoadHandle) dyldLoadHandle; *unloadProcPtr = &TclpUnloadFile; return TCL_OK; @@ -201,75 +212,85 @@ TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr) * * TclpFindSymbol -- * - * Looks up a symbol, by name, through a handle associated with - * a previously loaded piece of code (shared library). + * Looks up a symbol, by name, through a handle associated with a + * previously loaded piece of code (shared library). * * Results: - * Returns a pointer to the function associated with 'symbol' if - * it is found. Otherwise returns NULL and may leave an error - * message in the interp's result. + * Returns a pointer to the function associated with 'symbol' if it is + * found. Otherwise returns NULL and may leave an error message in the + * interp's result. * *---------------------------------------------------------------------- */ + Tcl_PackageInitProc* -TclpFindSymbol(interp, loadHandle, symbol) - Tcl_Interp *interp; - Tcl_LoadHandle loadHandle; - CONST char *symbol; +TclpFindSymbol(interp, loadHandle, symbol) + Tcl_Interp *interp; /* For error reporting. */ + Tcl_LoadHandle loadHandle; /* Handle from TclpDlopen. */ + CONST char *symbol; /* Symbol name to look up. */ { NSSymbol nsSymbol; CONST char *native; Tcl_DString newName, ds; Tcl_PackageInitProc* proc = NULL; Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle; - /* + + /* * dyld adds an underscore to the beginning of symbol names. */ + native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds); Tcl_DStringInit(&newName); Tcl_DStringAppend(&newName, "_", 1); native = Tcl_DStringAppend(&newName, native, -1); - if (dyldLoadHandle->dyld_lib) { - nsSymbol = NSLookupSymbolInImage(dyldLoadHandle->dyld_lib, native, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - if(nsSymbol) { - /* until dyld supports unloading of MY_DYLIB binaries, the - * following is not needed: */ + + if (dyldLoadHandle->dyldLibHeader) { + nsSymbol = NSLookupSymbolInImage(dyldLoadHandle->dyldLibHeader, native, + NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + if (nsSymbol) { + /* + * Until dyld supports unloading of MY_DYLIB binaries, the + * following is not needed. + */ + #ifdef DYLD_SUPPORTS_DYLIB_UNLOADING - NSModule module = NSModuleForSymbol(nsSymbol); - Tcl_DyldModuleHandle *dyldModuleHandle = dyldLoadHandle->firstModuleHandle; - while (dyldModuleHandle) { - if (module == dyldModuleHandle->module) break; - dyldModuleHandle = dyldModuleHandle->nextModuleHandle; - } - if (!dyldModuleHandle) { - dyldModuleHandle = (Tcl_DyldModuleHandle *) - ckalloc(sizeof(Tcl_DyldModuleHandle)); - if (dyldModuleHandle) { - dyldModuleHandle->module = module; - dyldModuleHandle->nextModuleHandle = - dyldLoadHandle->firstModuleHandle; - dyldLoadHandle->firstModuleHandle = dyldModuleHandle; - } - } + NSModule module = NSModuleForSymbol(nsSymbol); + Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr; + + while (modulePtr != NULL) { + if (module == modulePtr->module) { + break; + } + modulePtr = modulePtr->nextPtr; + } + if (modulePtr == NULL) { + modulePtr = (Tcl_DyldModuleHandle *) + ckalloc(sizeof(Tcl_DyldModuleHandle)); + modulePtr->module = module; + modulePtr->nextPtr = dyldLoadHandle->modulePtr; + dyldLoadHandle->modulePtr = modulePtr; + } #endif /* DYLD_SUPPORTS_DYLIB_UNLOADING */ - } else { - NSLinkEditErrors editError; - CONST char *name, *msg; - NSLinkEditError(&editError, &errno, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); - } + + } else { + NSLinkEditErrors editError; + int errorNumber; + CONST char *name, *msg; + + NSLinkEditError(&editError, &errorNumber, &name, &msg); + Tcl_AppendResult(interp, msg, (char *) NULL); + } } else { - nsSymbol = NSLookupSymbolInModule(dyldLoadHandle->firstModuleHandle->module, - native); + nsSymbol = NSLookupSymbolInModule(dyldLoadHandle->modulePtr->module, + native); } - if(nsSymbol) { - proc = NSAddressOfSymbol(nsSymbol); + if (nsSymbol) { + proc = NSAddressOfSymbol(nsSymbol); } Tcl_DStringFree(&newName); Tcl_DStringFree(&ds); - + return proc; } @@ -278,37 +299,37 @@ TclpFindSymbol(interp, loadHandle, symbol) * * TclpUnloadFile -- * - * Unloads a dynamically loaded binary code file from memory. - * Code pointers in the formerly loaded file are no longer valid - * after calling this function. + * Unloads a dynamically loaded binary code file from memory. Code + * pointers in the formerly loaded file are no longer valid after calling + * this function. * * Results: - * None. + * None. * * Side effects: - * Code dissapears from memory. - * Note that dyld currently only supports unloading of binaries of - * type MH_BUNDLE loaded with NSLinkModule() in TclpDlopen() above. + * Code dissapears from memory. Note that dyld currently only supports + * unloading of binaries of type MH_BUNDLE loaded with NSLinkModule() in + * TclpDlopen() above. * *---------------------------------------------------------------------- */ void TclpUnloadFile(loadHandle) - Tcl_LoadHandle loadHandle; /* loadHandle returned by a previous call - * to TclpDlopen(). The loadHandle is - * a token that represents the loaded - * file. */ + Tcl_LoadHandle loadHandle; /* loadHandle returned by a previous call to + * TclpDlopen(). The loadHandle is a token + * that represents the loaded file. */ { Tcl_DyldLoadHandle *dyldLoadHandle = (Tcl_DyldLoadHandle *) loadHandle; - Tcl_DyldModuleHandle *dyldModuleHandle = dyldLoadHandle->firstModuleHandle; - void *ptr; - - while (dyldModuleHandle) { - NSUnLinkModule(dyldModuleHandle->module, - NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); - ptr = dyldModuleHandle; - dyldModuleHandle = dyldModuleHandle->nextModuleHandle; + Tcl_DyldModuleHandle *modulePtr = dyldLoadHandle->modulePtr; + + while (modulePtr != NULL) { + void *ptr; + + NSUnLinkModule(modulePtr->module, + NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); + ptr = modulePtr; + modulePtr = modulePtr->nextPtr; ckfree(ptr); } ckfree((char*) dyldLoadHandle); @@ -319,27 +340,27 @@ TclpUnloadFile(loadHandle) * * TclGuessPackageName -- * - * If the "load" command is invoked without providing a package - * name, this procedure is invoked to try to figure it out. + * If the "load" command is invoked without providing a package name, + * this procedure is invoked to try to figure it out. * * Results: - * Always returns 0 to indicate that we couldn't figure out a - * package name; generic code will then try to guess the package - * from the file name. A return value of 1 would have meant that - * we figured out the package name and put it in bufPtr. + * Always returns 0 to indicate that we couldn't figure out a package + * name; generic code will then try to guess the package from the file + * name. A return value of 1 would have meant that we figured out the + * package name and put it in bufPtr. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------- */ int TclGuessPackageName(fileName, bufPtr) - CONST char *fileName; /* Name of file containing package (already - * translated to local form if needed). */ - Tcl_DString *bufPtr; /* Initialized empty dstring. Append - * package name to this if possible. */ + CONST char *fileName; /* Name of file containing package (already + * translated to local form if needed). */ + Tcl_DString *bufPtr; /* Initialized empty dstring. Append package + * name to this if possible. */ { return 0; } @@ -353,10 +374,10 @@ TclGuessPackageName(fileName, bufPtr) * Allocate a buffer that can be used with TclpLoadMemory() below. * * Results: - * Pointer to allocated buffer or NULL if an error occurs. + * Pointer to allocated buffer or NULL if an error occurs. * * Side effects: - * Buffer is allocated. + * Buffer is allocated. * *---------------------------------------------------------------------- */ @@ -364,30 +385,34 @@ TclGuessPackageName(fileName, bufPtr) void* TclpLoadMemoryGetBuffer(interp, size) Tcl_Interp *interp; /* Used for error reporting. */ - int size; /* Size of desired buffer */ + int size; /* Size of desired buffer. */ { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - void * buffer = NULL; - + void *buffer = NULL; + if (!tsdPtr->haveLoadMemory) { - /* NSCreateObjectFileImageFromMemory is available but always - * fails prior to Darwin 7 */ - struct utsname name; - if (!uname(&name)) { - long release = strtol(name.release, NULL, 10); - tsdPtr->haveLoadMemory = (release >= 7) ? 1 : -1; - } + /* + * NSCreateObjectFileImageFromMemory is available but always fails + * prior to Darwin 7. + */ + + struct utsname name; + + if (!uname(&name)) { + long release = strtol(name.release, NULL, 10); + tsdPtr->haveLoadMemory = (release >= 7) ? 1 : -1; + } } if (tsdPtr->haveLoadMemory > 0) { - /* We must allocate the buffer using vm_allocate, because - * NSCreateObjectFileImageFromMemory will dispose of it - * using vm_deallocate. - */ - int err = vm_allocate(mach_task_self(), - (vm_address_t*)&buffer, size, 1); - if (err) { - buffer = NULL; - } + /* + * We must allocate the buffer using vm_allocate, because + * NSCreateObjectFileImageFromMemory will dispose of it using + * vm_deallocate. + */ + + if (vm_allocate(mach_task_self(), (vm_address_t *) &buffer, size, 1)) { + buffer = NULL; + } } return buffer; } @@ -397,15 +422,15 @@ TclpLoadMemoryGetBuffer(interp, size) * * TclpLoadMemory -- * - * Dynamically loads binary code file from memory and returns - * a handle to the new code. + * Dynamically loads binary code file from memory and returns a handle to + * the new code. * * Results: - * A standard Tcl completion code. If an error occurs, an error - * message is left in the interpreter's result. + * A standard Tcl completion code. If an error occurs, an error message + * is left in the interpreter's result. * * Side effects: - * New code is loaded from memory. + * New code is loaded from memory. * *---------------------------------------------------------------------- */ @@ -415,60 +440,103 @@ TclpLoadMemory(interp, buffer, size, codeSize, loadHandle, unloadProcPtr) Tcl_Interp *interp; /* Used for error reporting. */ void *buffer; /* Buffer containing the desired code * (allocated with TclpLoadMemoryGetBuffer). */ - int size; /* Allocation size of buffer. */ - int codeSize; /* Size of code data read into buffer or -1 if - * an error occurred and the buffer should - * just be freed. */ + int size; /* Allocation size of buffer. */ + int codeSize; /* Size of code data read into buffer or -1 if + * an error occurred and the buffer should + * just be freed. */ Tcl_LoadHandle *loadHandle; /* Filled with token for dynamically loaded - * file which will be passed back to + * file which will be passed back to * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr; + Tcl_FSUnloadFileProc **unloadProcPtr; /* Filled with address of Tcl_FSUnloadFileProc - * function which should be used for - * this file. */ + * function which should be used for this + * file. */ { Tcl_DyldLoadHandle *dyldLoadHandle; - NSObjectFileImage dyld_ofi = NULL; - Tcl_DyldModuleHandle *dyldModuleHandle; - CONST char *ofi_msg = NULL; + NSObjectFileImage dyldObjFileImage = NULL; + Tcl_DyldModuleHandle *modulePtr; + NSModule module; + CONST char *objFileImageErrMsg = NULL; + + /* + * Try to create an object file image that we can load from. + */ if (codeSize >= 0) { - NSObjectFileImageReturnCode err; - err = NSCreateObjectFileImageFromMemory(buffer, codeSize, &dyld_ofi); - ofi_msg = DyldOFIErrorMsg(err); + NSObjectFileImageReturnCode err = NSObjectFileImageSuccess; + +#ifndef __LP64__ + struct mach_header *mh = buffer; + if (codeSize < sizeof(struct mach_header) || mh->magic != MH_MAGIC +#else + struct mach_header_64 *mh = buffer; + if (codeSize < sizeof(struct mach_header_64) || mh->magic != MH_MAGIC_64 +#endif + || mh->filetype != MH_BUNDLE) { + err = NSObjectFileImageInappropriateFile; + } + if (err == NSObjectFileImageSuccess) { + err = NSCreateObjectFileImageFromMemory(buffer, codeSize, + &dyldObjFileImage); + } + objFileImageErrMsg = DyldOFIErrorMsg(err); } - if (!dyld_ofi) { - vm_deallocate(mach_task_self(), (vm_address_t) buffer, size); - if (ofi_msg) { - Tcl_AppendResult(interp, "NSCreateObjectFileImageFromFile() error: ", - ofi_msg, (char *) NULL); - } - return TCL_ERROR; - } else { - NSModule module; - module = NSLinkModule(dyld_ofi, "[Memory Based Bundle]", - NSLINKMODULE_OPTION_BINDNOW |NSLINKMODULE_OPTION_RETURN_ON_ERROR); - NSDestroyObjectFileImage(dyld_ofi); - if (module) { - dyldModuleHandle = (Tcl_DyldModuleHandle *) - ckalloc(sizeof(Tcl_DyldModuleHandle)); - if (!dyldModuleHandle) return TCL_ERROR; - dyldModuleHandle->module = module; - dyldModuleHandle->nextModuleHandle = NULL; - } else { - NSLinkEditErrors editError; - CONST char *name, *msg; - NSLinkEditError(&editError, &errno, &name, &msg); - Tcl_AppendResult(interp, msg, (char *) NULL); - return TCL_ERROR; - } + + /* + * If it went wrong (or we were asked to just deallocate), get rid of the + * memory block and create an error message. + */ + + if (dyldObjFileImage == NULL) { + vm_deallocate(mach_task_self(), (vm_address_t) buffer, size); + if (objFileImageErrMsg != NULL) { + Tcl_AppendResult(interp, + "NSCreateObjectFileImageFromFile() error: ", + objFileImageErrMsg, (char *) NULL); + } + return TCL_ERROR; } - dyldLoadHandle = (Tcl_DyldLoadHandle *) ckalloc(sizeof(Tcl_DyldLoadHandle)); - if (!dyldLoadHandle) return TCL_ERROR; - dyldLoadHandle->dyld_lib = NULL; - dyldLoadHandle->firstModuleHandle = dyldModuleHandle; + + /* + * Extract the module we want from the image of the object file. + */ + + module = NSLinkModule(dyldObjFileImage, "[Memory Based Bundle]", + NSLINKMODULE_OPTION_BINDNOW | NSLINKMODULE_OPTION_RETURN_ON_ERROR); + NSDestroyObjectFileImage(dyldObjFileImage); + + if (!module) { + NSLinkEditErrors editError; + int errorNumber; + CONST char *name, *msg; + + NSLinkEditError(&editError, &errorNumber, &name, &msg); + Tcl_AppendResult(interp, msg, (char *) NULL); + return TCL_ERROR; + } + + /* + * Stash the module reference within the load handle we create and return. + */ + + modulePtr = (Tcl_DyldModuleHandle *) ckalloc(sizeof(Tcl_DyldModuleHandle)); + modulePtr->module = module; + modulePtr->nextPtr = NULL; + + dyldLoadHandle = (Tcl_DyldLoadHandle *) + ckalloc(sizeof(Tcl_DyldLoadHandle)); + dyldLoadHandle->dyldLibHeader = NULL; + dyldLoadHandle->modulePtr = modulePtr; *loadHandle = (Tcl_LoadHandle) dyldLoadHandle; *unloadProcPtr = &TclpUnloadFile; return TCL_OK; } #endif + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ -- cgit v0.12