diff options
author | Bryan Drewery <bryan@shatow.net> | 2017-03-07 00:58:33 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2017-03-07 00:59:17 +0300 |
commit | ad93bf21f8b28b838320f927e67446773f0a4e0e (patch) | |
tree | cf565e19257f92906ec1ed49ba5ab8793bbae7b5 /configure.ac | |
parent | 9a1df3da098e7317e509366c77d14315e480d5ac (diff) |
Conditionalize the build/install of rm(1) on whether -x works
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 0ed8e4c8..be89c815 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,20 @@ AC_CHECK_HEADERS_ONCE([float.h]) AC_CHECK_HEADERS_ONCE([math.h]) AC_CHECK_HEADERS_ONCE([fcntl.h]) +# Look for rm -x support. Exit status 64 is bad argument, 1 is +# bad file. So as long as it is not 64 it should be fine. +AC_CACHE_CHECK([whether rm -x works], [ac_cv_rm_x_works], + [ac_cv_rm_x_works=no + rm -x /nonexistent 2>/dev/null + test $? -eq 1 && ac_cv_rm_x_works=yes]) +if test "$ac_cv_rm_x_works" = yes; then + RM= +else + # Need bundled + RM=rm +fi +AC_SUBST([RM]) + AC_CHECK_DECLS([F_DUPFD_CLOEXEC], [ac_have_f_dupfd_cloexec=1], [ac_have_f_dupfd_cloexec=0], [[#include <fcntl.h>]]) |