diff --git a/ax_cxx_compile_stdcxx_11.m4 b/ax_cxx_compile_stdcxx_11.m4 index af37acd..4c831e0 100644 --- a/ax_cxx_compile_stdcxx_11.m4 +++ b/ax_cxx_compile_stdcxx_11.m4 @@ -4,12 +4,16 @@ # # SYNOPSIS # +# AX_REQUIRE_STDCXX_11 +# AX_REQUIRE_STDCXX_14 # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) +# AX_CXX_COMPILE_STDCXX_14([ext|noext],[mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXXFLAGS to enable support. +# or C++14 standard; if necessary, add switches to CXXFLAGS to +# enable support. # # The first argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. @@ -131,3 +135,97 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl AC_SUBST(HAVE_CXX11) fi ]) + +AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [dnl + m4_if([$1], [], [], + [$1], [ext], [], + [$1], [noext], [], + [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_14])])dnl + m4_if([$2], [], [ax_cxx_compile_cxx14_required=true], + [$2], [mandatory], [ax_cxx_compile_cxx14_required=true], + [$2], [optional], [ax_cxx_compile_cxx14_required=false], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_14])])dnl + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++14 features by default, + ax_cv_cxx_compile_cxx14, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [ax_cv_cxx_compile_cxx14=yes], + [ax_cv_cxx_compile_cxx14=no])]) + if test x$ax_cv_cxx_compile_cxx14 = xyes; then + ac_success=yes + fi + + m4_if([$1], [noext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=gnu++14 -std=gnu++0y; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx14_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++14 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + + m4_if([$1], [ext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=c++14 -std=c++0y; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx14_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++14 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx14_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++14 language features is required.]) + fi + else + if test x$ac_success = xno; then + HAVE_CXX14=0 + AC_MSG_NOTICE([No compiler with C++14 support was found]) + AX_CXX_COMPILE_STDCXX_11([$1], [optional]) + else + HAVE_CXX11=1 + HAVE_CXX14=1 + AC_DEFINE(HAVE_CXX14,1, + [define if the compiler supports basic C++14 syntax]) + AC_DEFINE(HAVE_CXX11,1, + [define if the compiler supports basic C++14 syntax]) + fi + AC_SUBST(HAVE_CXX11) + AC_SUBST(HAVE_CXX14) + fi +]) + +AC_DEFUN([AX_REQUIRE_STDCXX_11], [ + if test x${HAVE_CXX11} != x1; then + AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) + fi +]) + +AC_DEFUN([AX_REQUIRE_STDCXX_14], [ + if test x${HAVE_CXX14} != x1; then + AC_MSG_ERROR([*** A compiler with support for C++14 language features is required.]) + fi +]) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 4128d9f..4f63768 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -7,7 +7,7 @@ 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 +# it is taken modulo 256 due to a bug on Apple's SX m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix], m4_ifdef([x_least_diff], mrw_esyscmd_s([ @@ -129,7 +129,7 @@ AC_DEFUN([AX_SUBST], [ # m4_define(x_minor, MINOR_NUMBER) # project's minor version # m4_include(ax_init_standard_project.m4) # AC_INIT(x_package_name, x_version, x_bugreport, x_package_name) -# AM_INIT_AUTOMAKE([1.9 tar-pax]) +# AM_INIT_AUTOMAKE([1.9 tar-pax parallel-tests color-tests]) # AX_INIT_STANDARD_PROJECT # # you change nothing but: YOUR_PACKAGE_NAME, MAJOR_NUMBER, MINOR_NUMBER @@ -170,15 +170,45 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) - README=$(tail -n +3 README) + if test -f README.md; then + README=$(tail -n +3 README.md) + DESCRIPTION=$(head -1 README.md) + else + README=$(tail -n +3 README) + DESCRIPTION=$(head -1 README) + fi + README_ESCAPED=$(echo "$README" | sed ':a;N;$!ba;s/\n/\\n/g;s,",\\",g') + if which pandoc 2>&1 > /dev/null; then + README_HTML=$(echo "$README" | pandoc -f markdown_github -t html | sed ':a;N;$!ba;s,\\\(.\),\\\\\1,g;s/\n/\\n/g;s,",\\",g;s, ,\ \ ,g') + else + README_HTML="${README}" + fi AX_SUBST(README) _AM_SUBST_NOTMAKE([README]) - DESCRIPTION=$(head -1 README) + AX_SUBST(README_ESCAPED) + _AM_SUBST_NOTMAKE([README_ESCAPED]) + AX_SUBST(README_HTML) + _AM_SUBST_NOTMAKE([README_HTML]) AX_SUBST(DESCRIPTION) _AM_SUBST_NOTMAKE([DESCRIPTION]) + LICENSE=$(echo $(head -1 COPYING)) + AX_SUBST(LICENSE) + COPYING=$(.*,\1,') AX_SUBST(AUTHOR) _AM_SUBST_NOTMAKE([AUTHOR]) + AX_SUBST(AUTHOR_NAME) + AX_SUBST(AUTHOR_URL) + AX_SUBST(AUTHOR_MAIL) + PROJECT_URL="${PROJECT_URL:-${AUTHOR_URL}/projects/${PACKAGE_NAME}}" + SOURCE_DOWNLOAD="${SOURCE_DOWNLOAD:-${AUTHOR_URL}/downloads/${PACKAGE_NAME}}" + AX_SUBST(PROJECT_URL) + AX_SUBST(SOURCE_DOWNLOAD) DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null) AX_SUBST(DISTRO) ARCH=$((@<:@@<:@ $(uname -sm) =~ 64 @:>@@:>@ && echo amd64) || (@<:@@<:@ $(uname -sm) =~ 'i?86' @:>@@:>@ && echo i386 || uname -sm)) @@ -242,6 +272,25 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ else AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG" fi + + AC_ARG_WITH(gcov, + [AS_HELP_STRING([--with-gcov=FILE], + [enable gcov, set gcov file (defaults to gcov)])], + [GCOV="$enableval"], [GCOV="no"]) + AM_CONDITIONAL(COVERAGE, test "$GCOV" != "no") + if test "$GCOV" != "no"; then + if test "$GCOV" == "yes"; then + GCOV=gcov + fi + AC_CHECK_PROG(has_gcov, [$GCOV], [yes], [no]) + if test "$has_gcov" != "yes"; then + AC_MSG_ERROR([gcov: program $GCOV not found]) + fi + AC_MSG_NOTICE([Coverage tests enabled, using ${GCOV}]); + AM_CXXFLAGS="${AM_CXXFLAGS:-} -O0 --coverage -fprofile-arcs -ftest-coverage" + AM_LDFLAGS="${AM_LDFLAGS} -O0 --coverage -fprofile-arcs" + AX_SUBST(GCOV) + fi if test -f ${PACKAGE_NAME}.desktop.in; then AC_CONFIG_FILES([${PACKAGE_NAME}.desktop]) @@ -273,7 +322,7 @@ EOF AC_DEFUN([AX_USE_CXX], [ m4_include(ax_cxx_compile_stdcxx_11.m4) AC_LANG(C++) - AX_CXX_COMPILE_STDCXX_11(noext, optional) + AX_CXX_COMPILE_STDCXX_14(noext, optional) AC_PROG_CXX AC_PROG_CPP @@ -383,6 +432,33 @@ maintainer-clean-example-targets: EOF ]) +# use this in configure.ac to support C++ examples +AC_DEFUN([AX_USE_NODEJS], [ + AC_PATH_PROG(ANDROID, [android], [0], + [${PATH}${PATH_SEPARATOR}${ANDROID_HOME}/tools]) + AC_PATH_PROG(CORDOVA, [cordova], [0], + [${PATH}${PATH_SEPARATOR}$(pwd)/node_modules/cordova/bin]) + if test ${CORDOVA} = 0; then + AC_MSG_WARN([cordova is missing, on ubuntu install cordova-cli from repository ppa:cordova-ubuntu/ppa]) + fi + if test ${ANDROID} = 0; then + AC_MSG_WARN([android sdk is missing, set variable ANDROID_HOME after installation]) + fi + AM_CONDITIONAL(HAVE_CORDOVA, [test ${CORDOVA} != 0 -a ${ANDROID} != 0]) + AX_SUBST(CORDOVA) + AC_CONFIG_FILES([nodejs/package.json]) + AC_CONFIG_FILES([nodejs/makefile]) + AC_CONFIG_FILES([cordova/makefile]) + AC_CONFIG_FILES([cordova/config.xml]) + AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-example-targets], [examples/makefile.in]) + test -f examples/makefile.in && cat >> examples/makefile.in <> doc/makefile.in <> doc/makefile.in <Perl Documentation

