#! /bin/echo This_file_must_be_sourced,_not_executed # config/bootstrap.local --- maintainer's bootstrap script # # Author: Bruce Korb # Time-stamp: "2007-07-04 14:33:12 bkorb" # by: bkorb ## ## This file is part of AutoGen. ## ## AutoGen copyright (c) 1992-2007 Bruce Korb - all rights reserved ## ## AutoGen is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## AutoGen is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## See the GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License along ## with this program. If not, see . # ---------------------------------------------------------------------- # @(#) $Id: bootstrap.local,v 4.25 2007/07/04 21:36:40 bkorb Exp $ # ---------------------------------------------------------------------- locate_exe() { if [ -x "$1" ] then echo "$1" return 0 fi case "${1}" in */* ) echo "Cannot find ${1}" >&2 return 1 ;; "" ) echo "USAGE: locate_exe " >&2 exit 1 ;; * ) name="${1}" ;; esac SV="${IFS}" IFS=" :" set -- ${PATH} for f do if [ -x ${f}/${name} ] then echo ${f}/${name} return 0 fi done return 1 } make_funcs_def() { ${VERBOSE} && set -x svdir=`pwd` cd ${srcdir}/autoopts test -d autoopts || mkdir autoopts test -d po || mkdir po ${AGexe} -L. genshell.def || exit 1 ${AGexe} -L. usage-txt.def || exit 1 mv usage-txt.h autoopts/. mv usage-txt.pot po/. files=`sed -n '/^CSRC/,/\.c$/p' Makefile.am | \ sed '/^CSRC/d;s/[=\\]//' echo ../compat/pathfind.c guileopt.c` getdefs linenum srcfile template=options_h output=funcs.def $files chmod u+w funcs.def eval "`egrep '^A[GO]_' ../VERSION`" vers_curr=$(expr '(' $AO_CURRENT '*' 4096 ')' + $AO_REVISION) vers_min=$( expr '(' $AO_CURRENT - $AO_AGE ')' '*' 4096) cat >> funcs.def <<- _END_VERS_INFO_ vers-curr = "${vers_curr}"; vers-min = "${vers_min}"; vers-min-str = "`expr $AO_CURRENT - $AO_AGE`:0:0"; vers-sovers = "${AO_SOVERS}"; library = opts; /* * THIS FILE IS DISTRIBUTED * * This file is used to construct options.h + doc files. Because it is * such a nuisance to get the build ordering correct, we distribute * this. It should be constructed after all binaries are built. */ _END_VERS_INFO_ ${AGexe} funcs.def test -f options.h || exit 1 # Regenerate the "genshell.h" 'cuz we just altered the template to # contain the header version number. # ${AGexe} -L. genshell.def || exit 1 mv options.h autoopts/. ${AGexe} -Tagman3.tpl funcs.def || exit 1 exec 4> Makefile.new sed '/^GENMAN /q' Makefile.am >&4 ls -1 *.3 | \ fgrep -v 'pathfind.3' | \ ${CLexe} -I4 --spread=1 --line-sep=' \' >&4 # ' rm -f *.3 echo "MAN_STAMP = man3-stamp" >&4 sed '1,/^MAN_STAMP /d' Makefile.am >&4 exec 4>&- if cmp Makefile.new Makefile.am then rm -f Makefile.new else mv -f Makefile.new Makefile.am echo "WARNING: Makefile.am has been updated" fi :mkfwd -p `egrep -l '^LOCAL |START-STATIC-FORWARD' *.c` > /dev/null 2>&1 || : ${AGexe} aoconf.def cd ${svdir} } config_versions() { set -a . VERSION set +a unset LANG || LANG='' if grep '==ADD_CONFIG_FILES==' ${config_file} > /dev/null then exec 4> configure.files echo 'AC_CONFIG_FILES([\' >&4 #' list=$( find [a-rt-z]* snprintfv/Makefile.am Makefile.am \ -name 'Makefile.am' -o -name '*.in' | \ sed 's,\.\(am\|in\)$,,;/^configure$/d' | sort -u) for f in ${list} ; do echo $f ; done | \ sed 's/^/ /;$s/$/ ])/' >&4 exec 4>&- sed="-e 's/^AC_INIT(.*/AC_INIT([${PACKAGE}],[${AG_VERSION}],[${EADDR}])/'" case "${AG_PATCHLEVEL}" in ( *[0-9]pre[1-9]* ) : ;; ( * ) sed="${sed} -e '/^case .*GCC.* in/,/^esac/d'" ;; esac sed="${sed} -e '/==ADD_CONFIG_FILES==/r configure.files'" sed="${sed} -e '/==ADD_CONFIG_FILES==/d'" : "sed ${sed} ${config_file} > configure.tmp" eval sed ${sed} ${config_file} > configure.tmp mv -f configure.tmp ${config_file} rm -f configure.files fi for f in $(egrep -l 'eaddr +=' */*opts.def) do sed "/eaddr *=/s/= .*/= '${EADDR}';/" $f > X ; mv -f X $f done if grep '__CURRENT_VERSION__' NEWS > /dev/null then sed "1s/__CURRENT_VERSION__.*/${AG_VERSION} - $(date '+%B %Y')/" NEWS > X mv -f X NEWS fi ( cd ${srcdir}/config ${AGexe} -L. libopts.def ${AGexe} -L. misc.def ) || exit 1 cp ${srcdir}/snprintfv/snprintfv.m4 ${srcdir}/config/. marker='=== Component Todo:' rm -f TODO exec 3> TODO sed "/${marker}/,\$d" TODO-top >&3 for f in */TODO do test -f $f || continue echo ; echo ${marker} ${f} '===' cat ${f} done >&3 exec 3>&- ( cd ${srcdir}/pkg/debian debver=$(echo 1:${AG_VERSION}-1 | sed 's/pre/~pre/') fgrep "(${debver})" changelog && exit 0 reltype=$( case "${AG_VERSION}" in ( *pre* ) echo prerelease ;; ( * ) echo release ;; esac ) uname=$(finger $(id -n -u) | sed 's/.*Name: *//;1q') exec 3> changelog-new cat >&3 <<- _EOF_ autogen (${debver}) experimental; urgency=low * New ${reltype}. _EOF_ sed '1,2d;/^$/q;s/^/ /' ${srcdir}/NEWS >&3 cat >&3 <<- _EOF_ -- ${uname} <${EADDR}> $(date -R) _EOF_ cat changelog >&3 rm -f changelog exec 3>&- mv changelog-new changelog ) } check_tools() { test -z "${AGexe}" -o -z "$GDexe" -o -z "$CLexe" && exit 1 ( $CLexe --version && \ $GDexe --version && \ $AGexe --version ) > /dev/null || exit 1 } # IF the source dir is not known, # THEN it is the directory above the directory that # contains this file. # [ -z "${srcdir}" ] && { srcdir=`echo $0 | sed 's;/[^/]*$;;'` } MISSING=${MISSING-${srcdir}/config/missing} case ${BOOTSTRAP} in ( pre ) echo '@setfilename autogen.info' > ${srcdir}/doc/autogen.texi if test -f ${srcdir}/configure then rm -f ${srcdir}/configure ; fi check_tools make_funcs_def config_versions chmod a+x ${srcdir}/*/test/*.test exec 3> XXX$$ sed '/^DEBIAN_FILES *=/,$d' ${srcdir}/pkg/Makefile.am >&3 (\cd ${srcdir}/pkg ; ls -1d libopts/* ) | \ egrep -v '^libopts/(CVS|SCCS)$' | \ columns --spread=1 --first='LIBOPTS_FILES =' -I16 --line=" \\" >&3 echo >&3 (\cd ${srcdir}/pkg ; ls -1d mkpkg.debian debian/* ) | \ egrep -v '^debian/(CVS|SCCS)$' | \ columns --spread=1 --first='DEBIAN_FILES =' -I16 --line=" \\" >&3 sed '1,/LIBOPTS_FILES *=/d' ${srcdir}/pkg/Makefile.am >&3 exec 3>&- mv -f XXX$$ ${srcdir}/pkg/Makefile.am ;; ( post ) rm -f ${srcdir}/doc/autogen.texi ;; esac # Local Variables: # mode: shell-script # sh-indentation: 2 # indent-tabs-mode: nil # End: # config/bootstrap.local ends here