]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/acinclude.m4
acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Check for lldiv_t.
[gcc.git] / libstdc++-v3 / acinclude.m4
index 24fa70ec0ad81e709cb54e2f42935c2a6af1ee25..e658f571742abbbd7a57afa639dc5026ceeefe6f 100644 (file)
@@ -276,7 +276,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
   AC_REQUIRE([AC_PROG_LD])
 
   # Set --gc-sections.
-  if test "$ac_cv_prog_gnu_ld" = "broken"; then
+  if test "$ac_cv_prog_gnu_ld" = "notbroken"; then
     # GNU ld it is!  Joy and bunny rabbits!
 
     # All these tests are for C++; save the language and the compiler flags.
@@ -1440,21 +1440,44 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
    *)   AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
    esac],
   enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
+  # Allow use of os-dependent settings, so that macros that turn on
+  # C99 capabilities can be defined and used in a consistent way.
+  OS_INC_PATH=${srcdir}/$os_include_dir
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS="-I$OS_INC_PATH"
 
-  # Check for the existance of functions used if long long is enabled.
+  # Check for the existence of functions used if long long is enabled.
   AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
   AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
 
+  # Check for lldiv_t, et. al.
+  AC_MSG_CHECKING([for lldiv_t declaration])
+  AC_CACHE_VAL(glibcpp_lldiv_t_use, [
+  AC_TRY_COMPILE([#include <bits/os_defines.h>
+                 #include <stdlib.h>], 
+                   [ lldiv_t mydivt;], 
+                   [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
+  ])
+  AC_MSG_RESULT($glibcpp_lldiv_t_use)
+  if test x$glibcpp_lldiv_t_use = x"yes"; then
+    AC_DEFINE(_GLIBCPP_HAVE_LLDIV_T)
+  fi
+
   AC_MSG_CHECKING([for enabled long long])
   if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then 
     enable_long_long=no; 
   fi; 
   AC_MSG_RESULT($enable_long_long)
 
-  dnl Option parsed, now set things appropriately
+  # Option parsed, now set things appropriately
   if test x"$enable_long_long" = xyes; then
     AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
   fi
+       
+  # Reset CFLAGS
+  CFLAGS="$ac_save_CFLAGS"
 ])
 
 
This page took 0.031526 seconds and 5 git commands to generate.