16880260 Enable autogen autoopts self-tests
authorRich Burridge <rich.burridge@oracle.com>
Fri, 31 May 2013 10:26:55 -0700
changeset 1325 b76c7672b0eb
parent 1324 e80cd1a9b659
child 1326 6edae69990a7
16880260 Enable autogen autoopts self-tests
components/autogen/Makefile
components/autogen/patches/ag-text.c.patch
components/autogen/patches/guile-iface.h.patch
--- a/components/autogen/Makefile	Fri May 31 08:29:39 2013 -0700
+++ b/components/autogen/Makefile	Fri May 31 10:26:55 2013 -0700
@@ -46,6 +46,19 @@
 # strip the environment or install target fails
 ENV +=	-i
 
+# Replace all occurrences of "echo" with "/usr/gnu/bin/echo" in the two
+# scripts used by autogen that munge the man and mdoc output. This prevents
+# bogus conversions (like "\f" -> Control-L) happening.
+# Adjust "tr" to "/usr/gnu/bin/tr" in the autoopts vendor.test.
+# These changes now allow the autoopts tests to successfully complete.
+COMPONENT_POST_UNPACK_ACTION = \
+	$(GSED) -i -e 's|echo|/usr/gnu/bin/echo|' \
+		$(SOURCE_DIR)/autoopts/tpl/mdoc2man.sh ; \
+	$(GSED) -i -e 's|echo|/usr/gnu/bin/echo|' \
+		$(SOURCE_DIR)/autoopts/tpl/texi2mdoc.sh ; \
+	$(GSED) -i -e 's| tr | /usr/gnu/bin/tr |' \
+		$(SOURCE_DIR)/autoopts/test/vendor.test
+
 # Enable ASLR for this component
 ASLR_MODE = $(ASLR_ENABLE)
 
@@ -54,13 +67,7 @@
 
 install:	$(INSTALL_32_and_64)
 
-test:		build
-	-(cd $(BUILD_DIR_32)/agen5/test; gmake check)
-	-(cd $(BUILD_DIR_32)/getdefs/test; gmake check)
-	-(cd $(BUILD_DIR_32)/xml2ag/test; gmake check)
-	-(cd $(BUILD_DIR_64)/agen5/test; gmake check)
-	-(cd $(BUILD_DIR_64)/getdefs/test; gmake check)
-	-(cd $(BUILD_DIR_64)/xml2ag/test; gmake check)
+test:		$(TEST_32_and_64)
 
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
--- a/components/autogen/patches/ag-text.c.patch	Fri May 31 08:29:39 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-The RESOLVE_SCM_NUMBER ag-text string needs to be adjusted so it
-prints out correctly on 32-bit SPARC machines. It was just plain
-luck that this worked correctly on 32-bit x86 (little-endian)
-machines, as the four least significant bytes of the returned value
-contained the correct value.
-
-Rather than adjust the majority of the 404 string offsets in this
-file, we simply loose one of the spaces in the following string.
-
-This patch has been sent upstream to the autogen author/maintainer.
-
---- autogen-5.16.2/agen5/ag-text.c.orig	2013-05-28 18:52:53.386918600 -0700
-+++ autogen-5.16.2/agen5/ag-text.c	2013-05-28 19:09:56.084583327 -0700
[email protected]@ -65,8 +65,8 @@
-             "%s\0"
- /*   646 */ "** BOGUS **\0"
- /*   658 */ "break\0"
--/*   664 */ "%ld\0"
--/*   668 */ "fserr %d: cannot %s %s:  %s\n\0"
-+/*   664 */ "%lld\0"
-+/*   669 */ "fserr %d: cannot %s %s: %s\n\0"
- /*   697 */ "duplicate make target\0"
- /*   719 */ "unknown dependency type:  %s\0"
- /*   748 */ "Content-type: text/plain\n\n"
---- autogen-5.16.2/agen5/ag-text.h.orig	2013-05-28 18:53:06.411186250 -0700
-+++ autogen-5.16.2/agen5/ag-text.h	2013-05-28 19:09:34.497154304 -0700
[email protected]@ -86,8 +86,8 @@
- #define BREAK_STR                    (ag_text_strtable+658)
- #define BREAK_STR_LEN                5
- #define BUILD_DEFS_LONG_FMT          (ag_text_strtable+664)
--#define BUILD_DEFS_LONG_FMT_LEN      3
--#define CANNOT_FMT                   (ag_text_strtable+668)
-+#define BUILD_DEFS_LONG_FMT_LEN      4
-+#define CANNOT_FMT                   (ag_text_strtable+669)
- #define CANNOT_FMT_LEN               28
- #define CFGDEP_DUP_TARGET_MSG        (ag_text_strtable+697)
- #define CFGDEP_DUP_TARGET_MSG_LEN    21
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/autogen/patches/guile-iface.h.patch	Fri May 31 10:26:55 2013 -0700
@@ -0,0 +1,35 @@
+The guile gh_scm2ulong() and scm_to_ulong() routines should really
+return an unsigned long otherwise the generation of the getdefs
+opts.[h,c] files from the opts.def file fails for 32-bit SPARC.
+
+This problem has been reported upstream, and the fix is in autogen-5.17.5pre2
+
+--- autogen-5.16.2/agen5/guile-iface.h.orig	2013-05-31 09:59:18.924928189 -0700
++++ autogen-5.16.2/agen5/guile-iface.h	2013-05-31 10:00:51.274085992 -0700
[email protected]@ -32,7 +32,7 @@
+ # define AG_SCM_SYM_P(_s)             SCM_SYMBOLP(_s)
+ # define AG_SCM_TO_INT(_i)            gh_scm2int(_i)
+ # define AG_SCM_TO_LONG(_v)           gh_scm2long(_v)
+-# define AG_SCM_TO_ULONG(_v)          gh_scm2ulong(_v)
++# define AG_SCM_TO_ULONG(_v)          ((unsigned long)gh_scm2ulong(_v))
+ # define AG_SCM_VEC_P(_v)             SCM_VECTORP(_v)
+ 
+ #elif GUILE_VERSION < 200000
[email protected]@ -58,7 +58,7 @@
+ # define AG_SCM_SYM_P(_s)             scm_is_symbol(_s)
+ # define AG_SCM_TO_INT(_i)            scm_to_int(_i)
+ # define AG_SCM_TO_LONG(_v)           scm_to_long(_v)
+-# define AG_SCM_TO_ULONG(_v)          scm_to_ulong(_v)
++# define AG_SCM_TO_ULONG(_v)          ((unsigned long)scm_to_ulong(_v))
+ # define AG_SCM_VEC_P(_v)             scm_is_vector(_v)
+ 
+ #elif GUILE_VERSION < 201000
[email protected]@ -84,7 +84,7 @@
+ # define AG_SCM_SYM_P(_s)             scm_is_symbol(_s)
+ # define AG_SCM_TO_INT(_i)            scm_to_int(_i)
+ # define AG_SCM_TO_LONG(_v)           scm_to_long(_v)
+-# define AG_SCM_TO_ULONG(_v)          scm_to_ulong(_v)
++# define AG_SCM_TO_ULONG(_v)          ((unsigned long)scm_to_ulong(_v))
+ # define AG_SCM_VEC_P(_v)             scm_is_vector(_v)
+ 
+ #else