[PATCH] Configure support for 'long long'
Chip Salzenberg
chip@valinux.com
Sat Apr 1 00:00:00 GMT 2000
2000-02-11 Chip Salzenberg <chip@valinux.com>
Support 'configure --enable-long-long'.
* bits/c++config.h (_GLIBCPP_USE_LONG_LONG): Remove.
* stl/bits/stl_config.h (__STL_LONG_LONG): Remove '#if 0'.
* acconfig.h (_GLIBCPP_USE_LONG_LONG): Add. Default to undef.
* acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Define flag macro.
* configure.in (GLIBCPP_ENABLE_LONG_LONG): Use it.
(This patch also include changes to some derived files:
* aclocal.m4
* config.h.in
* configure
... because the Cygnus versions of some of the tools involved
are still not public, AFAIK.)
Index: bits/c++config.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/c++config.h,v
retrieving revision 1.26
diff -u -2 -r1.26 c++config.h
--- c++config.h 2000/02/02 08:46:40 1.26
+++ c++config.h 2000/02/11 22:19:10
@@ -59,11 +59,4 @@
//#define _GLIBCPP_DEPRICATED 1
-// Implies that long long should be used.
-// On __linux__ systesms, it may be necessary to define __USE_GNU
-// and _GNU_SOURCE. This is required for limits.h to define
-// LONG_LONG_MIN and LONG_LONG_MAX, which are used in std_limits.h if
-// __STL_LONG_LONG is defined.
-//#define _GLIBCPP_USE_LONG_LONG 1
-
// Use corrected code from the committee library group's issues list.
# define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
Index: stl/bits/stl_config.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/stl/bits/stl_config.h,v
retrieving revision 1.22
diff -u -2 -r1.22 stl_config.h
--- stl_config.h 1999/09/09 04:40:34 1.22
+++ stl_config.h 2000/02/11 22:19:20
@@ -270,10 +270,7 @@
# define __STL_USE_EXCEPTIONS
# endif
-/// 1998-10-27 ncm, support for long long elsewhere is not ready yet.
-#if 0
# ifndef __STRICT_ANSI__
# define __STL_LONG_LONG
# endif
-#endif
# endif
Index: acconfig.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/acconfig.h,v
retrieving revision 1.14
diff -u -2 -r1.14 acconfig.h
--- acconfig.h 2000/02/09 18:06:34 1.14
+++ acconfig.h 2000/02/11 22:19:04
@@ -8,4 +8,7 @@
#undef _GLIBCPP_USE_NAMESPACES
+// Include support for 'long long' and 'unsigned long long'.
+#undef _GLIBCPP_USE_LONG_LONG
+
// Define if the host has a type mbstate_t defined in
// wchar.h, as required by 21.1.3.1. Some systems, namely
Index: acinclude.m4
===================================================================
RCS file: /cvs/libstdc++/libstdc++/acinclude.m4,v
retrieving revision 1.6
diff -u -2 -r1.6 acinclude.m4
--- acinclude.m4 2000/02/09 14:01:01 1.6
+++ acinclude.m4 2000/02/11 22:19:05
@@ -97,4 +101,11 @@
dnl defaults to `no'.
dnl
+dnl GLIBCPP_ENABLE_LONG_LONG
+dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
+dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
+dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
+dnl defaults to `no'.
+dnl
dnl GLIBCPP_ENABLE_NAMESPACES
dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES
@@ -131,4 +142,25 @@
esac
AC_SUBST(DEBUGFLAGS)
+])
+
+
+dnl GLIBCPP_ENABLE_LONG_LONG
+AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
+define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
+AC_ARG_ENABLE(long-long,
+changequote(<<, >>)dnl
+<< --enable-long_long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
+changequote([, ])dnl
+[case "$enableval" in
+ yes) enable_long_long=yes ;;
+ no) enable_long_long=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
+ esac],
+enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
+dnl Option parsed, now set things appropriately
+case "$enable_long_long" in
+ yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
+ ;;
+esac
])
Index: aclocal.m4
===================================================================
RCS file: /cvs/libstdc++/libstdc++/aclocal.m4,v
retrieving revision 1.14
diff -u -2 -r1.14 aclocal.m4
--- aclocal.m4 2000/02/09 18:06:34 1.14
+++ aclocal.m4 2000/02/11 22:19:06
@@ -1,5 +1,5 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999, 2000 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -109,4 +113,11 @@
dnl defaults to `no'.
dnl
+dnl GLIBCPP_ENABLE_LONG_LONG
+dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
+dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
+dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
+dnl defaults to `no'.
+dnl
dnl GLIBCPP_ENABLE_NAMESPACES
dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES
@@ -143,4 +154,25 @@
esac
AC_SUBST(DEBUGFLAGS)
+])
+
+
+dnl GLIBCPP_ENABLE_LONG_LONG
+AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
+define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
+AC_ARG_ENABLE(long-long,
+changequote(<<, >>)dnl
+<< --enable-long_long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
+changequote([, ])dnl
+[case "$enableval" in
+ yes) enable_long_long=yes ;;
+ no) enable_long_long=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
+ esac],
+enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
+dnl Option parsed, now set things appropriately
+case "$enable_long_long" in
+ yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
+ ;;
+esac
])
Index: config.h.in
===================================================================
RCS file: /cvs/libstdc++/libstdc++/config.h.in,v
retrieving revision 1.24
diff -u -2 -r1.24 config.h.in
--- config.h.in 2000/02/09 18:06:34 1.24
+++ config.h.in 2000/02/11 22:19:07
@@ -11,4 +11,7 @@
#undef _GLIBCPP_USE_NAMESPACES
+// Include support for 'long long' and 'unsigned long long'.
+#undef _GLIBCPP_USE_LONG_LONG
+
// Define if the host has a type mbstate_t defined in
// wchar.h, as required by 21.1.3.1. Some systems, namely
Index: configure.in
===================================================================
RCS file: /cvs/libstdc++/libstdc++/configure.in,v
retrieving revision 1.50
diff -u -2 -r1.50 configure.in
--- configure.in 2000/02/10 20:00:58 1.50
+++ configure.in 2000/02/11 22:19:10
@@ -58,4 +58,5 @@
GLIBCPP_ENABLE_DEBUG
+GLIBCPP_ENABLE_LONG_LONG
GLIBCPP_ENABLE_NAMESPACES
GLIBCPP_ENABLE_RELIBGCC
Index: configure
===================================================================
RCS file: /cvs/libstdc++/libstdc++/configure,v
retrieving revision 1.50
diff -u -2 -r1.50 configure
--- configure 2000/02/10 20:00:58 1.50
+++ configure 2000/02/11 22:19:10
@@ -3,5 +3,5 @@
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 00 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -2207,4 +2207,23 @@
;;
no) DEBUGFLAGS='-g'
+ ;;
+esac
+
+
+# Check whether --enable-long-long or --disable-long-long was given.
+if test "${enable_long_long+set}" = set; then
+ enableval="$enable_long_long"
+ case "$enableval" in
+ yes) enable_long_long=yes ;;
+ no) enable_long_long=no ;;
+ *) { echo "configure: error: Unknown argument to enable/disable long long" 1>&2; exit 1; } ;;
+ esac
+else
+ enable_long_long=no
+fi
+case "$enable_long_long" in
+ yes) cat >> confdefs.h <<\EOF
+#define _GLIBCPP_USE_LONG_LONG 1
+EOF
;;
esac
More information about the Libstdc++
mailing list