|
|
|
@ -22,26 +22,29 @@ configure=0 |
|
|
|
|
build=0 |
|
|
|
|
overwrite=0 |
|
|
|
|
rebuild=0 |
|
|
|
|
rebuildfiles=() |
|
|
|
|
while test $# -gt 0; do |
|
|
|
|
case "$1" in |
|
|
|
|
(--configure|-c) configure=1;; |
|
|
|
|
(--build|-b) configure=1; build=1;; |
|
|
|
|
(--overwrite|-o) overwrite=1;; |
|
|
|
|
(--rebuild|-r) rebuild=1;; |
|
|
|
|
(--rebuild-file|-f) shift; rebuildfiles+=("$1");; |
|
|
|
|
(--version|-v) |
|
|
|
|
echo "$Id$"; |
|
|
|
|
exit;; |
|
|
|
|
(--help|-h) less <<EOF |
|
|
|
|
SYNOPSIS |
|
|
|
|
|
|
|
|
|
${MY_NAME} [--help|-h] [--configure|-c] |
|
|
|
|
${MY_NAME} [--help|-h] [OPTIOS] |
|
|
|
|
|
|
|
|
|
OPTIONS |
|
|
|
|
|
|
|
|
|
--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) |
|
|
|
|
--rebuild -r force rebuild of generated files, even if modified |
|
|
|
|
--rebuild, -r force rebuild of generated files, even if modified |
|
|
|
|
--rebuild-file, -f <file> rebild specific file (can be added multiple times) |
|
|
|
|
--help, -h show this help |
|
|
|
|
--version, -v show version and date of this file |
|
|
|
|
|
|
|
|
@ -122,9 +125,15 @@ GENERATED FILES |
|
|
|
|
|
|
|
|
|
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 <file>" and "${MY_NAME}" to rebuild file "<file>". |
|
|
|
|
To rebuild all these files, just run "${MY_NAME} -r". |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
@ -256,6 +265,12 @@ testtag() { |
|
|
|
|
egrep -q '^ *'"$1" configure.ac |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
contains() { |
|
|
|
|
local e |
|
|
|
|
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done |
|
|
|
|
return 1 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
checkdir() { |
|
|
|
|
if ! test -d "$1"; then # create path |
|
|
|
|
run mkdir -p "$1" |
|
|
|
@ -285,8 +300,10 @@ to() { |
|
|
|
|
esac |
|
|
|
|
shift; |
|
|
|
|
done |
|
|
|
|
if checkfile "$1" && test $rebuild -eq 0; then # file already exists |
|
|
|
|
return |
|
|
|
|
if checkfile "$1" && test $rebuild -eq 0 \ |
|
|
|
|
&& ! contains "$1" "${rebuildfiles[@]}"; then |
|
|
|
|
# file already exists and must not be rebuilt |
|
|
|
|
return 1 |
|
|
|
|
fi |
|
|
|
|
checkdir "$(dirname ${1})" |
|
|
|
|
echo -en "\e[1m-> generating:\e[0m $1 ..." |
|
|
|
@ -307,10 +324,13 @@ to() { |
|
|
|
|
run svn add "$1" |
|
|
|
|
run svn propset svn:keywords "Id" "$1" |
|
|
|
|
fi |
|
|
|
|
return 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
fi |
|
|
|
|
run cp "${0%/*}/$1" "$1" |
|
|
|
@ -348,8 +368,8 @@ copy ax_init_standard_project.m4 |
|
|
|
|
copy ax_cxx_compile_stdcxx_11.m4 |
|
|
|
|
copy ax_check_qt.m4 |
|
|
|
|
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 |
|
|
|
|
m4_define(x_major, 0) # project's major version |
|
|
|
|
m4_define(x_minor, 0) # project's minor version |
|
|
|
@ -370,14 +390,11 @@ AX_INIT_STANDARD_PROJECT |
|
|
|
|
|
|
|
|
|
# qt features, uncomment, what you need: |
|
|
|
|
#AX_CHECK_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets]) |
|
|
|
|
#AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_KEYWORDS" |
|
|
|
|
#AX_QT_NO_KEYWORDS |
|
|
|
|
|
|
|
|
|
# create output |
|
|
|
|
AC_OUTPUT |
|
|
|
|
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) |
|
|
|
|
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_CXX src/makefile.am |
|
|
|
|
to --condition AX_USE_CXX src/version.hxx <<EOF |
|
|
|
@ -473,10 +490,14 @@ LDADD = -l${PACKAGE_NAME} |
|
|
|
|
|
|
|
|
|
MAINTAINERCLEANFILES = makefile.in |
|
|
|
|
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 |
|
|
|
|
if test $exists -eq 0; then |
|
|
|
|
run svn add doc/doxyfile.in |
|
|
|
|
run svn propset svn:keywords "Id" doc/doxyfile.in |
|
|
|
|
fi |
|
|
|
|
doxyreplace PROJECT_NAME "@PACKAGE_NAME@" |
|
|
|
|
doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@" |
|
|
|
|
doxyreplace PROJECT_BRIEF "@DESCRIPTION@" |
|
|
|
@ -595,13 +616,15 @@ ${HEADER}%: |
|
|
|
|
EOF |
|
|
|
|
echo 7 | to debian/compat |
|
|
|
|
fi |
|
|
|
|
if ! test -f makefile.am; then |
|
|
|
|
SUBDIRS="" |
|
|
|
|
for d in src test scripts doc examples; do |
|
|
|
|
test -d $d && SUBDIRS="${SUBDIRS} $d" |
|
|
|
|
done |
|
|
|
|
echo "${HEADER}SUBDIRS =${SUBDIRS}\n\nMAINTAINERCLEANFILES = makefile.in" | to makefile.am |
|
|
|
|
fi |
|
|
|
|
to makefile.am<<EOF |
|
|
|
|
${HEADER}SUBDIRS =${SUBDIRS} |
|
|
|
|
|
|
|
|
|
MAINTAINERCLEANFILES = makefile.in |
|
|
|
|
EOF |
|
|
|
|
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF |
|
|
|
|
${HEADER}prefix=@prefix@ |
|
|
|
|
exec_prefix=@exec_prefix@ |
|
|
|
@ -613,6 +636,7 @@ Description: @DESCRIPTION@ |
|
|
|
|
Version: @VERSION@ |
|
|
|
|
Libs: -L\${libdir} -l@PACKAGE_NAME@ @LDFLAGS@ |
|
|
|
|
Cflags: -I\${includedir} @CPPFLAGS@ |
|
|
|
|
Requires: @PKG_REQUIREMENTS@ |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
#### Cleanup If Makefile Exists #### |
|
|
|
|