1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-03-06 10:25:41 +00:00
parent 4e01509312
commit e2421845df
3 changed files with 28 additions and 8 deletions

View file

@ -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.

View file

@ -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})

View file

@ -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