aboutsummaryrefslogtreecommitdiff
path: root/libctf/configure
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-06-04 15:04:49 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-06-04 17:05:08 +0100
commitad118caa9f690114d11384b0813f30980cc333f3 (patch)
tree3261c7175a31eb17ae72c2a8f0d107c4d1ad9f59 /libctf/configure
parent6b22174ff163b828a2069f22353018ca97fc0fb4 (diff)
downloadgdb-ad118caa9f690114d11384b0813f30980cc333f3.zip
gdb-ad118caa9f690114d11384b0813f30980cc333f3.tar.gz
gdb-ad118caa9f690114d11384b0813f30980cc333f3.tar.bz2
libctf: work on platforms without O_CLOEXEC.
(Not tested on any such platforms, since I don't have access to any at the moment. Testing encouraged.) libctf/ * configure.ac: Check for O_CLOEXEC. * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be. * config.h.in: Regenerate.
Diffstat (limited to 'libctf/configure')
-rwxr-xr-xlibctf/configure37
1 files changed, 37 insertions, 0 deletions
diff --git a/libctf/configure b/libctf/configure
index d485b1a..31f1667 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -6462,6 +6462,43 @@ else
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
+$as_echo_n "checking for O_CLOEXEC... " >&6; }
+if ${ac_cv_libctf_macro_O_CLOEXEC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+
+int
+main ()
+{
+return O_CLOEXEC;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_libctf_macro_O_CLOEXEC=yes
+else
+ ac_cv_libctf_macro_O_CLOEXEC=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libctf_macro_O_CLOEXEC" >&5
+$as_echo "$ac_cv_libctf_macro_O_CLOEXEC" >&6; }
+
+if test $ac_cv_libctf_macro_O_CLOEXEC = yes; then
+
+$as_echo "#define HAVE_O_CLOEXEC 1" >>confdefs.h
+
+fi
+
ac_config_files="$ac_config_files Makefile"
ac_config_headers="$ac_config_headers config.h"