diff options
author | Bryan Drewery <bryan@shatow.net> | 2015-06-07 00:08:20 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2015-06-07 00:09:13 +0300 |
commit | c47e8184b3981a1ed1f03322488f97687db07c8f (patch) | |
tree | e40f38ff0a944111ba6e4842f85a5ead327d88f4 /configure.ac | |
parent | 11f349c9e844c02743dcd0c17471804a2e8eb621 (diff) |
Fix build on older FreeBSD due to sh. If F_DUPFD_CLOEXEC is unavailable then use system sh.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 7c193111..550403e6 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,17 @@ AC_CHECK_HEADERS_ONCE([float.h]) AC_CHECK_HEADERS_ONCE([math.h]) AC_CHECK_HEADERS_ONCE([fcntl.h]) +AC_CHECK_DECLS([F_DUPFD_CLOEXEC], [ac_have_f_dupfd_cloexec=1], + [ac_have_f_dupfd_cloexec=0], [[#include <fcntl.h>]]) + +SH=sh +if [[ $ac_have_f_dupfd_cloexec -eq 0 ]]; then + AC_MSG_WARN([Not using bundled /bin/sh. Some runtime behavior may be wrong.]) + AC_MSG_WARN([It is advised to upgrade your base system to a newer release.]) + SH= +fi +AC_SUBST([SH]) + AC_CONFIG_FILES(Makefile) # Preserve timestamps for install. This is needed to preserve hardlinks |