From 7254573c551f83a83cf3f2d6e97de8ebe72e16fa Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 17 Oct 2012 06:33:14 +0000 Subject: configure.in: multiple opt-dir * configure.in (opt-dir): allow multiple directories separated by $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868] [Bug #7120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ configure.in | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96645c5b55..d7a48e1231 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 17 15:33:12 2012 Nobuyoshi Nakada + + * configure.in (opt-dir): allow multiple directories separated by + $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868] + [Bug #7120] + Wed Oct 17 15:08:13 2012 Shugo Maeda * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept diff --git a/configure.in b/configure.in index e2d43d1cdb..c038aa29e6 100644 --- a/configure.in +++ b/configure.in @@ -2293,13 +2293,19 @@ AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}") AC_SUBST(TRY_LINK) AC_ARG_WITH(opt-dir, - AS_HELP_STRING([--with-opt-dir=DIR], [add optional headers and libraries DIR]), + AS_HELP_STRING([--with-opt-dir=DIR-LIST], + [add optional headers and libraries directories separated by $PATH_SEPARATOR]), [ - CPPFLAGS="$CPPFLAGS -I$withval/include" - val=`echo $withval|sed 's/\\//\\\\\\//g'` - val=`echo ${LIBPATHFLAG} ${RPATHFLAG}|sed -E 's/%1\\$-s|%s/'${val}'\/lib/g'` - LDFLAGS="$LDFLAGS $val" - DLDFLAGS="$DLDFLAGS $val" + CPPFLAGS="$CPPFLAGS `echo \"$PATH_SEPARATOR$withval\" | sed \"s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //\"`" + set -x + val=`IFS="$PATH_SEPARATOR" + for dir in $withval; do + echo x ${LIBPATHFLAG} ${RPATHFLAG} | + sed -E 's/^x *//;s'"${PATH_SEPARATOR}"'%1\\$-s|%s'"${IFS}${dir}/lib${IFS}g" + done | tr '\012' ' '` + set +x + LDFLAGS="$LDFLAGS${LDFLAGS:+ }$val" + DLDFLAGS="$DLDFLAGS${DLDFLAGS:+ }$val" ]) AS_CASE(["$target_cpu-$target_os"], -- cgit v1.2.3