autoconf-patches
[Top][All Lists]
Advanced

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

3-bigendian-tests.patch


From: Alexandre Duret-Lutz
Subject: 3-bigendian-tests.patch
Date: Sun, 12 Aug 2001 12:54:46 +0200

Pfew, believe it or not, I've spent nearly 3 hours to write this
stupid test case.  Digging the whole stuff to figure which macro
are available and what am I allowed to do or not isn't really fun.
It would be nice if tests/README could feature some introductionnary
material, just to give a basic idea of how the testsuite works (a
manual would be better, but I understant that's a lot of work).

Anyway, here is the thing.  I won't be surprised if it turn out 
that I've used the wrong macros or mechanisms... :)

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,5 @@
+2001-08-12  Alexandre Duret-Lutz  <address@hidden>
+
+       * tests/semantics.at (AC_C_BIGENDIAN): New test.
+

Index: tests/semantics.at
===================================================================
RCS file: /home/adl/CVSROOT/actmp/tests/semantics.at,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 semantics.at
--- tests/semantics.at  11 Aug 2001 19:12:58 -0000      1.1.1.1
+++ tests/semantics.at  11 Aug 2001 22:55:21 -0000
@@ -307,6 +307,40 @@
 
 AT_CLEANUP(path)
 
+# -------------- #
+# AC_C_BIGENDIAN #
+# -------------- #
+
+AT_SETUP(AC_C_BIGENDIAN)
+
+# Make sure that AC_C_BIGENDIAN behave the same whether we are
+# cross-compiling or not.  Actually, the tests are differents in both
+# case, and the cross-compiling case is allowed to fail (BTW, it might
+# be interesting to replace [:] by [touch at-uendian] to cach systems for
+# which AC_C_BIGENDIAN does fail, just to know if such a system
+# exists.)
+
+# Don't use _AT_CHECK_AC_MACRO here, because we are creating
+# new files and don't want AC_CHECK_ENV to be run.
+AT_CONFIGURE_AC([AC_C_BIGENDIAN([touch at-bendian],[touch at-lendian],[:])])
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+
+rm -f config.hin  # So that next run of autoheader is quiet.
+# Use _AT_CHECK_AC_MACRO here, because it use AC_CHECK_ENV and this time
+# we want to make sure that we are not creating a new file (which
+# would indicate a different result from the non cross-compiling case).
+_AT_CHECK_AC_MACRO(
+  [cross_compiling=yes
+   AC_C_BIGENDIAN([touch at-bendian],[touch at-lendian],[:])])
+
+# Make sure AC_C_BIGENDIAN with no argument will define WORDS_BIGENDIAN
+AT_CONFIGURE_AC([AC_C_BIGENDIAN])
+AT_CHECK_AUTOHEADER
+AT_CHECK([grep WORDS_BIGENDIAN config.hin], [], [ignore])
+
+AT_CLEANUP(at-bendian at-lendian)
 
 # ------------------------------ #
 # AC_PATH_PROG & AC_PATH_PROGS.  #



reply via email to

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