From 85aae4c658cd515a02fcc646fa1d1d67aed2c2c6 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 6 Feb 2013 08:32:43 +0000 Subject: [PATCH] configure.in: architecture name * configure.in, version.c: parametric architecture name for paths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 +++- configure.in | 10 ++++++++-- version.c | 33 +++++++++++++++++---------------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86221a16ea..4da5c90afb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Wed Feb 6 17:32:36 2013 Nobuyoshi Nakada +Wed Feb 6 17:32:41 2013 Nobuyoshi Nakada + + * configure.in, version.c: parametric architecture name for paths. * configure.in (shvar_to_cpp): convert sh variable references by replacing with string literal forms in cpp. diff --git a/configure.in b/configure.in index 0b369bea04..cff998d53d 100644 --- a/configure.in +++ b/configure.in @@ -3143,8 +3143,8 @@ shvar_to_cpp() { -e 's/\${\([[A-Z][A-Z_]]*\)}/"\1"/g' \ -e 's|\${libdir}|'"${libdir}|g" \ -e 's/\${ruby_version}/"RUBY_LIB_VERSION"/g' \ - -e 's/\${arch}/"RUBY_ARCH"/g' \ - -e 's/\${sitearch}/"RUBY_SITEARCH"/g' \ + -e 's/\${arch}/"arch"/g' \ + -e 's/\${sitearch}/"arch"/g' \ -e 's/\${vendorarchdir}/"RUBY_VENDOR_ARCH_LIB"/g' \ -e 's/\${sitearchdir}/"RUBY_SITE_ARCH_LIB"/g' \ -e 's/\${vendorlibdir}/"RUBY_VENDOR_LIB2"/g' \ @@ -3240,17 +3240,23 @@ shvar_to_cpp RUBY_LIB "${rubylibdir}" if test "x${RUBY_LIB}" != 'xRUBY_LIB_PREFIX"/"RUBY_LIB_VERSION'; then AC_DEFINE_UNQUOTED(RUBY_LIB, ${RUBY_LIB} !!) fi +shvar_to_cpp RUBY_ARCH_LIB_FOR "${rubyarchdir}" +AC_DEFINE_UNQUOTED(RUBY_ARCH_LIB_FOR(arch), ${RUBY_ARCH_LIB_FOR} !!) if test "x$sitedir" = xno; then AC_DEFINE(NO_RUBY_SITE_LIB, [] !!) else shvar_to_cpp RUBY_SITE_LIB "${sitedir}" AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB} !!) + shvar_to_cpp RUBY_SITE_ARCH_LIB_FOR "${sitearchdir}" + AC_DEFINE_UNQUOTED(RUBY_SITE_ARCH_LIB_FOR(arch), ${RUBY_SITE_ARCH_LIB_FOR} !!) fi if test "x$vendordir" = xno; then AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !!) else shvar_to_cpp RUBY_VENDOR_LIB "${vendordir}" AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB} !!) + shvar_to_cpp RUBY_VENDOR_ARCH_LIB_FOR "${vendorarchdir}" + AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCH_LIB_FOR(arch), ${RUBY_VENDOR_ARCH_LIB_FOR} !!) fi AC_SUBST(arch)dnl diff --git a/version.c b/version.c index 26e275a2e4..282960d72f 100644 --- a/version.c +++ b/version.c @@ -42,13 +42,14 @@ #define RUBY_LIB RUBY_LIB_PREFIX "/"RUBY_LIB_VERSION #define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION #define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION -#define RUBY_ARCHLIB RUBY_LIB "/"RUBY_ARCH -#define RUBY_SITE_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_SITEARCH -#define RUBY_VENDOR_ARCHLIB RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH -#ifdef RUBY_THINARCH -#define RUBY_THIN_ARCHLIB RUBY_LIB "/"RUBY_THINARCH -#define RUBY_SITE_THIN_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_THINARCH -#define RUBY_VENDOR_THIN_ARCHLIB RUBY_VENDOR_LIB2 "/"RUBY_THINARCH +#ifndef RUBY_ARCH_LIB_FOR +#define RUBY_ARCH_LIB_FOR(arch) RUBY_LIB "/"arch +#endif +#ifndef RUBY_SITE_ARCH_LIB_FOR +#define RUBY_SITE_ARCH_LIB_FOR(arch) RUBY_SITE_LIB2 "/"arch +#endif +#ifndef RUBY_VENDOR_ARCH_LIB_FOR +#define RUBY_VENDOR_ARCH_LIB_FOR(arch) RUBY_VENDOR_LIB2 "/"arch #endif const int ruby_api_version[] = { @@ -72,27 +73,27 @@ const char ruby_initial_load_paths[] = #endif #ifndef NO_RUBY_SITE_LIB RUBY_SITE_LIB2 "\0" -#ifdef RUBY_SITE_THIN_ARCHLIB - RUBY_SITE_THIN_ARCHLIB "\0" +#ifdef RUBY_THINARCH + RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0" #endif - RUBY_SITE_ARCHLIB "\0" + RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0" RUBY_SITE_LIB "\0" #endif #ifndef NO_RUBY_VENDOR_LIB RUBY_VENDOR_LIB2 "\0" -#ifdef RUBY_VENDOR_THIN_ARCHLIB - RUBY_VENDOR_THIN_ARCHLIB "\0" +#ifdef RUBY_THINARCH + RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0" #endif - RUBY_VENDOR_ARCHLIB "\0" + RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0" RUBY_VENDOR_LIB "\0" #endif RUBY_LIB "\0" -#ifdef RUBY_THIN_ARCHLIB - RUBY_THIN_ARCHLIB "\0" +#ifdef RUBY_THINARCH + RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0" #endif - RUBY_ARCHLIB "\0" + RUBY_ARCH_LIB_FOR(RUBY_ARCH) "\0" #endif "";