shtool/shtool.patch

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@16 1 diff -Nau ChangeLog.orig ChangeLog
michael@16 2 --- ChangeLog.orig 2008-07-18 09:57:29.000000000 +0200
michael@16 3 +++ ChangeLog 2009-01-06 01:29:18.000000000 +0100
michael@16 4 @@ -114,6 +114,9 @@
michael@16 5
michael@16 6 Changes between 2.0.1 and 2.0.2 (11-Aug-2004 to 15-Jun-2005):
michael@16 7
michael@16 8 + *) Added ISO C++ language output to "shtool version".
michael@16 9 + [Michael Schloh von Bennewitz <michael@schloh.com>]
michael@16 10 +
michael@16 11 *) Fix insecure temporary file handling (CAN-2005-1751, CAN-2005-1759).
michael@16 12 [Eric Romang <eromang@zataz.net>, Ralf S. Engelschall]
michael@16 13
michael@16 14 diff -Nau RATIONAL.orig RATIONAL
michael@16 15 --- RATIONAL.orig 2008-04-02 22:10:17.000000000 +0200
michael@16 16 +++ RATIONAL 2009-01-06 01:30:19.000000000 +0100
michael@16 17 @@ -6,8 +6,8 @@
michael@16 18
michael@16 19 GNU shtool -- The GNU Portable Shell Tool
michael@16 20
michael@16 21 - RATIONAL
michael@16 22 - ========
michael@16 23 + RATIONALE
michael@16 24 + =========
michael@16 25
michael@16 26 The Context
michael@16 27
michael@16 28 diff -Nau sh.version.orig sh.version
michael@16 29 --- sh.version.orig 2008-04-02 22:10:17.000000000 +0200
michael@16 30 +++ sh.version 2009-01-06 01:32:32.000000000 +0100
michael@16 31 @@ -211,7 +211,7 @@
michael@16 32 ;;
michael@16 33 c )
michael@16 34 echo >>$file "/*"
michael@16 35 - echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)"
michael@16 36 + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C)"
michael@16 37 echo >>$file "** [automatically generated and maintained by GNU shtool]"
michael@16 38 echo >>$file "*/"
michael@16 39 echo >>$file ""
michael@16 40 @@ -257,6 +257,65 @@
michael@16 41 echo >>$file "#endif /* _${filestr}_AS_HEADER_ */"
michael@16 42 echo >>$file ""
michael@16 43 ;;
michael@16 44 + cxx )
michael@16 45 + echo >>$file "//"
michael@16 46 + echo >>$file "// ${file} -- Version Information for ${name} (syntax: ISO C++)"
michael@16 47 + echo >>$file "// [automatically generated and maintained by GNU shtool]"
michael@16 48 + echo >>$file "//"
michael@16 49 + echo >>$file ""
michael@16 50 + echo >>$file "#ifdef _${filestr}_AS_HEADER_"
michael@16 51 + echo >>$file ""
michael@16 52 + echo >>$file "#ifndef _${filestr}_"
michael@16 53 + echo >>$file "#define _${filestr}_"
michael@16 54 + echo >>$file ""
michael@16 55 + echo >>$file "#define ${prefixupper}VERSION ${vHex}"
michael@16 56 + echo >>$file ""
michael@16 57 + echo >>$file "typedef class ${prefix}version_class {"
michael@16 58 + echo >>$file "private:"
michael@16 59 + echo >>$file " const int v_hex;"
michael@16 60 + echo >>$file " const char *v_short;"
michael@16 61 + echo >>$file " const char *v_long;"
michael@16 62 + echo >>$file " const char *v_tex;"
michael@16 63 + echo >>$file " const char *v_gnu;"
michael@16 64 + echo >>$file " const char *v_web;"
michael@16 65 + echo >>$file " const char *v_sccs;"
michael@16 66 + echo >>$file " const char *v_rcs;"
michael@16 67 + echo >>$file "public:"
michael@16 68 + echo >>$file " ${prefix}version_class(void) : \\"
michael@16 69 + echo >>$file " v_hex(${vHex}), \\"
michael@16 70 + echo >>$file " v_short(\"${vShort}\"), \\"
michael@16 71 + echo >>$file " v_long(\"${vLong}\"), \\"
michael@16 72 + echo >>$file " v_tex(\"${vTeX}\"), \\"
michael@16 73 + echo >>$file " v_gnu(\"${vGNU}\"), \\"
michael@16 74 + echo >>$file " v_web(\"${vWeb}\"), \\"
michael@16 75 + echo >>$file " v_sccs(\"${vSCCS}\"), \\"
michael@16 76 + echo >>$file " v_rcs(\"${vRCS}\") \\"
michael@16 77 + echo >>$file " {}"
michael@16 78 + echo >>$file " const int getHex(void) {return (v_hex);};"
michael@16 79 + echo >>$file " const char *getShort(void) {return (v_short);};"
michael@16 80 + echo >>$file " const char *getLong(void) {return (v_long);};"
michael@16 81 + echo >>$file " const char *getTex(void) {return (v_tex);};"
michael@16 82 + echo >>$file " const char *getGnu(void) {return (v_gnu);};"
michael@16 83 + echo >>$file " const char *getWeb(void) {return (v_web);};"
michael@16 84 + echo >>$file " const char *getSccs(void) {return (v_sccs);};"
michael@16 85 + echo >>$file " const char *getRcs(void) {return (v_rcs);};"
michael@16 86 + echo >>$file "} ${prefix}version_t;"
michael@16 87 + echo >>$file ""
michael@16 88 + echo >>$file "extern ${prefix}version_t ${prefix}version;"
michael@16 89 + echo >>$file ""
michael@16 90 + echo >>$file "#endif // _${filestr}_"
michael@16 91 + echo >>$file ""
michael@16 92 + echo >>$file "#else // _${filestr}_AS_HEADER_"
michael@16 93 + echo >>$file ""
michael@16 94 + echo >>$file "#define _${filestr}_AS_HEADER_"
michael@16 95 + echo >>$file "#include \"${file}\""
michael@16 96 + echo >>$file "#undef _${filestr}_AS_HEADER_"
michael@16 97 + echo >>$file ""
michael@16 98 + echo >>$file "${prefix}version_t ${prefix}version;"
michael@16 99 + echo >>$file ""
michael@16 100 + echo >>$file "#endif // _${filestr}_AS_HEADER_"
michael@16 101 + echo >>$file ""
michael@16 102 + ;;
michael@16 103 m4 )
michael@16 104 echo >>$file "##"
michael@16 105 echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)"
michael@16 106 @@ -367,9 +426,9 @@
michael@16 107
michael@16 108 =item B<-l>, B<--language> I<lang>
michael@16 109
michael@16 110 -Choose format of version file I<file>. I<lang>="C<txt>", ANSI C
michael@16 111 -(I<lang>="c"), M4 (I<lang>="m4"), Perl (I<lang>="perl") or Python
michael@16 112 -(I<lang>="python"). Default is C<txt>.
michael@16 113 +Choose format of version file I<file>. I<lang>="C<txt>", ISO C
michael@16 114 +(I<lang>="c"), ISO C++ (I<lang>="cxx"), M4 (I<lang>="m4"), Perl
michael@16 115 +(I<lang>="perl") or Python (I<lang>="python"). Default is C<txt>.
michael@16 116
michael@16 117 =item B<-n>, B<--name> I<name>
michael@16 118
michael@16 119 diff -Nau shtool.pod.orig shtool.pod
michael@16 120 --- shtool.pod.orig 2008-04-02 22:10:17.000000000 +0200
michael@16 121 +++ shtool.pod 2009-01-06 01:32:54.000000000 +0100
michael@16 122 @@ -161,8 +161,8 @@
michael@16 123
michael@16 124 =item B<version>
michael@16 125
michael@16 126 -Maintain a version information file in either Text, C/C++, Perl or Python.
michael@16 127 -format.
michael@16 128 +Maintain a version information file in either Text, C, C++, M4, Perl or
michael@16 129 +Python.
michael@16 130
michael@16 131 =item B<path>
michael@16 132

mercurial