From 108b50a38b298ade25dc7d355c75ebe0c21b9001 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 13 Jan 2014 08:07:03 -0800 Subject: 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. --- configure | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'configure') 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 @@ -731,6 +730,22 @@ else printf "yes\n" 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" -- cgit v1.2.3