#!/bin/bash proc die { echo @Argv !1 > !2 exit 1 } proc clean { echo $1 | sed -e 's/\\//g' } ### NOTE: ############################################################ ### These variables specify the tool versions we want to use. ### Periods should be escaped with backslash for use by grep. ### ### If you update these, please also update docs/GettingStarted.html global want_autoconf_version := ''2\.61'' global want_autoheader_version := $want_autoconf_version global want_aclocal_version := ''1\.10'' global want_libtool_version := ''1\.5\.22'' ### END NOTE ######################################################### global outfile := 'configure' global configfile := 'configure.ac' global want_autoconf_version_clean := $[clean $want_autoconf_version] global want_autoheader_version_clean := $[clean $want_autoheader_version] global want_aclocal_version_clean := $[clean $want_aclocal_version] global want_libtool_version_clean := $[clean $want_libtool_version] test -d autoconf && test -f autoconf/$configfile && cd autoconf test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first" autoconf --version | grep $want_autoconf_version > /dev/null test $Status -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean" aclocal --version | grep '^aclocal.*'$want_aclocal_version > /dev/null test $Status -eq 0 || die "Your aclocal was not detected as being $want_aclocal_version_clean" autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null test $Status -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean" libtool --version | grep $want_libtool_version > /dev/null test $Status -eq 0 || die "Your libtool was not detected as being $want_libtool_version_clean" echo "" echo "### NOTE: ############################################################" echo "### If you get *any* warnings from autoconf below you MUST fix the" echo "### scripts in the m4 directory because there are future forward" echo "### compatibility or platform support issues at risk. Please do NOT" echo "### commit any configure script that was generated with warnings" echo "### present. You should get just three 'Regenerating..' lines." echo "######################################################################" echo "" echo "Regenerating aclocal.m4 with aclocal $want_aclocal_version_clean" global cwd := $[pwd] aclocal --force -I $cwd/m4 || die "aclocal failed" echo "Regenerating configure with autoconf $want_autoconf_version_clean" autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed" cd .. echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean" autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed" exit 0 (CommandList children: [ (FuncDef name: die body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_At "$@"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[17])] ) (C {(exit)} {(1)}) ] spids: [8] ) spids: [4 7] ) (FuncDef name: clean body: (BraceGroup children: [ (Pipeline children: [(C {(echo)} {($ VSub_Number "$1")}) (C {(sed)} {(-e)} {(SQ <"s/\\\\//g">)})] negated: False ) ] spids: [32] ) spids: [28 31] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_autoconf_version) op: Equal rhs: {(SQ <"2\\.61">)} spids: [67] ) ] spids: [67] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_autoheader_version) op: Equal rhs: {($ VSub_Name "$want_autoconf_version")} spids: [72] ) ] spids: [72] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_aclocal_version) op: Equal rhs: {(SQ <"1\\.10">)} spids: [75] ) ] spids: [75] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_libtool_version) op: Equal rhs: {(SQ <"1\\.5\\.22">)} spids: [80] ) ] spids: [80] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:outfile) op:Equal rhs:{(configure)} spids:[89])] spids: [89] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:configfile) op:Equal rhs:{(configure.ac)} spids:[92])] spids: [92] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_autoconf_version_clean) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(clean)} {($ VSub_Name "$want_autoconf_version")})] ) left_token: spids: [97 101] ) } spids: [96] ) ] spids: [96] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_autoheader_version_clean) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(clean)} {($ VSub_Name "$want_autoheader_version")})] ) left_token: spids: [104 108] ) } spids: [103] ) ] spids: [103] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_aclocal_version_clean) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(clean)} {($ VSub_Name "$want_aclocal_version")})] ) left_token: spids: [111 115] ) } spids: [110] ) ] spids: [110] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:want_libtool_version_clean) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(clean)} {($ VSub_Name "$want_libtool_version")})] ) left_token: spids: [118 122] ) } spids: [117] ) ] spids: [117] ) (AndOr children: [ (C {(test)} {(-d)} {(autoconf)}) (AndOr children: [ (C {(test)} {(-f)} {(autoconf/) ($ VSub_Name "$configfile")}) (C {(cd)} {(autoconf)}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) (AndOr children: [ (C {(test)} {(-f)} {($ VSub_Name "$configfile")}) (C {(die)} {(DQ ("Can't find 'autoconf' dir; please cd into it first"))}) ] op_id: Op_DPipe ) (Pipeline children: [ (C {(autoconf)} {(--version)}) (SimpleCommand words: [{(grep)} {($ VSub_Name "$want_autoconf_version")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[170])] ) ] negated: False ) (AndOr children: [ (C {(test)} {($ VSub_QMark "$?")} {(-eq)} {(0)}) (C {(die)} { (DQ ("Your autoconf was not detected as being ") ($ VSub_Name "$want_autoconf_version_clean") ) } ) ] op_id: Op_DPipe ) (Pipeline children: [ (C {(aclocal)} {(--version)}) (SimpleCommand words: [{(grep)} {(SQ <"^aclocal.*">) ($ VSub_Name "$want_aclocal_version")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[204])] ) ] negated: False ) (AndOr children: [ (C {(test)} {($ VSub_QMark "$?")} {(-eq)} {(0)}) (C {(die)} { (DQ ("Your aclocal was not detected as being ") ($ VSub_Name "$want_aclocal_version_clean") ) } ) ] op_id: Op_DPipe ) (Pipeline children: [ (C {(autoheader)} {(--version)}) (SimpleCommand words: [{(grep)} {(SQ <"^autoheader.*">) ($ VSub_Name "$want_autoheader_version")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[238])] ) ] negated: False ) (AndOr children: [ (C {(test)} {($ VSub_QMark "$?")} {(-eq)} {(0)}) (C {(die)} { (DQ ("Your autoheader was not detected as being ") ($ VSub_Name "$want_autoheader_version_clean") ) } ) ] op_id: Op_DPipe ) (Pipeline children: [ (C {(libtool)} {(--version)}) (SimpleCommand words: [{(grep)} {($ VSub_Name "$want_libtool_version")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[269])] ) ] negated: False ) (AndOr children: [ (C {(test)} {($ VSub_QMark "$?")} {(-eq)} {(0)}) (C {(die)} { (DQ ("Your libtool was not detected as being ") ($ VSub_Name "$want_libtool_version_clean") ) } ) ] op_id: Op_DPipe ) (C {(echo)} {(DQ )}) (C {(echo)} {(DQ ("### NOTE: ############################################################"))}) (C {(echo)} {(DQ ("### If you get *any* warnings from autoconf below you MUST fix the"))}) (C {(echo)} {(DQ ("### scripts in the m4 directory because there are future forward"))}) (C {(echo)} {(DQ ("### compatibility or platform support issues at risk. Please do NOT"))}) (C {(echo)} {(DQ ("### commit any configure script that was generated with warnings"))}) (C {(echo)} {(DQ ("### present. You should get just three 'Regenerating..' lines."))}) (C {(echo)} {(DQ ("######################################################################"))}) (C {(echo)} {(DQ )}) (C {(echo)} {(DQ ("Regenerating aclocal.m4 with aclocal ") ($ VSub_Name "$want_aclocal_version_clean"))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cwd) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: spids: [350 352] ) } spids: [349] ) ] spids: [349] ) (AndOr children: [ (C {(aclocal)} {(--force)} {(-I)} {($ VSub_Name "$cwd") (/m4)}) (C {(die)} {(DQ ("aclocal failed"))}) ] op_id: Op_DPipe ) (C {(echo)} {(DQ ("Regenerating configure with autoconf ") ($ VSub_Name "$want_autoconf_version_clean"))} ) (AndOr children: [ (C {(autoconf)} {(--force)} {(--warnings) (Lit_Other "=") (all)} {(-o)} {(../) ($ VSub_Name "$outfile")} {($ VSub_Name "$configfile")} ) (C {(die)} {(DQ ("autoconf failed"))}) ] op_id: Op_DPipe ) (C {(cd)} {(..)}) (C {(echo)} { (DQ ("Regenerating config.h.in with autoheader ") ($ VSub_Name "$want_autoheader_version_clean") ) } ) (AndOr children: [ (C {(autoheader)} {(--warnings) (Lit_Other "=") (all)} {(-I)} {(autoconf)} {(-I)} {(autoconf/m4)} {(autoconf/) ($ VSub_Name "$configfile")} ) (C {(die)} {(DQ ("autoheader failed"))}) ] op_id: Op_DPipe ) (C {(exit)} {(0)}) ] )