From 402e59f82f13306e66199395370eaeff8cb541c2 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Mon, 23 Feb 2009 21:45:02 +0100 Subject: [PATCH] New decimal constants ECL_VERSION_NUMBER (C/C++) and EXT:+ECL-VERSION-NUMBER+ (Lisp) --- src/CHANGELOG | 5 +++++ src/c/symbols_list.h | 2 ++ src/c/symbols_list2.h | 2 ++ src/configure | 10 +++++++--- src/configure.in | 10 +++++++--- src/h/config.h.in | 3 +++ 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index aa3f1964c..1aa9f13de 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -87,6 +87,11 @@ ECL 9.1.0: now stored using an (ARRAY (SIGNED-BYTE 32)). This saves memory on systems with 64-bit pointers. + - Two new constants, a C macro ECL_VERSION_NUMBER, and Lisp constant + EXT:+ECL-VERSION-NUMBER+, allow determining the version of ECL with + a greater granurality. The constant is a decimal number, yymmaa, + matching the ECL versioning scheme. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index 81b234c8a..b830f028b 100644 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -1749,5 +1749,7 @@ cl_symbols[] = { {EXT_ "HEAP-SIZE", EXT_ORDINARY, si_heap_size, -1, OBJNULL}, #endif +{EXT_ "+ECL-VERSION-NUMBER+", EXT_CONSTANT, NULL, -1, MAKE_FIXNUM(ECL_VERSION_NUMBER)}, + /* Tag for end of list */ {NULL, CL_ORDINARY, NULL, -1, OBJNULL}}; diff --git a/src/c/symbols_list2.h b/src/c/symbols_list2.h index 5c0b4df50..89b4c1c75 100644 --- a/src/c/symbols_list2.h +++ b/src/c/symbols_list2.h @@ -1749,5 +1749,7 @@ cl_symbols[] = { {EXT_ "HEAP-SIZE","si_heap_size"}, #endif +{EXT_ "+ECL-VERSION-NUMBER+",NULL}, + /* Tag for end of list */ {NULL,NULL}}; diff --git a/src/configure b/src/configure index f41a5b906..09d7a8147 100755 --- a/src/configure +++ b/src/configure @@ -654,6 +654,7 @@ CL_FIXNUM_TYPE EGREP GREP XMKMF +ECL_VERSION_NUMBER SONAME_LDFLAGS SONAME SONAME1 @@ -5162,6 +5163,9 @@ fi { $as_echo "$as_me:$LINENO: checking for soname flags" >&5 $as_echo_n "checking for soname flags... " >&6; } +PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(.*\)\..*\..*,\1,g'` +PACKAGE_MINOR=`echo ${PACKAGE_VERSION} | sed -e 's,.*\.\(.*\)\..*,\1,g'` +PACKAGE_LEAST=`echo ${PACKAGE_VERSION} | sed -e 's,.*\..*\.\(.*\),\1,g'` if test "${enable_soname}" != yes; then SONAME='' SONAME1='' @@ -5172,9 +5176,6 @@ if test "${enable_soname}" != yes; then { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } else - PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(.*\)\..*\..*,\1,g'` - PACKAGE_MINOR=`echo ${PACKAGE_VERSION} | sed -e 's,.*\.\(.*\)\..*,\1,g'` - PACKAGE_LEAST=`echo ${PACKAGE_VERSION} | sed -e 's,.*\..*\.\(.*\),\1,g'` i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_LEAST}" SONAME3=`echo $SONAME | sed "s,.SOVERSION,.$i,g"` i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}" @@ -5192,6 +5193,9 @@ fi +ECL_VERSION_NUMBER=$(($PACKAGE_MAJOR * 10000 + $PACKAGE_MINOR * 100 + $PACKAGE_LEAST)) + + if test "${with_fpe}" != yes; then cat >>confdefs.h <<\_ACEOF #define ECL_AVOID_FPE_H 1 diff --git a/src/configure.in b/src/configure.in index ec16be599..3f4a1a2b0 100644 --- a/src/configure.in +++ b/src/configure.in @@ -397,6 +397,9 @@ dnl ---------------------------------------------------------------------- dnl SONAME is only active when SONAME_LDFLAGS and SONAME are non nil dnl AC_MSG_CHECKING(for soname flags) +PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(.*\)\..*\..*,\1,g'` +PACKAGE_MINOR=`echo ${PACKAGE_VERSION} | sed -e 's,.*\.\(.*\)\..*,\1,g'` +PACKAGE_LEAST=`echo ${PACKAGE_VERSION} | sed -e 's,.*\..*\.\(.*\),\1,g'` if test "${enable_soname}" != yes; then SONAME='' SONAME1='' @@ -406,9 +409,6 @@ if test "${enable_soname}" != yes; then SONAME_LDFLAGS='' AC_MSG_RESULT([none]) else - PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(.*\)\..*\..*,\1,g'` - PACKAGE_MINOR=`echo ${PACKAGE_VERSION} | sed -e 's,.*\.\(.*\)\..*,\1,g'` - PACKAGE_LEAST=`echo ${PACKAGE_VERSION} | sed -e 's,.*\..*\.\(.*\),\1,g'` i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_LEAST}" SONAME3=`echo $SONAME | sed "s,.SOVERSION,.$i,g"` i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}" @@ -425,6 +425,10 @@ AC_SUBST(SONAME1) AC_SUBST(SONAME) AC_SUBST(SONAME_LDFLAGS) +dnl Related to that, the package version number +ECL_VERSION_NUMBER=$(($PACKAGE_MAJOR * 10000 + $PACKAGE_MINOR * 100 + $PACKAGE_LEAST)) +AC_SUBST(ECL_VERSION_NUMBER) + dnl ---------------------------------------------------------------------- dnl Deactivate floating point exceptions if asked to if test "${with_fpe}" != yes; then diff --git a/src/h/config.h.in b/src/h/config.h.in index c884603de..ebfb9978a 100644 --- a/src/h/config.h.in +++ b/src/h/config.h.in @@ -39,6 +39,9 @@ # define ECL_API #endif +/* Decimal number made with the formula yymmvv */ +#define ECL_VERSION_NUMBER @ECL_VERSION_NUMBER@ + /* * FEATURES LINKED IN */