-dnl Configure samples if their sources are present:
-if test -d ${srcdir}/samples ; then
- AC_CONFIG_FILES([
- samples/Makefile
- samples/access/Makefile
- samples/artprov/Makefile
- samples/caret/Makefile
- samples/calendar/Makefile
- samples/checklst/Makefile
- samples/config/Makefile
- samples/controls/Makefile
- samples/console/Makefile
- samples/db/Makefile
- samples/dialogs/Makefile
- samples/dialup/Makefile
- samples/docview/Makefile
- samples/docvwmdi/Makefile
- samples/dnd/Makefile
- samples/dragimag/Makefile
- samples/drawing/Makefile
- samples/dynamic/Makefile
- samples/erase/Makefile
- samples/event/Makefile
- samples/exec/Makefile
- samples/font/Makefile
- samples/grid/Makefile
- samples/help/Makefile
- samples/image/Makefile
- samples/internat/Makefile
- samples/ipc/Makefile
- samples/joytest/Makefile
- samples/keyboard/Makefile
- samples/layout/Makefile
- samples/listctrl/Makefile
- samples/mdi/Makefile
- samples/menu/Makefile
- samples/memcheck/Makefile
- samples/minifram/Makefile
- samples/minimal/Makefile
- samples/mobile/Makefile
- samples/mobile/wxedit/Makefile
- samples/mobile/styles/Makefile
- samples/multimon/Makefile
- samples/notebook/Makefile
- samples/oleauto/Makefile
- samples/ownerdrw/Makefile
- samples/png/Makefile
- samples/printing/Makefile
- samples/propsize/Makefile
- samples/regtest/Makefile
- samples/rotate/Makefile
- samples/sashtest/Makefile
- samples/shaped/Makefile
- samples/scroll/Makefile
- samples/scrollsub/Makefile
- samples/sockets/Makefile
- samples/splitter/Makefile
- samples/statbar/Makefile
- samples/taskbar/Makefile
- samples/text/Makefile
- samples/thread/Makefile
- samples/toolbar/Makefile
- samples/treectrl/Makefile
- samples/typetest/Makefile
- samples/validate/Makefile
- samples/widgets/Makefile
- samples/wizard/Makefile
- samples/htlbox/Makefile
- samples/html/Makefile
- samples/html/about/Makefile
- samples/html/help/Makefile
- samples/html/printing/Makefile
- samples/html/helpview/Makefile
- samples/html/test/Makefile
- samples/html/zip/Makefile
- samples/html/virtual/Makefile
- samples/html/widget/Makefile
- samples/opengl/Makefile
- samples/opengl/cube/Makefile
- samples/opengl/penguin/Makefile
- samples/opengl/isosurf/Makefile
- ])
-fi
-
-dnl Configure demos if their sources are present:
-if test -d ${srcdir}/demos ; then
- AC_CONFIG_FILES([
- demos/Makefile
- demos/bombs/Makefile
- demos/dbbrowse/Makefile
- demos/forty/Makefile
- demos/fractal/Makefile
- demos/life/Makefile
- demos/poem/Makefile
- ])
-fi
-
-dnl Configure utils if their sources are present:
-if test -d ${srcdir}/utils ; then
- AC_CONFIG_FILES([
- utils/Makefile
- utils/makegen/Makefile
- utils/HelpGen/Makefile
- utils/HelpGen/src/Makefile
- utils/tex2rtf/Makefile
- utils/tex2rtf/src/Makefile
- utils/hhp2cached/Makefile
- utils/dialoged/Makefile
- utils/dialoged/src/Makefile
- utils/emulator/Makefile
- utils/emulator/src/Makefile
- utils/helpview/Makefile
- utils/helpview/src/Makefile
- utils/configtool/Makefile
- utils/configtool/src/Makefile
- ])
-fi
+dnl Configure samples, contrib etc. directories, but only if they are present:
+if test "$wxUSE_GUI" = "yes"; then
+ SUBDIRS="samples demos utils contrib"
+else dnl we build wxBase only
+ dnl there are no wxBase programs in contrib nor demos
+ SUBDIRS="samples utils"
+fi
+
+for subdir in `echo $SUBDIRS`; do
+ if test -d ${srcdir}/${subdir} ; then
+ if test "$wxUSE_GUI" = "yes"; then
+ if test ${subdir} = "samples"; then
+ dnl only take those samples which compile in the current
+ dnl configuration and which exist
+ makefiles="samples/Makefile.in $makefiles"
+ for sample in `echo $SAMPLES_SUBDIRS`; do
+ if test -d $srcdir/samples/$sample; then
+ makefiles="samples/$sample/Makefile.in $makefiles"
+ fi
+ done
+ else dnl assume that everything compiles for utils &c
+ makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
+ fi
+ else dnl we build wxBase only
+ dnl don't take all samples/utils, just those which build with
+ dnl wxBase
+ if test ${subdir} = "samples"; then
+ makefiles="samples/Makefile.in samples/console/Makefile.in"
+ else dnl utils
+ makefiles="utils/HelpGen/Makefile.in \
+ utils/HelpGen/src/Makefile.in"
+ fi
+ fi