From: amalec Date: Fri, 1 Jun 2001 15:33:42 +0000 (+0000) Subject: Made building docs conditional on presence of lyx and sgml2html X-Git-Tag: 0.10.0~1121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b78d7c0e0af5a8a0d26c1d84b0046df2ec25daa2;p=check Made building docs conditional on presence of lyx and sgml2html git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@20 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/check/aclocal.m4 b/check/aclocal.m4 index 85b52e9..cf8646d 100644 --- a/check/aclocal.m4 +++ b/check/aclocal.m4 @@ -103,6 +103,19 @@ else fi AC_SUBST($1)]) +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, diff --git a/check/configure b/check/configure index 0434364..2449400 100755 --- a/check/configure +++ b/check/configure @@ -691,7 +691,7 @@ fi PACKAGE=check -VERSION=0.4 +VERSION=0.5.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1145,10 +1145,82 @@ else echo "$ac_t""no" 1>&6 fi +# Extract the first word of "lyx", so it can be a program name with args. +set dummy lyx; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1152: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_have_lyx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$have_lyx"; then + ac_cv_prog_have_lyx="$have_lyx" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_have_lyx="yes" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +have_lyx="$ac_cv_prog_have_lyx" +if test -n "$have_lyx"; then + echo "$ac_t""$have_lyx" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test x"$have_lyx" != "xyes" ; then + echo "configure: warning: couldn't find lyx, not building docs" 1>&2 +fi +# Extract the first word of "sgml2html", so it can be a program name with args. +set dummy sgml2html; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1184: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_have_sgmltools'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$have_sgmltools"; then + ac_cv_prog_have_sgmltools="$have_sgmltools" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_have_sgmltools="yes" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +have_sgmltools="$ac_cv_prog_have_sgmltools" +if test -n "$have_sgmltools"; then + echo "$ac_t""$have_sgmltools" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test x"$have_sgmltools" != "xyes" ; then + echo "configure: warning: couldn't find sgml2html, not building docs" 1>&2 +fi +if test x"$have_lyx" = "xyes" -a x"$have_sgmltools" = "xyes" ; then + MAKE_DOC_TRUE= + MAKE_DOC_FALSE='#' +else + MAKE_DOC_TRUE='#' + MAKE_DOC_FALSE= +fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1152: checking how to run the C preprocessor" >&5 +echo "configure:1224: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1163,13 +1235,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1180,13 +1252,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1197,13 +1269,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1228,12 +1300,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1232: checking for ANSI C header files" >&5 +echo "configure:1304: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1241,7 +1313,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1258,7 +1330,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1276,7 +1348,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1297,7 +1369,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1308,7 +1380,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1332,12 +1404,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1336: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1408: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1353,7 +1425,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1377,17 +1449,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1381: checking for $ac_hdr" >&5 +echo "configure:1453: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1418,12 +1490,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1422: checking for working const" >&5 +echo "configure:1494: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1493,12 +1565,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1497: checking for pid_t" >&5 +echo "configure:1569: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1526,12 +1598,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1530: checking for size_t" >&5 +echo "configure:1602: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1560,12 +1632,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1564: checking for vprintf" >&5 +echo "configure:1636: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1612,12 +1684,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1616: checking for _doprnt" >&5 +echo "configure:1688: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1667,12 +1739,12 @@ fi for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1671: checking for $ac_func" >&5 +echo "configure:1743: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1871,6 +1943,10 @@ s%@AWK@%$AWK%g s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@RANLIB@%$RANLIB%g +s%@have_lyx@%$have_lyx%g +s%@have_sgmltools@%$have_sgmltools%g +s%@MAKE_DOC_TRUE@%$MAKE_DOC_TRUE%g +s%@MAKE_DOC_FALSE@%$MAKE_DOC_FALSE%g s%@CPP@%$CPP%g CEOF diff --git a/check/configure.in b/check/configure.in index 2d30cf8..39a9623 100644 --- a/check/configure.in +++ b/check/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/check.c) -AM_INIT_AUTOMAKE(check,0.5) +AM_INIT_AUTOMAKE(check,0.5.1) dnl Checks for programs. AC_PROG_AWK @@ -8,7 +8,15 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB - +AC_CHECK_PROG(have_lyx,lyx,yes) +if test x"$have_lyx" != "xyes" ; then + AC_MSG_WARN([couldn't find lyx, not building docs]) +fi +AC_CHECK_PROG(have_sgmltools,sgml2html,yes) +if test x"$have_sgmltools" != "xyes" ; then + AC_MSG_WARN([couldn't find sgml2html, not building docs]) +fi +AM_CONDITIONAL(MAKE_DOC, test x"$have_lyx" = "xyes" -a x"$have_sgmltools" = "xyes" ) dnl Checks for libraries. dnl Checks for header files. diff --git a/check/doc/Makefile.am b/check/doc/Makefile.am index 14c46c3..e037725 100644 --- a/check/doc/Makefile.am +++ b/check/doc/Makefile.am @@ -43,6 +43,10 @@ EXTRA_DIST = $(lyx_docs) $(example_docs) afake_DATA = +if MAKE_DOC doc_DATA = $(lyx_docs) $(sgml_docs) $(html_docs) $(example_docs) +else +doc_DATA = $(lyx_docs) $(example_docs) +endif CLEANFILES = $(sgml_docs) $(html_docs) *.*~ \ No newline at end of file diff --git a/check/doc/example.lyx b/check/doc/example.lyx index bd7464c..2d5bd9c 100644 --- a/check/doc/example.lyx +++ b/check/doc/example.lyx @@ -117,7 +117,7 @@ ation, and having the unit tests reassure you at each step of that change \layout Standard Look at the Check homepage for the latest information on Check: -\begin_inset LatexCommand \htmlurl[check.sourceforge.net]{check.sourceforge.net} +\begin_inset LatexCommand \htmlurl[http://check.sourceforge.net]{http://check.sourceforge.net} \end_inset