diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 10:25:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 10:25:41 +0000 |
commit | e2421845dfa50789cdeec02189290fdbe093acf2 (patch) | |
tree | 71c0c9071ac4a357342160cb11fc0051ea1dfaaf | |
parent | 4e015093125bc6dd074905ddfb4b1c88900453b2 (diff) | |
download | ruby-e2421845dfa50789cdeec02189290fdbe093acf2.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.in | 21 | ||||
-rw-r--r-- | version.h | 8 |
3 files changed, 28 insertions, 8 deletions
@@ -1,4 +1,9 @@ -Fri Mar 6 18:46:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> +Fri Mar 6 19:25:40 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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}) @@ -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 |