Browse Source

bugfix, possible crash

master
Marc Wäckerlin 2 years ago
parent
commit
032c5e750d

+ 99
- 1
ax_cxx_compile_stdcxx_11.m4 View File

@@ -4,12 +4,16 @@
4 4
 #
5 5
 # SYNOPSIS
6 6
 #
7
+#   AX_REQUIRE_STDCXX_11
8
+#   AX_REQUIRE_STDCXX_14
7 9
 #   AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
10
+#   AX_CXX_COMPILE_STDCXX_14([ext|noext],[mandatory|optional])
8 11
 #
9 12
 # DESCRIPTION
10 13
 #
11 14
 #   Check for baseline language coverage in the compiler for the C++11
12
-#   standard; if necessary, add switches to CXXFLAGS to enable support.
15
+#   or C++14 standard; if necessary, add switches to CXXFLAGS to
16
+#   enable support.
13 17
 #
14 18
 #   The first argument, if specified, indicates whether you insist on an
15 19
 #   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
131 135
     AC_SUBST(HAVE_CXX11)
132 136
   fi
133 137
 ])
138
+
139
+AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [dnl
140
+  m4_if([$1], [], [],
141
+        [$1], [ext], [],
142
+        [$1], [noext], [],
143
+        [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_14])])dnl
144
+  m4_if([$2], [], [ax_cxx_compile_cxx14_required=true],
145
+        [$2], [mandatory], [ax_cxx_compile_cxx14_required=true],
146
+        [$2], [optional], [ax_cxx_compile_cxx14_required=false],
147
+        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_14])])dnl
148
+  AC_LANG_PUSH([C++])dnl
149
+  ac_success=no
150
+  AC_CACHE_CHECK(whether $CXX supports C++14 features by default,
151
+  ax_cv_cxx_compile_cxx14,
152
+  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
153
+    [ax_cv_cxx_compile_cxx14=yes],
154
+    [ax_cv_cxx_compile_cxx14=no])])
155
+  if test x$ax_cv_cxx_compile_cxx14 = xyes; then
156
+    ac_success=yes
157
+  fi
158
+
159
+  m4_if([$1], [noext], [], [dnl
160
+  if test x$ac_success = xno; then
161
+    for switch in -std=gnu++14 -std=gnu++0y; do
162
+      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx14_$switch])
163
+      AC_CACHE_CHECK(whether $CXX supports C++14 features with $switch,
164
+                     $cachevar,
165
+        [ac_save_CXXFLAGS="$CXXFLAGS"
166
+         CXXFLAGS="$CXXFLAGS $switch"
167
+         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
168
+          [eval $cachevar=yes],
169
+          [eval $cachevar=no])
170
+         CXXFLAGS="$ac_save_CXXFLAGS"])
171
+      if eval test x\$$cachevar = xyes; then
172
+        CXXFLAGS="$CXXFLAGS $switch"
173
+        ac_success=yes
174
+        break
175
+      fi
176
+    done
177
+  fi])
178
+
179
+  m4_if([$1], [ext], [], [dnl
180
+  if test x$ac_success = xno; then
181
+    for switch in -std=c++14 -std=c++0y; do
182
+      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx14_$switch])
183
+      AC_CACHE_CHECK(whether $CXX supports C++14 features with $switch,
184
+                     $cachevar,
185
+        [ac_save_CXXFLAGS="$CXXFLAGS"
186
+         CXXFLAGS="$CXXFLAGS $switch"
187
+         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
188
+          [eval $cachevar=yes],
189
+          [eval $cachevar=no])
190
+         CXXFLAGS="$ac_save_CXXFLAGS"])
191
+      if eval test x\$$cachevar = xyes; then
192
+        CXXFLAGS="$CXXFLAGS $switch"
193
+        ac_success=yes
194
+        break
195
+      fi
196
+    done
197
+  fi])
198
+  AC_LANG_POP([C++])
199
+  if test x$ax_cxx_compile_cxx14_required = xtrue; then
200
+    if test x$ac_success = xno; then
201
+      AC_MSG_ERROR([*** A compiler with support for C++14 language features is required.])
202
+    fi
203
+  else
204
+    if test x$ac_success = xno; then
205
+      HAVE_CXX14=0
206
+      AC_MSG_NOTICE([No compiler with C++14 support was found])
207
+      AX_CXX_COMPILE_STDCXX_11([$1], [optional])
208
+    else
209
+      HAVE_CXX11=1
210
+      HAVE_CXX14=1
211
+      AC_DEFINE(HAVE_CXX14,1,
212
+                [define if the compiler supports basic C++14 syntax])
213
+      AC_DEFINE(HAVE_CXX11,1,
214
+                [define if the compiler supports basic C++14 syntax])
215
+    fi
216
+    AC_SUBST(HAVE_CXX11)
217
+    AC_SUBST(HAVE_CXX14)
218
+  fi
219
+])
220
+
221
+AC_DEFUN([AX_REQUIRE_STDCXX_11], [
222
+  if test x${HAVE_CXX11} != x1; then
223
+    AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
224
+  fi
225
+])
226
+
227
+AC_DEFUN([AX_REQUIRE_STDCXX_14], [
228
+  if test x${HAVE_CXX14} != x1; then
229
+    AC_MSG_ERROR([*** A compiler with support for C++14 language features is required.])
230
+  fi
231
+])

+ 155
- 9
ax_init_standard_project.m4 View File

@@ -7,7 +7,7 @@
7 7
 m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))])
8 8
 
9 9
 # define least version number from subversion's revision number:
