|
|
@ -22,28 +22,31 @@ configure=0 |
|
|
|
build=0 |
|
|
|
build=0 |
|
|
|
overwrite=0 |
|
|
|
overwrite=0 |
|
|
|
rebuild=0 |
|
|
|
rebuild=0 |
|
|
|
|
|
|
|
rebuildfiles=() |
|
|
|
while test $# -gt 0; do |
|
|
|
while test $# -gt 0; do |
|
|
|
case "$1" in |
|
|
|
case "$1" in |
|
|
|
(--configure|-c) configure=1;; |
|
|
|
(--configure|-c) configure=1;; |
|
|
|
(--build|-b) configure=1; build=1;; |
|
|
|
(--build|-b) configure=1; build=1;; |
|
|
|
(--overwrite|-o) overwrite=1;; |
|
|
|
(--overwrite|-o) overwrite=1;; |
|
|
|
(--rebuild|-r) rebuild=1;; |
|
|
|
(--rebuild|-r) rebuild=1;; |
|
|
|
|
|
|
|
(--rebuild-file|-f) shift; rebuildfiles+=("$1");; |
|
|
|
(--version|-v) |
|
|
|
(--version|-v) |
|
|
|
echo "$Id: bootstrap.sh 31 2015-05-05 15:06:08Z marc $"; |
|
|
|
echo "$Id: bootstrap.sh 31 2015-05-05 15:06:08Z marc $"; |
|
|
|
exit;; |
|
|
|
exit;; |
|
|
|
(--help|-h) less <<EOF |
|
|
|
(--help|-h) less <<EOF |
|
|
|
SYNOPSIS |
|
|
|
SYNOPSIS |
|
|
|
|
|
|
|
|
|
|
|
${MY_NAME} [--help|-h] [--configure|-c] |
|
|
|
${MY_NAME} [--help|-h] [OPTIOS] |
|
|
|
|
|
|
|
|
|
|
|
OPTIONS |
|
|
|
OPTIONS |
|
|
|
|
|
|
|
|
|
|
|
--configure, -c call ./configure after initialization |
|
|
|
--configure, -c call ./configure after initialization |
|
|
|
--build, -c build, call ./configure && make after initialization |
|
|
|
--build, -c build, also call ./configure && make |
|
|
|
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros) |
|
|
|
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros) |
|
|
|
--rebuild -r force rebuild of generated files, even if modified |
|
|
|
--rebuild, -r force rebuild of generated files, even if modified |
|
|
|
--help, -h show this help |
|
|
|
--rebuild-file, -f <file> rebild specific file (can be added multiple times) |
|
|
|
--version, -v show version and date of this file |
|
|
|
--help, -h show this help |
|
|
|
|
|
|
|
--version, -v show version and date of this file |
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION |
|
|
|
DESCRIPTION |
|
|
|
|
|
|
|
|
|
|
@ -122,9 +125,15 @@ GENERATED FILES |
|
|
|
|
|
|
|
|
|
|
|
REBUILDING FILES |
|
|
|
REBUILDING FILES |
|
|
|
|
|
|
|
|
|
|
|
To rebuild all these files, just run "${MY_NAME} -o". You can also |
|
|
|
To rebuild all these files, just run "${MY_NAME} -r". |
|
|
|
remove and rebuild a single file by removing it from subversion, |
|
|
|
|
|
|
|
just call "svn rm <file>" and "${MY_NAME}" to rebuild file "<file>". |
|
|
|
To copy only the files provided by this package, that means those |
|
|
|
|
|
|
|
files you must never change, that means to update the build system |
|
|
|
|
|
|
|
to the latest release, run "${MY_NAME} -o" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can also rebuild a list of singleany list of specific file files |
|
|
|
|
|
|
|
by adding option "${MY_NAME} -f <file>" to rebuild file |
|
|
|
|
|
|
|
"<file>". You can add option "-f" more than once. |
|
|
|
|
|
|
|
|
|
|
|
FILES TO EDIT |
|
|
|
FILES TO EDIT |
|
|
|
|
|
|
|
|
|
|
@ -256,6 +265,12 @@ testtag() { |
|
|
|
egrep -q '^ *'"$1" configure.ac |
|
|
|
egrep -q '^ *'"$1" configure.ac |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contains() { |
|
|
|
|
|
|
|
local e |
|
|
|
|
|
|
|
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done |
|
|
|
|
|
|
|
return 1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
checkdir() { |
|
|
|
checkdir() { |
|
|
|
if ! test -d "$1"; then # create path |
|
|
|
if ! test -d "$1"; then # create path |
|
|
|
run mkdir -p "$1" |
|
|
|
run mkdir -p "$1" |
|
|
@ -285,8 +300,10 @@ to() { |
|
|
|
esac |
|
|
|
esac |
|
|
|
shift; |
|
|
|
shift; |
|
|
|
done |
|
|
|
done |
|
|
|
if checkfile "$1" && test $rebuild -eq 0; then # file already exists |
|
|
|
if checkfile "$1" && test $rebuild -eq 0 \ |
|
|
|
return |
|
|
|
&& ! contains "$1" "${rebuildfiles[@]}"; then |
|
|
|
|
|
|
|
# file already exists and must not be rebuilt |
|
|
|
|
|
|
|
return 1 |
|
|
|
fi |
|
|
|
fi |
|
|
|
checkdir "$(dirname ${1})" |
|
|
|
checkdir "$(dirname ${1})" |
|
|
|
echo -en "\e[1m-> generating:\e[0m $1 ..." |
|
|
|
echo -en "\e[1m-> generating:\e[0m $1 ..." |
|
|
@ -307,10 +324,13 @@ to() { |
|
|
|
run svn add "$1" |
|
|
|
run svn add "$1" |
|
|
|
run svn propset svn:keywords "Id" "$1" |
|
|
|
run svn propset svn:keywords "Id" "$1" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
return 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
copy() { |
|
|
|
copy() { |
|
|
|
if checkfile "$1" && test $overwrite -eq 0; then |
|
|
|
if checkfile "$1" && test $overwrite -eq 0 \ |
|
|
|
|
|
|
|
&& ! contains "$1" "${rebuildfiles[@]}"; then |
|
|
|
|
|
|
|
# file already exists and must not be rebuilt |
|
|
|
return |
|
|
|
return |
|
|
|
fi |
|
|
|
fi |
|
|
|
run cp "${0%/*}/$1" "$1" |
|
|
|
run cp "${0%/*}/$1" "$1" |
|
|
@ -348,8 +368,8 @@ copy ax_init_standard_project.m4 |
|
|
|
copy ax_cxx_compile_stdcxx_11.m4 |
|
|
|
copy ax_cxx_compile_stdcxx_11.m4 |
|
|
|
copy ax_check_qt.m4 |
|
|
|
copy ax_check_qt.m4 |
|
|
|
copy AUTHORS |
|
|
|
copy AUTHORS |
|
|
|
if ! test -f configure.ac; then |
|
|
|
to configure.ac <<EOF && \ |
|
|
|
to configure.ac <<EOF |
|
|
|
( echo "please edit configure.ac, then rerun $0"; exit 0 ) |
|
|
|
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name |
|
|
|
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name |
|
|
|
m4_define(x_major, 0) # project's major version |
|
|
|
m4_define(x_major, 0) # project's major version |
|
|
|
m4_define(x_minor, 0) # project's minor version |
|
|
|
m4_define(x_minor, 0) # project's minor version |
|
|
@ -375,9 +395,6 @@ AX_INIT_STANDARD_PROJECT |
|
|
|
# create output |
|
|
|
# create output |
|
|
|
AC_OUTPUT |
|
|
|
AC_OUTPUT |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
echo "please edit configure.ac, then rerun $0" |
|
|
|
|
|
|
|
exit 0 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac) |
|
|
|
PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac) |
|
|
|
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_CXX src/makefile.am |
|
|
|
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_CXX src/makefile.am |
|
|
|
to --condition AX_USE_CXX src/version.hxx <<EOF |
|
|
|
to --condition AX_USE_CXX src/version.hxx <<EOF |
|
|
@ -473,10 +490,14 @@ LDADD = -l${PACKAGE_NAME} |
|
|
|
|
|
|
|
|
|
|
|
MAINTAINERCLEANFILES = makefile.in |
|
|
|
MAINTAINERCLEANFILES = makefile.in |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
if testtag AX_USE_DOXYGEN && ! test -f doc/doxyfile.in; then |
|
|
|
if testtag AX_USE_DOXYGEN && \ |
|
|
|
|
|
|
|
( ! checkfile doc/doxyfile.in || \ |
|
|
|
|
|
|
|
contains doc/doxyfile.in "${rebuildfiles[@]}" ); then |
|
|
|
run doxygen -g doc/doxyfile.in |
|
|
|
run doxygen -g doc/doxyfile.in |
|
|
|
run svn add doc/doxyfile.in |
|
|
|
if test $exists -eq 0; then |
|
|
|
run svn propset svn:keywords "Id" doc/doxyfile.in |
|
|
|
run svn add doc/doxyfile.in |
|
|
|
|
|
|
|
run svn propset svn:keywords "Id" doc/doxyfile.in |
|
|
|
|
|
|
|
fi |
|
|
|
doxyreplace PROJECT_NAME "@PACKAGE_NAME@" |
|
|
|
doxyreplace PROJECT_NAME "@PACKAGE_NAME@" |
|
|
|
doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@" |
|
|
|
doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@" |
|
|
|
doxyreplace PROJECT_BRIEF "@DESCRIPTION@" |
|
|
|
doxyreplace PROJECT_BRIEF "@DESCRIPTION@" |
|
|
@ -595,13 +616,15 @@ ${HEADER}%: |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
echo 7 | to debian/compat |
|
|
|
echo 7 | to debian/compat |
|
|
|
fi |
|
|
|
fi |
|
|
|
if ! test -f makefile.am; then |
|
|
|
SUBDIRS="" |
|
|
|
SUBDIRS="" |
|
|
|
for d in src test scripts doc examples; do |
|
|
|
for d in src test scripts doc examples; do |
|
|
|
test -d $d && SUBDIRS="${SUBDIRS} $d" |
|
|
|
test -d $d && SUBDIRS="${SUBDIRS} $d" |
|
|
|
done |
|
|
|
done |
|
|
|
to makefile.am<<EOF |
|
|
|
echo "${HEADER}SUBDIRS =${SUBDIRS}\n\nMAINTAINERCLEANFILES = makefile.in" | to makefile.am |
|
|
|
${HEADER}SUBDIRS =${SUBDIRS} |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
MAINTAINERCLEANFILES = makefile.in |
|
|
|
|
|
|
|
EOF |
|
|
|
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF |
|
|
|
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF |
|
|
|
${HEADER}prefix=@prefix@ |
|
|
|
${HEADER}prefix=@prefix@ |
|
|
|
exec_prefix=@exec_prefix@ |
|
|
|
exec_prefix=@exec_prefix@ |
|
|
@ -613,6 +636,7 @@ Description: @DESCRIPTION@ |
|
|
|
Version: @VERSION@ |
|
|
|
Version: @VERSION@ |
|
|
|
Libs: -L\${libdir} -l@PACKAGE_NAME@ @LDFLAGS@ |
|
|
|
Libs: -L\${libdir} -l@PACKAGE_NAME@ @LDFLAGS@ |
|
|
|
Cflags: -I\${includedir} @CPPFLAGS@ |
|
|
|
Cflags: -I\${includedir} @CPPFLAGS@ |
|
|
|
|
|
|
|
Requires: @PKG_REQUIREMENTS@ |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
|
|
#### Cleanup If Makefile Exists #### |
|
|
|
#### Cleanup If Makefile Exists #### |
|
|
|