emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117306: Use a shell function in configure.ac to cut


From: Paul Eggert
Subject: [Emacs-diffs] trunk r117306: Use a shell function in configure.ac to cut down on code duplication.
Date: Wed, 11 Jun 2014 17:51:31 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117306
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2014-06-11 10:51:27 -0700
message:
  Use a shell function in configure.ac to cut down on code duplication.
  
  * configure.ac (emacs_check_gnu_make): New shell function.
  Use it to avoid duplication when checking for GNU Make.
  It's OK for 'configure' to use shell functions these days,
  as long as we follow the advice in the 'Shell Functions'
  section of the Autoconf manual.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-06-11 03:03:40 +0000
+++ b/ChangeLog 2014-06-11 17:51:27 +0000
@@ -1,3 +1,12 @@
+2014-06-11  Paul Eggert  <address@hidden>
+
+       Use a shell function in configure.ac to cut down on code duplication.
+       * configure.ac (emacs_check_gnu_make): New shell function.
+       Use it to avoid duplication when checking for GNU Make.
+       It's OK for 'configure' to use shell functions these days,
+       as long as we follow the advice in the 'Shell Functions'
+       section of the Autoconf manual.
+
 2014-06-11  Glenn Morris  <address@hidden>
 
        * configure.ac: Require at least version 3.81 of GNU make.

=== modified file 'configure.ac'
--- a/configure.ac      2014-06-11 03:33:34 +0000
+++ b/configure.ac      2014-06-11 17:51:27 +0000
@@ -93,32 +93,35 @@
    AC_SUBST([SET_MAKE])])
 
 dnl Check for GNU Make and possibly set MAKE before running AM_INIT_AUTOMAKE.
+[emacs_check_gnu_make ()
+{
+  emacs_makeout=`($1 --version) 2>/dev/null` &&
+  case $emacs_makeout in
+    'GNU Make '3.8[1-9]* | 'GNU Make '3.9[0-9]* | \
+    'GNU Make '3.[1-9][0-9][0-9]* | 'GNU Make '[4-9]* | 'GNU Make '[1-9][0-9]* 
)
+       ac_path_MAKE_found=:;;
+  esac
+}]
 AC_CACHE_CHECK([for GNU Make], [ac_cv_path_MAKE],
   [ac_path_MAKE_found=false
    if test -n "$MAKE"; then
-     emacs_makeout=`($MAKE --version) 2>/dev/null` &&
-     case $emacs_makeout in
-       'GNU Make '[[1-3]][[0-9]]* | 'GNU Make '[[4-9]]* | 'GNU Make 
'3.8[[1-9]]* | 'GNU Make '3.9*)
-        ac_path_MAKE_found=:;;
-     esac
+     emacs_check_gnu_make "$MAKE"
      ac_cv_path_MAKE=$MAKE
    else
      emacs_tried_make=false
      emacs_tried_gmake=false
      emacs_tried_gnumake=false
      AC_PATH_PROGS_FEATURE_CHECK([MAKE], [make gmake gnumake],
-       [[emacs_makeout=`($ac_path_MAKE --version) 2>/dev/null` &&
-        case $emacs_makeout in
-          'GNU Make '[1-3][0-9]* | 'GNU Make '[4-9]* | 'GNU Make '3.8[1-9]* | 
'GNU Make '3.9*)
-             # Use the fully-qualified program name only if the basename
-             # would not resolve to it.
-             if eval \$emacs_tried_$ac_prog; then
-               ac_cv_path_MAKE=$ac_path_MAKE
-             else
-               ac_cv_path_MAKE=$ac_prog
-             fi
-             ac_path_MAKE_found=:;;
-        esac
+       [[emacs_check_gnu_make "$ac_path_MAKE"
+        if $ac_path_MAKE_found; then
+          # Use the fully-qualified program name only if the basename
+          # would not resolve to it.
+          if eval \$emacs_tried_$ac_prog; then
+            ac_cv_path_MAKE=$ac_path_MAKE
+          else
+            ac_cv_path_MAKE=$ac_prog
+          fi
+        fi
         eval emacs_tried_$ac_prog=:]])
    fi])
 $ac_path_MAKE_found || {


reply via email to

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