10
-# it is taken modulo 256 due to a bug on Apple's MacOSX
10
+# it is taken modulo 256 due to a bug on Apple's SX
11 11
 m4_define(x_least, m4_ifdef([x_least_fix], [x_least_fix],
12 12
   m4_ifdef([x_least_diff],
13 13
     mrw_esyscmd_s([
@@ -129,7 +129,7 @@ AC_DEFUN([AX_SUBST], [
129 129
 # m4_define(x_minor, MINOR_NUMBER) # project's minor version
130 130
 # m4_include(ax_init_standard_project.m4)
131 131
 # AC_INIT(x_package_name, x_version, x_bugreport, x_package_name)
132
-# AM_INIT_AUTOMAKE([1.9 tar-pax])
132
+# AM_INIT_AUTOMAKE([1.9 tar-pax parallel-tests color-tests])
133 133
 # AX_INIT_STANDARD_PROJECT
134 134
 #
135 135
 # you change nothing but: YOUR_PACKAGE_NAME, MAJOR_NUMBER, MINOR_NUMBER
@@ -170,15 +170,45 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
170 170
   AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'"
171 171
   AX_SUBST(NUMBERS)
172 172
   AX_SUBST(HOME)
173
-  README=$(tail -n +3 README)
173
+  if test -f README.md; then
174
+    README=$(tail -n +3 README.md)
175
+    DESCRIPTION=$(head -1 README.md)
176
+  else
177
+    README=$(tail -n +3 README)
178
+    DESCRIPTION=$(head -1 README)
179
+  fi
180
+  README_ESCAPED=$(echo "$README" | sed ':a;N;$!ba;s/\n/\\n/g;s,",\\",g')
181
+  if which pandoc 2>&1 > /dev/null; then   
182
+    README_HTML=$(echo "$README" | pandoc -f markdown_github -t html | sed ':a;N;$!ba;s,\\\(.\),\\\\<span>\1</span>,g;s/\n/\\n/g;s,",\\",g;s,  ,\&nbsp;\&nbsp;,g')
183
+  else
184
+    README_HTML="${README}"
185
+  fi
174 186
   AX_SUBST(README)
175 187
   _AM_SUBST_NOTMAKE([README])
176
-  DESCRIPTION=$(head -1 README)
188
+  AX_SUBST(README_ESCAPED)
189
+  _AM_SUBST_NOTMAKE([README_ESCAPED])
190
+  AX_SUBST(README_HTML)
191
+  _AM_SUBST_NOTMAKE([README_HTML])
177 192
   AX_SUBST(DESCRIPTION)
178 193
   _AM_SUBST_NOTMAKE([DESCRIPTION])
194
+  LICENSE=$(echo $(head -1 COPYING))
195
+  AX_SUBST(LICENSE)
196
+  COPYING=$(<COPYING)
197
+  AX_SUBST(COPYING)
198
+  _AM_SUBST_NOTMAKE([COPYING])
179 199
   AUTHOR=$(head -1 AUTHORS)
200
+  AUTHOR_NAME=$(echo $AUTHOR | sed 's, *[[<(]].*$,,')
201
+  AUTHOR_URL=$(echo $AUTHOR | sed 's,.*(\(http[[^)]]*\)).*,\1,')
202
+  AUTHOR_MAIL=$(echo $AUTHOR | sed 's,.*<\(.*@.*\)>.*,\1,')
180 203
   AX_SUBST(AUTHOR)
181 204
   _AM_SUBST_NOTMAKE([AUTHOR])
205
+  AX_SUBST(AUTHOR_NAME)
206
+  AX_SUBST(AUTHOR_URL)
207
+  AX_SUBST(AUTHOR_MAIL)
208
+  PROJECT_URL="${PROJECT_URL:-${AUTHOR_URL}/projects/${PACKAGE_NAME}}"
209
+  SOURCE_DOWNLOAD="${SOURCE_DOWNLOAD:-${AUTHOR_URL}/downloads/${PACKAGE_NAME}}"
210
+  AX_SUBST(PROJECT_URL)
211
+  AX_SUBST(SOURCE_DOWNLOAD)
182 212
   DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null)
183 213
   AX_SUBST(DISTRO)
184 214
   ARCH=$((@<:@@<:@ $(uname -sm) =~ 64 @:>@@:>@ && echo amd64) || (@<:@@<:@ $(uname -sm) =~ 'i?86' @:>@@:>@ && echo i386 || uname -sm))
@@ -242,6 +272,25 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
242 272
   else
243 273
     AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG"
244 274
   fi
275
+
276
+  AC_ARG_WITH(gcov,
277
+    [AS_HELP_STRING([--with-gcov=FILE],
278
+                    [enable gcov, set gcov file (defaults to gcov)])],
279
+    [GCOV="$enableval"], [GCOV="no"])
280
+  AM_CONDITIONAL(COVERAGE, test "$GCOV" != "no")
281
+  if test "$GCOV" != "no"; then
282
+    if test "$GCOV" == "yes"; then
283
+      GCOV=gcov
284
+    fi
285
+    AC_CHECK_PROG(has_gcov, [$GCOV], [yes], [no])
286
+    if test "$has_gcov" != "yes"; then
287
+      AC_MSG_ERROR([gcov: program $GCOV not found])
288
+    fi
289
+    AC_MSG_NOTICE([Coverage tests enabled, using ${GCOV}]);
290
+    AM_CXXFLAGS="${AM_CXXFLAGS:-} -O0 --coverage -fprofile-arcs -ftest-coverage"
291
+    AM_LDFLAGS="${AM_LDFLAGS} -O0 --coverage -fprofile-arcs"
292
+    AX_SUBST(GCOV)
293
+  fi
245 294
   
246 295
   if test -f ${PACKAGE_NAME}.desktop.in; then
247 296
     AC_CONFIG_FILES([${PACKAGE_NAME}.desktop])
@@ -273,7 +322,7 @@ EOF
273 322
 AC_DEFUN([AX_USE_CXX], [
274 323
   m4_include(ax_cxx_compile_stdcxx_11.m4)
275 324
   AC_LANG(C++)
276
-  AX_CXX_COMPILE_STDCXX_11(noext, optional)
325
+  AX_CXX_COMPILE_STDCXX_14(noext, optional)
277 326
   AC_PROG_CXX
278 327
   AC_PROG_CPP
279 328
 
@@ -383,6 +432,33 @@ maintainer-clean-example-targets:
383 432
 EOF
384 433
 ])
385 434
 
435
+# use this in configure.ac to support C++ examples
436
+AC_DEFUN([AX_USE_NODEJS], [
437
+  AC_PATH_PROG(ANDROID, [android], [0],
438
+                         [${PATH}${PATH_SEPARATOR}${ANDROID_HOME}/tools])
439
+  AC_PATH_PROG(CORDOVA, [cordova], [0],
440
+                        [${PATH}${PATH_SEPARATOR}$(pwd)/node_modules/cordova/bin])
441
+  if test ${CORDOVA} = 0; then
442
+     AC_MSG_WARN([cordova is missing, on ubuntu install cordova-cli from repository ppa:cordova-ubuntu/ppa])
443
+  fi
444
+  if test ${ANDROID} = 0; then
445
+     AC_MSG_WARN([android sdk is missing, set variable ANDROID_HOME after installation])
446
+  fi
447
+  AM_CONDITIONAL(HAVE_CORDOVA, [test ${CORDOVA} != 0 -a ${ANDROID} != 0])
448
+  AX_SUBST(CORDOVA)
449
+  AC_CONFIG_FILES([nodejs/package.json])
450
+  AC_CONFIG_FILES([nodejs/makefile])
451
+  AC_CONFIG_FILES([cordova/makefile])
452
+  AC_CONFIG_FILES([cordova/config.xml])
453
+  AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-example-targets], [examples/makefile.in])
454
+  test -f examples/makefile.in && cat >> examples/makefile.in <<EOF
455
+#### Begin: Appended by $0
456
+maintainer-clean-example-targets:
457
+	-rm makefile.in
458
+#### End: $0
459
+EOF
460
+])
461
+
386 462
 # use this in configure.ac to support HTML data for webservers
387 463
 AC_DEFUN([AX_BUILD_HTML], [
388 464
   AC_CONFIG_FILES([html/makefile])
@@ -425,7 +501,11 @@ EOF
425 501
 
426 502
 # use this in configure.ac to support debian packages
427 503
 AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [
428
-  README_DEB=$(tail -n +3 README | sed -e 's/^ *$/./g' -e 's/^/ /g')
504
+  if test -f README.md; then
505
+    README_DEB=$(tail -n +3 README.md | sed -e 's/^ *$/./g' -e 's/^/ /g')
506
+  else
507
+    README_DEB=$(tail -n +3 README | sed -e 's/^ *$/./g' -e 's/^/ /g')
508
+  fi
429 509
   AC_SUBST(README_DEB)
430 510
   _AM_SUBST_NOTMAKE([README_DEB])
431 511
   AC_CONFIG_FILES([debian/changelog debian/control])
@@ -473,6 +553,7 @@ AC_DEFUN([AX_USE_DOXYGEN], [
473 553
   AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
474 554
   AC_CHECK_PROG(have_dot, dot, yes, no)
475 555
   AC_CHECK_PROG(have_mscgen, mscgen, yes, no)
556
+  AM_CONDITIONAL(NEED_PLANTUML, test "$have_doxygen" = "yes" -a "1.8.11" != $((echo "1.8.11"; doxygen -v) | sort -V | head -1))
476 557
   PDF_DOC=${PACKAGE_NAME}-${PACKAGE_VERSION}.pdf
477 558
   AC_SUBST(PDF_DOC)
478 559
   if test "$have_doxygen" = "no"; then
@@ -487,22 +568,38 @@ AC_DEFUN([AX_USE_DOXYGEN], [
487 568
     AC_MSG_WARN([Missing program mscgen!
488 569
      - when you rebild documentation, there are no message state charts
489 570
      - there are precompiled derived files in the distribution]); fi
490
-  AC_CONFIG_FILES([doc/makefile doc/doxyfile])
571
+  AC_CONFIG_FILES([doc/makefile doc/doxyfile doc/header.html doc/footer.html])
491 572
   AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-documentation], [doc/makefile.in])
492 573
   AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-documentation], [doc/makefile.in])
493 574
   AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-documentation], [doc/makefile.in])
494 575
   AX_ADD_MAKEFILE_TARGET_DEP([install-data-am], [install-data-documentation], [doc/makefile.in])
495 576
   AX_ADD_MAKEFILE_TARGET_DEP([uninstall-am], [uninstall-documentation], [doc/makefile.in])
496 577
   AX_ADD_MAKEFILE_TARGET_DEP([all], [doc], [doc/makefile.in])
497
-  AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf], [doc/makefile.in])
578
+  AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf gen-uml-images], [doc/makefile.in])
498 579
   test -f doc/makefile.in && cat >> doc/makefile.in <<EOF
499 580
 #### Begin: Appended by $0
500
-doc: doxyfile
581
+doc: doxyfile @NEED_PLANTUML_TRUE@ gen-uml-images
582
+	@NEED_PLANTUML_TRUE@ doxyadd() { grep -q "\$\$[1] += \$\$[2]" doxyfile || sed -i '/^'"\$\$[1]"' *=/a'"\$\$[1]"' += '"\$\$[2]" doxyfile; }; \\
583
+	@NEED_PLANTUML_TRUE@ doxyadd ALIASES '"startuml{1}=@image html \\\\1\\\\n@image latex \\\\1\\\\n\\\\if DontIgnorePlantUMLCode"'; \\
584
+	@NEED_PLANTUML_TRUE@ doxyadd ALIASES '"enduml=\\\\endif"'; \\
585
+	@NEED_PLANTUML_TRUE@ doxyadd IMAGE_PATH '"gen-uml-images"';
501 586
 	doxygen doxyfile
502 587
 @PEDANTIC_TRUE@	test \! -s doxygen.errors
503 588
 
589
+@NEED_PLANTUML_TRUE@EXTRA_DIST = ${EXTRA_DIST} plantuml.jar
590
+@NEED_PLANTUML_TRUE@
591
+@NEED_PLANTUML_TRUE@gen-uml-images:
592
+@NEED_PLANTUML_TRUE@	test -d gen-uml-images || mkdir gen-uml-images
593
+@NEED_PLANTUML_TRUE@	eval \$\$(sed -n 's, *INPUT *\\(+\\?\\)= *\\(.*\\),INPUT\\1=" \\2",gp' doxyfile); \\
594
+@NEED_PLANTUML_TRUE@	eval \$\$(sed -n 's, *FILE_PATTERNS *\\(+\\?\\)= *\\(.*\\),FILE_PATTERNS\\1=" \\2",gp' doxyfile); \\
595
+@NEED_PLANTUML_TRUE@	SOURCES="**.("\$\$(echo \$\${FILE_PATTERNS} | sed 's,*.,,g;s, ,|,g')")"; \\
596
+@NEED_PLANTUML_TRUE@	for src in \$\$INPUT; do \\
597
+@NEED_PLANTUML_TRUE@	  java  -Djava.awt.headless=true -jar \${top_srcdir}/doc/plantuml.jar -v -o \$\$(pwd)/gen-uml-images "\$\$src/\$\$SOURCES"; \\
598
+@NEED_PLANTUML_TRUE@	done
599
+
504 600
 clean-documentation:
505 601
 	-rm doxygen.errors @PDF_DOC@
602
+	@NEED_PLANTUML_TRUE@ -rm -rf gen-uml-images
506 603
 distclean-documentation:
507 604
 	-rm -r html
508 605
 	-rm  @PACKAGE_NAME@.doxytag
@@ -519,6 +616,55 @@ uninstall-documentation:
519 616
 EOF
520 617
 ])
