* configure.ac: Modernize checks for `long long' and `long double'
[deliverable/binutils-gdb.git] / gdb / configure
index efb0a2cba48a404da0921bcfa6f8f1feeaf75405..8759ad17cfa59aa206e3301dcab17289d1022e28 100755 (executable)
@@ -17514,64 +17514,6 @@ _ACEOF
 fi
 
 
-# The following save_state_t checkery is only necessary for HPUX
-# versions earlier than 10.20.  When those fade from memory, this
-# could be expunged. --jsm 1999-03-22
-
-echo "$as_me:$LINENO: checking for HPUX save_state structure" >&5
-echo $ECHO_N "checking for HPUX save_state structure... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <machine/save_state.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "save_state_t" >/dev/null 2>&1; then
-  gdb_cv_hpux_savestate=yes
-else
-  gdb_cv_hpux_savestate=no
-fi
-rm -f conftest*
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <machine/save_state.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "ss_wide" >/dev/null 2>&1; then
-  gdb_cv_hpux_sswide=yes
-else
-  gdb_cv_hpux_sswide=no
-fi
-rm -f conftest*
-
-if test $gdb_cv_hpux_savestate = yes
-then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_SAVE_STATE_T 1
-_ACEOF
-
-fi
-if test $gdb_cv_hpux_sswide = yes
-then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_MEMBER_SS_WIDE 1
-_ACEOF
-
-fi
-echo "$as_me:$LINENO: result: $gdb_cv_hpux_sswide" >&5
-echo "${ECHO_T}$gdb_cv_hpux_sswide" >&6
-
-
 # If we are configured native on GNU/Linux, work around problems with
 # sys/procfs.h
 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
@@ -18917,6 +18859,7 @@ _ACEOF
   fi
 fi
 
+# Check if the compiler supports the `long long' type.
 
 echo "$as_me:$LINENO: checking for long long support in compiler" >&5
 echo $ECHO_N "checking for long long support in compiler... $ECHO_C" >&6
@@ -18929,14 +18872,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+extern long long foo;
 int
 main ()
 {
-
-  extern long long foo;
-  switch (foo & 2) { case 0: return 1; }
-
+switch (foo & 2) { case 0: return 1; }
   ;
   return 0;
 }
@@ -18972,16 +18912,17 @@ gdb_cv_c_long_long=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 echo "$as_me:$LINENO: result: $gdb_cv_c_long_long" >&5
 echo "${ECHO_T}$gdb_cv_c_long_long" >&6
 if test $gdb_cv_c_long_long = yes; then
-  cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
 #define CC_HAS_LONG_LONG 1
 _ACEOF
 
 fi
 
+# Check if the compiler and runtime support printing long longs.
 
 echo "$as_me:$LINENO: checking for long long support in printf" >&5
 echo $ECHO_N "checking for long long support in printf... $ECHO_C" >&6
@@ -18997,9 +18938,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int main () {
-  char buf[32];
+$ac_includes_default
+int
+main ()
+{
+char buf[32];
   long long l = 0;
   l = (l << 16) + 0x0123;
   l = (l << 16) + 0x4567;
@@ -19007,6 +18950,8 @@ int main () {
   l = (l << 16) + 0xcdef;
   sprintf (buf, "0x%016llx", l);
   return (strcmp ("0x0123456789abcdef", buf));
+  ;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-
+echo "$as_me:$LINENO: result: $gdb_cv_printf_has_long_long" >&5
+echo "${ECHO_T}$gdb_cv_printf_has_long_long" >&6
 if test $gdb_cv_printf_has_long_long = yes; then
-  cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
 #define PRINTF_HAS_LONG_LONG 1
 _ACEOF
 
 fi
-echo "$as_me:$LINENO: result: $gdb_cv_printf_has_long_long" >&5
-echo "${ECHO_T}$gdb_cv_printf_has_long_long" >&6
 
+# Check if the compiler supports the `long double' type.  We can't use
+# AC_C_LONG_DOUBLE because that one does additional checks on the
+# constants defined in <float.h> that fail on some systems,
+# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
 
 echo "$as_me:$LINENO: checking for long double support in compiler" >&5
 echo $ECHO_N "checking for long double support in compiler... $ECHO_C" >&6
-if test "${ac_cv_c_long_double+set}" = set; then
+if test "${gdb_cv_c_long_double+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19054,14 +19003,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int
-main ()
-{
 long double foo;
-  ;
-  return 0;
-}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -19085,25 +19027,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_long_double=yes
+  gdb_cv_c_long_double=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_c_long_double=no
+gdb_cv_c_long_double=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+echo "$as_me:$LINENO: result: $gdb_cv_c_long_double" >&5
+echo "${ECHO_T}$gdb_cv_c_long_double" >&6
+if test $gdb_cv_c_long_double = yes; then
 
-echo "$as_me:$LINENO: result: $ac_cv_c_long_double" >&5
-echo "${ECHO_T}$ac_cv_c_long_double" >&6
-if test $ac_cv_c_long_double = yes; then
-  cat >>confdefs.h <<\_ACEOF
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_LONG_DOUBLE 1
 _ACEOF
 
 fi
 
+# Check if the compiler and runtime support printing long doubles.
 
 echo "$as_me:$LINENO: checking for long double support in printf" >&5
 echo $ECHO_N "checking for long double support in printf... $ECHO_C" >&6
@@ -19119,12 +19062,16 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int main () {
-  char buf[16];
+$ac_includes_default
+int
+main ()
+{
+char buf[16];
   long double f = 3.141592653;
   sprintf (buf, "%Lg", f);
   return (strncmp ("3.14159", buf, 7));
+  ;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-
+echo "$as_me:$LINENO: result: $gdb_cv_printf_has_long_double" >&5
+echo "${ECHO_T}$gdb_cv_printf_has_long_double" >&6
 if test $gdb_cv_printf_has_long_double = yes; then
-  cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
 #define PRINTF_HAS_LONG_DOUBLE 1
 _ACEOF
 
 fi
-echo "$as_me:$LINENO: result: $gdb_cv_printf_has_long_double" >&5
-echo "${ECHO_T}$gdb_cv_printf_has_long_double" >&6
 
+# Check if the compiler and runtime support scanning long doubles.
 
 echo "$as_me:$LINENO: checking for long double support in scanf" >&5
 echo $ECHO_N "checking for long double support in scanf... $ECHO_C" >&6
@@ -19175,12 +19123,16 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int main () {
-  char *buf = "3.141592653";
+#include <stdio.h>
+int
+main ()
+{
+char *buf = "3.141592653";
   long double f = 0;
   sscanf (buf, "%Lg", &f);
   return !(f > 3.14159 && f < 3.14160);
+  ;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-
+echo "$as_me:$LINENO: result: $gdb_cv_scanf_has_long_double" >&5
+echo "${ECHO_T}$gdb_cv_scanf_has_long_double" >&6
 if test $gdb_cv_scanf_has_long_double = yes; then
-  cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
 #define SCANF_HAS_LONG_DOUBLE 1
 _ACEOF
 
 fi
-echo "$as_me:$LINENO: result: $gdb_cv_scanf_has_long_double" >&5
-echo "${ECHO_T}$gdb_cv_scanf_has_long_double" >&6
 
 case ${host_os} in
 aix*)
This page took 0.029611 seconds and 4 git commands to generate.