about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-10-26 17:59:59 +0000
committerUlrich Drepper <drepper@redhat.com>1998-10-26 17:59:59 +0000
commita8eab8b1402ceff505b0cdee440c02a72cc4307d (patch)
tree8e80293b123361be225adf8e0048ffcdb866349d /configure.in
parent665a657ef1aec8a605aa33e46a4f701e2fd9eba3 (diff)
downloadglibc-a8eab8b1402ceff505b0cdee440c02a72cc4307d.tar.gz
glibc-a8eab8b1402ceff505b0cdee440c02a72cc4307d.tar.xz
glibc-a8eab8b1402ceff505b0cdee440c02a72cc4307d.zip
Update.
	* include/libc-symbols.h: If HAVE_BUILTIN_EXPECT is not defined
	define __builtin_expect as a macro substituting to the first
	argument.
	* config.h.in: Define HAVE_BUILTIN_EXPECT.
	* configure.in: Add test for __builtin_expect.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index d256af08da..40d9f55a16 100644
--- a/configure.in
+++ b/configure.in
@@ -987,6 +987,28 @@ static)
   ;;
 esac
 
+dnl Check whether compiler understands __builtin_expect.
+AC_CACHE_CHECK(for __builtin_expect, libc_cv_gcc_builtin_expect,
+[cat > conftest.c <<EOF
+#line __oline__ "configure"
+int foo (int a)
+{
+  a = __builtin_expect (a, 10);
+  return a == 10 ? 0 : 1;
+}
+EOF
+dnl No \ in command here because it ends up inside ''.
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -nostdlib -nostartfiles
+			    -o conftest conftest.c -lgcc >&AC_FD_CC]); then
+  libc_cv_gcc_builtin_expect=yes
+else
+  libc_cv_gcc_builtin_expect=no
+fi
+rm -f conftest*])
+if test "$libc_cv_gcc_builtin_expect" = yes; then
+  AC_DEFINE(HAVE_BUILTIN_EXPECT)
+fi
+
 ### End of automated tests.
 ### Now run sysdeps configure fragments.