diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-22 07:42:45 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-03-22 07:42:45 +0000 |
commit | 080080fa23312d15be53ab53dbbd025591afba1f (patch) | |
tree | 2d5d6e5acb96e7dbeb3eac561d238255eae24681 | |
parent | 3cc24861060b02637a0522176cc185c1c967aec3 (diff) | |
download | rtmux-080080fa23312d15be53ab53dbbd025591afba1f.tar.gz rtmux-080080fa23312d15be53ab53dbbd025591afba1f.tar.bz2 rtmux-080080fa23312d15be53ab53dbbd025591afba1f.zip |
Use AC_USE_SYSTEM_EXTENSIONS and explicitly check for daemon() in headers.
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | configure.ac | 27 |
2 files changed, 13 insertions, 24 deletions
diff --git a/Makefile.am b/Makefile.am index 413bd590..007c5de1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,12 +14,6 @@ dist-hook: # Preprocessor flags. AM_CPPFLAGS += @XOPEN_DEFINES@ -DTMUX_CONF="\"$(sysconfdir)/tmux.conf\"" -# glibc as usual does things ass-backwards and hides useful things by default, -# so everyone has to add this. -if IS_GLIBC -AM_CFLAGS += -D_GNU_SOURCE -endif - # Set flags for gcc. if IS_GCC AM_CFLAGS += -std=gnu99 -O2 @@ -47,9 +41,9 @@ endif # Set flags for Solaris. if IS_SUNOS if IS_GCC -AM_CPPFLAGS += -D_XPG6 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS +AM_CPPFLAGS += -D_XPG6 -D_POSIX_PTHREAD_SEMANTICS else -AM_CPPFLAGS += -D_XPG4_2 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS +AM_CPPFLAGS += -D_XPG4_2 -D_POSIX_PTHREAD_SEMANTICS endif endif diff --git a/configure.ac b/configure.ac index 0f84d750..ad20b5fd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ # configure.ac AC_INIT(tmux, master) +AC_PREREQ([2.60]) AC_CONFIG_AUX_DIR(etc) AM_INIT_AUTOMAKE([foreign subdir-objects]) @@ -26,6 +27,7 @@ AC_PROG_CPP AC_PROG_EGREP AC_PROG_INSTALL PKG_PROG_PKG_CONFIG +AC_USE_SYSTEM_EXTENSIONS # Default tmux.conf goes in /etc not ${prefix}/etc. test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc @@ -79,22 +81,6 @@ AC_EGREP_CPP( ) AM_CONDITIONAL(IS_SUNCC, test "x$found_suncc" = xyes) -# Is this glibc? -AC_MSG_CHECKING(for glibc) -AC_EGREP_CPP( - yes, - [ - #include <features.h> - #ifdef __GLIBC__ - yes - #endif - ], - found_glibc=yes, - found_glibc=no -) -AM_CONDITIONAL(IS_GLIBC, test "x$found_glibc" = xyes) -AC_MSG_RESULT($found_glibc) - # Check for various headers. Alternatives included from compat.h. AC_CHECK_HEADERS( [ \ @@ -390,6 +376,15 @@ AM_CONDITIONAL(NO_CLOSEFROM, [test "x$found_closefrom" = xno]) # Look for daemon, compat/daemon.c used if missing. AC_CHECK_FUNC(daemon, found_daemon=yes, found_daemon=no) +AC_CHECK_DECL( + daemon, + , + found_daemon=no, + [ + #include <stdlib.h> + #include <unistd.h> + ] +) if test "x$found_daemon" = xyes; then AC_DEFINE(HAVE_DAEMON) fi |