dnl future trouble.
dnl ===========================================================================
+dnl GINAC_HEADER_GETVAL(NAME,FILE)
+dnl ----------------------------
+dnl Expand at autoconf time to the value of a "#define NAME" from the given
+dnl FILE. The regexps here aren't very rugged, but are enough for us.
+dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted.
+dnl (shamelessly ripped from GMP, and changed prefix to GINAC_).
+
+define(GINAC_HEADER_GETVAL,
+[patsubst(patsubst(
+esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]),
+[^.*$1[ ]+],[]),
+[[
+ ]*$],[])])
+define(GINAC_GET_VERSION,
+[GINAC_HEADER_GETVAL(GINACLIB_$1_VERSION,[ginac/version.h])])
+
dnl Usage: GINAC_STD_CXX_HEADERS
dnl Check for standard C++ headers, bail out if something is missing.
AC_DEFUN([GINAC_STD_CXX_HEADERS], [
dnl Process this file with autoconf to produce a configure script.
dnl GiNaC version number
-m4_define([ginac_major_version], [1])
-m4_define([ginac_minor_version], [6])
-m4_define([ginac_micro_version], [2])
+m4_define([ginac_major_version], GINAC_GET_VERSION([MAJOR]))
+m4_define([ginac_minor_version], GINAC_GET_VERSION([MINOR]))
+m4_define([ginac_micro_version], GINAC_GET_VERSION([MICRO]))
m4_define([ginac_version], [ginac_major_version.ginac_minor_version.ginac_micro_version])
m4_define([ginac_release], [ginac_major_version.ginac_minor_version])
AC_PREREQ(2.59)
AC_CONFIG_SRCDIR(ginac/basic.cpp)
AC_CONFIG_AUX_DIR([config])
-AC_CONFIG_HEADERS([config/config.h ginac/version.h])
+AC_CONFIG_HEADERS([config/config.h])
AC_CONFIG_MACRO_DIR([m4])
dnl This defines PACKAGE and VERSION.
AM_INIT_AUTOMAKE([gnu 1.8 dist-bzip2])
-dnl Process GiNaC version information
-AC_DEFINE([GINACLIB_MAJOR_VERSION], ginac_major_version, [Major version of GiNaC])
-AC_DEFINE([GINACLIB_MINOR_VERSION], ginac_minor_version, [Minor version of GiNaC])
-AC_DEFINE([GINACLIB_MICRO_VERSION], ginac_micro_version, [Micro version of GiNaC])
-
dnl GiNaC archive file version information.
dnl
dnl If properties have been added, ARCHIVE_VERSION += 1, ARCHIVE_AGE += 1.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_VERSION_H__
-#define __GINAC_VERSION_H__
+#ifndef GINAC_VERSION_H
+#define GINAC_VERSION_H
/* Major version of GiNaC */
-#undef GINACLIB_MAJOR_VERSION
+#define GINACLIB_MAJOR_VERSION 1
/* Minor version of GiNaC */
-#undef GINACLIB_MINOR_VERSION
+#define GINACLIB_MINOR_VERSION 6
/* Micro version of GiNaC */
-#undef GINACLIB_MICRO_VERSION
+#define GINACLIB_MICRO_VERSION 2
namespace GiNaC {
} // namespace GiNaC
-#endif // ndef __GINAC_VERSION_H__
+#endif // ndef GINAC_VERSION_H