From 41d42a59373a53754b7e3de3b3509f459832145e Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 1 Jan 2014 09:19:37 +0000 Subject: [PATCH] configure.in: LDFLAGS and DLDFLAGS for opt-dir * configure.in: reset LDFLAGS and DLDFLAGS for opt-dir again after LIBPATHFLAG and RPATHFLAG are set. [ruby-dev:47868] [Bug #9317] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 29 +++++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98aa306bfa..085b464965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 1 18:19:35 2014 Nobuyoshi Nakada + + * configure.in: reset LDFLAGS and DLDFLAGS for opt-dir again after + LIBPATHFLAG and RPATHFLAG are set. [ruby-dev:47868] [Bug #9317] + Wed Jan 1 11:12:29 2014 Nobuyoshi Nakada * configure.in: use SSE2 instructions for drop unexpected diff --git a/configure.in b/configure.in index 60ab5777ac..e8194abf64 100644 --- a/configure.in +++ b/configure.in @@ -865,17 +865,11 @@ AC_ARG_WITH(opt-dir, [ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"` CPPFLAGS="$CPPFLAGS $val" - val=`IFS="$PATH_SEPARATOR" - for dir in $withval; do - echo x ${LIBPATHFLAG} ${RPATHFLAG} | - sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g" - done | tr '\012' ' '` + val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib|g;s/^ //"` + LDFLAGS="$LDFLAGS $val" LDFLAGS_OPTDIR="$val" - test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS " - LDFLAGS="$LDFLAGS$val" - test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS " - DLDFLAGS="$DLDFLAGS$val" - ]) + OPT_DIR="$withval" + ], [OPT_DIR=]) test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\"" test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\"" @@ -2762,6 +2756,21 @@ AC_SUBST(RPATHFLAG) AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}") AC_SUBST(TRY_LINK) +if test "x$OPT_DIR" != x; then + pat=`echo "${LDFLAGS_OPTDIR}" | sed ['s/[][\\.*|]/\\\\&/']` + LDFLAGS=`echo "${LDFLAGS}" | sed "s| ${pat}||"` + val=`IFS="$PATH_SEPARATOR" + for dir in $OPT_DIR; do + echo x ${LIBPATHFLAG} ${RPATHFLAG} | + sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g" + done | tr '\012' ' '` + test x"${LDFLAGS}" = x || LDFLAGS="$LDFLAGS " + LDFLAGS="$LDFLAGS$val" + test x"${DLDFLAGS}" = x || DLDFLAGS="$DLDFLAGS " + DLDFLAGS="$DLDFLAGS$val" + LDFLAGS_OPTDIR="$val" +fi + AS_CASE(["$target_cpu-$target_os"], [*-darwin*], [ AC_CHECK_HEADERS([execinfo.h])