texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6466] get Perl configuration values differently


From: Gavin D. Smith
Subject: [6466] get Perl configuration values differently
Date: Sat, 25 Jul 2015 21:15:45 +0000

Revision: 6466
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6466
Author:   gavin
Date:     2015-07-25 21:15:44 +0000 (Sat, 25 Jul 2015)
Log Message:
-----------
get Perl configuration values differently

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/XSParagraph/configure.ac

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-07-25 19:56:57 UTC (rev 6465)
+++ trunk/ChangeLog     2015-07-25 21:15:44 UTC (rev 6466)
@@ -4,6 +4,11 @@
        * tp/Texinfo/Convert/XSParagraph/XSParagraph.pm: Don't goto a 
        label inside an if (0) { ... } block.
 
+       * tp/Texinfo/Convert/XSParagraph/configure.ac (fetch_conf): New 
+       function, to replace fetch_conf.pl script.  Use Perl executable 
+       from ${PERL} instead of /usr/bin/env perl, to make it easier for
+       the user to use a different perl.
+
 2015-07-25  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Convert/Plaintext.pm (new_formatter): Uncomment 

Modified: trunk/tp/Texinfo/Convert/XSParagraph/configure.ac
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/configure.ac   2015-07-25 19:56:57 UTC 
(rev 6465)
+++ trunk/tp/Texinfo/Convert/XSParagraph/configure.ac   2015-07-25 21:15:44 UTC 
(rev 6466)
@@ -9,16 +9,37 @@
 
 LT_INIT
 
+AC_PATH_PROG([PERL], [perl])
+
+fetch_conf ()
+{
+          conf_value=`${PERL} -V:$1`
+          echo got "$conf_value"
+          # This turns a string like "cc='cc';" into a string like "cc".
+          # We also turn \" into ", \' into ' and \\ into \.  There may 
+          # be other \ sequences we want to process as well.  This is
+          # the escape sequence for single-quoted strings in Perl.
+          conf_value=`echo $conf_value \
+              | sed -e 's/^@<:@^=@:>@*= *//' \
+                    -e 's/^'\''//'           \
+                    -e 's/ *; *$//'          \
+                    -e 's/'\''$//'           \
+                    -e 's/\\"/"/'            \
+                    -e 's/\\'\''/\'\''/'     \
+                    -e 's/\\\\/\\/'          `
+          echo got "$conf_value"
+} 
+
 AC_DEFUN([lookup_perl_conf],
          [echo Getting Perl conf value $1
-          AC_SUBST([PERL_CONF_$1], [`$srcdir/fetch_conf.pl $1`])
-         ])
+          fetch_conf $1
+          AC_SUBST([PERL_CONF_$1], [$conf_value])
+])
 
 AC_DEFUN([lookup_perl_flags],
          [echo Getting Perl flags for $1
 
-          conf_value=`$srcdir/fetch_conf.pl $1`
-          echo conf value is $conf_value
+          fetch_conf $1
 
           # Remove any flags that aren't -I or -D
           conf_value=`echo $conf_value | sed -e 's/-@<:@^ID@:>@@<:@^ @:>@*//g'`
@@ -38,7 +59,6 @@
 # TODO: would be nice to be able to do lookup_perl_conf([ccflags cccdlflags])
 # A for loop doesn't work; it has to be expanded at m4 time
 
-AC_PATH_PROG([PERL], [perl])
 AC_PATH_PROG([XSUBPP], [xsubpp])
 
 AC_CONFIG_FILES([Makefile lib/Makefile])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]