Update of /cvsroot/libfunutil/libfunutil/toc/tests In directory sc8-pr-cvs1:/tmp/cvs-serv7210/toc/tests Modified Files: Makefile awk.sh gnu_cpp_tools.sh qt_if_enabled.sh readline.sh toc_core_tests.sh toc_project_makefile.sh Log Message: massive commit, mainly fixes/changes from the elib tree. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Makefile 5 Aug 2003 09:27:43 -0000 1.1.1.1 +++ Makefile 27 Sep 2003 22:34:03 -0000 1.2 @@ -1,4 +1,7 @@ include toc.make +SUBDIRS = cpp DIST_FILES += $(wildcard *.sh) + +all: subdirs Index: awk.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/awk.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- awk.sh 31 Aug 2003 00:42:50 -0000 1.3 +++ awk.sh 27 Sep 2003 22:34:03 -0000 1.4 @@ -1,6 +1,6 @@ -# awk? +# toc_run_description = looking for gawk/awk/nawk err=0 -toc_find_failok awk || toc_find_failok gawk || toc_find_failok nawk || err=1 +toc_find_failok gawk || toc_find_failok awk || toc_find_failok nawk || err=1 toc_add_make AWK=$TOC_FIND_RESULT return $err Index: gnu_cpp_tools.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/gnu_cpp_tools.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gnu_cpp_tools.sh 5 Sep 2003 09:34:00 -0000 1.10 +++ gnu_cpp_tools.sh 27 Sep 2003 22:34:03 -0000 1.11 @@ -1,4 +1,4 @@ -# toc_run_description = looking for gcc, ld, and maybe other compilation-related tools +# toc_run_description = looking for GNU C/C++ compiler/linker tools. # toc_begin_help = # It takes the following configure arguments: # --enable-debug causes stuff to be built -g instead of -02. This is a @@ -11,6 +11,11 @@ # # It calls toc_add_make for the following: # - CC /path/to/gcc? +# - LD /path/to/ld +# - CXX /path/to/g++ +# - AR /path/to/ar +# - NM /path/to/nm (optional component) +# - STRIP /path/to/strip (optional component) # - INCLUDES probably empty # - CPPFLAGS probably empty # - OPT -g or -O2 (or some other value specified by --enable-debug) @@ -27,12 +32,22 @@ ; do key=${foo%%-*} var=${foo##*-} - toc_find_fail $key || { - echo "Couldn't find required app: $foo in PATH [$PATH]" + toc_find_failok $key || { + echo "Couldn't find required app: $key in PATH [$PATH]" return 1 } toc_add_make $var=${TOC_FIND_RESULT} done + +for foo in \ + nm-NM strip-STRIP \ + ; do + key=${foo%%-*} + var=${foo##*-} + toc_find_failok $key + toc_add_make $var="${TOC_FIND_RESULT}" +done + toc_add_make INCLUDES="$INCLUDES" toc_add_make CPPFLAGS="$CPPFLAGS" Index: qt_if_enabled.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/qt_if_enabled.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- qt_if_enabled.sh 30 Aug 2003 19:20:31 -0000 1.4 +++ qt_if_enabled.sh 27 Sep 2003 22:34:03 -0000 1.5 @@ -1,4 +1,40 @@ +#!/do/not/sh +# toc_run_description = checking whether to use Qt +# toc_begin_help = +# This test does not actually check for qt - it checks +# to see whether running the qt test is desired, then +# runs that test if it thinks it should. All arguments +# are passed on to the qt test (if it is run), so +# see that test for information on what arguments +# are required. +# +# If --without-qt is used then this test does not check for qt and +# returns zero. +# +# The qt test is invoked in any of the following cases: +# +# --with-qt is not zero +# +# --with-QTDIR=/path/to/qt +# +# --with-QTDIR and ${QTDIR} points to /path/to/qt +# +# Sets these config vars: +# +# - HAVE_QT: zero or one +# +# Others will be set by the qt test if it is run. +# +# Returns one of: +# +# - zero if none of the above conditions are met. +# +# - one if, e.g., --with-qt is passed but no QTDIR is set, or +# --with-QTDIR=/path points to an invalid path. +# +# - return code from the qt test. +# = toc_end_help toc_add_config_h HAVE_QT=0 toc_add_make configure_with_qt=${configure_with_qt-0} @@ -7,7 +43,7 @@ return 0 } use_qt=${configure_with_qt-0} -test "x${configure_with_QTDIR}" = "x1" && configure_with_QTDIR=$QTDIR +test "x${configure_with_QTDIR}" = "x1" && configure_with_QTDIR="$QTDIR" test "x${configure_with_QTDIR}" != "x" && { thedir="${configure_with_QTDIR}" test -d "$thedir" || { @@ -27,7 +63,7 @@ qt_required_version=${qt_required_version-'3.x'} qt_required_version_glob=${qt_required_version_glob-'3.*'} -toc_source_test qt $@ || { +toc_source_test qt "$@" || { err=$? echo "Qt $qt_required_version not found." return $err Index: readline.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/readline.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- readline.sh 31 Aug 2003 21:38:35 -0000 1.8 +++ readline.sh 27 Sep 2003 22:34:03 -0000 1.9 @@ -1,31 +1,33 @@ -# a basic toc test for libreadline. +# toc_run_description = looking for libreadline/libhistory # toc_begin_help = # Searches for GNU libreadline. -# Use --with-libreadline to enable it. -# Sets the LIBREADLINE_LDADD make var and the HAVE_READLINE config.h var. # -# Sample snippet for your shared makefile: +#Sets the LIBREADLINE_LDADD make var and the HAVE_READLINE config.h var. # -# configure_with_libreadline = @configure_with_libreadline@ -# ifeq (1,$(configure_with_libreadline)) -# LIBREADLINE_LDADD = @LIBREADLINE_LDADD@ -# endif +#Use --without-libreadline to explicitely disable libreadline support. # -# And for client makefiles: -# ifeq (1,$(configure_with_libreadline)) -# my_LDADD += $(LIBREADLINE_LDADD) -# endif +#Sample snippet for your shared makefile: +# +# configure_with_libreadline = @configure_with_libreadline@ +# LIBREADLINE_LDADD = @LIBREADLINE_LDADD@ +# +#And for client makefiles: +# +# ifeq (1,$(configure_with_libreadline)) +# my_LDADD += $(LIBREADLINE_LDADD) +# endif # # In your config.h.at put something like: # -# #define HAVE_READLINE @HAVE_READLINE@ +# #define HAVE_READLINE @HAVE_READLINE@ +# # = toc_end_help toc_add_config_h HAVE_READLINE=0 toc_add_make configure_with_libreadline=0 toc_add_make LIBREADLINE_LDADD= -test "${configure_with_libreadline}" = "0" && { +test "x${configure_with_libreadline}" = "x0" && { echo "libreadline has been explictely disabled with --without-readline." return 0 } @@ -38,6 +40,7 @@ return 1 } lib=${TOC_FIND_RESULT} + incpath=/usr/include:/usr/include/readline:/usr/local/include:/usr/local/include/readline:${prefix}/include:${prefix}/include/readline for inc in readline.h history.h; do toc_find_failok $inc $incpath || { @@ -48,21 +51,24 @@ done LIBREADLINE_LDADD="-lreadline" nc=-lncurses -if toc_find_failok nm > /dev/null; then -# echo -n "? Do we also need to link against $nc? ... " - if ${TOC_FIND_RESULT} ${lib} | grep -q tgoto; then - true - else - echo "It seems we also need to link against $n." - LIBREADLINE_LDADD="${LIBREADLINE_LDADD} $nc" - fi -else - echo "Couldn't find 'nm' to check $lib with, so i'm going to assume we need $nc." + +# note, this grep is apparenlty not sufficient, so i'm going +# to assume the readline needs ncurses for now. :/ +#if toc_find_failok nm > /dev/null; then +## echo -n "? Do we also need to link against $nc? ... " +# if ${TOC_FIND_RESULT} ${lib} | grep -q tgoto; then +# true +# else +# echo "It seems we also need to link against $n." +# LIBREADLINE_LDADD="${LIBREADLINE_LDADD} $nc" +# fi +#else +# echo "Couldn't find 'nm' to check $lib with, so i'm going to assume we need $nc." LIBREADLINE_LDADD="${LIBREADLINE_LDADD} $nc" -fi +#fi configure_with_libreadline=1 toc_add_config_h HAVE_READLINE=1 toc_add_make configure_with_libreadline=1 toc_add_make LIBREADLINE_LDADD="${LIBREADLINE_LDADD}" -return 0 \ No newline at end of file +return 0 Index: toc_core_tests.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/toc_core_tests.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- toc_core_tests.sh 5 Sep 2003 09:34:54 -0000 1.9 +++ toc_core_tests.sh 27 Sep 2003 22:34:03 -0000 1.10 @@ -1,15 +1,16 @@ -# toc_run_description = core sanity checks -# to be sourced from toc_core.sh -# This is the core sanity checker for toc. Any test which MUST -# pass for a tree to be considered toc-capable may be placed -# in here. +# toc_run_description = Looking for required build components... +# toc_begin_help = +# To be sourced from toc_core.sh. This is the core sanity checker for +# toc. Any test which MUST pass for a tree to be considered +# toc-capable may be placed in here. +# = toc_end_help -toc_quietly "Required components:" +toc_run running_under_cygwin +# toc_quietly "Looking for required build components:" for x in \ bash=SHELL \ cat=CAT \ cut=CUT \ - gzip=GZIP \ ls=LS \ perl=PERL \ sed=SED \ @@ -32,8 +33,10 @@ toc_find_fail install-sh ${TOC_TOCDIR}/bin toc_add_make INSTALLER_BIN="\$(top_srcdir)/${TOC_FIND_RESULT##${PWD}/}" + toc_find_fail makedist ${TOC_TOCDIR}/bin toc_add_make TOC_MAKEDIST_BIN="\$(top_srcdir)/${TOC_FIND_RESULT##${PWD}/}" +# it's very arguable to make makedist a required component :/ for x in \ awk \ @@ -41,25 +44,25 @@ gnu_find \ gnu_tar \ ; do - toc_source_test $x || { - echo "required test $x failed." + toc_run_failok $x || { + echo "${TOC_EMOTICON_ERROR} $x test failed." return 1 } done -toc_run running_under_cygwin - #toc_run_failok gnu_install || { # boldecho "Didn't find GNU install. You won't be able to do a 'make install'." #} -toc_quietly "Optional components:" +toc_quietly "Looking for optional build components:" for x in \ + gzip=GZIP \ bzip2=BZIP \ zip=ZIP \ ; do f=${x%%=*} v=${x##*=} + foo=configure_with_${f} toc_find_failok $f toc_add_make $v=${TOC_FIND_RESULT} done Index: toc_project_makefile.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/toc_project_makefile.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- toc_project_makefile.sh 26 Aug 2003 08:31:28 -0000 1.4 +++ toc_project_makefile.sh 27 Sep 2003 22:34:03 -0000 1.5 @@ -1,3 +1,4 @@ +# toc_run_description = looking for toc.${PACKAGE_NAME}.make.at # Creates toc.${PACKAGE_NAME}.make from toc.${PACKAGE_NAME}.make.at # This file is sought by toc.make (but is always optional) |