| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Run this to generate all the initial makefiles, etc. |
| 3 | # Shamelessly copied from Glade |
| 4 | |
| 5 | DIE=0 |
| 6 | |
| 7 | if testscip-shell system . . test. -d m4local ; then |
| 8 | : |
| 9 | else |
| 10 | echoscip-shell system . . echo. "Directory \`m4local' does not exist. Creating it." |
| 11 | if testscip-shell system . . test. -e m4local ; then |
| 12 | echoscip-shell system . . echo. "**Error**: A file \`m4local' exists and is not a directory." |
| 13 | echoscip-shell system . . echo. "Please remove it." |
| 14 | DIE=1 |
| 15 | fi |
| 16 | mkdirscip-shell system . . mkdir. m4local |
| 17 | fi |
| 18 | |
| 19 | if testscip-shell system . . test. -d m4 ; then |
| 20 | rmscip-shell system . . rm. -rf m4 |
| 21 | elif testscip-shell system . . test. -e m4 ; then |
| 22 | echoscip-shell system . . echo. "**Error**: A file \`m4local' exists and is not a directory." |
| 23 | echoscip-shell system . . echo. "Please remove it." |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
| 27 | mkdirscip-shell system . . mkdir. m4 |
| 28 | |
| 29 | # shellcheck disable=SC2006,SC2154 |
| 30 | testscip-shell system . . test. -f "$srcdir/configure.ac" && sedscip-shell system . . sed. "s/XXXRELEASE_DATE=XXX/RELEASE_DATE=\"`datescip-shell system . . date. '+%d %b %Y'`\"/" "$srcdir/m4extra/stp_release.m4.in" > "$srcdir/m4/stp_release.m4" |
| 31 | |
| 32 | # Make sure all of our auto* bits are up to date. |
| 33 | autoreconfscip-shell system . . autoreconf. -ivf |
| 34 | |
| 35 | # shellcheck disable=SC2006 |
| 36 | libtoolv=`libtool --version | headscip-shell system . . head. -1 | sedscip-shell system . . sed. 's,.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\.[0-9][0-9]*\)\?\).*[a-z]*\([ ]?.*\|\)$,\1,'` |
| 37 | if [scip-shell system . . `[`. -n "$libtoolv" ] ; then |
| 38 | # shellcheck disable=SC2006 |
| 39 | libtool_major=`echoscip-shell system . . echo. "$libtoolv" | awkscip-shell system . . awk. -F. '{print $1}'` |
| 40 | # shellcheck disable=SC2006 |
| 41 | libtool_minor=`echoscip-shell system . . echo. "$libtoolv" | awkscip-shell system . . awk. -F. '{print $2}'` |
| 42 | # shellcheck disable=SC2006,SC2034 |
| 43 | libtool_point=`echoscip-shell system . . echo. "$libtoolv" | awkscip-shell system . . awk. -F. '{print $3}'` |
| 44 | if [scip-shell system . . `[`. "$libtool_major" -le 1 ] && [scip-shell system . . `[`. "$libtool_minor" -lt 5 ] ; then |
| 45 | libtool_err=1 |
| 46 | fi |
| 47 | else |
| 48 | libtool_err=1 |
| 49 | fi |
| 50 | |
| 51 | if [scip-shell system . . `[`. -z "`type -p glib-mkenums`" ] ; then |
| 52 | echoscip-shell system . . echo. |
| 53 | echoscip-shell system . . echo. "**Error**: You must have \`glib2-mkenums' installed to create a" |
| 54 | echoscip-shell system . . echo. "Gutenprint distribution. This is usually distributed in the" |
| 55 | echoscip-shell system . . echo. "glib2-devel, glib2-dev, or similar package." |
| 56 | DIE=1 |
| 57 | fi |
| 58 | |
| 59 | if [scip-shell system . . `[`. -n "$libtool_err" ] ; then |
| 60 | echoscip-shell system . . echo. |
| 61 | echoscip-shell system . . echo. "**Warning**: You should have \`libtool' 1.5 or newer installed to" |
| 62 | echoscip-shell system . . echo. "create a Gutenprint distribution. Earlier versions of libtool do" |
| 63 | echoscip-shell system . . echo. "not generate correct code for all platforms." |
| 64 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-1.5.tar.gz" |
| 65 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 66 | DIE=1 |
| 67 | fi |
| 68 | |
| 69 | (autoconfscip-shell system . . autoconf. --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 70 | echoscip-shell system . . echo. |
| 71 | echoscip-shell system . . echo. "**Error**: You must have \`autoconf' installed to" |
| 72 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 73 | echoscip-shell system . . echo. "Download the appropriate package for your distribution," |
| 74 | echoscip-shell system . . echo. "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" |
| 75 | DIE=1 |
| 76 | } |
| 77 | |
| 78 | testscip-shell system . . test. -f "$srcdir/ChangeLog" || echoscip-shell system . . echo. > "$srcdir/ChangeLog" |
| 79 | |
| 80 | (grepscip-shell system . . grep. "^AM_PROG_LIBTOOL" "$srcdir/configure.ac" >/dev/nullscip-shell filesystem . . `/dev/null`.) && { |
| 81 | (libtool --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 82 | echoscip-shell system . . echo. |
| 83 | echoscip-shell system . . echo. "**Error**: You must have \`libtool' installed to" |
| 84 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 85 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-1.5.tar.gz" |
| 86 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 87 | DIE=1 |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | grepscip-shell system . . grep. "^AM_GNU_GETTEXT" "$srcdir/configure.ac" >/dev/nullscip-shell filesystem . . `/dev/null`. && { |
| 92 | grepscip-shell system . . grep. "sed.*POTFILES" "$srcdir/configure.ac" >/dev/nullscip-shell filesystem . . `/dev/null`. || \ |
| 93 | (gettextscip-shell system . . gettext. --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 94 | echoscip-shell system . . echo. |
| 95 | echoscip-shell system . . echo. "**Error**: You must have \`gettext' installed to" |
| 96 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 97 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/gettext/gettext-0.16.tar.gz" |
| 98 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 99 | DIE=1 |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | (pkg-config --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 104 | echoscip-shell system . . echo. |
| 105 | echoscip-shell system . . echo. "**Error**: You must have \`pkg-config' installed to" |
| 106 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 107 | echoscip-shell system . . echo. "Download the appropriate package for your distribution," |
| 108 | echoscip-shell system . . echo. "or get the source tarball at http://www.freedesktop.org/" |
| 109 | DIE=1 |
| 110 | } |
| 111 | |
| 112 | |
| 113 | #### MRS: The following now only generates a warning, since earlier |
| 114 | #### versions of gettext *do* work, they just don't create the |
| 115 | #### right uninstall code. |
| 116 | |
| 117 | # shellcheck disable=SC2006 |
| 118 | gettextv=`gettextscip-shell system . . gettext. --version | headscip-shell system . . head. -1 | awkscip-shell system . . awk. '{print $NF}'` |
| 119 | gettext_err=1 |
| 120 | if [scip-shell system . . `[`. -n "$gettextv" ] ; then |
| 121 | # shellcheck disable=SC2006 |
| 122 | gettext_major=`echoscip-shell system . . echo. "$gettextv" | awkscip-shell system . . awk. -F. '{print $1}'` |
| 123 | # shellcheck disable=SC2006 |
| 124 | gettext_minor=`echoscip-shell system . . echo. "$gettextv" | awkscip-shell system . . awk. -F. '{print $2}'` |
| 125 | # shellcheck disable=SC2006,SC2034 |
| 126 | gettext_point=`echoscip-shell system . . echo. "$gettextv" | awkscip-shell system . . awk. -F. '{print $3}'` |
| 127 | if [scip-shell system . . `[`. "$gettext_major" -gt 0 ] || [scip-shell system . . `[`. "$gettext_minor" -ge 16 ] ; then |
| 128 | gettext_err= |
| 129 | fi |
| 130 | fi |
| 131 | if [scip-shell system . . `[`. -n "$gettext_err" ] ; then |
| 132 | echoscip-shell system . . echo. |
| 133 | echoscip-shell system . . echo. "**Warning**: You must have \`gettext' 0.16 or newer installed to" |
| 134 | echoscip-shell system . . echo. "create a Gutenprint distribution. Earlier versions of gettext do" |
| 135 | echoscip-shell system . . echo. "not generate the correct 'make uninstall' code." |
| 136 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/gnu/gettext/gettext-0.16.tar.gz" |
| 137 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 138 | fi |
| 139 | |
| 140 | (autopointscip-shell system . . autopoint. --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 141 | echoscip-shell system . . echo. |
| 142 | echoscip-shell system . . echo. "**Error**: You must have \`autopoint' installed to" |
| 143 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 144 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/gettext/gettext-0.16.tar.gz" |
| 145 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 146 | DIE=1 |
| 147 | NO_AUTOMAKE=yes |
| 148 | } |
| 149 | |
| 150 | (automakescip-shell system . . automake. --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 151 | echoscip-shell system . . echo. |
| 152 | echoscip-shell system . . echo. "**Error**: You must have \`automake' installed to" |
| 153 | echoscip-shell system . . echo. "create a Gutenprint distribution." |
| 154 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.7.tar.gz" |
| 155 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 156 | DIE=1 |
| 157 | NO_AUTOMAKE=yes |
| 158 | } |
| 159 | |
| 160 | |
| 161 | # if no automake, don't bother testing for aclocal |
| 162 | testscip-shell system . . test. -n "$NO_AUTOMAKE" || (aclocalscip-shell system . . aclocal. --version) < /dev/nullscip-shell filesystem . . `/dev/null`. > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 163 | echoscip-shell system . . echo. |
| 164 | echoscip-shell system . . echo. "**Error**: Missing \`aclocal'. The version of \`automake'" |
| 165 | echoscip-shell system . . echo. "installed doesn't appear recent enough." |
| 166 | echoscip-shell system . . echo. "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.7.tar.gz" |
| 167 | echoscip-shell system . . echo. "(or a newer version if it is available)" |
| 168 | DIE=1 |
| 169 | } |
| 170 | |
| 171 | |
| 172 | # Check for existence of dvips |
| 173 | |
| 174 | command -V dvips >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 175 | echoscip-shell system . . echo. |
| 176 | echoscip-shell system . . echo. "***Warning***: You must have \"dvips\" installed to" |
| 177 | echoscip-shell system . . echo. "build the Gutenprint user's guide." |
| 178 | echoscip-shell system . . echo. |
| 179 | } |
| 180 | |
| 181 | |
| 182 | command -V db2html >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 183 | echoscip-shell system . . echo. " " |
| 184 | echoscip-shell system . . echo. "***Warning***: You must have \"db2html\" installed to" |
| 185 | echoscip-shell system . . echo. "build the Gutenprint user's guide." |
| 186 | echoscip-shell system . . echo. "This usually comes from packages named docbook-utils or docbook-toys." |
| 187 | echoscip-shell system . . echo. " " |
| 188 | } |
| 189 | |
| 190 | command -V db2pdf >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 || { |
| 191 | echoscip-shell system . . echo. " " |
| 192 | echoscip-shell system . . echo. "***Warning***: You must have \"db2pdf\" installed to" |
| 193 | echoscip-shell system . . echo. "build the Gutenprint developers's guide." |
| 194 | echoscip-shell system . . echo. "This usually comes from packages named docbook-utils-pdf" |
| 195 | echoscip-shell system . . echo. "or docbook-toys." |
| 196 | echoscip-shell system . . echo. " " |
| 197 | } |
| 198 | |
| 199 | # Check for convert |
| 200 | |
| 201 | command -V convert >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 |
| 202 | testscip-shell system . . test. $? -ne 0 && { |
| 203 | echoscip-shell system . . echo. " " |
| 204 | echoscip-shell system . . echo. "***Warning***: You must have \"convert\" installed to" |
| 205 | echoscip-shell system . . echo. "build the Gutenprint user's guide." |
| 206 | echoscip-shell system . . echo. "\"convert\" comes from the ImageMagick software package." |
| 207 | echoscip-shell system . . echo. "Go to http://imagemagick.sourceforge.net/http and get" |
| 208 | echoscip-shell system . . echo. "the file ImageMagick-5.3.1.tar.gz" |
| 209 | echoscip-shell system . . echo. "(or a newer version if available)" |
| 210 | echoscip-shell system . . echo. " " |
| 211 | } |
| 212 | |
| 213 | # Check for docbook version 4 |
| 214 | # Note workaround for Fedora installation |
| 215 | # Include path for Fedora Docbook. A bit circuitous, but Fedora appends |
| 216 | # a bunch of extra stuff to the name of the directory-- including the |
| 217 | # version of Fedora (eg -fc9). We don't want to test for every version |
| 218 | # of Fedora and modern bourne shells won't expand the glob (*); |
| 219 | # therefore, we do a `find` first and then test to see if there are any |
| 220 | # results. |
| 221 | |
| 222 | if testscip-shell system . . test. -d /usr/share/sgml/docbookscip-shell filesystem . . `/usr/share/sgml/docbook`. ; then |
| 223 | # shellcheck disable=SC2006 |
| 224 | fedora_docbook=`findscip-shell system . . find. /usr/share/sgml/docbookscip-shell filesystem . . `/usr/share/sgml/docbook`. -type d -name 'sgml-dtd-4.*' -print` |
| 225 | fi |
| 226 | |
| 227 | { |
| 228 | testscip-shell system . . test. -d "/usr/share/sgml/docbook_4scip-shell filesystem . . `/usr/share/sgml/docbook_4`." || testscip-shell system . . test. -d "/usr/share/sgml/docbook/dtd/4.0scip-shell filesystem . . `/usr/share/sgml/docbook/dtd/4.0`." || testscip-shell system . . test. -d "/usr/share/sgml/docbook/dtd/4.1scip-shell filesystem . . `/usr/share/sgml/docbook/dtd/4.1`." || testscip-shell system . . test. -d "/usr/share/sgml/docbook_4.1scip-shell filesystem . . `/usr/share/sgml/docbook_4.1`." || testscip-shell system . . test. -n "$fedora_docbook" |
| 229 | } || { |
| 230 | echoscip-shell system . . echo. " " |
| 231 | echoscip-shell system . . echo. "***Warning***: You must have Docbook v4 installed to" |
| 232 | echoscip-shell system . . echo. "build the Gutenprint user's guide." |
| 233 | echoscip-shell system . . echo. " " |
| 234 | } |
| 235 | |
| 236 | if testscip-shell system . . test. "$DIE" -eq 1; then |
| 237 | exit 1 |
| 238 | fi |
| 239 | |
| 240 | if testscip-shell system . . test. -z "$*"; then |
| 241 | echoscip-shell system . . echo. "**Warning**: I am going to run \`configure' with no arguments." |
| 242 | echoscip-shell system . . echo. "If you wish to pass any to it, please specify them on the" |
| 243 | # shellcheck disable=SC1117 |
| 244 | echoscip-shell system . . echo. "\`$0\' command line." |
| 245 | echoscip-shell system . . echo. |
| 246 | fi |
| 247 | |
| 248 | case $CC in |
| 249 | xlc ) |
| 250 | am_opt=--include-deps;; |
| 251 | esac |
| 252 | |
| 253 | # We don't have subdirectories. We don't want any untarred directories that |
| 254 | # contain configure.ac files to mess things up for us. |
| 255 | coin="$srcdir/configure.ac" |
| 256 | # shellcheck disable=SC2006 |
| 257 | dr=`dirnamescip-shell system . . dirname. "$coin"` |
| 258 | if testscip-shell system . . test. -f "$dr/NO-AUTO-GEN"; then |
| 259 | echoscip-shell system . . echo. skipping "$dr" -- flagged as no auto-gen |
| 260 | else |
| 261 | echoscip-shell system . . echo. processing "$dr" |
| 262 | # shellcheck disable=SC2006 |
| 263 | macrodirs=`sedscip-shell system . . sed. -n -e 's,^dnl AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < "$coin"` |
| 264 | ( cd "$dr" |
| 265 | aclocalinclude="$ACLOCAL_FLAGS" |
| 266 | for k in $macrodirs; do |
| 267 | if testscip-shell system . . test. -d "$k"; then |
| 268 | aclocalinclude="$aclocalinclude -I $k" |
| 269 | ##else |
| 270 | ## echo "**Warning**: No such directory \`$k'. Ignored." |
| 271 | fi |
| 272 | done |
| 273 | if grepscip-shell system . . grep. "^AM_GNU_GETTEXT" configure.ac >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 274 | if grepscip-shell system . . grep. "sed.*POTFILES" configure.ac >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 275 | : #do nothing -- we still have an old unmodified configure.ac |
| 276 | else |
| 277 | echoscip-shell system . . echo. "Creating $dr/aclocal.m4 ..." |
| 278 | rmscip-shell system . . rm. -f aclocal.m4 |
| 279 | testscip-shell system . . test. -r aclocal.m4 || touchscip-shell system . . touch. aclocal.m4 |
| 280 | # We've removed po/ChangeLog from the repository. Version |
| 281 | # 0.10.40 of gettext appends an entry to the ChangeLog every time |
| 282 | # anyone runs autogen.sh. Since developers do that a lot, and |
| 283 | # then proceed to commit their entire sandbox, we wind up with |
| 284 | # an ever-growing po/ChangeLog that generates conflicts on |
| 285 | # a routine basis. There's no good reason for this. |
| 286 | echoscip-shell system . . echo. 'This ChangeLog is redundant. Please see the main ChangeLog for i18n changes.' > po/ChangeLog |
| 287 | echoscip-shell system . . echo. >> po/ChangeLog |
| 288 | echoscip-shell system . . echo. 'This file is present only to keep po/Makefile.in.in happy.' >> po/ChangeLog |
| 289 | echoscip-shell system . . echo. "Running autopoint... Ignore non-fatal messages." |
| 290 | autopointscip-shell system . . autopoint. --force |
| 291 | # shellcheck disable=SC2181 |
| 292 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 293 | echoscip-shell system . . echo. 'Autopoint failed!' |
| 294 | exit 1 |
| 295 | fi |
| 296 | echoscip-shell system . . echo. "Making $dr/aclocal.m4 writable ..." |
| 297 | testscip-shell system . . test. -r "$dr/aclocal.m4" && chmodscip-shell system . . chmod. u+w "$dr/aclocal.m4" |
| 298 | fi |
| 299 | fi |
| 300 | if grepscip-shell system . . grep. "^AM_PROG_LIBTOOL" configure.ac >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 301 | echoscip-shell system . . echo. "Running libtoolize..." |
| 302 | libtoolizescip-shell system . . libtoolize. --force --copy |
| 303 | # shellcheck disable=SC2181 |
| 304 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 305 | echoscip-shell system . . echo. 'Libtoolize failed!' |
| 306 | exit 1 |
| 307 | fi |
| 308 | fi |
| 309 | echoscip-shell system . . echo. "Running aclocal $aclocalinclude ..." |
| 310 | # shellcheck disable=SC2086 |
| 311 | aclocalscip-shell system . . aclocal. $aclocalinclude |
| 312 | # shellcheck disable=SC2181 |
| 313 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 314 | echoscip-shell system . . echo. 'aclocal failed!' |
| 315 | exit 1 |
| 316 | fi |
| 317 | if grepscip-shell system . . grep. "^AM_CONFIG_HEADER" configure.ac >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 318 | echoscip-shell system . . echo. "Running autoheader..." |
| 319 | autoheaderscip-shell system . . autoheader. |
| 320 | # shellcheck disable=SC2181 |
| 321 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 322 | echoscip-shell system . . echo. 'autoheader failed!' |
| 323 | exit 1 |
| 324 | fi |
| 325 | fi |
| 326 | echoscip-shell system . . echo. "Running automake --gnu $am_opt ..." |
| 327 | automakescip-shell system . . automake. --add-missing --force-missing --copy --gnu $am_opt |
| 328 | # shellcheck disable=SC2181 |
| 329 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 330 | echoscip-shell system . . echo. 'automake failed!' |
| 331 | exit 1 |
| 332 | fi |
| 333 | echoscip-shell system . . echo. "Running autoconf ..." |
| 334 | autoconfscip-shell system . . autoconf. |
| 335 | # shellcheck disable=SC2181 |
| 336 | if [scip-shell system . . `[`. $? -ne 0 ] ; then |
| 337 | echoscip-shell system . . echo. 'autoconf failed!' |
| 338 | exit 1 |
| 339 | fi |
| 340 | ) || exit 1 |
| 341 | fi |
| 342 | |
| 343 | conf_flags="--enable-maintainer-mode" #--enable-iso-c |
| 344 | |
| 345 | if testscip-shell system . . test. -z "$NOCONFIGURE"; then |
| 346 | echoscip-shell system . . echo. Running "$srcdir/configure" $conf_flags "$@" ... |
| 347 | "$srcdir/configure" $conf_flags "$@" \ |
| 348 | && echoscip-shell system . . echo. Now type \`make\' to compile "$PKG_NAME" || exit 1 |
| 349 | else |
| 350 | echoscip-shell system . . echo. Skipping configure process. |
| 351 | fi |