diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-04-04 14:28:42 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-06-09 11:45:57 +1000 |
commit | 980235d194353a1ee9109303f5a12bb42f68d6c3 (patch) | |
tree | b139bff3d923c7288952078b0c915abfe776286c /auto.def | |
parent | 64716bd6592527d31b6c5e79295d0218afc98682 (diff) | |
download | jimtcl-980235d194353a1ee9109303f5a12bb42f68d6c3.zip jimtcl-980235d194353a1ee9109303f5a12bb42f68d6c3.tar.gz jimtcl-980235d194353a1ee9109303f5a12bb42f68d6c3.tar.bz2 |
Better handling of environ on Mac OS X
Shared libraries can't access environ directly, so use
_NSGetEnviron() on Mac OS X
Also, load modules with (RTLD_NOW | RTLD_LOCAL) instead of RTLD_LAZY
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'auto.def')
-rw-r--r-- | auto.def | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -56,7 +56,7 @@ options { cc-check-types "long long" -cc-check-includes sys/un.h dlfcn.h unistd.h +cc-check-includes sys/un.h dlfcn.h unistd.h crt_externs.h cc-check-functions ualarm sysinfo lstat fork vfork system cc-check-functions backtrace geteuid mkstemp realpath strptime @@ -74,12 +74,14 @@ switch -glob -- [get-define host] { cc-check-tools ar ranlib strip define tclsh [info nameofexecutable] -msg-checking "Checking environ declared in unistd.h..." -if {[cctest -cflags -D_GNU_SOURCE -includes unistd.h -code {char **ep = environ;}]} { - define NO_ENVIRON_EXTERN - msg-result "yes" -} else { - msg-result "no" +if {![cc-check-functions _NSGetEnviron]} { + msg-checking "Checking environ declared in unistd.h..." + if {[cctest -cflags -D_GNU_SOURCE -includes unistd.h -code {char **ep = environ;}]} { + define NO_ENVIRON_EXTERN + msg-result "yes" + } else { + msg-result "no" + } } set extra_objs {} |