From: <sg...@us...> - 2003-09-27 22:34:52
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests In directory sc8-pr-cvs1:/tmp/cvs-serv7408/toc/tests Added Files: flex.sh gcc_try_compile.sh zlib.sh Log Message: egg --- NEW FILE: flex.sh --- # toc_run_description = looking for GNU flex toc_find_failok flex || return toc_add_make FLEX=${TOC_FIND_RESULT} toc_find_failok FlexLexer.h /usr/include:/usr/local/include || return return 0 --- NEW FILE: gcc_try_compile.sh --- # toc_run_description = trying to compile $@ # # toc_begin_help = # # Tries to compile $@ using ${CC} and returns the error code which the # compiler returns. $@ may be made up of any flags which you want to # pass to the compilers, such as -I/some/path. # # This code uses ${INCLUDES}. You can easily set it only for the # duration of this test by doing something like the following: # # INCLUDES="-I/path1 -I/path2" toc_run_fail myfile.c # # This is an alternative to using the more verbose approach of saving # INCLUDES, adjusting it, calling this test and re-setting INCLUDES. # # = toc_end_help #test x"$@" = x && { # ^^^ this no workie when, e.g., -I... is passed in, because -I is a flag used by test :/ # echo "usage: try_compile cc_flag|file1.{c,cpp...} [cc_flag|file2...]" # return 1 #} toc_get_make CC CC=${TOC_GET_MAKE} test "x$CC" = x && { echo "This test requires that the config variable CC have been set to point to gcc." echo "Try running the gnu_cpp_tools test, or another test which sets C/C++-related variables, or call toc_add_make CC=/path/to/gcc." return 1 } tmpprefix=.toc.try_compile dotofile=$tmpprefix.o compiler_out=$tmpprefix.out cmd="$CC ${INCLUDES} $@ -c -o $dotofile" echo $cmd > $compiler_out $cmd >> $compiler_out 2>&1 err=$? test -f $dotofile && rm $dotofile test $err != 0 && { echo "Compiler output is in $compiler_out (but will be erased the next time this test is run!)." } || { rm $compiler_out } return $err --- NEW FILE: zlib.sh --- # toc_run_description = looking for zlib # toc_begin_help = # Searches for libz.a and zlib.h in commonly-used locations and # sets the config var HAVE_ZLIB to zero or one. # Pass --disable-zlib to configure to explicitely set # HAVE_ZLIB to zero. # = toc_end_help test x0 = x${configure_enable_zlib} && { echo "zlib explicitely disabled via --disable-zlib." toc_add_config HAVE_ZLIB=0 return 0 } toc_find_failok libz.a ${prefix}/lib:/usr/lib:/usr/local/lib:${LD_LIBRARY_PATH} zlib_a=${TOC_FIND_RESULT} toc_find_failok zlib.h ${prefix}/include:/usr/include:/usr/local/include zlib_h=${TOC_FIND_RESULT} test "x" = "x$zlib_a" -o "x" = "x$zlib_h" HAVE_ZLIB=$? toc_add_config HAVE_ZLIB=$HAVE_ZLIB |