[前][次][番号順一覧][スレッド一覧]

ruby-changes:27242

From: nobu <ko1@a...>
Date: Mon, 18 Feb 2013 10:22:51 +0900 (JST)
Subject: [ruby-changes:27242] nobu:r39294 (trunk): configure.in: unexpand_shvar

nobu	2013-02-18 10:09:56 +0900 (Mon, 18 Feb 2013)

  New Revision: 39294

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39294

  Log:
    configure.in: unexpand_shvar
    
    * configure.in (unexpand_shvar): regularize a shell variable by
      unexpanding shell variables in it.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in

Index: configure.in
===================================================================
--- configure.in	(revision 39293)
+++ configure.in	(revision 39294)
@@ -3227,6 +3227,23 @@ shvar_to_cpp() { https://github.com/ruby/ruby/blob/trunk/configure.in#L3227
     eval $var='"$val"'
 }
 
+unexpand_shvar() {
+    local var=$1 val n v expr quote
+    shift
+    test "$#" == 0 && return
+    quote=['s/${[^${}"]*}/"&"/g']
+    for n do
+        eval v='"$'$n'"'
+	v="`echo \"$v\" | sed -e \"$quote\" -e ['s/[][$|.\\?*]/\\\\&/g']`"
+	if test -n "$v"; then
+	    expr=["${expr};s|"'\("[^$"]*\)'"$v|\\1\${$n}\"|g"]
+	    AS_CASE(["$v"], [*'${'*'}'*], [expr=["$expr;s|$v|\"\${$n}\"|g"]])
+	fi
+    done
+    expr=["${quote}${expr};"'s/"\(\${[^${}"]*}\)"/\1/g']
+    eval $var='"`echo \"\\\"${'$var'}\\\"\" | sed \"$expr;s/\\\"\\\"//g;s/^\\\"//;s/\\\"\\\$//\"`"'
+}
+
 rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
 AC_ARG_WITH(rubylibprefix,
 	    AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
@@ -3311,6 +3328,9 @@ AC_ARG_WITH(vendorarchdir, https://github.com/ruby/ruby/blob/trunk/configure.in#L3328
             [vendorarchdir=$withval],
             [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
 
+unexpand_shvar rubylibprefix       exec_prefix libdir RUBY_BASE_NAME
+unexpand_shvar rubyarchprefix      exec_prefix libdir arch RUBY_BASE_NAME archlibdir rubylibprefix
+unexpand_shvar rubysitearchprefix  exec_prefix libdir sitearch arch RUBY_BASE_NAME archlibdir sitearchlibdir rubylibprefix
 if test "${LOAD_RELATIVE+set}"; then
     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
     RUBY_EXEC_PREFIX='""'
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39293)
+++ ChangeLog	(revision 39294)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Feb 18 10:09:54 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (unexpand_shvar): regularize a shell variable by
+	  unexpanding shell variables in it.
+
+Mon Feb 18 10:08:28 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (unexpand_shvar): regularize a shell variable by
+	  unexpanding shell variables in it.
+
 Sun Feb 17 20:55:44 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* compar.c (rb_invcmp): compare by inversed comarison, with preventing

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]