Alexandre Julliard : configure: Always use -fno-builtin if supported, since it's needed for scanf too.

Alexandre Julliard julliard at winehq.org
Mon Sep 22 07:03:45 CDT 2008


Module: wine
Branch: master
Commit: 6538cb44e371bcd3a821227ffc40624de5da1ead
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6538cb44e371bcd3a821227ffc40624de5da1ead

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Sep 22 11:51:02 2008 +0200

configure: Always use -fno-builtin if supported, since it's needed for scanf too.

---

 configure    |  118 +++++++++++++++++++++++++++++-----------------------------
 configure.ac |   12 +-----
 2 files changed, 60 insertions(+), 70 deletions(-)

diff --git a/configure b/configure
index ff2c11d..bc57d85 100755
--- a/configure
+++ b/configure
@@ -16266,6 +16266,65 @@ _ACEOF
 
 fi
 
+  { echo "$as_me:$LINENO: checking whether the compiler supports -fno-builtin" >&5
+echo $ECHO_N "checking whether the compiler supports -fno-builtin... $ECHO_C" >&6; }
+if test "${ac_cv_cflags__fno_builtin+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fno-builtin"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_cflags__fno_builtin=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_cflags__fno_builtin=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$ac_wine_try_cflags_saved
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cflags__fno_builtin" >&5
+echo "${ECHO_T}$ac_cv_cflags__fno_builtin" >&6; }
+if test $ac_cv_cflags__fno_builtin = yes; then
+  BUILTINFLAG="-fno-builtin"
+
+fi
+
   { echo "$as_me:$LINENO: checking whether the compiler supports -fno-strict-aliasing" >&5
 echo $ECHO_N "checking whether the compiler supports -fno-strict-aliasing... $ECHO_C" >&6; }
 if test "${ac_cv_cflags__fno_strict_aliasing+set}" = set; then
@@ -16555,65 +16614,6 @@ echo "${ECHO_T}$ac_cv_c_string_h_warnings" >&6; }
   then
     EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
   fi
-
-  BUILTINFLAG=""
-
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Werror"
-  { echo "$as_me:$LINENO: checking for builtin wchar inlines" >&5
-echo $ECHO_N "checking for builtin wchar inlines... $ECHO_C" >&6; }
-if test "${ac_cv_c_builtin_wchar_ctype+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-int iswlower(unsigned short);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_builtin_wchar_ctype=no
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_builtin_wchar_ctype=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_builtin_wchar_ctype" >&5
-echo "${ECHO_T}$ac_cv_c_builtin_wchar_ctype" >&6; }
-  CFLAGS="$saved_CFLAGS"
-  if test "$ac_cv_c_builtin_wchar_ctype" = "yes"
-  then
-    BUILTINFLAG="-fno-builtin"
-  fi
 fi
 
 
diff --git a/configure.ac b/configure.ac
index 27ae9ef..cda7f47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1238,6 +1238,7 @@ then
   WINE_TRY_CFLAGS([-fshort-wchar],
                   [AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar",
                              [Specifies the compiler flag that forces a short wchar_t])])
+  WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
   WINE_TRY_CFLAGS([-fno-strict-aliasing])
   WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
   WINE_TRY_CFLAGS([-Wwrite-strings])
@@ -1253,17 +1254,6 @@ then
   then
     EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
   fi
-
-  AC_SUBST(BUILTINFLAG,"")
-  saved_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Werror"
-  AC_CACHE_CHECK([for builtin wchar inlines], ac_cv_c_builtin_wchar_ctype,
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int iswlower(unsigned short);]])],[ac_cv_c_builtin_wchar_ctype=no],[ac_cv_c_builtin_wchar_ctype=yes]))
-  CFLAGS="$saved_CFLAGS"
-  if test "$ac_cv_c_builtin_wchar_ctype" = "yes"
-  then
-    BUILTINFLAG="-fno-builtin"
-  fi
 fi
 
 dnl **** Check how to define a function in assembly code ****




More information about the wine-cvs mailing list