diff --git a/ChangeLog b/ChangeLog index dd581d549b..7fa2f29323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Fri Mar 6 18:46:51 2009 Nobuyoshi Nakada +Fri Mar 6 19:25:40 2009 Nobuyoshi Nakada + + * configure.in (RUBY_LIB_VERSION_STYLE): sets full or minor style + not to show RUBY_VERSION_MAJOR and so on. + + * version.h (RUBY_LIB_VERSION): makes from RUBY_LIB_VERSION_STYLE. * configure.in, Makefile.in, win32/Makefile.sub (CHDIR): cd using phisical directory. diff --git a/configure.in b/configure.in index 529e567c96..569deefb52 100644 --- a/configure.in +++ b/configure.in @@ -2136,20 +2136,23 @@ AC_ARG_WITH(ruby-version, [ruby_version=$withval], [ruby_version=full]) unset RUBY_LIB_VERSION +unset RUBY_LIB_VERSION_STYLE case "$ruby_version" in when(full) - RUBY_LIB_VERSION='STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY)' + RUBY_LIB_VERSION_STYLE='3 /* full */' ;; when(minor) - RUBY_LIB_VERSION='STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)' + RUBY_LIB_VERSION_STYLE='2 /* minor */' ;; esac -if test ${RUBY_LIB_VERSION+set}; then +if test ${RUBY_LIB_VERSION_STYLE+set}; then { - echo '#include "version.h"' - echo "ruby_version=${RUBY_LIB_VERSION}" + echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE" + echo '#define STRINGIZE(x) x' + echo '#include "version.h"' + echo 'ruby_version=RUBY_LIB_VERSION' } > conftest.c - ruby_version="`$CPP -I"${srcdir}" -D'STRINGIZE(x)=x' conftest.c | grep '^ruby_version='`" + ruby_version="`$CPP -I"${srcdir}" conftest.c | grep '^ruby_version='`" eval $ruby_version else RUBY_LIB_VERSION="\"${ruby_version}\"" @@ -2199,7 +2202,11 @@ case "$RUBY_VENDOR_LIB_PATH" in esac RUBY_VENDOR_LIB_PATH2='RUBY_VENDOR_LIB"/"RUBY_LIB_VERSION' -AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, ${RUBY_LIB_VERSION}) +if test ${RUBY_LIB_VERSION_STYLE+set}; then + AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE) +else + AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION]) +fi AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, "${RUBY_LIB_PREFIX}") AC_DEFINE_UNQUOTED(RUBY_LIB, ${RUBY_LIB_PATH}) AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH}) diff --git a/version.h b/version.h index f998043dbd..88717e6495 100644 --- a/version.h +++ b/version.h @@ -24,6 +24,14 @@ RUBY_EXTERN const char ruby_copyright[]; #define RUBY_BIRTH_MONTH 2 #define RUBY_BIRTH_DAY 24 +#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE +# if RUBY_LIB_VERSION_STYLE == 3 +# define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY) +# elif RUBY_LIB_VERSION_STYLE == 2 +# define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR) +# endif +#endif + #if RUBY_PATCHLEVEL == -1 #define RUBY_PATCHLEVEL_STR "dev" #else