diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-08 01:14:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-08 01:14:14 +0000 |
commit | 240e3ce9159ab29636baf2d0c79d9bb6f0b60b19 (patch) | |
tree | 96c872851cbbacdd4ef0d053e0398500b83ef80b | |
parent | b0d8c103fc15bfadc408d148c2e79b773d22589e (diff) | |
download | ruby-240e3ce9159ab29636baf2d0c79d9bb6f0b60b19.tar.gz ruby-240e3ce9159ab29636baf2d0c79d9bb6f0b60b19.tar.xz ruby-240e3ce9159ab29636baf2d0c79d9bb6f0b60b19.zip |
* Makefile.in, configure.in, win32/Makefile.sub (RUBY_BASE_NAME):
program base name. [ruby-dev:38241]
* configure.in (--with-soname): base name of shared library.
[ruby-dev:38290]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.in | 1 | ||||
-rw-r--r-- | configure.in | 48 | ||||
-rw-r--r-- | lib/mkmf.rb | 1 | ||||
-rw-r--r-- | win32/Makefile.sub | 17 |
5 files changed, 54 insertions, 21 deletions
@@ -1,3 +1,11 @@ +Fri May 8 10:14:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * Makefile.in, configure.in, win32/Makefile.sub (RUBY_BASE_NAME): + program base name. [ruby-dev:38241] + + * configure.in (--with-soname): base name of shared library. + [ruby-dev:38290] + Fri May 8 10:07:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * array.c (rb_ary_flatten_bang): clears temporary array. diff --git a/Makefile.in b/Makefile.in index 0ebf9bd57..167be6ec4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,6 +66,7 @@ BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@ BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@ BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@ +RUBY_BASE_NAME=@RUBY_BASE_NAME@ RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@ RUBY_SO_NAME=@RUBY_SO_NAME@ EXEEXT = @EXEEXT@ diff --git a/configure.in b/configure.in index 724b58bbd..b63c67717 100644 --- a/configure.in +++ b/configure.in @@ -113,6 +113,8 @@ if test "$program_prefix" = NONE; then fi RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"` RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"` +AC_SUBST(RUBY_BASE_NAME) +AC_SUBST(RUBYW_BASE_NAME) AC_CANONICAL_TARGET target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'` @@ -1932,7 +1934,10 @@ case "$target_os" in ;; esac -RUBY_SO_NAME='$(RUBY_INSTALL_NAME)' +AC_ARG_WITH(soname, + AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]), + [RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)']) + LIBRUBY_LDSHARED=$LDSHARED LIBRUBY_DLDFLAGS=$DLDFLAGS LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)' @@ -2020,7 +2025,7 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)' LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_* $(XLDFLAGS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib' - LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib' + LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib' ;; when(interix*) LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)' @@ -2110,16 +2115,17 @@ case "$target_os" in CPPFLAGS="$CPPFLAGS -I/boot/home/config/include" ;; when(cygwin*|mingw*) + RUBY_SO_NAME="${RUBY_SO_NAME}${MAJOR}${MINOR}${TEENY}" LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' case "$target_os" in when(cygwin*) if test x"$enable_shared" = xyes; then - LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}${TEENY}.dll + LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' fi ;; when(mingw*) - RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}${TEENY} + RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}" if test x"$enable_shared" = xyes; then LIBRUBY_SO='$(RUBY_SO_NAME)'.dll LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)' @@ -2275,14 +2281,20 @@ ri_suffix= test "$program_suffix" != NONE && ri_suffix=$program_suffix -RUBY_INSTALL_NAME="${ri_prefix}${RUBY_BASE_NAME}${ri_suffix}" +RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}" case "$target_os" in when(cygwin*|mingw*) - RUBYW_INSTALL_NAME="${ri_prefix}${RUBYW_BASE_NAME}${ri_suffix}" - rubyw_install_name="$RUBYW_INSTALL_NAME" + RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}" + rubyw_install_name='$(RUBYW_INSTALL_NAME)' ;; esac -RUBY_LIB_PREFIX=`eval echo \\"${libdir}/${RUBY_INSTALL_NAME}\\"` + +rubylibprefix='${libdir}/${RUBY_BASE_NAME}' +AC_ARG_WITH(rubylibprefix, + AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_INSTALL_NAME]]]), + [rubylibprefix=$withval]) +RUBY_LIB_PREFIX=`eval echo \\"${rubylibprefix}\\"` +AC_SUBST(rubylibprefix) AC_ARG_WITH(ruby-version, AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]), @@ -2314,14 +2326,20 @@ fi AC_ARG_WITH(sitedir, AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]), [sitedir=$withval], - [sitedir='${libdir}/${RUBY_INSTALL_NAME}/site_ruby']) -SITE_DIR=`eval echo \\"${sitedir}\\"` + [sitedir='${rubylibprefix}/site_ruby']) +dir="${sitedir}" +until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do + dir="${SITE_DIR}" +done AC_ARG_WITH(vendordir, AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]), [vendordir=$withval], - [vendordir='${libdir}/${RUBY_INSTALL_NAME}/vendor_ruby']) -VENDOR_DIR=`eval echo \\"${vendordir}\\"` + [vendordir='${rubylibprefix}/vendor_ruby']) +dir="${vendordir}" +until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do + dir="${VENDOR_DIR}" +done if test "${LOAD_RELATIVE+set}"; then AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) @@ -2423,9 +2441,9 @@ if test "$search_path" != ""; then fi AC_ARG_WITH(rubyhdrdir, - AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_INSTALL_NAME/RUBY_VERSION]]]), + AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME/RUBY_VERSION]]]), [rubyhdrdir=$withval], - [rubyhdrdir='${includedir}/${RUBY_INSTALL_NAME}-${ruby_version}']) + [rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}']) AC_ARG_WITH(sitehdrdir, AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [RUBYHDRDIR/site_ruby]]), @@ -2494,7 +2512,7 @@ done AC_SUBST(BUILTIN_TRANSSRCS) AC_SUBST(BUILTIN_TRANSOBJS) -PACKAGE=$RUBY_INSTALL_NAME +PACKAGE=$RUBY_BASE_NAME AC_SUBST(PACKAGE) AC_MSG_RESULT($PACKAGE library version = $ruby_version) diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 4c69eb6d6..d24c87f5c 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1450,6 +1450,7 @@ LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'} AR = #{CONFIG['AR']} EXEEXT = #{CONFIG['EXEEXT']} +RUBY_BASE_NAME = #{CONFIG['RUBY_BASE_NAME']} RUBY_INSTALL_NAME = #{CONFIG['RUBY_INSTALL_NAME']} RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']} arch = #{CONFIG['arch']} diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 8c15802b4..5e375a134 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -32,8 +32,11 @@ LIB = $(pathlist:;=/lib;) !ifndef srcdir srcdir = .. !endif +!ifndef RUBY_BASE_NAME +RUBY_BASE_NAME = ruby +!endif !ifndef RUBY_INSTALL_NAME -RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)ruby$(RUBY_SUFFIX) +RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(RUBY_SUFFIX) !endif !if !defined(RUBYW_INSTALL_NAME) || "$(RUBYW_INSTALL_NAME)" == "$(RUBY_INSTALL_NAME)" RUBYW_INSTALL_NAME = $(RUBY_INSTALL_NAME:ruby=rubyw) @@ -116,7 +119,7 @@ ruby_version = $(MAJOR).$(MINOR).$(TEENY) !endif !ifndef RUBY_SO_NAME -RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY) +RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)$(TEENY) !endif !ifndef RUBY_PLATFORM RUBY_PLATFORM = $(arch) @@ -529,7 +532,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define LOAD_RELATIVE 1 #define DLEXT ".so" #define RUBY_LIB_VERSION_STYLE 3 /* full */ -#define RUBY_LIB_PREFIX "/lib/$(RUBY_INSTALL_NAME)" +#define RUBY_LIB_PREFIX "/lib/$(RUBY_BASE_NAME)" #define RUBY_LIB RUBY_LIB_PREFIX"/"RUBY_LIB_VERSION #define RUBY_SITE_LIB RUBY_LIB_PREFIX"/site_ruby" #define RUBY_SITE_LIB2 RUBY_SITE_LIB"/"RUBY_LIB_VERSION @@ -645,6 +648,7 @@ s,@ARCHFILE@,,;t t s,@RDOCTARGET@,,;t t s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t +s,@RUBY_BASE_NAME@,$(RUBY_BASE_NAME),;t t s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t @@ -686,9 +690,10 @@ s,@EXPORT_PREFIX@, ,;t t s,@arch@,$(ARCH)-$(PLATFORM),;t t s,@sitearch@,$(ARCH)-$(RT),;t t s,@ruby_version@,$(ruby_version),;t t -s,@sitedir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/site_ruby,;t t -s,@vendordir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/vendor_ruby,;t t -s,@rubyhdrdir@,$$(includedir)/$${RUBY_INSTALL_NAME}-$$(ruby_version),;t t +s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t +s,@sitedir@,$${rubylibprefix}/site_ruby,;t t +s,@vendordir@,$${rubylibprefix}/vendor_ruby,;t t +s,@rubyhdrdir@,$$(includedir)/$${RUBY_BASE_NAME}-$$(ruby_version),;t t s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t |