|
|
dc1507 |
2012-09-12 Teresa Johnson <tejohnson@google.com>
|
|
|
dc1507 |
|
|
|
dc1507 |
PR gcov-profile/54487
|
|
|
dc1507 |
* configure.ac (HOST_HAS_F_SETLKW): Set based on compile
|
|
|
dc1507 |
test using F_SETLKW with fcntl.
|
|
|
dc1507 |
* configure, config.in: Regenerate.
|
|
|
dc1507 |
|
|
|
dc1507 |
--- gcc/configure.ac (revision 191237)
|
|
|
dc1507 |
+++ gcc/configure.ac (revision 191238)
|
|
|
dc1507 |
@@ -1146,6 +1146,22 @@ if test $gcc_cv_type_clock_t = yes; then
|
|
|
dc1507 |
[Define if <time.h> defines clock_t.])
|
|
|
dc1507 |
fi
|
|
|
dc1507 |
|
|
|
dc1507 |
+# Check if F_SETLKW is supported by fcntl.
|
|
|
dc1507 |
+AC_CACHE_CHECK(for F_SETLKW, ac_cv_f_setlkw, [
|
|
|
dc1507 |
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
dc1507 |
+#include <fcntl.h>]], [[
|
|
|
dc1507 |
+struct flock fl;
|
|
|
dc1507 |
+fl.l_whence = 0;
|
|
|
dc1507 |
+fl.l_start = 0;
|
|
|
dc1507 |
+fl.l_len = 0;
|
|
|
dc1507 |
+fl.l_pid = 0;
|
|
|
dc1507 |
+return fcntl (1, F_SETLKW, &fl);]])],
|
|
|
dc1507 |
+[ac_cv_f_setlkw=yes],[ac_cv_f_setlkw=no])])
|
|
|
dc1507 |
+if test $ac_cv_f_setlkw = yes; then
|
|
|
dc1507 |
+ AC_DEFINE(HOST_HAS_F_SETLKW, 1,
|
|
|
dc1507 |
+ [Define if F_SETLKW supported by fcntl.])
|
|
|
dc1507 |
+fi
|
|
|
dc1507 |
+
|
|
|
dc1507 |
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
|
|
|
dc1507 |
CFLAGS="$saved_CFLAGS"
|
|
|
dc1507 |
|
|
|
dc1507 |
--- gcc/configure (revision 191237)
|
|
|
dc1507 |
+++ gcc/configure (revision 191238)
|
|
|
dc1507 |
@@ -13271,6 +13271,76 @@ _ACEOF
|
|
|
dc1507 |
|
|
|
dc1507 |
fi
|
|
|
dc1507 |
|
|
|
dc1507 |
+# Check if F_SETLKW is supported by fcntl.
|
|
|
dc1507 |
+echo "$as_me:$LINENO: checking for F_SETLKW" >&5
|
|
|
dc1507 |
+echo $ECHO_N "checking for F_SETLKW... $ECHO_C" >&6
|
|
|
dc1507 |
+if test "${ac_cv_f_setlkw+set}" = set; then
|
|
|
dc1507 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
|
dc1507 |
+else
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+cat >conftest.$ac_ext <<_ACEOF
|
|
|
dc1507 |
+/* confdefs.h. */
|
|
|
dc1507 |
+_ACEOF
|
|
|
dc1507 |
+cat confdefs.h >>conftest.$ac_ext
|
|
|
dc1507 |
+cat >>conftest.$ac_ext <<_ACEOF
|
|
|
dc1507 |
+/* end confdefs.h. */
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+#include <fcntl.h>
|
|
|
dc1507 |
+int
|
|
|
dc1507 |
+main ()
|
|
|
dc1507 |
+{
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+struct flock fl;
|
|
|
dc1507 |
+fl.l_whence = 0;
|
|
|
dc1507 |
+fl.l_start = 0;
|
|
|
dc1507 |
+fl.l_len = 0;
|
|
|
dc1507 |
+fl.l_pid = 0;
|
|
|
dc1507 |
+return fcntl (1, F_SETLKW, &fl);
|
|
|
dc1507 |
+ ;
|
|
|
dc1507 |
+ return 0;
|
|
|
dc1507 |
+}
|
|
|
dc1507 |
+_ACEOF
|
|
|
dc1507 |
+rm -f conftest.$ac_objext
|
|
|
dc1507 |
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
|
|
dc1507 |
+ (eval $ac_compile) 2>conftest.er1
|
|
|
dc1507 |
+ ac_status=$?
|
|
|
dc1507 |
+ grep -v '^ *+' conftest.er1 >conftest.err
|
|
|
dc1507 |
+ rm -f conftest.er1
|
|
|
dc1507 |
+ cat conftest.err >&5
|
|
|
dc1507 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
|
dc1507 |
+ (exit $ac_status); } &&
|
|
|
dc1507 |
+ { ac_try='test -z "$ac_c_werror_flag"
|
|
|
dc1507 |
+ || test ! -s conftest.err'
|
|
|
dc1507 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
|
dc1507 |
+ (eval $ac_try) 2>&5
|
|
|
dc1507 |
+ ac_status=$?
|
|
|
dc1507 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
|
dc1507 |
+ (exit $ac_status); }; } &&
|
|
|
dc1507 |
+ { ac_try='test -s conftest.$ac_objext'
|
|
|
dc1507 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
|
dc1507 |
+ (eval $ac_try) 2>&5
|
|
|
dc1507 |
+ ac_status=$?
|
|
|
dc1507 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
|
dc1507 |
+ (exit $ac_status); }; }; then
|
|
|
dc1507 |
+ ac_cv_f_setlkw=yes
|
|
|
dc1507 |
+else
|
|
|
dc1507 |
+ echo "$as_me: failed program was:" >&5
|
|
|
dc1507 |
+sed 's/^/| /' conftest.$ac_ext >&5
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+ac_cv_f_setlkw=no
|
|
|
dc1507 |
+fi
|
|
|
dc1507 |
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
|
dc1507 |
+fi
|
|
|
dc1507 |
+echo "$as_me:$LINENO: result: $ac_cv_f_setlkw" >&5
|
|
|
dc1507 |
+echo "${ECHO_T}$ac_cv_f_setlkw" >&6
|
|
|
dc1507 |
+if test $ac_cv_f_setlkw = yes; then
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+cat >>confdefs.h <<\_ACEOF
|
|
|
dc1507 |
+#define HOST_HAS_F_SETLKW 1
|
|
|
dc1507 |
+_ACEOF
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+fi
|
|
|
dc1507 |
+
|
|
|
dc1507 |
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
|
|
|
dc1507 |
CFLAGS="$saved_CFLAGS"
|
|
|
dc1507 |
|
|
|
dc1507 |
--- gcc/config.in (revision 191237)
|
|
|
dc1507 |
+++ gcc/config.in (revision 191238)
|
|
|
dc1507 |
@@ -1398,6 +1398,12 @@
|
|
|
dc1507 |
#endif
|
|
|
dc1507 |
|
|
|
dc1507 |
|
|
|
dc1507 |
+/* Define if F_SETLKW supported by fcntl. */
|
|
|
dc1507 |
+#ifndef USED_FOR_TARGET
|
|
|
dc1507 |
+#undef HOST_HAS_F_SETLKW
|
|
|
dc1507 |
+#endif
|
|
|
dc1507 |
+
|
|
|
dc1507 |
+
|
|
|
dc1507 |
/* Define as const if the declaration of iconv() needs const. */
|
|
|
dc1507 |
#ifndef USED_FOR_TARGET
|
|
|
dc1507 |
#undef ICONV_CONST
|