summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 08:33:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 08:33:03 +0000
commit834fd50ae2953505c454c56342a42da441ccb22f (patch)
tree6f0a480aa67d3e8f289e008da4faf76487ee731e
parent67db06ba972a1fc99d5942e0d96ee6f0662a0e55 (diff)
configure.in: multiarch option
* configure.in (multiarch): add option to move architecture dependent directories. [Feature #6111] * template/ruby.pc.in: add arch dependent paths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--configure.in31
-rw-r--r--template/ruby.pc.in4
3 files changed, 34 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 30f18c3..b14b928 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Wed Feb 6 17:32:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Wed Feb 6 17:33:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (multiarch): add option to move architecture dependent
+ directories. [Feature #6111]
+
+ * template/ruby.pc.in: add arch dependent paths.
* configure.in (rubyarchhdrdir, sitearchhdrdir, vendorarchhdrdir): add
options to customize architecture dependent header directories.
diff --git a/configure.in b/configure.in
index 1786402..2828ff7 100644
--- a/configure.in
+++ b/configure.in
@@ -3138,11 +3138,24 @@ 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}'${multiarch+'/${arch}'}
+sitearchlibdir='${libdir}'${multiarch+'/${sitearch}'}
+archincludedir='${includedir}'${multiarch+'/${arch}'}
+sitearchincludedir='${includedir}'${multiarch+'/${sitearch}'}
+
shvar_to_cpp() {
local var="$1" val="$2"
val="`echo '"'"${val}"'"' |
sed \
-e 's/\${\([[A-Z][A-Z_]]*\)}/"\1"/g' \
+ -e 's|\${sitearchlibdir}|'"${sitearchlibdir}|g" \
+ -e 's|\${sitearchincludedir}|'"${sitearchincludedir}|g" \
+ -e 's|\${archlibdir}|'"${archlibdir}|g" \
+ -e 's|\${archincludedir}|'"${archincludedir}|g" \
-e 's|\${libdir}|'"${libdir}|g" \
-e 's/\${ruby_version}/"RUBY_LIB_VERSION"/g' \
-e 's/\${arch}/"arch"/g' \
@@ -3173,9 +3186,9 @@ AC_ARG_WITH(rubylibprefix,
rubylibprefix="$withval"])
AC_SUBST(rubylibprefix)
rubylibdir='${rubylibprefix}/${ruby_version}'
-rubyarchdir='${rubylibdir}/${arch}'
+rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
-rubyarchprefix='${rubylibprefix}/${arch}'
+rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
AC_ARG_WITH(rubyarchprefix,
AS_HELP_STRING([--with-rubyarchprefix=DIR],
[prefix for architecture dependent ruby libraries [[RUBYLIBPREFIX/ARCH]]]),
@@ -3225,7 +3238,7 @@ AC_ARG_WITH(sitearchdir,
AS_HELP_STRING([--with-arch-sitedir=DIR],
[architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
[sitearchdir=$withval],
- [sitearchdir='${sitelibdir}/${sitearch}'])
+ [sitearchdir=${multiarch+'${rubyarchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
AC_ARG_WITH(vendordir,
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
@@ -3237,7 +3250,7 @@ AC_ARG_WITH(vendorarchdir,
AS_HELP_STRING([--with-arch-vendordir=DIR],
[architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
[vendorarchdir=$withval],
- [vendorarchdir='${vendorlibdir}/${sitearch}'])
+ [vendorarchdir=${multiarch+'${rubyarchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
@@ -3281,6 +3294,10 @@ else
AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCH_LIB_FOR(arch), ${RUBY_VENDOR_ARCH_LIB_FOR} !<verconf>!)
fi
+AC_SUBST(archlibdir)dnl
+AC_SUBST(sitearchlibdir)dnl
+AC_SUBST(archincludedir)dnl
+AC_SUBST(sitearchincludedir)dnl
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)dnl
@@ -3343,7 +3360,7 @@ AC_ARG_WITH(rubyarchhdrdir,
AS_HELP_STRING([--with-arch-rubyhdrdir=DIR],
[architecture dependent core headers in DIR [[$(rubyhdrdir)/$(arch)]]]),
[rubyarchhdrdir=$withval],
- [rubyarchhdrdir='${rubyhdrdir}/${arch}'])
+ [rubyarchhdrdir=${multiarch+'${archincludedir}/${RUBY_VERSION_NAME}'}${multiarch-'${rubyhdrdir}/${arch}'}])
AC_ARG_WITH(sitehdrdir,
AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
@@ -3354,7 +3371,7 @@ AC_ARG_WITH(sitearchhdrdir,
AS_HELP_STRING([--with-arch-sitehdrdir=DIR],
[architecture dependent core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
[sitearchhdrdir=$withval],
- [sitearchhdrdir='${sitehdrdir}/${sitearch}'])
+ [sitearchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/site_ruby'}${multiarch-'${sitehdrdir}/${sitearch}'}])
AC_ARG_WITH(vendorhdrdir,
AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
@@ -3365,7 +3382,7 @@ AC_ARG_WITH(vendorarchhdrdir,
AS_HELP_STRING([--with-arch-vendorhdrdir=DIR],
[architecture dependent core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
[vendorarchhdrdir=$withval],
- [vendorarchhdrdir='${vendorhdrdir}/${sitearch}'])
+ [vendorarchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/vendor_ruby'}${multiarch-'${vendorhdrdir}/${sitearch}'}])
AC_SUBST(rubyhdrdir)dnl
AC_SUBST(sitehdrdir)dnl
diff --git a/template/ruby.pc.in b/template/ruby.pc.in
index fe11b8a..7ffd2d4 100644
--- a/template/ruby.pc.in
+++ b/template/ruby.pc.in
@@ -24,6 +24,10 @@ LIBRUBYARG_STATIC=@LIBRUBYARG_STATIC@
LIBRUBYARG=@LIBRUBYARG@
LIBS=@LIBS@
DLDFLAGS=@DLDFLAGS@
+archlibdir=@archlibdir@
+sitearchlibdir=@sitearchlibdir@
+archincludedir=@archincludedir@
+sitearchincludedir=@sitearchincludedir@
ruby=${bindir}/${RUBY_INSTALL_NAME}@EXEEXT@
rubylibprefix=@rubylibprefix@
rubyarchprefix=@rubyarchprefix@