summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-13 08:07:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-13 08:07:03 -0800
commit108b50a38b298ade25dc7d355c75ebe0c21b9001 (patch)
tree0d14bc3168fb5e4962411e3a9ef042b7df340e77
parent3b60aa9463bc649ae8982173e0630d864d254806 (diff)
downloadtxr-108b50a38b298ade25dc7d355c75ebe0c21b9001.tar.gz
txr-108b50a38b298ade25dc7d355c75ebe0c21b9001.tar.bz2
txr-108b50a38b298ade25dc7d355c75ebe0c21b9001.zip
Mac OSX Upkeep.
* configure: (need_svid_source, need_bsd_source): Variables removed. (need_darwin_c_source): New variable. Detect Apple environment and add -D_DARWIN_C_SOURCE, which is needed to reveal some functions in headers. * signal.c (sig_init): Wrap #ifdefs around SIGPOLL; it is not defined on Darwin.
-rwxr-xr-xconfigure30
-rw-r--r--signal.c2
2 files changed, 23 insertions, 9 deletions
diff --git a/configure b/configure
index 6574934e..f0912c83 100755
--- a/configure
+++ b/configure
@@ -103,8 +103,7 @@ have_timegm=
have_syslog=
have_windows_h=
have_posix_sigs=
-need_svid_source=
-need_bsd_source=
+need_darwin_c_source=
#
# Parse configuration variables
@@ -732,6 +731,22 @@ else
fi
#
+# Detect Apple environment. We need _DARWIN_C_SOURCE.
+#
+
+case "$ccname" in
+ *gcc )
+ printf "Checking for Apple environment ... "
+ if echo | gcc -dM -E - | grep -s __APPLE__ > /dev/null 2>&1 ; then
+ need_darwin_c_source=y
+ printf "yes\n"
+ else
+ printf "no\n"
+ fi
+ ;;
+esac
+
+#
# Check for annoying warnings from ctype.h macros
#
@@ -1370,12 +1385,11 @@ int main(void)
}
!
rm -f conftest$exe
-if ! $make EXTRA_FLAGS='-D_BSD_SOURCE' conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
+if ! $make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
printf "no\n"
else
printf "yes\n"
printf "#define HAVE_SETENV 1\n" >> config.h
- need_bsd_source=y
fi
printf "Checking for tzset function ... "
@@ -1676,12 +1690,10 @@ fi
printf "Regenerating config.make ... "
-if [ -n "$need_svid_source" ] ; then
- lang_flags="$lang_flags -D_SVID_SOURCE"
-fi
-if [ -n "$need_bsd_source" ] ; then
- lang_flags="$lang_flags -D_BSD_SOURCE"
+if [ -n "$need_darwin_c_source" ] ; then
+ lang_flags="$lang_flags -D_DARWIN_C_SOURCE"
fi
+
gen_config_make
printf "done\n"
diff --git a/signal.c b/signal.c
index d69814a6..8e430e52 100644
--- a/signal.c
+++ b/signal.c
@@ -108,7 +108,9 @@ void sig_init(void)
sig_xfsz = num_fast(SIGXFSZ);
sigtalrm = num_fast(SIGVTALRM);
sig_prof = num_fast(SIGPROF);
+#ifdef SIGPOLL
sig_poll = num_fast(SIGPOLL);
+#endif
sig_sys = num_fast(SIGSYS);
#ifdef SIGWINCH
sig_winch = num_fast(SIGWINCH);