Skip to content

Commit

Permalink
configure.in: expand libdir_basename
Browse files Browse the repository at this point in the history
* configure.in (libdir_basename): expand with multiarch in configure,
  not to defer the expansion till ruby.pc.in and mkmf.rb.  [Bug ruby#7874]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 21, 2013
1 parent cb71fee commit 739c8ff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Thu Feb 21 09:51:05 2013 Nobuyoshi Nakada <[email protected]>
Thu Feb 21 12:42:19 2013 Nobuyoshi Nakada <[email protected]>

* configure.in (libdir_basename): expand with multiarch in configure,
not to defer the expansion till ruby.pc.in and mkmf.rb. [Bug #7874]

* configure.in (libdir_basename): also -rpath and -install_name flags
are affected when libruby directory changes. [Bug #7874]
Expand Down
1 change: 0 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libdir = @libdir@
libdir_basename = @libdir_basename@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
Expand Down
32 changes: 15 additions & 17 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,15 @@ AS_CASE(["$target_os"],
DLDLIBS="$DLDLIBS -lc"
])

AC_ARG_ENABLE(multiarch,
AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
[multiarch=], [unset multiarch])

archlibdir='${libdir}/${arch}'
sitearchlibdir='${libdir}/${sitearch}'
archincludedir='${includedir}/${arch}'
sitearchincludedir='${includedir}/${sitearch}'

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)'])
Expand All @@ -2680,7 +2689,7 @@ ENABLE_SHARED=no
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
libprefix='$(libdir)'
libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
LIBRUBY_RELATIVE=${load_relative-no}
AS_CASE("$enable_shared", [yes], [
LIBRUBY='$(LIBRUBY_SO)'
Expand All @@ -2699,7 +2708,7 @@ AS_CASE("$enable_shared", [yes], [
AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
fi
AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
AC_SUBST(libdir_basename)
libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}

AS_CASE(["$target_os"],
[freebsd*|dragonfly*], [],
Expand All @@ -2720,7 +2729,8 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'" $LDFLAGS_OPTDIR"
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
if test "$load_relative" = yes; then
LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../\${libdir_basename}'"
libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
LIBRUBY_RELATIVE=yes
fi
],
Expand Down Expand Up @@ -2777,7 +2787,7 @@ AS_CASE("$enable_shared", [yes], [
RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
if test "$load_relative" = yes; then
libprefix='@executable_path/../${libdir_basename}'
libprefix="@executable_path/../${libdir_basename}"
LIBRUBY_RELATIVE=yes
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
Expand Down Expand Up @@ -2834,7 +2844,7 @@ AS_CASE("$enable_shared", [yes], [
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L${libprefix}"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi
Expand Down Expand Up @@ -3229,18 +3239,6 @@ AS_CASE(["$target_os"],
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
])

AC_ARG_ENABLE(multiarch,
AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
[multiarch=], [unset multiarch])

archlibdir='${libdir}/${arch}'
sitearchlibdir='${libdir}/${sitearch}'
archincludedir='${includedir}/${arch}'
sitearchincludedir='${includedir}/${sitearch}'
if test ${libdir_basename+set}; then
libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}
fi

shvar_to_cpp() {
local var="$1" val="$2"
local exec_prefix_pat="`echo \"${exec_prefix}\" | sed 's/\\./\\\\./g'`"
Expand Down

0 comments on commit 739c8ff

Please sign in to comment.