autoconf-patches
[Top][All Lists]
Advanced

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

FYI: 93-expr.patch


From: Akim Demaille
Subject: FYI: 93-expr.patch
Date: 12 Jan 2001 10:20:57 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake)

I apply this as is, but I confess I'd like feedback on the `expr' part
of tests/Makefile.am.  I think it is good that `expr' is left in
tests/ when maintainer-check failed, but others might have different
opinions.

Also, I'm no pro in Makefiles, and don't know too well about phony and
other weird things.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        With `expr's that return `0' on failures, the executable suffix is
        `0'.  Test and fix.
        Reported by Assar Westerlund.
        
        * Makefile.am (maintainer-check): New target.
        * tests/Makefile.am (maintainer-check, maintainer-check-posix)
        (maintainer-check-c++, expr): Likewise.
        * configure.in (EXPR): Look for it.
        * tests/atgeneral.m4 (AT_CHECK): Propagate $2's default value.
        * tests/compile.at (Extensions): New test.
        * aclang.m4 (_AC_COMPILER_EXEEXT_DEFAULT, _AC_COMPILER_EXEEXT_O):
        Distinguish files with or without a dot.
        
Index: Makefile.am
--- Makefile.am Fri, 22 Dec 2000 18:31:03 +0100 akim (ace/45_Makefile.a 1.41 
644)
+++ Makefile.am Thu, 11 Jan 2001 23:40:05 +0100 akim (ace/45_Makefile.a 1.41 
644)
@@ -89,6 +89,11 @@
 MAINTAINERCLEANFILES = acversion.m4 INSTALL.txt
 
 
+## maintainer-check ##
+
+maintainer-check:
+       cd tests && make maintainer-check
+
 ## ----------------------------------- ##
 ## Special installation instructions.  ##
 ## ----------------------------------- ##
Index: aclang.m4
--- aclang.m4 Sat, 23 Dec 2000 11:22:15 +0100 akim (ace/b/32_aclang.m4 1.5.3.64 
644)
+++ aclang.m4 Fri, 12 Jan 2001 00:22:29 +0100 akim (ace/b/32_aclang.m4 1.5.3.64 
644)
@@ -651,6 +651,7 @@ AC_DEFUN([AC_OBJEXT],   [])
 # _AC_COMPILER_EXEEXT_DEFAULT
 # ---------------------------
 # Check for the extension used for the default name for executables.
+# Beware of `expr' that may return `0' or `'.
 m4_define([_AC_COMPILER_EXEEXT_DEFAULT],
 [# Try without -o first, disregard a.out.
 ac_link_default=`echo "$ac_link" | sed ['s/ -o *conftest[^ ]*//']`
@@ -658,8 +659,9 @@ m4_define([_AC_COMPILER_EXEEXT_DEFAULT],
 [for ac_file in `ls a.exe conftest.exe a.* conftest conftest.* 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.out | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
-    *) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
-       break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
+          break;;
+    * ) break;;
   esac
 done],
           [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
@@ -683,8 +685,9 @@ m4_define([_AC_COMPILER_EXEEXT_O],
 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
     *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
-    *) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
-       break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : ['[^.]*\(\..*\)']`
+          break;;
+    * ) break;;
   esac
 done],
               [AC_MSG_ERROR([cannot compute EXEEXT: cannot compile and link])])
Index: configure.in
--- configure.in Tue, 12 Dec 2000 20:23:51 +0100 akim (ace/7_configure. 1.27 
644)
+++ configure.in Thu, 11 Jan 2001 23:59:05 +0100 akim (ace/7_configure. 1.27 
644)
@@ -6,6 +6,7 @@
 
 # Initialize the test suite.
 AT_CONFIG(..)
+AC_PATH_PROG(EXPR, expr)
 
 # We use a path for GNU m4 so even if users have another m4 first in
 # their path, the installer can configure with a path that has GNU m4
Index: tests/Makefile.am
--- tests/Makefile.am Fri, 15 Dec 2000 20:41:04 +0100 akim (ace/b/17_Makefile.a 
1.37 644)
+++ tests/Makefile.am Fri, 12 Jan 2001 00:01:23 +0100 akim (ace/b/17_Makefile.a 
1.37 644)
@@ -54,6 +54,36 @@
 update.at: mktests.sh $(MACRO_FILES)
        cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
 
-CLEANFILES = debug-*.sh macro configure configure.in config.status \
-             config.cache config.log config.h.in config.h
+CLEANFILES = debug-*.sh macro configure configure.in configure.ac \
+             config.status config.cache config.log config.h.in config.h \
+             stderr stdout empty
 DISTCLEANFILES = atconfig testsuite
+
+
+## ------------------ ##
+## Maintainer rules.  ##
+## ------------------ ##
+
+## maintainer-check ##
+
+maintainer-check: maintainer-check-posix maintainer-check-c++
+
+# The hairy heredoc is more robust than using echo.
+expr:
+       echo '#! $(SHELL)'            >expr
+       echo 'address@hidden@ "$$@"`' >>expr
+       echo 'estatus=$$?'           >>expr
+       echo 'cat <<EOF'             >>expr
+       echo '$${result:-0}'         >>expr
+       echo 'EOF'                   >>expr
+       echo 'exit $$estatus'        >>expr
+       chmod +x expr
+
+# Try the test suite with more severe environments.
+maintainer-check-posix: expr
+       POSIXLY_CORRECTLY=yes make check
+       rm expr
+
+# Try using G++ as a C compiler.
+maintainer-check-c++:
+       CC=g++ make check
\ No newline at end of file
Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Tue, 19 Dec 2000 21:16:19 +0100 akim 
(ace/b/19_atgeneral. 1.45 644)
+++ tests/atgeneral.m4 Fri, 12 Jan 2001 00:21:37 +0100 akim 
(ace/b/19_atgeneral. 1.45 644)
@@ -463,7 +463,7 @@ m4_define([AT_CHECK],
   [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
+   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected 
m4_default([$2], [0])" >&2
       at_failed=:;;])
 esac
 AS_IFELSE($at_failed, [$5], [$6])
Index: tests/compile.at
--- tests/compile.at Sat, 23 Dec 2000 11:22:15 +0100 akim (ace/b/50_compile.at 
1.7 644)
+++ tests/compile.at Fri, 12 Jan 2001 00:27:48 +0100 akim (ace/b/50_compile.at 
1.7 644)
@@ -7,6 +7,27 @@
 # primitive, so check those first.
 
 
+##- ----------- ##
+## Extensions.  ##
+## ------------ ##
+
+# As far as we know only `foo', `foo.exe' are possible executable,
+# and `foo.o', `foo.obj' are possible object files.  Autoconf must not
+# know that, but it is OK for the test suite to take this into account.
+AT_CHECK_MACRO([Extensions],
+[[AC_PROG_CC
+case $ac_exeext in
+  '' | '.exe' ) ;;
+  * ) AC_MSG_ERROR([suspicious executable suffix: $ac_exeext]);;
+esac
+
+case $ac_objext in
+  'o' | 'obj' ) ;;
+  * ) AC_MSG_ERROR([suspicious object suffix: $ac_objext]);;
+esac
+]])
+
+
 ## ------------ ##
 ## C keywords.  ##
 ## ------------ ##
@@ -17,10 +38,11 @@
 AC_C_CONST
 AC_C_INLINE
 AC_C_VOLATILE
-case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
+case $GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile in
  yes,*no*)
    AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
-esac]])
+esac
+]])
 
 
 



reply via email to

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