Perl Documentation

    " > perldoc/index.html + for p in \${PERL_SOURCES:%=perldoc/%}; do \ + echo '
  • '"\$\${p#perldoc/}"'
  • ' >> perldoc/index.html; \ + done + echo "
" >> perldoc/index.html + +perldoc/%: + pods2html --notoc --empty --index index @top_srcdir@/\${@:perldoc/%=%} \$[@] + +distclean-perldoc: + -rm -r perldoc +maintainer-clean-perldoc: + -rm makefile.in +install-data-perldoc: + test -d \$(DESTDIR)\${docdir} || mkdir -p \$(DESTDIR)\${docdir} + chmod -R u+w \$(DESTDIR)\${docdir} + cp -r perldoc \$(DESTDIR)\${docdir}/ +uninstall-perldoc: + -chmod -R u+w \$(DESTDIR)\${docdir} + -rm -rf \$(DESTDIR)\${docdir}/perldoc +#### End: $0 +EOF +]) + # require a specific package, with fallback: test for a header # - parameter: # $1 = unique id (no special characters) diff --git a/bootstrap.sh b/bootstrap.sh index 22e0c7b..f44efb9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -129,6 +129,7 @@ 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 + * makefile_test.inc.am - makefile to be included in tests * resolve-debbuilddeps.sh - script to install debian package dependencies * resolve-rpmbuilddeps.sh - script to install RPM package dependencies * build-in-docker.sh - script to build the project encapsulated in a docker container @@ -148,9 +149,14 @@ GENERATED FILES * src/version.cxx - if you enabled AX_USE_CXX * html/makefile.am - if you enabled AX_BUILD_HTML * scripts/makefile.am - if you enabled AX_USE_SCRIPTS - * doc/makefile.am - if you enabled AX_USE_DOXYGEN + * doc/makefile.am - if you enabled AX_USE_DOXYGEN or AX_USE_PERLDOC * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN - * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT + * doc/header.html.in - if you enabled AX_USE_DOXYGEN + * doc/footer.html.in - if you enabled AX_USE_DOXYGEN + * doc/style.css - if you enabled AX_USE_DOXYGEN + * doc/plantuml.jar - if you enable AX_USE_DOXYGEN + * test/makefile.am - if you enabled AX_USE_CPPUNIT and AX_USE_CXX + * test/${DEFAULT_PROJECT_NAME#lib}.cxx - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT * examples/makefile.am - if you enabled AX_BUILD_EXAMPLES * debian/changelog.in - if you enabled AX_USE_DEBIAN_PACKAGING * debian/control.in - if you enabled AX_USE_DEBIAN_PACKAGING @@ -191,6 +197,7 @@ FILES TO EDIT * src/makefile.am * html/makefile.am * test/makefile.am + * test/${DEFAULT_PROJECT_NAME}.cxx * examples/makefile.am FILE DEPENDENCIES @@ -201,8 +208,8 @@ FILE DEPENDENCIES * test/makefile.am depends on AX_USE_LIBTOOL * 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_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL + * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_PERLDOC, + AX_USE_CPPUNIT 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 @@ -236,6 +243,7 @@ FILES * Enable LibTool library creation: AX_USE_LIBTOOL * Enable Scripts: AX_USE_SCRIPTS * Enable Doxygen documentation generation: AX_USE_DOXYGEN + * Enable Perldoc documentation generation: AX_USE_PERLDOC * Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING * Enable RPM packaging by calling "make rpm": AX_USE_RPM_PACKAGING * Enable C++ testing using CppUnit: AX_USE_CPPUNIT @@ -433,6 +441,9 @@ copy() { source="${0%/*}/$1" fi fi + if test "${1%/*}" != "$1"; then + test -d "${1%/*}" || svn mkdir "${1%/*}" + fi run cp "${source}" "$1" if test $exists -eq 0; then if test -n "${VCS}" -a $novcs -eq 0 && ! contains "$1" "${excludevcs[@]}"; then @@ -500,6 +511,7 @@ copy ${MY_NAME} copy ax_init_standard_project.m4 copy ax_cxx_compile_stdcxx_11.m4 copy ax_check_qt.m4 +copy makefile_test.inc.am copy resolve-debbuilddeps.sh copy resolve-rpmbuilddeps.sh copy build-in-docker.sh @@ -522,7 +534,11 @@ ${DEFAULT_PROJECT_NAME} add description for ${DEFAULT_PROJECT_NAME} EOF to configure.ac < #include @@ -672,7 +710,8 @@ class ${PackageName}: public QMainWindow, protected Ui::${PackageName} { #endif EOF - to --condition AX_USE_CXX src/${PACKAGE_NAME}.ui < ${PackageName} @@ -754,7 +793,7 @@ EOF to --condition AX_USE_CXX src/version.cxx < +#include +#include +#include +#include +#include + +/// @todo Rename DummyTest and DummyTest::dummy() +/// @todo Write test cases +class DummyTest: public CppUnit::TestFixture { + public: + void dummy() { + } + CPPUNIT_TEST_SUITE(DummyTest); + CPPUNIT_TEST(dummy); + CPPUNIT_TEST_SUITE_END(); +}; +CPPUNIT_TEST_SUITE_REGISTRATION(DummyTest); + +int main(int argc, char** argv) try { + std::ofstream ofs((*argv+std::string(".xml")).c_str()); + CppUnit::TextUi::TestRunner runner; + runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs)); + runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); + return runner.run() ? 0 : 1; + } catch (std::exception& e) { + std::cerr<<"***Exception: "< + + + + + + +\$projectname: \$title +\$title + + + +\$treeview +\$search +\$mathjax + +\$extrastylesheet + + +
+ +
+
+ +
\$projectname \$projectnumber
+
\$projectbrief
+
+ +
+EOF +to --condition AX_USE_DOXYGEN doc/footer.html.in < + +
+ + +EOF +to --condition AX_USE_DOXYGEN doc/style.css <@AUTHOR_NAME@\\n"' doxyadd ALIASES '"license=\\par License\\n"' doxyadd ALIASES '"classmutex=\\par Reentrant:\\nAccess is locked with class static mutex @c "' doxyadd ALIASES '"instancemutex=\\par Reentrant:\\nAccess is locked with per instance mutex @c "' doxyadd ALIASES '"mutex=\\par Reentrant:\\nAccess is locked with mutex @c "' doxyadd ALIASES '"api=\\xrefitem api \\"API Call\\" \\"\\""' + doxyadd ALIASES '"description=@DESCRIPTION@"' + doxyadd ALIASES '"readme=@README_HTML@"' + doxyadd ALIASES '"author=@AUTHOR_NAME@"' + doxyreplace PLANTUML_JAR_PATH '"@top_srcdir@/doc/plantuml.jar"' doxyreplace ENABLE_PREPROCESSING YES doxyreplace MACRO_EXPANSION YES doxyadd PREDEFINED '"NAMESPACE=@PACKAGE_NAME@"' @@ -886,9 +1052,20 @@ if testtag AX_USE_DOXYGEN; then if testtag AX_BUILD_TEST AX_USE_CPPUNIT; then doxyadd INPUT "@top_srcdir@/test" fi + if testtag AX_USE_NODEJS; then + doxyadd INPUT "@top_srcdir@/nodejs" + doxyadd EXCLUDE "@top_srcdir@/nodejs/node_modules" + doxyadd EXCLUDE "@top_srcdir@/nodejs/public/javascripts/ext" + fi doxyreplace FILE_PATTERNS '*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.idl *.ddl *.odl *.h *.hh *.hxx *.hpp *.h++ *.cs *.d *.php *.php4 *.php5 *.phtml *.inc *.m *.markdown *.md *.mm *.dox *.py *.f90 *.f *.for *.tcl *.vhd *.vhdl *.ucf *.qsf *.as *.js *.wt *.sql' doxyreplace RECURSIVE YES - doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_*" + doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_* version.[ch]xx" + doxyreplace HTML_HEADER header.html + doxyreplace HTML_FOOTER footer.html + doxyreplace HTML_EXTRA_STYLESHEET style.css + doxyreplace HTML_DYNAMIC_SECTIONS YES + doxyreplace DISABLE_INDEX NO + doxyreplace GENERATE_TREEVIEW YES if testtag AX_BUILD_EXAMPLES; then doxyreplace EXAMPLE_PATH @top_srcdir@/examples fi @@ -897,7 +1074,6 @@ if testtag AX_USE_DOXYGEN; then doxyreplace SOURCE_BROWSER YES doxyreplace INLINE_SOURCES YES doxyreplace GENERATE_TESTLIST YES - doxyreplace GENERATE_TREEVIEW NO doxyreplace SEARCHENGINE NO doxyreplace GENERATE_HTML YES doxyreplace GENERATE_LATEX NO @@ -924,7 +1100,7 @@ if testtag AX_USE_DEBIAN_PACKAGING; then -- @AUTHOR@ @BUILD_DATE@ EOF - BUILD_DEPENDS="debhelper, ${VCSDEPENDS} pkg-config, automake, libtool, autotools-dev, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)" + BUILD_DEPENDS="debhelper, ${VCSDEPENDS} pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_PERLDOC; then echo -n ", libpod-tree-perl"; fi; if testtag AX_USE_PLANTUML; then echo -n ", default-jre-headless|default-jre"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)" to debian/control.in < + + + + diff --git a/doc/header.html.in b/doc/header.html.in new file mode 100644 index 0000000..311876f --- /dev/null +++ b/doc/header.html.in @@ -0,0 +1,33 @@ + + + + + + + +$projectname: $title +$title + + + +$treeview +$search +$mathjax + +$extrastylesheet + + +
+ +
+
+ +
$projectname $projectnumber
+
$projectbrief
+
+ +
diff --git a/doc/plantuml.jar b/doc/plantuml.jar new file mode 100644 index 0000000..9502c23 Binary files /dev/null and b/doc/plantuml.jar differ diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..303c151 --- /dev/null +++ b/doc/style.css @@ -0,0 +1,38 @@ +#titlearea { + display: flex; + justify-content: space-between; + align-items: flex-begin; +} +#titlearea nav { + padding: 0; + margin: 0; +} +#titlearea nav a { + background-color: lightgray; + border: 1px solid gray; + color: black; + padding: 1ex; + margin: 0; +} +img, object { + max-width: 100% !important; +} +@media (max-width: 50em) { + #navrow1, #navrow2 { + display: block + } + #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s { + display: none; + } + #doc-content { + margin-left: 0 !important; + } +} +@media (min-width: 50em) { + #navrow1, #navrow2 { + display: none; + } + #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s { + display: block + } +} diff --git a/makefile_test.inc.am b/makefile_test.inc.am new file mode 100644 index 0000000..baf81c4 --- /dev/null +++ b/makefile_test.inc.am @@ -0,0 +1,9 @@ +## @id $Id$ + +## 1 2 3 4 5 6 7 8 +## 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +%.gcda: % + gcov $< + +CLEANFILES += ${CLEANFILES} ${TEST:%=%.gcno} ${TEST:%=%.gcda} *.gcov diff --git a/resolve-debbuilddeps.sh b/resolve-debbuilddeps.sh index ecd5522..5ce3dd5 100755 --- a/resolve-debbuilddeps.sh +++ b/resolve-debbuilddeps.sh @@ -16,7 +16,7 @@ if test -n "${SCHROOTNAME}"; then SUDO="schroot -c "${SCHROOTNAME}" -u root -d / --" else DO="" - if grep -q '/docker/' /proc/1/cgroup; then + if grep -q '/docker' /proc/1/cgroup; then SUDO="" else SUDO="sudo" diff --git a/scripts/bootstrap-to-docker.sh b/scripts/bootstrap-to-docker.sh index 10f8c16..11ce0aa 100755 --- a/scripts/bootstrap-to-docker.sh +++ b/scripts/bootstrap-to-docker.sh @@ -11,6 +11,9 @@ docker_user=${1:-${docker_user:-$(id -un)}} if test -f /etc/setup-debootstrap.conf; then . /etc/setup-debootstrap.conf fi +if test -f ~/setup-debootstrap.conf; then + . ~/setup-debootstrap.conf +fi tmpdir=${tmpdir:-"/var/tmp/chroots"} test -d "${tmpdir}" || mkdir -p "${tmpdir}" @@ -139,6 +142,11 @@ for ((i=0; i<${#distros[@]}; ++i)); do fi fi echo " ---- mount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2 + for x in proc sys dev; do + if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then + umount -flr "${tmpdir}/${distro}-${arch}"/$x/ + fi + done sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc/ sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys/ sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev/ @@ -187,9 +195,11 @@ EOF1 echo " ---- install ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2 sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${instpkgs} echo " ---- unmount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2 - sudo umount "${tmpdir}/${distro}-${arch}"/proc/ - sudo umount "${tmpdir}/${distro}-${arch}"/sys/ - sudo umount "${tmpdir}/${distro}-${arch}"/dev/ + for x in proc sys dev; do + if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then + umount -flr "${tmpdir}/${distro}-${arch}"/$x/ + fi + done echo " ---- import ${tmpdir}/${distro}-${arch} to ${docker_user}/${type}:${distro}-${arch}" 1>&2 cd "${tmpdir}/${distro}-${arch}" sudo tar c . | docker import - "${docker_user}/${type}:${distro}-${arch}" diff --git a/sql-to-dot.sed b/sql-to-dot.sed index 07b2989..e4e99b3 100755 --- a/sql-to-dot.sed +++ b/sql-to-dot.sed @@ -11,6 +11,11 @@ H;$!d;$x # remove all single-line comment lines s/\n--[^\n]*//g +# encode html entities +s/&/\&##SEMICOLON##/g +s//\>##SEMICOLON##/g + # reduce spaces s,\t\| \+, ,g @@ -21,7 +26,7 @@ s,\t\| \+, ,g s,\n\+,\n,g # remove unknown commands -s,\(;\|\n\) *\(DELIMITER\|USE\|DROP\|CREATE[ \n]\+DATABASE\)[ \n]\+[^;]*;\+,,ig +s,\(;\|\n\) *\(INSERT\|DELIMITER\|USE\|DROP\|CREATE[ \n]\+DATABASE\)[ \n]\+[^;]*;\+,,ig # convert special characters within quotes :a;s/^\(\([^"]*"[^",]*"\)*[^"]*"[^"]*\),\([^"]*".*\)/\1\##COMMA##\3/g;ta @@ -34,17 +39,18 @@ h s,.*\(create[ \n]\+table[^;]*;\).*,\1,ig # start html table node -s|CREATE[ \n]\+TABLE[ \n]\+\(if[ \n]\+not[ \n]\+exists[ \n]\+\)\?`\?\(\w\+\)`\?| \2\n [shape=none, margin=0, label=<\n \n |ig +s|CREATE[ \n]\+TABLE[ \n]\+\(IF[ \n]\+NOT[ \n]\+EXISTS[ \n]\+\)\?`\?\(\w\+\)`\?| \2\n [shape=none, margin=0, label=<\n
\2
\n |ig # remove key definitions -s/[),][\n ]*\(PRIMARY[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi +s/[),][\n ]*\(\(UNIQUE\|PRIMARY\)[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi # move foreign keys as relation to the end :b;s/\(\w\+\)\([^;]*\)FOREIGN[\n ]\+KEY[ \n]*([ \n]*`\?\([a-z]\+\)`\?[ \n]*)[ \n]*REFERENCES[ \n]*`\?\([a-z]\+\)`\?[ \n]*([ \n]*`\?\([a-z]\+\)`\?[ \n]*)[ \n]*\([^,)]*\)\([,)].*\)/\1\2\7\n \1:\3 -> \4:\5 [label="\6"]##SEMICOLON##/ig;tb # create table rows -s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)[ \n]\+COMMENT[ \n]*["']\([^"']*\)["'][ \n]*|\n |gi -s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n |g +s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n |g +# extract comment +s|\([^<]*\)COMMENT[ \n]\+["']\([^"']*\)["']\([^<]*\)|\1\4|g # add line breaks for long lines s|\(]*>[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}\)|\1
\2|g
\2
\1\2\4\5
\1\2\4
\1\2\4
\3