521 618
 
619
+# use this in configure.ac to support Doxygen documentation generation
620
+AC_DEFUN([AX_USE_PERLDOC], [
621
+  PERL_SOURCES="m4_default([$1], [perl])"
622
+  AX_SUBST(PERL_SOURCES)
623
+  if test -z "$PERL_SOURCES"; then
624
+    AC_MSG_ERROR([You must specify the path to per files
625
+     - use [AX]_[USE]_PERLDOC([[pathes to perldoc]])]); fi
626
+  AC_CHECK_PROG(have_perldoc, pods2html, yes, no)
627
+  if test "$have_doxygen" = "no"; then
628
+    AC_MSG_WARN([Missing program pods2html!
629
+     - you cannot rebuild the documentation
630
+     - there are precompiled derived files in the distribution
631
+     - if you need to generate documentation, install libpod-tree-perl]); fi
632
+  AC_CONFIG_FILES([doc/makefile])
633
+  AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-perldoc], [doc/makefile.in])
634
+  AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-perldoc], [doc/makefile.in])
635
+  AX_ADD_MAKEFILE_TARGET_DEP([install-data-am], [install-data-perldoc], [doc/makefile.in])
636
+  AX_ADD_MAKEFILE_TARGET_DEP([uninstall-am], [uninstall-perldoc], [doc/makefile.in])
637
+  AX_ADD_MAKEFILE_TARGET_DEP([all], [doc], [doc/makefile.in])
638
+  AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [doc], [doc/makefile.in])
639
+  test -f doc/makefile.in && cat >> doc/makefile.in <<EOF
640
+#### Begin: Appended by $0
641
+doc: perldoc/index.html
642
+
643
+perldoc/index.html: \${PERL_SOURCES:%=perldoc/%}
644
+	echo "<html><head><title>Perl Documentation</title></head><body><h1>Perl Documentation</h1><ul>" > perldoc/index.html
645
+	for p in \${PERL_SOURCES:%=perldoc/%}; do \
646
+	  echo '<li><a href="'"\$\${p#perldoc/}"'/index.html">'"\$\${p#perldoc/}"'</a></li>' >> perldoc/index.html; \
647
+	done
648
+	echo "</ul></body></html>" >> perldoc/index.html
649
+
650
+perldoc/%:
651
+	pods2html --notoc --empty --index index @top_srcdir@/\${@:perldoc/%=%} \$[@]
652
+
653
+distclean-perldoc:
654
+	-rm -r perldoc
655
+maintainer-clean-perldoc:
656
+	-rm makefile.in
657
+install-data-perldoc:
658
+	test -d \$(DESTDIR)\${docdir} || mkdir -p \$(DESTDIR)\${docdir}
659
+	chmod -R u+w \$(DESTDIR)\${docdir}
660
+	cp -r perldoc \$(DESTDIR)\${docdir}/
661
+uninstall-perldoc:
662
+	-chmod -R u+w \$(DESTDIR)\${docdir}
663
+	-rm -rf \$(DESTDIR)\${docdir}/perldoc
664
+#### End: $0
665
+EOF
666
+])
667
+
522 668
 # require a specific package, with fallback: test for a header
