diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 817cf2c..4569170 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -283,6 +283,11 @@ rpm: dist EOF ]) +# use this in configure.ac to support scripts, e.g. bash scripts +AC_DEFUN([AX_USE_SCRIPTS], [ + AC_CONFIG_FILES([scripts/makefile]) +]) + # use this in configure.ac to support Doxygen documentation generation AC_DEFUN([AX_USE_DOXYGEN], [ AC_CHECK_PROG(have_doxygen, doxygen, yes, no) diff --git a/bootstrap.sh b/bootstrap.sh index 3db7578..409d62e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,10 +19,18 @@ PROJECT_PATH=$(pwd) DEFAULT_PROJECT_NAME=${PROJECT_PATH##*/} configure=0 +build=0 +overwrite=0 +rebuild=0 while test $# -gt 0; do case "$1" in (--configure|-c) configure=1;; - (--version|-v) echo "$Id: bootstrap.sh 31 2015-05-05 15:06:08Z marc $"; exit;; + (--build|-b) configure=1; build=1;; + (--overwrite|-o) overwrite=1;; + (--rebuild|-r) rebuild=1;; + (--version|-v) + echo "$Id: bootstrap.sh 31 2015-05-05 15:06:08Z marc $"; + exit;; (--help|-h) less <" - and run ${MY_NAME} again. +REBUILDING FILES + + To rebuild all these files, just run "${MY_NAME} -o". You can also + remove and rebuild a single file by removing it from subversion, + just call "svn rm " and "${MY_NAME}" to rebuild file "". FILES TO EDIT @@ -128,8 +143,8 @@ FILES TO EDIT FILE DEPENDENCIES - You should rebuild (remove and run (see above) the files, whenever - you change the configuration a dependent, i.e.: + You should rebuild (see above) the files, whenever you change the + configuration a dependent, i.e.: * test/makefile.am depends on AX_USE_LIBTOOL * doc/doxyfile.in depends on AX_BUILD_EXAMPLES @@ -162,8 +177,9 @@ FILES number. The following macros are supported: * Enable C++: AX_USE_CXX * Enable LibTool library creation: AX_USE_LIBTOOL + * Enable Scripts: AX_USE_SCRIPTS * Enable Doxygen documentation generation: AX_USE_DOXYGEN - * Enable debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING + * Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING * Not yet implemented: AX_USE_RPM_PACKAGING * Enable C++ testing using CppUnit: AX_USE_CPPUNIT * Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES @@ -198,7 +214,7 @@ EOF done -HEADER='## @id $Id: bootstrap.sh 31 2015-05-05 15:06:08Z marc $ +HEADER='## @id '"\$Id\$"' # # This file has been added by '${MY_NAME}' on '$(date -R)' # Feel free to change it or even remove and rebuild it, up to your needs @@ -247,6 +263,14 @@ checkdir() { fi } +checkfile() { + exists=0 + if test -f "$1"; then + exists=1 + fi + test $exists -eq 1 +} + to() { while test $# -gt 0; do mode="u=rw,g=rw,o=r" @@ -261,7 +285,7 @@ to() { esac shift; done - if test -f "$1"; then # file already exists + if checkfile "$1" && test $rebuild -eq 0; then # file already exists return fi checkdir "$(dirname ${1})" @@ -279,13 +303,18 @@ to() { echo -e " \e[32msuccess\e[0m" fi chmod $mode $1 - run svn add "$1" - run svn propset svn:keywords "Id" "$1" + if test $exists -eq 0; then + run svn add "$1" + run svn propset svn:keywords "Id" "$1" + fi } copy() { - if ! test -f "$1"; then - run cp "${0%/*}/$1" "$1" + if checkfile "$1" && test $overwrite -eq 0; then + return + fi + run cp "${0%/*}/$1" "$1" + if test $exists -eq 0; then run svn add "$1" run svn propset svn:keywords "Id" "$1" fi @@ -321,6 +350,7 @@ AX_INIT_STANDARD_PROJECT # requirements, uncomment, what you need: #AX_USE_CXX #AX_USE_LIBTOOL +#AX_USE_SCRIPTS #AX_USE_DOXYGEN #AX_USE_DEBIAN_PACKAGING #AX_USE_RPM_PACKAGING @@ -342,7 +372,7 @@ echo "${HEADER}" | to --condition AX_USE_CXX src/makefile.am to --condition AX_USE_CXX src/version.hxx <