This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libstdc++] Cleanup build system [13/13]
- From: Kelley Cook <kcook at gcc dot gnu dot org>
- To: libstdc++ at gcc dot gnu dot org, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 08 Apr 2005 13:46:23 -0400
- Subject: [libstdc++] Cleanup build system [13/13]
- Hop-count: 1
After spending most of Thursday actually learning m4 ...I'm happy with
this patch.
Assuming part 10 and part 12 are also approved, then acconfig.h is now gone!
I'm including the diffs for config.h.in too, so it is simple to see what
happens.
You can see that there was previously a pasto associated with defining
ceil[fl]
ATAN2{F,L}, HYPOT{,F,L}, and MODF{F,L} were previously missing.
QFINITE and MODL go away, but they were never defined anyway and don't
exist in POSIX. Moreover they aren't present anywhere in libstdc++
sources. If one wishes to restore this check a one line addition to
call the appropriate GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_x in
GLIBCXX_CHECK_MATH_SUPPORT will put them back in.
The only changes to the generated Makefile.in was the deletion
acconfig.h as a dependency, while the generated configure is the same
except for whitespace.
OK?
2005-04-08 Kelley Cook <kcook@gcc.gnu.org>
* linkage.m4 (GLIBCXX_MAYBE_UNDERSCORED_FUNCS): New macro.
(GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1,
GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2,
GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3,
GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1,
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2): Use it.
(GLIBCXX_CHECK_MATH_SUPPORT): Delete obsolete comment.
* acconfig.h: Delete file.
* Makefile.in, config.h.in, configure: Regenerate.
diff -prdu -x '*~' -x autom4te.cache /home/kcook34/gcc-orig/libstdc++-v3/linkage.m4 ./linkage.m4
--- /home/kcook34/gcc-orig/libstdc++-v3/linkage.m4 2005-04-08 13:18:13.658033900 -0400
+++ ./linkage.m4 2005-04-08 12:54:54.022165200 -0400
@@ -28,6 +28,22 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_1], [
])
+dnl
+dnl Define autoheader template for using the underscore functions
+dnl For each parameter, create a macro where if func doesn't exist,
+dnl but _func does, then it will "#define func _func".
+dnl
+dnl GLIBCXX_MAYBE_UNDERSCORED_FUNCS
+AC_DEFUN([GLIBCXX_MAYBE_UNDERSCORED_FUNCS],
+[AC_FOREACH([glibcxx_ufunc], [$1],
+ [AH_VERBATIM(_[]glibcxx_ufunc,
+[#if defined (]AS_TR_CPP(HAVE__[]glibcxx_ufunc)[) && ! defined (]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[)
+# define ]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[ 1
+# define ]glibcxx_ufunc[ _]glibcxx_ufunc[
+#endif])])
+])
+
+
dnl
dnl Check to see if the (math function) argument passed is
dnl 1) declared when using the c++ compiler
@@ -51,6 +67,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LI
AC_CHECK_FUNCS(_$1)
fi
fi
+ GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1)
])
@@ -88,6 +105,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS_AND_L
AC_CHECK_FUNCS(patsubst(funclist,[\w+],[_\&]))
fi
fi
+ GLIBCXX_MAYBE_UNDERSCORED_FUNCS(funclist)
undefine([funclist])
])
@@ -134,6 +152,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LI
AC_CHECK_FUNCS(_$1)
fi
fi
+ GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1)
])
@@ -180,6 +199,7 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LI
AC_CHECK_FUNCS(_$1)
fi
fi
+ GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1)
])
@@ -238,6 +258,7 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_
if test x$glibcxx_cv_func_$1_use = x"yes"; then
AC_CHECK_FUNCS($1)
fi
+ GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1)
])
@@ -463,10 +484,6 @@ AC_DEFUN([GLIBCXX_CHECK_MATH_SUPPORT], [
GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
- dnl Some runtimes have these functions with a preceding underscore. Please
- dnl keep this sync'd with the one above. And if you add any new symbol,
- dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
- dnl Check to see if certain C math functions exist.
LIBS="$ac_save_LIBS"
CXXFLAGS="$ac_save_CXXFLAGS"
])
diff -prdu -x '*~' -x autom4te.cache /home/kcook34/gcc-orig/libstdc++-v3/config.h.in ./config.h.in
--- /home/kcook34/gcc-orig/libstdc++-v3/config.h.in 2005-04-08 12:54:35.215685400 -0400
+++ ./config.h.in 2005-04-08 13:24:12.036930900 -0400
@@ -1,6 +1,4 @@
/* config.h.in. Generated from configure.ac by autoheader. */
-// Symbols and macros for libstdc++ -*- C++ -*-
-
/* Define to 1 if you have the `acosf' function. */
#undef HAVE_ACOSF
@@ -706,10 +704,7 @@
/* Define if code specialized for wchar_t should be used. */
#undef _GLIBCXX_USE_WCHAR_T
-//
-// Systems that have certain non-standard functions prefixed with an
-// underscore, we'll handle those here. Must come after config.h.in.
-//
+
#if defined (HAVE__ACOSF) && ! defined (HAVE_ACOSF)
# define HAVE_ACOSF 1
# define acosf _acosf
@@ -730,6 +725,16 @@
# define asinl _asinl
#endif
+#if defined (HAVE__ATAN2F) && ! defined (HAVE_ATAN2F)
+# define HAVE_ATAN2F 1
+# define atan2f _atan2f
+#endif
+
+#if defined (HAVE__ATAN2L) && ! defined (HAVE_ATAN2L)
+# define HAVE_ATAN2L 1
+# define atan2l _atan2l
+#endif
+
#if defined (HAVE__ATANF) && ! defined (HAVE_ATANF)
# define HAVE_ATANF 1
# define atanf _atanf
@@ -742,12 +747,12 @@
#if defined (HAVE__CEILF) && ! defined (HAVE_CEILF)
# define HAVE_CEILF 1
-# define aceil _ceilf
+# define ceilf _ceilf
#endif
#if defined (HAVE__CEILL) && ! defined (HAVE_CEILL)
# define HAVE_CEILL 1
-# define aceil _ceill
+# define ceill _ceill
#endif
#if defined (HAVE__COPYSIGN) && ! defined (HAVE_COPYSIGN)
@@ -850,6 +855,21 @@
# define frexpl _frexpl
#endif
+#if defined (HAVE__HYPOT) && ! defined (HAVE_HYPOT)
+# define HAVE_HYPOT 1
+# define hypot _hypot
+#endif
+
+#if defined (HAVE__HYPOTF) && ! defined (HAVE_HYPOTF)
+# define HAVE_HYPOTF 1
+# define hypotf _hypotf
+#endif
+
+#if defined (HAVE__HYPOTL) && ! defined (HAVE_HYPOTL)
+# define HAVE_HYPOTL 1
+# define hypotl _hypotl
+#endif
+
#if defined (HAVE__ISINF) && ! defined (HAVE_ISINF)
# define HAVE_ISINF 1
# define isinf _isinf
@@ -915,9 +935,14 @@
# define modf _modf
#endif
-#if defined (HAVE__MODL) && ! defined (HAVE_MODL)
-# define HAVE_MODL 1
-# define modl _modl
+#if defined (HAVE__MODFF) && ! defined (HAVE_MODFF)
+# define HAVE_MODFF 1
+# define modff _modff
+#endif
+
+#if defined (HAVE__MODFL) && ! defined (HAVE_MODFL)
+# define HAVE_MODFL 1
+# define modfl _modfl
#endif
#if defined (HAVE__POWF) && ! defined (HAVE_POWF)
@@ -930,11 +955,6 @@
# define powl _powl
#endif
-#if defined (HAVE__QFINITE) && ! defined (HAVE_QFINITE)
-# define HAVE_QFINITE 1
-# define qfinite _qfinite
-#endif
-
#if defined (HAVE__QFPCLASS) && ! defined (HAVE_QFPCLASS)
# define HAVE_QFPCLASS 1
# define qfpclass _qfpclass