523 669
 #  - parameter:
524 670
 #     $1 = unique id (no special characters)

+ 200
- 17
bootstrap.sh View File

@@ -129,6 +129,7 @@ GENERATED FILES
129 129
     * ax_init_standard_project.m4 - auxiliary macro definition file
130 130
     * ax_cxx_compile_stdcxx_11.m4 - auxiliary macro definition file
131 131
     * ax_check_qt.m4 - auxiliary macro definition file
132
+    * makefile_test.inc.am - makefile to be included in tests
132 133
     * resolve-debbuilddeps.sh - script to install debian package dependencies
133 134
     * resolve-rpmbuilddeps.sh - script to install RPM package dependencies
134 135
     * build-in-docker.sh - script to build the project encapsulated in a docker container
@@ -148,9 +149,14 @@ GENERATED FILES
148 149
     * src/version.cxx - if you enabled AX_USE_CXX
149 150
     * html/makefile.am - if you enabled AX_BUILD_HTML
150 151
     * scripts/makefile.am - if you enabled AX_USE_SCRIPTS
151
-    * doc/makefile.am - if you enabled AX_USE_DOXYGEN
152
+    * doc/makefile.am - if you enabled AX_USE_DOXYGEN or AX_USE_PERLDOC
152 153
     * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN
153
-    * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT
154
+    * doc/header.html.in - if you enabled AX_USE_DOXYGEN
155
+    * doc/footer.html.in - if you enabled AX_USE_DOXYGEN
156
+    * doc/style.css - if you enabled AX_USE_DOXYGEN
157
+    * doc/plantuml.jar - if you enable AX_USE_DOXYGEN
158
+    * test/makefile.am - if you enabled AX_USE_CPPUNIT and AX_USE_CXX
159
+    * test/${DEFAULT_PROJECT_NAME#lib}.cxx - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT
154 160
     * examples/makefile.am - if you enabled AX_BUILD_EXAMPLES
155 161
     * debian/changelog.in - if you enabled AX_USE_DEBIAN_PACKAGING
156 162
     * debian/control.in - if you enabled AX_USE_DEBIAN_PACKAGING
@@ -191,6 +197,7 @@ FILES TO EDIT
191 197
     * src/makefile.am
192 198
     * html/makefile.am
193 199
     * test/makefile.am
200
+    * test/${DEFAULT_PROJECT_NAME}.cxx
194 201
     * examples/makefile.am
195 202
 
196 203
 FILE DEPENDENCIES
@@ -201,8 +208,8 @@ FILE DEPENDENCIES
201 208
     * test/makefile.am depends on AX_USE_LIBTOOL
202 209
     * html/makefile.am depends on AX_BUILD_HTML
203 210
     * doc/doxyfile.in depends on AX_BUILD_EXAMPLES
204
-    * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_CPPUNIT
205
-      AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL
211
+    * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_PERLDOC,
212
+      AX_USE_CPPUNIT AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL
206 213
     * debian/${DEFAULT_PROJECT_NAME}.install depends on AX_USE_LIBTOOL
207 214
     * debian/${DEFAULT_PROJECT_NAME}.dirs depends on AX_USE_LIBTOOL
208 215
     * debian/${DEFAULT_PROJECT_NAME}-dev.install depends on AX_USE_LIBTOOL
@@ -236,6 +243,7 @@ FILES
236 243
       * Enable LibTool library creation: AX_USE_LIBTOOL
237 244
       * Enable Scripts: AX_USE_SCRIPTS
238 245
       * Enable Doxygen documentation generation: AX_USE_DOXYGEN
246
+      * Enable Perldoc documentation generation: AX_USE_PERLDOC
239 247
       * Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING
240 248
       * Enable RPM packaging by calling "make rpm": AX_USE_RPM_PACKAGING
241 249
       * Enable C++ testing using CppUnit: AX_USE_CPPUNIT
@@ -433,6 +441,9 @@ copy() {
433 441
             source="${0%/*}/$1"
434 442
         fi
435 443
     fi
444
+    if test "${1%/*}" != "$1"; then
445
+        test -d "${1%/*}" || svn mkdir "${1%/*}"
446
+    fi
436 447
     run cp "${source}" "$1"
437 448
     if test $exists -eq 0; then
438 449
         if test -n "${VCS}" -a $novcs -eq 0 && ! contains "$1" "${excludevcs[@]}"; then
@@ -500,6 +511,7 @@ copy ${MY_NAME}
500 511
 copy ax_init_standard_project.m4
501 512
 copy ax_cxx_compile_stdcxx_11.m4
502 513
 copy ax_check_qt.m4
514
+copy makefile_test.inc.am
503 515
 copy resolve-debbuilddeps.sh
504 516
 copy resolve-rpmbuilddeps.sh
505 517
 copy build-in-docker.sh
@@ -522,7 +534,11 @@ ${DEFAULT_PROJECT_NAME}
522 534
 add description for ${DEFAULT_PROJECT_NAME}
523 535
 EOF
524 536
 to configure.ac <<EOF && notice "please edit configure.ac, then rerun $0" && exit 0
525
-${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
537
+${HEADER}# default is generated from AUTHORS and project name
538
+PROJECT_URL=
539
+SOURCE_DOWNLOAD=
540
+
541
+m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
526 542
 m4_define(x_major, 0) # project's major version
527 543
 m4_define(x_minor, 0) # project's minor version
528 544
 m4_include(ax_init_standard_project.m4)
@@ -535,6 +551,7 @@ AX_INIT_STANDARD_PROJECT
535 551
 #AX_USE_LIBTOOL
536 552
 #AX_USE_SCRIPTS
537 553
 #AX_USE_DOXYGEN
554
+#AX_USE_PERLDOC
538 555
 #AX_USE_DEBIAN_PACKAGING
539 556
 #AX_USE_RPM_PACKAGING
540 557
 #AX_USE_CPPUNIT
@@ -562,6 +579,20 @@ if ! testtag AX_CHECK_QT && \
562 579
    ! testtag AX_REQUIRE_QT; then
563 580
     echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | \
564 581
         to --condition AX_USE_CXX src/makefile.am
582
+    if ! ls src/*.[ch]xx; then
583
+        to --condition AX_USE_CXX src/${PACKAGE_NAME#lib}.hxx <<EOF
584
+${CHEADER}#ifndef ${PackageName^^}_HXX
585
+#define ${PackageName^^}_HXX
586
+
587
+/** @mainpage @description
588
+
589
+    @readme
590
+
591
+    */
592
+
593
+#endif
594
+EOF
595
+    fi
565 596
 elif ! test -e src/makefile.am; then
566 597
     to --condition AX_USE_CXX src/makefile.am <<EOF
567 598
 ${HEADER}bin_PROGRAMS = ${PACKAGE_NAME}
@@ -652,10 +683,17 @@ int main(int argc, char *argv[]) try {
652 683
   return 1;
653 684
  }
654 685
 EOF
655
-    to --condition AX_USE_CXX src/${PACKAGE_NAME}.hxx <<EOF
686
+    if ! ls src/*.[ch]xx; then
687
+        to --condition AX_USE_CXX src/${PACKAGE_NAME#lib}.hxx <<EOF
656 688
 ${CHEADER}#ifndef ${PackageName^^}_HXX
657 689
 #define ${PackageName^^}_HXX
658 690
 
691
+/** @mainpage @description
692
+
693
+    @readme
694
+
695
+    */
696
+
659 697
 #include <QMainWindow>
660 698
 #include <ui_${PACKAGE_NAME}.hxx>
661 699
 
@@ -672,7 +710,8 @@ class ${PackageName}: public QMainWindow, protected Ui::${PackageName} {
672 710
 
673 711
 #endif
674 712
 EOF
675
-    to --condition AX_USE_CXX src/${PACKAGE_NAME}.ui <<EOF
713
+    fi
714
+    to --condition AX_USE_CXX src/${PACKAGE_NAME#lib}.ui <<EOF
676 715
 <?xml version="1.0" encoding="UTF-8"?>
677 716
 <ui version="4.0">
678 717
  <class>${PackageName}</class>
@@ -754,7 +793,7 @@ EOF
754 793
 to --condition AX_USE_CXX src/version.cxx <<EOF
755 794
 /*! @file
756 795
 
757
-    @id $Id\$
796
+    @id \$Id\$
758 797
 */
759 798
 //       1         2         3         4         5         6         7         8
760 799
 // 45678901234567890123456789012345678901234567890123456789012345678901234567890
@@ -798,7 +837,7 @@ ${HEADER}dist_bin_SCRIPTS =
798 837
 
799 838
 MAINTAINERCLEANFILES = makefile.in
800 839
 EOF
801
-echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am
840
+echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition 'AX_USE_DOXYGEN|AX_USE_PERLDOC' doc/makefile.am
802 841
 if testtag AX_BUILD_TEST; then
803 842
     to test/runtests.sh < ${0%/*}/test/runtests.sh
804 843
 fi
@@ -809,16 +848,51 @@ AM_CPPFLAGS = -I\${top_srcdir}/src -I\${top_builddir}/src
809 848
 AM_LDFLAGS = -L\${abs_top_builddir}/src/.libs
810 849
 $(if testtag AX_USE_LIBTOOL; then
811 850
 cat <<EOF3
812
-LDADD = -l${PACKAGE_NAME#lib}
851
+LDADD = -lcppunit -l${PACKAGE_NAME#lib}
813 852
 EOF3
814 853
 fi)
815 854
 EOF2
816 855
 fi)
817 856
 
818
-TESTS =
857
+check_PROGRAMS = ${PACKAGE_NAME#lib}
858
+TESTS = \${check_PROGRAMS}
859
+
860
+${PACKAGE_NAME#lib}_SOURCES = ${PACKAGE_NAME#lib}.cxx
819 861
 
820 862
 MAINTAINERCLEANFILES = makefile.in
821 863
 EOF
864
+to --condition AX_USE_CPPUNIT --condition AX_USE_CXX test/${PACKAGE_NAME#lib}.cxx <<EOF
865
+${CHEADER}
866
+#include <cppunit/TestFixture.h>
867
+#include <cppunit/ui/text/TestRunner.h>
868
+#include <cppunit/extensions/HelperMacros.h>
869
+#include <cppunit/extensions/TestFactoryRegistry.h>
870
+#include <cppunit/XmlOutputter.h>
871
+#include <fstream>
872
+
873
+/// @todo Rename DummyTest and DummyTest::dummy()
874
+/// @todo Write test cases
875
+class DummyTest: public CppUnit::TestFixture { 
876
+  public:
877
+    void dummy() {
878
+    }
879
+    CPPUNIT_TEST_SUITE(DummyTest);
880
+    CPPUNIT_TEST(dummy);
881
+    CPPUNIT_TEST_SUITE_END();
882
+};
883
+CPPUNIT_TEST_SUITE_REGISTRATION(DummyTest);
884
+
885
+int main(int argc, char** argv) try {
886
+  std::ofstream ofs((*argv+std::string(".xml")).c_str());
887
+  CppUnit::TextUi::TestRunner runner;
888
+  runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs));
889
+  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
890
+  return runner.run() ? 0 : 1;
891
+ } catch (std::exception& e) {
892
+  std::cerr<<"***Exception: "<<e.what()<<std::endl;
893
+  return 1;
894
+ }
895
+EOF
822 896
 to --condition AX_BUILD_EXAMPLES examples/makefile.am <<EOF
823 897
 ${HEADER}AM_CPPFLAGS = -I\${top_srcdir}/src -I\${top_builddir}/src
824 898
 AM_LDFLAGS = -L\${abs_top_builddir}/src/.libs
@@ -834,6 +908,94 @@ www_DATA =
834 908
 
835 909
 MAINTAINERCLEANFILES = makefile.in
836 910
 EOF
911
+to --condition AX_USE_DOXYGEN doc/header.html.in <<EOF
912
+<!-- HTML header for doxygen 1.8.6-->
913
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
914
+<html xmlns="http://www.w3.org/1999/xhtml">
915
+<head>
916
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
917
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
918
+<meta name="generator" content="Doxygen \$doxygenversion"/>
919
+<!--BEGIN PROJECT_NAME--><title>\$projectname: \$title</title><!--END PROJECT_NAME-->
920
+<!--BEGIN !PROJECT_NAME--><title>\$title</title><!--END !PROJECT_NAME-->
921
+<link href="\$relpath^tabs.css" rel="stylesheet" type="text/css"/>
922
+<script type="text/javascript" src="\$relpath^jquery.js"></script>
923
+<script type="text/javascript" src="\$relpath^dynsections.js"></script>
924
+\$treeview
925
+\$search
926
+\$mathjax
927
+<link href="\$relpath^\$stylesheet" rel="stylesheet" type="text/css" />
928
+\$extrastylesheet
929
+</head>
930
+<body>
931
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
932
+
933
+<div id="titlearea">
934
+  <div id="projecthead">
935
+    <div id="projectlogo"><img alt="" src="\$relpath^\$projectlogo"/></div>
936
+    <div id="projectname">\$projectname</span>&#160;<span id="projectnumber">\$projectnumber</div>
937
+    <div id="projectbrief">\$projectbrief</div>
938
+  </div>
939
+  <nav>
940
+    <a href="@PROJECT_URL@" target="_blank">Project Management</a>
941
+    <a href="@SOURCE_DOWNLOAD@" target="_blank">Download</a>
942
+    <div>\$searchbox</div>
943
+  </nav>
944
+</div>
945
+EOF
946
+to --condition AX_USE_DOXYGEN doc/footer.html.in <<EOF
947
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
948
+  <ul>
949
+    \$navpath
950
+    <li class="footer"><a href="@AUTHOR_URL@" target="_blank">@AUTHOR_NAME@</a></li>
951
+  </ul>
952
+</div>
953
+</body>
954
+</html>
955
+EOF
956
+to --condition AX_USE_DOXYGEN doc/style.css <<EOF
957
+#titlearea {
958
+  display: flex;
959
+  justify-content: space-between;
960
+  align-items: flex-begin;
961
+}
962
+#titlearea nav {
963
+  padding: 0;
964
+  margin: 0;
965
+}
966
+#titlearea nav a {
967
+  background-color: lightgray;
968
+  border: 1px solid gray;
969
+  color: black;
970
+  padding: 1ex;
971
+  margin: 0;
972
+}
973
+img, object {
974
+  max-width: 100% !important;
975
+}
976
+@media (max-width: 50em) {
977
+  #navrow1, #navrow2 {
978
+    display: block
979
+  }
980
+  #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s {
981
+    display: none;
982
+  }
983
+  #doc-content {
984
+    margin-left: 0 !important;
985
+  }
986
+}
987
+@media (min-width: 50em) {
988
+  #navrow1, #navrow2 {
989
+    display: none;
990
+  }
991
+  #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s {
992
+    display: block
993
+  }
994
+}
995
+EOF
996
+if testtag AX_USE_DOXYGEN; then
997
+    copy doc/plantuml.jar
998
+fi
837 999
 if testtag AX_USE_DOXYGEN; then
838 1000
     if ! checkfile doc/doxyfile.in || \
839 1001
         contains doc/doxyfile.in "${rebuildfiles[@]}"; then
@@ -854,12 +1016,16 @@ if testtag AX_USE_DOXYGEN; then
854 1016
         doxyreplace MULTILINE_CPP_IS_BRIEF YES
855 1017
         doxyreplace TAB_SIZE 2
856 1018
         doxyreplace ALIASES '"id=\\par File-ID\\n"'
857
-        doxyadd ALIASES '"copy=\\par Copyright\\n"'
1019
+        doxyadd ALIASES '"copy=\\par Copyright by <a href="@AUTHOR_URL@" target="_blank">@AUTHOR_NAME@</a>\\n"'
858 1020
         doxyadd ALIASES '"license=\\par License\\n"'
859 1021
         doxyadd ALIASES '"classmutex=\\par Reentrant:\\nAccess is locked with class static mutex @c "'
860 1022
         doxyadd ALIASES '"instancemutex=\\par Reentrant:\\nAccess is locked with per instance mutex @c "'
861 1023
         doxyadd ALIASES '"mutex=\\par Reentrant:\\nAccess is locked with mutex @c "'
862 1024
         doxyadd ALIASES '"api=\\xrefitem api \\"API Call\\" \\"\\""'
1025
+        doxyadd ALIASES '"description=@DESCRIPTION@"'
1026
+        doxyadd ALIASES '"readme=@README_HTML@"'
1027
+        doxyadd ALIASES '"author=<a href="@AUTHOR_URL@" target="_blank">@AUTHOR_NAME@</a>"'
1028
+        doxyreplace PLANTUML_JAR_PATH '"@top_srcdir@/doc/plantuml.jar"'
863 1029
         doxyreplace ENABLE_PREPROCESSING YES
864 1030
         doxyreplace MACRO_EXPANSION YES
865 1031
         doxyadd PREDEFINED '"NAMESPACE=@PACKAGE_NAME@"'
@@ -886,9 +1052,20 @@ if testtag AX_USE_DOXYGEN; then
886 1052
         if testtag AX_BUILD_TEST AX_USE_CPPUNIT; then
887 1053
             doxyadd INPUT "@top_srcdir@/test"
888 1054
         fi
1055
+        if testtag AX_USE_NODEJS; then
1056
+            doxyadd INPUT "@top_srcdir@/nodejs"
1057
+            doxyadd EXCLUDE "@top_srcdir@/nodejs/node_modules"
1058
+	    doxyadd EXCLUDE "@top_srcdir@/nodejs/public/javascripts/ext"
1059
+        fi
889 1060
         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'
890 1061
         doxyreplace RECURSIVE YES
891
-        doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_*"
1062
+        doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_* version.[ch]xx"
1063
+        doxyreplace HTML_HEADER header.html
1064
+        doxyreplace HTML_FOOTER footer.html
1065
+        doxyreplace HTML_EXTRA_STYLESHEET style.css
1066
+        doxyreplace HTML_DYNAMIC_SECTIONS YES
1067
+        doxyreplace DISABLE_INDEX NO
1068
+        doxyreplace GENERATE_TREEVIEW YES 
892 1069
         if testtag AX_BUILD_EXAMPLES; then
893 1070
             doxyreplace EXAMPLE_PATH @top_srcdir@/examples
894 1071
         fi
@@ -897,7 +1074,6 @@ if testtag AX_USE_DOXYGEN; then
897 1074
         doxyreplace SOURCE_BROWSER YES
898 1075
         doxyreplace INLINE_SOURCES YES
899 1076
         doxyreplace GENERATE_TESTLIST YES
900
-        doxyreplace GENERATE_TREEVIEW NO
901 1077
         doxyreplace SEARCHENGINE NO
902 1078
         doxyreplace GENERATE_HTML YES
903 1079
         doxyreplace GENERATE_LATEX NO
@@ -924,7 +1100,7 @@ if testtag AX_USE_DEBIAN_PACKAGING; then
924 1100
 
925 1101
  -- @AUTHOR@  @BUILD_DATE@
926 1102
 EOF
927
-    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)"
1103
+    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)"
928 1104
     to debian/control.in <<EOF
929 1105
 Source: @PACKAGE_NAME@
930 1106
 Priority: extra
@@ -998,7 +1174,14 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
998 1174
 BuildRequires: gnupg, ${VCSDEPENDS} make, automake, autoconf, rpm-build$(
999 1175
     if testtag AX_USE_DOXYGEN; then
1000 1176
       echo -n ", doxygen";
1001
-    fi)
1177
+    fi
1178
+    if testtag AX_USE_PERLDOC; then
1179
+      echo -n ", libpod-tree-perl";
1180
+    fi
1181
+    if testtag AX_USE_PLANTUML; then
1182
+      echo -n ", default-jre-headless";
1183
+    fi
1184
+)
1002 1185
 %if 0%{?fedora} != 20
1003 1186
 $(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi)
1004 1187
 %endif
@@ -1109,7 +1292,7 @@ fi
1109 1292
 if testtag AX_USE_SCRIPTS; then
1110 1293
     SUBDIRS="${SUBDIRS} scripts"
1111 1294
 fi
1112
-if testtag AX_USE_DOXYGEN; then
1295
+if testtag 'AX_USE_DOXYGEN|AX_USE_PERLDOC'; then
1113 1296
     SUBDIRS="${SUBDIRS} doc"
1114 1297
 fi
1115 1298
 if testtag AX_BUILD_EXAMPLES; then

+ 1
- 1
build-in-docker.sh View File

@@ -183,7 +183,7 @@ function ifthenelse() {
183 183
 set -x
184 184
 
185 185
 docker pull $img
186
-DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -w /workdir $img sleep infinity)
186
+DOCKER_ID=$(docker run -d ${dirs[@]} ${envs[@]} -e HOME="${HOME}" -w /workdir $img sleep infinity)
187 187
 trap 'traperror '"${DOCKER_ID}"' "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FUNCNAME[@]}" "${FUNCTION}"' SIGINT INT TERM EXIT
188 188
 case $mode in
189 189
     (apt)

+ 8
- 0
doc/footer.html.in View File

@@ -0,0 +1,8 @@
1
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
2
+  <ul>
3
+    $navpath
4
+    <li class="footer"><a href="@AUTHOR_URL@" target="_blank">@AUTHOR_NAME@</a></li>
5
+  </ul>
6
+</div>
7
+</body>
8
+</html>

+ 33
- 0
doc/header.html.in View File

@@ -0,0 +1,33 @@
1
+<!-- HTML header for doxygen 1.8.6-->
2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+<html xmlns="http://www.w3.org/1999/xhtml">
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7
+<meta name="generator" content="Doxygen $doxygenversion"/>
8
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
9
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
10
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
11
+<script type="text/javascript" src="$relpath^jquery.js"></script>
12
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
13
+$treeview
14
+$search
15
+$mathjax
16
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
17
+$extrastylesheet
18
+</head>
19
+<body>
20
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
21
+
22
+<div id="titlearea">
23
+  <div id="projecthead">
24
+    <div id="projectlogo"><img alt="" src="$relpath^$projectlogo"/></div>
25
+    <div id="projectname">$projectname</span>&#160;<span id="projectnumber">$projectnumber</div>
26
+    <div id="projectbrief">$projectbrief</div>
27
+  </div>
28
+  <nav>
29
+    <a href="@PROJECT_URL@" target="_blank">Project Management</a>
30
+    <a href="@SOURCE_DOWNLOAD@" target="_blank">Download</a>
31
+    <div>$searchbox</div>
32
+  </nav>
33
+</div>

BIN
doc/plantuml.jar View File


+ 38
- 0
doc/style.css View File

@@ -0,0 +1,38 @@
1
+#titlearea {
2
+  display: flex;
3
+  justify-content: space-between;
4
+  align-items: flex-begin;
5
+}
6
+#titlearea nav {
7
+  padding: 0;
8
+  margin: 0;
9
+}
10
+#titlearea nav a {
11
+  background-color: lightgray;
12
+  border: 1px solid gray;
13
+  color: black;
14
+  padding: 1ex;
15
+  margin: 0;
16
+}
17
+img, object {
18
+  max-width: 100% !important;
19
+}
20
+@media (max-width: 50em) {
21
+  #navrow1, #navrow2 {
22
+    display: block
23
+  }
24
+  #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s {
25
+    display: none;
26
+  }
27
+  #doc-content {
28
+    margin-left: 0 !important;
29
+  }
30
+}
31
+@media (min-width: 50em) {
32
+  #navrow1, #navrow2 {
33
+    display: none;
34
+  }
35
+  #side-nav, #splitbar, .ui-resizable-handle ui-resizable-e, .ui-resizable-handle ui-resizable-s {
36
+    display: block
37
+  }
38
+}

+ 9
- 0
makefile_test.inc.am View File

@@ -0,0 +1,9 @@
1
+## @id $Id$
2
+
3
+##       1         2         3         4         5         6         7         8
4
+## 45678901234567890123456789012345678901234567890123456789012345678901234567890
5
+
6
+%.gcda: %
7
+	gcov $<
8
+
9
+CLEANFILES += ${CLEANFILES} ${TEST:%=%.gcno} ${TEST:%=%.gcda} *.gcov

+ 1
- 1
resolve-debbuilddeps.sh View File

@@ -16,7 +16,7 @@ if test -n "${SCHROOTNAME}"; then
16 16
   SUDO="schroot -c "${SCHROOTNAME}" -u root -d / --"
17 17
 else
18 18
   DO=""
19
-  if grep -q '/docker/' /proc/1/cgroup; then
19
+  if grep -q '/docker' /proc/1/cgroup; then
20 20
       SUDO=""
21 21
   else
22 22
       SUDO="sudo"

+ 11
- 5
sql-to-dot.sed View File

@@ -11,6 +11,11 @@ H;$!d;$x
11 11
 # remove all single-line comment lines
12 12
 s/\n--[^\n]*//g
13 13
 
14
+# encode html entities
15
+s/&/\&amp##SEMICOLON##/g
16
+s/</\&lt##SEMICOLON##/g
17
+s/>/\&gt##SEMICOLON##/g
18
+
14 19
 # reduce spaces
15 20
 s,\t\| \+, ,g
16 21
 
@@ -21,7 +26,7 @@ s,\t\| \+, ,g
21 26
 s,\n\+,\n,g
22 27
 
23 28
 # remove unknown commands
24
-s,\(;\|\n\) *\(DELIMITER\|USE\|DROP\|CREATE[ \n]\+DATABASE\)[ \n]\+[^;]*;\+,,ig
29
+s,\(;\|\n\) *\(INSERT\|DELIMITER\|USE\|DROP\|CREATE[ \n]\+DATABASE\)[ \n]\+[^;]*;\+,,ig
25 30
 
26 31
 # convert special characters within quotes
27 32
 :a;s/^\(\([^"]*"[^",]*"\)*[^"]*"[^"]*\),\([^"]*".*\)/\1\##COMMA##\3/g;ta
@@ -34,17 +39,18 @@ h
34 39
 s,.*\(create[ \n]\+table[^;]*;\).*,\1,ig
35 40
 
36 41
 # start html table node
37
-s|CREATE[ \n]\+TABLE[ \n]\+\(if[ \n]\+not[ \n]\+exists[ \n]\+\)\?`\?\(\w\+\)`\?|    \2\n        [shape=none, margin=0, label=<\n            <table bgcolor="#dddddd">\n                <tr><td bgcolor="#ddddff" colspan="4"><b>\2</b></td></tr>|ig
42
+s|CREATE[ \n]\+TABLE[ \n]\+\(IF[ \n]\+NOT[ \n]\+EXISTS[ \n]\+\)\?`\?\(\w\+\)`\?|    \2\n        [shape=none, margin=0, label=<\n            <table bgcolor="#dddddd">\n                <tr><td bgcolor="#ddddff" colspan="4"><b>\2</b></td></tr>|ig
38 43
 
39 44
 # remove key definitions
40
-s/[),][\n ]*\(PRIMARY[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi
45
+s/[),][\n ]*\(\(UNIQUE\|PRIMARY\)[ \n]\+\)\?KEY[ \n]\+[^(]*([^)]*)//gi
41 46
 
42 47
 # move foreign keys as relation to the end
43 48
 :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
44 49
 
45 50
 # create table rows
46
-s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)[ \n]\+COMMENT[ \n]*["']\([^"']*\)["'][ \n]*|\n                <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\4</td><td align="left">\5</td></tr>|gi
47
-s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n                <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\4</td></tr>|g
51
+s|[(,][ \n]*`\?\(\w\+\)`\?[ \n]\+\(\w\+\(([^)]\+)\)\?\)[ \n]*\([^,)]*\)|\n                <tr><td align="left" port="\1"><b>\1</b></td><td align="left">\2</td><td align="left">\4</td><td></td></tr>|g
52
+# extract comment
53
+s|\(<td\( *\w*="\w*"\)* *>[^<]*\)COMMENT[ \n]\+["']\([^"']*\)["']\([^<]*</td>\)<td></td>|\1\4<td align="left">\3</td>|g
48 54
 
49 55
 # add line breaks for long lines
50 56
 s|\(<td[^>]*>[^<]\{30,40\}\)[ \n]\+\([^<]\{20,\}</td>\)|\1<br/>\2|g

+ 1
- 1
src/mrw/list.hxx View File

@@ -91,7 +91,7 @@ template <typename T, typename A>
91 91
     throw(std::bad_exception) {
92 92
   std::list<T, A> copy(l);
93 93
   copy.push_back(o);
94
-  return ;
94
+  return copy;
95 95
 }
96 96
 
97 97
 /* @brief push a char* to a list of string

+ 41
- 0
test/mrw-c++.cxx View File

@@ -0,0 +1,41 @@
1
+/** @id $Id$
2
+
3
+   This file has been added:
4
+     - by bootstrap.sh
5
+     - on Wed, 28 September 2016 08:40:24 +0200
6
+
7
+*/
8
+//       1         2         3         4         5         6         7         8
9
+// 45678901234567890123456789012345678901234567890123456789012345678901234567890
10
+
11
+
12
+
13
+#include <cppunit/TestFixture.h>
14
+#include <cppunit/ui/text/TestRunner.h>
15
+#include <cppunit/extensions/HelperMacros.h>
16
+#include <cppunit/extensions/TestFactoryRegistry.h>
17
+#include <cppunit/XmlOutputter.h>
18
+#include <fstream>
19
+
20
+/// @todo Rename DummyTest and DummyTest::dummy()
21
+/// @todo Write test cases
22
+class DummyTest: public CppUnit::TestFixture { 
23
+  public:
24
+    void dummy() {
25
+    }
26
+    CPPUNIT_TEST_SUITE(DummyTest);
27
+    CPPUNIT_TEST(dummy);
28
+    CPPUNIT_TEST_SUITE_END();
29
+};
30
+CPPUNIT_TEST_SUITE_REGISTRATION(DummyTest);
31
+
32
+int main(int argc, char** argv) try {
33
+  std::ofstream ofs((*argv+std::string(".xml")).c_str());
34
+  CppUnit::TextUi::TestRunner runner;
35
+  runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), ofs));
36
+  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
37
+  return runner.run() ? 0 : 1;
38
+ } catch (std::exception& e) {
39
+  std::cerr<<"***Exception: "<<e.what()<<std::endl;
40
+  return 1;
41
+ }

Loading…
Cancel
Save