From 4b3e045fcca55dc60ec551f1b18dc79b99057f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sun, 1 Nov 2015 23:56:14 +0000 Subject: [PATCH] new author url --- AUTHORS | 2 +- ChangeLog | 61 ++++++++++ ax_check_qt.m4 | 149 +++++++++++++------------ ax_init_standard_project.m4 | 216 +++++++++++++++++++++++++++++++----- bootstrap.sh | 55 ++++++--- 5 files changed, 368 insertions(+), 115 deletions(-) diff --git a/AUTHORS b/AUTHORS index bd79912..86ccdef 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -Marc Wäckerlin (http://marc.waeckerlin.org) +Marc Wäckerlin (https://marc.wäckerlin.ch) diff --git a/ChangeLog b/ChangeLog index 244bb62..62ff970 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,64 @@ +2015-08-17 14:03 marc + + * ax_init_standard_project.m4, bootstrap.sh: Debian sid is more + restrictive in time format + +2015-07-31 11:47 marc + + * libxml-cxx.spec.in: graphviz must not be used in fedora-20, + otherise it never terminates + +2015-07-31 10:46 marc + + * ax_init_standard_project.m4, bootstrap.sh: fixed version number + +2015-07-31 07:05 marc + + * bootstrap.sh, libxml-cxx.spec.in: repair rpm build + +2015-07-31 07:00 marc + + * ax_check_qt.m4, ax_init_standard_project.m4, bootstrap.sh, + libxml-cxx.spec.in, mac-create-app-bundle.sh, makefile.am: repair + rpm build + +2015-07-13 13:55 marc + + * src/xml.cxx: need another move for squeeze + +2015-07-13 13:11 marc + + * configure.ac: typo + +2015-07-13 12:37 marc + + * README, configure.ac: typo + +2015-07-13 12:23 marc + + * bootstrap.sh, doc/doxyfile.in, doc/makefile.am: fix builds + +2015-07-13 12:00 marc + + * src/libxml-cxx.pc.in: link-fix + +2015-07-13 11:55 marc + + * examples/address.cxx, examples/node_macros.cxx, + src/xml-cxx/xml.hxx, src/xml.cxx, test/xml_test.cxx: replaced + std::auto_ptr by new std::unique_ptr + +2015-07-13 11:27 marc + + * AUTHORS, ChangeLog, ax_check_qt.m4, ax_init_standard_project.m4, + bootstrap.sh, configure.ac, debian, debian/changelog.in, + debian/compat, debian/control.in, debian/docs, + debian/libxml-cxx-dev.install, debian/libxml-cxx.install, + debian/rules, doc/examples, doc/makefile.am, examples, + examples/makefile.am, makefile.am, src/libxml-cxx.pc.in, + src/makefile.am, src/version.cxx, src/version.hxx, src/xml.cxx, + test/makefile.am: update to new build system + 2015-05-08 22:00 marc * ChangeLog, src/xml-cxx/xml.hxx, src/xml.cxx: added Node::first() diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 91c0072..479f65c 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -1,10 +1,10 @@ # SYNOPSIS # # Check if a module exists: -# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules] [flags]) # # Abort if a module does not exist: -# AX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules] [flags]) # # DESCRIPTIONS # @@ -35,9 +35,22 @@ # Optional list of more, optional modules, e.g. modules that # exist only in Qt5, but not in Qt4, such as QtWidgets or # QtWebKitWidgets +# +# flags +# +# Optional flages, space separated from this list: +# +# manualflags +# +# CXXFLAGS, CPPFLAGS and LIBS variables are not +# automatically expanded, but you need to add the +# qt_prefix_CXXFLAGS, qt_prefix_CPPFLAGS and qt_prefix_LIBS +# variables manually where you need them. This is useful, +# if some build targets need a feature and some don't. AC_DEFUN([AX_CXX_QT_TOOL], [ + PKG_PROG_PKG_CONFIG if test -z "$HAVE_$1"; then HAVE_$1=1 AC_MSG_CHECKING([for $2]) @@ -61,7 +74,7 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ fi fi AC_SUBST($1) - AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) + AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) if test $HAVE_$1 -eq 1; then AC_MSG_RESULT([$$1]) else @@ -79,27 +92,10 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [ AX_CXX_QT_TOOL(LRELEASE, lrelease) ]) -AC_DEFUN([AX_CHECK_VALID_FLAG], [ - AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) - save_cppflags="$CPPFLAGS" - newflag="no" - for test_flag in $1; do - CPPFLAGS+=" ${test_flag}" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ - newflag="$test_flag" - CPPFLAGS="$save_cppflags" - CPPFLAGS+=" ${test_flag}" - break; - ]) - CPPFLAGS="$save_cppflags" - done - AC_SUBST(CPPFLAGS) - AC_MSG_RESULT([$newflag]) -]) - AC_DEFUN([AX_CHECK_QT], [ qt_modules="$2" qt_modules_optional="$3" + qt_flags="$4" AX_CXX_QT_TOOLS HAVE_$1=0 PKG_PROG_PKG_CONFIG @@ -108,17 +104,37 @@ AC_DEFUN([AX_CHECK_QT], [ AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix Qt5Core) QT_PLUGIN_PATH=${QTDIR}/share/qt5/plugins - CPPFLAGS+=" ${[$1]5_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}" - CXXFLAGS+=" ${[$1]5_CFLAGS}" - LIBS+=" ${[$1]5_LIBS}" + [$1]_CPPFLAGS="${[$1]5_CFLAGS}" + [$1]_CXXFLAGS="${[$1]5_CFLAGS}" + [$1]_LIBS="${[$1]5_LIBS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${qt_flags/manualflags/}" = "${qt_flags}"; then + CPPFLAGS+=" ${[$1]_CPPFLAGS}" + CXXFLAGS+=" ${[$1]_CXXFLAGS}" + LIBS+=" ${[$1]_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi PKG_REQUIREMENTS+=" ${qt_modules//Qt/Qt5}" if test -n "${qt_modules_optional}"; then PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [ - CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" - CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" - LIBS+=" ${[$1]5_OPTIONAL_LIBS}" + [$1]_CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + [$1]_CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + [$1]_LIBS+=" ${[$1]5_OPTIONAL_LIBS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${qt_flags/manualflags/}" = "${qt_flags}"; then + CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}" + LIBS+=" ${[$1]5_OPTIONAL_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi PKG_REQUIREMENTS+=" ${qt_modules_optional//Qt/Qt5}" ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional//Qt/Qt5}]) @@ -130,17 +146,36 @@ AC_DEFUN([AX_CHECK_QT], [ AC_DEFINE([HAVE_$1]) QTDIR=$(${PKG_CONFIG} --variable=prefix QtCore) QT_PLUGIN_PATH=${QTDIR}/share/qt/plugins - CPPFLAGS+=" ${$1_CFLAGS}" MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" - LIBS+=" ${$1_LIBS}" + [$1]_CPPFLAGS="${[$1]_CFLAGS}" + [$1]_CXXFLAGS="${[$1]_CFLAGS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${qt_flags/manualflags/}" = "${qt_flags}"; then + CPPFLAGS+=" ${[$1]_CPPFLAGS}" + CXXFLAGS+=" ${[$1]_CXXFLAGS}" + LIBS+=" ${[$1]_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi PKG_REQUIREMENTS+=" ${qt_modules}" if test -n "$3"; then PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [ - CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" - MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}" - CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" - LIBS+=" ${$1_OPTIONAL_LIBS}" + MOC_FLAGS+="${$1_OPTIONAL_CFLAGS}" + [$1]_CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + [$1]_CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + [$1]_LIBS+=" ${$1_OPTIONAL_LIBS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${qt_flags/manualflags/}" = "${qt_flags}"; then + CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}" + LIBS+=" ${$1_OPTIONAL_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi PKG_REQUIREMENTS+=" ${qt_modules_optional}" ], [ AC_MSG_NOTICE([Not found: ${qt_modules_optional}]) @@ -148,8 +183,11 @@ AC_DEFUN([AX_CHECK_QT], [ fi ], [HAVE_$1=0]) ]) - AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) - AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag]) + AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) + AX_CHECK_VALID_CXX_FLAG([-fPIC -fPIE], [position independent code flag]) + if test -n "${MINGW}"; then + AX_CHECK_VALID_CXX_FLAG([-Wl,-subsystem,windows], [windows console flag]) + fi AC_SUBST(QTDIR) AC_SUBST(QT_PLUGIN_PATH) AC_SUBST(CPPFLAGS) @@ -176,49 +214,15 @@ qrc_%.cxx: %.qrc %.qm: %.ts ${LRELEASE} $< -qm [$][@] -#%.ts: ${LANGUAGE_FILES} +#%.ts: ${LANGUAGE_FILES:%=%} # ${LUPDATE} -no-obsolete \ # -target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \ # -ts [$][@] $< ']) -# SYNOPSIS -# -# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) -# -# DESCRIPTIONS -# -# qt_prefix -# -# Each call to AX_CHECK_QT should have a different prefix -# value (with a few exceptions discussed later on). This value, -# usually provided in uppercase, is used as prefix to the -# variables holding the compiler flags and libraries reported by -# pkg-config. -# -# For instance, if your prefix was to be FOO you'll be provided -# two variables FOO_CFLAGS and FOO_LIBS. -# -# This will also be used as message during the configure checks: -# checking for FOO.... -# -# list-of-modules -# -# A single call to the macro can check for the presence of one or -# more qt modules; you'll see later how to make good use of this -# feature. Each entry in the list can have a version comparison -# specifier, with the same syntax as the Requires keyword in the -# data files themselves. -# -# optional-modules -# -# Optional list of more, optional modules, e.g. modules that -# exist only in Qt5, but not in Qt4, such as QtWidgets or -# QtWebKitWidgets - AC_DEFUN([AX_REQUIRE_QT], [ - AX_CHECK_QT([$1], [$2], [$3]) + AX_CHECK_QT([$1], [$2], [$3], [$4]) if ! test "$HAVE_$1" -eq 1; then AC_MSG_ERROR([Required Qt modules not found: $2]) fi @@ -227,7 +231,6 @@ AC_DEFUN([AX_REQUIRE_QT], [ # Omit Qt Keywords # AX_QT_NO_KEYWORDS - AC_DEFUN([AX_QT_NO_KEYWORDS], [ CPPFLAGS+=" -DQT_NO_KEYWORDS" ]) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 0db6a35..5baecf4 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -8,7 +8,16 @@ m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))]) # define least version number from subversion's revision number: # it is taken modulo 256 due to a bug on Apple's MacOSX -m4_define(x_least, mrw_esyscmd_s([ +m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ + SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" + for path in . .. ../..; do + if svn info $path 2>&1 > /dev/null; then + SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + break; + fi + done + echo $ECHO_N $(($SVN_REVISION)) +]), mrw_esyscmd_s([ SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then @@ -18,7 +27,7 @@ m4_define(x_least, mrw_esyscmd_s([ done # Mac does not support LEAST > 255 echo $ECHO_N $(($SVN_REVISION%256)) -])) +]))) # define version number from subversion's revision number: # it is taken modulo 256 due to a bug on Apple's MacOSX # add to x_minor if revision number is > 256 @@ -34,7 +43,7 @@ m4_define(x_minor_diff, mrw_esyscmd_s([ echo $ECHO_N $(($SVN_REVISION/256)) ])) # setup version number -m4_define(x_version, [x_major.m4_eval(x_minor+x_minor_diff).x_least]) +m4_define(x_version, [x_major.m4_ifdef([x_least_diff], x_minor, m4_eval(x_minor+x_minor_diff)).m4_eval(m4_ifdef([x_least_diff], [x_least-x_least_diff], [x_least]))]) ## bugreport mail address is taken from in first line of AUTHORS m4_define(x_bugreport, mrw_esyscmd_s([ @@ -107,14 +116,27 @@ AC_DEFUN([AX_SUBST], [ # # configures the basic environment AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ - MINGW=no - MAC=no - case $host in - *mingw*) MINGW=yes;; - *darwin* | *rhapsody* | *macosx*) MAC=yes;; - esac - AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") - AM_CONDITIONAL(MAC, test "$MAC" = "yes") + AC_MSG_CHECKING([target platfrom]) + UNIX=1 + MINGW= + MACOSX= + for h in ${target} ${target_os} ${host} ${host_os} \ + ${build} ${build_os} $(uname -s 2> /dev/null); do + p="$h is generic Unix" + case "$h" in + (*mingw*) + UNIX=; MINGW=1; p="MinGW"; break;; + (*Darwin*|*darwin*|*rhapsody*|*macosx*) + UNIX=; MACOSX=1; p="MacOSX"; break;; + esac + done + AC_MSG_RESULT($p) + AM_CONDITIONAL(UNIX, test "$UNIX" = "1") + AM_CONDITIONAL(MINGW, test "$MINGW" = "1") + AM_CONDITIONAL(MACOSX, test "$MACOSX" = "1") + AX_SUBST(UNIX) + AX_SUBST(MINGW) + AX_SUBST(MACOSX) AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) @@ -127,8 +149,17 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AUTHOR=$(head -1 AUTHORS) AX_SUBST(AUTHOR) _AM_SUBST_NOTMAKE([AUTHOR]) - DISTRO=$(lsb_release -sc) + DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null) AX_SUBST(DISTRO) + DISTRIBUTOR=$(lsb_release -si 2>/dev/null || uname -s 2>/dev/null) + case "${DISTRIBUTOR// /-}" in + (Ubuntu) UBUNTU=1; AX_SUBST(UBUNTU);; + (Debian) DEBIAN=1; AX_SUBST(DEBIAN);; + (SUSE-LINUX) SUSE=1; AX_SUBST(SUSE);; + (Fedora) FEDORA=1; AX_SUBST(FEDORA);; + (Centos) CENTOS=1; AX_SUBST(CENTOS);; + esac + AX_SUBST(DISTRIBUTOR) BUILD_NUMBER=${BUILD_NUMBER:-1} AX_SUBST(BUILD_NUMBER) BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") @@ -156,19 +187,36 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ - all warnings result in an error - doxygen warnings are treated as error too]); fi + AC_ARG_ENABLE(debug, + [AS_HELP_STRING([--enable-debug], + [compile for debugger])], + [have_debug="$enableval"], [have_debug="no"]) + AM_CONDITIONAL(DEBUG, test "$enableval" = "yes") + if test "$have_debug" == "yes"; then + AC_MSG_NOTICE([Debug compile mode enabled]); + AM_CPPFLAGS="${AM_CPPFLAGS} -DDEBUG" + AM_CXXFLAGS="${AM_CXXFLAGS:-} -ggdb3 -O0" + AM_LDFLAGS="${AM_LDFLAGS} -ggdb3 -O0" + else + AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG" + fi + AC_CONFIG_FILES([makefile]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-standard-project-targets], [makefile.in]) test -f makefile.in && cat >> makefile.in <> examples/html.in <> html/makefile.in < /dev/null); do if test -f "$f"; then $1_found=${tmp_package} $1_CFLAGS+=" -I${f%/*}" @@ -446,7 +497,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package) for x in ${tmp_includedir}; do AC_MSG_NOTICE([search for $3 in $x]) - for f in $(find ${x} -name "$3"); do + for f in $(find ${x} -name "$3" 2> /dev/null); do if test -f "$f"; then $1_found=${tmp_package} $1_CFLAGS+=" -I${f%/*}" @@ -473,26 +524,47 @@ AC_DEFUN([AX_PKG_REQUIRE], [ AC_MSG_ERROR([Feature $1 not found please install module $secondpar]) fi fi - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" - LIBS+=" ${$1_LIBS}" + [$1]_CPPFLAGS="${$1_CFLAGS}" + [$1]_CXXFLAGS="${$1_CFLAGS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${optional_flags/manualflags/}" = "${optional_flags}"; then + CPPFLAGS+=" ${$1_CPPFLAGS}" + CXXFLAGS+=" ${$1_CXXFLAGS}" + LIBS+=" ${$1_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi ]) # check if a specific package exists # - parameter: # $1 = unique id (no special characters) # $2 = module name (optional, if different from id) +# $3 = optional flags: +# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged # # uses PKG_CHECK_MODULES to test for a module # sets automake conditional HAVE_$1 to 0 (not found) or 1 (found) # sets all flags, so that the module can be used everywhere AC_DEFUN([AX_PKG_CHECK], [ + optional_flags="$3" PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [ HAVE_$1=1 - CPPFLAGS+=" ${$1_CFLAGS}" - CXXFLAGS+=" ${$1_CFLAGS}" - LIBS+=" ${$1_LIBS}" + [$1]_CPPFLAGS="${$1_CFLAGS}" + [$1]_CXXFLAGS="${$1_CFLAGS}" + AC_SUBST([$1]_CPPFLAGS) + AC_SUBST([$1]_CXXFLAGS) + if test "${optional_flags/manualflags/}" = "${optional_flags}"; then + CPPFLAGS+=" ${$1_CPPFLAGS}" + CXXFLAGS+=" ${$1_CXXFLAGS}" + LIBS+=" ${$1_LIBS}" + AC_MSG_NOTICE([Adding flags for $1]) + else + AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) + fi if test -z "$PKG_REQUIREMENTS"; then PKG_REQUIREMENTS="m4_default([$2], [$1])" else @@ -501,7 +573,7 @@ AC_DEFUN([AX_PKG_CHECK], [ ], [ HAVE_$1=0 ]) - AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) + AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) AC_SUBST(HAVE_$1) AC_SUBST(CPPFLAGS) AC_SUBST(CXXFLAGS) @@ -532,3 +604,95 @@ AC_DEFUN([AX_REQUIRE_HEADER], [ ], []) ], []) ]) + +# Check within a list of CPP-Flags for the first that is usable and +# configure it +# - parameter: +# $1 = white-space separated list of alternative flags +# $2 = module name (optional, if different from id) +AC_DEFUN([AX_CHECK_VALID_CPP_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_cppflags="$CPPFLAGS" + newflag="no" + for test_flag in $1; do + CPPFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + CPPFLAGS="$save_cppflags" + CPPFLAGS+=" ${test_flag}" + break; + ]) + CPPFLAGS="$save_cppflags" + done + AC_SUBST(CPPFLAGS) + AC_MSG_RESULT([$newflag in $CPPFLAGS]) +]) + +# Check within a list of CXX-Flags for the first that is usable and +# configure it +# - parameter: +# $1 = white-space separated list of alternative flags +# $2 = module name (optional, if different from id) +AC_DEFUN([AX_CHECK_VALID_CXX_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_cxxflags="$CXXFLAGS" + newflag="no" + for test_flag in $1; do + CXXFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + CXXFLAGS="$save_cxxflags" + CXXFLAGS+=" ${test_flag}" + break; + ]) + CXXFLAGS="$save_cxxflags" + done + AC_SUBST(CXXFLAGS) + AC_MSG_RESULT([$newflag in $CXXFLAGS]) +]) + +# Check within a list of C-Flags for the first that is usable and +# configure it +# - parameter: +# $1 = white-space separated list of alternative flags +# $2 = module name (optional, if different from id) +AC_DEFUN([AX_CHECK_VALID_C_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_cflags="$CFLAGS" + newflag="no" + for test_flag in $1; do + CFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + CFLAGS="$save_cflags" + CFLAGS+=" ${test_flag}" + break; + ]) + CFLAGS="$save_cflags" + done + AC_SUBST(CFLAGS) + AC_MSG_RESULT([$newflag in $CFLAGS]) +]) + +# Check within a list of LD-Flags for the first that is usable and +# configure it +# - parameter: +# $1 = white-space separated list of alternative flags +# $2 = module name (optional, if different from id) +AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [ + AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) + save_ldflags="$LDFLAGS" + newflag="no" + for test_flag in $1; do + LDFLAGS+=" ${test_flag}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + newflag="$test_flag" + LDFLAGS="$save_ldflags" + LDFLAGS+=" ${test_flag}" + break; + ]) + LDFLAGS="$save_ldflags" + done + AC_SUBST(LDFLAGS) + AC_MSG_RESULT([$newflag in $LDFLAGS]) +]) diff --git a/bootstrap.sh b/bootstrap.sh index 41f1f4e..d3e8653 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -103,8 +103,13 @@ GENERATED FILES * ax_init_standard_project.m4 - auxiliary macro definition file * ax_cxx_compile_stdcxx_11.m4 - auxiliary macro definition file * ax_check_qt.m4 - auxiliary macro definition file + * resolve-debbuilddeps.sh - script to install debian package dependencies + * resolve-rpmbuilddeps.sh - script to install RPM package dependencies + * build-resource-file.sh - build resource.qrc file from a resource directory * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle * AUTHORS - replace your name in AUTHORS before first run + * NEWS - empty file add your project's news + * README - add project description (first line is header, followed by an empty line) * configure.ac - global configuration file template * makefile.am - global makefile template * src/makefile.am - if you enabled AX_USE_CXX @@ -149,6 +154,7 @@ FILES TO EDIT The following files normally require editing: * AUTHORS + * NEWS * README * configure.ac * src/makefile.am @@ -165,19 +171,20 @@ FILE DEPENDENCIES * html/makefile.am depends on AX_BUILD_HTML * doc/doxyfile.in depends on AX_BUILD_EXAMPLES * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_CPPUNIT, - AX_CXX_QT, AX_CXX_CHECK_QT, AX_USE_LIBTOOL + AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}.install depends on AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}.dirs depends on AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}-dev.install depends on AX_USE_LIBTOOL * debian/${DEFAULT_PROJECT_NAME}-dev.dirs depends on AX_USE_LIBTOOL - * ${DEFAULT_PROJECT_NAME}.spec.in dependson AX_USE_RPM_PACKAGING, - AX_USE_LIBTOOL, AX_CXX_CHECK_QT, AX_CXX_QT, AX_USE_CPPUNIT + * ${DEFAULT_PROJECT_NAME}.spec.in depends on AX_USE_RPM_PACKAGING, + AX_USE_LIBTOOL, AX_CHECK_QT, AX_REQUIRE_QT, AX_CXX_QT, AX_USE_CPPUNIT FILES * AUTHORS: First line is the main author and used in Debian and RPM packaging, so there must be a GPG key that matches to this line. + * NEWS: File to add project news. * README: First line is a short description of your project, then an empty line must follow. All remaining lines are a long description of your project. this information @@ -203,7 +210,7 @@ FILES * Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES * Check for C++11 support: AX_CXX_COMPILE_STDCXX_11 (see ax_cxx_compile_stdcxx_11.m4) * Require a QT module: AX_REQUIRE_QT (see ax_check_qt.m4) - * Optionally use a QT module: AX_CHECK_QT (see ax_check_qt.m4) + * Optionally use a QT module: AX_CHECK_QT (see ax_check_qt.m4) * Require a module: AX_PKG_REQUIRE (see ax_init_standard_project.m4) * Check for an optional module: AX_PKG_CHECK (see ax_init_standard_project.m4) @@ -275,7 +282,8 @@ run() { } testtag() { - egrep -q '^ *'"$1" configure.ac + local IFS="|" + egrep -q '^ *'"($*)" configure.ac } contains() { @@ -380,6 +388,9 @@ copy ${MY_NAME} copy ax_init_standard_project.m4 copy ax_cxx_compile_stdcxx_11.m4 copy ax_check_qt.m4 +copy resolve-debbuilddeps.sh +copy resolve-rpmbuilddeps.sh +copy build-resource-file.sh copy mac-create-app-bundle.sh AUTHOR=$(gpg -K | sed -n 's,uid *,,p' | sort | head -1) if test -z "${AUTHOR}"; then @@ -388,6 +399,14 @@ fi to AUTHORS <