* configure.in, Makefile.common.in: add support for ccache,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 5 Sep 2008 16:35:04 +0000 (16:35 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 5 Sep 2008 16:35:04 +0000 (16:35 +0000)
  remove spurious $VERSION output, detect doc-tools even without
  --enable-doc to facilitate later manual doc-builds, minor cleanup
* configure: regenerated

* doc/Makefile.in: quieten pdflatex, makeindex, and latex2html,
  avoid races in parallel VPATH builds
* doc/clean.mk: remove .lyx files in the builddir for VPATH builds
* doc/sdccman.lyx: mention --without-ccache configure option

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5229 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
Makefile.common.in
configure
configure.in
doc/Makefile.in
doc/clean.mk
doc/sdccman.lyx

index 894ad9074410cddc2df93014547995b3fb9f545e..10751475fa91745a6e54573fcd54f84c780f005f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-09-05 Raphael Neider <rneider AT web.de>
+
+       * configure.in, Makefile.common.in: add support for ccache,
+         remove spurious $VERSION output, detect doc-tools even without
+         --enable-doc to facilitate later manual doc-builds, minor cleanup
+       * configure: regenerated
+
+       * doc/Makefile.in: quieten pdflatex, makeindex, and latex2html,
+         avoid races in parallel VPATH builds
+       * doc/clean.mk: remove .lyx files in the builddir for VPATH builds
+       * doc/sdccman.lyx: mention --without-ccache configure option
+
 2008-09-01 Raphael Neider <rneider AT web.de>
 
        * src/pic16/gen.c (pic16_derefPtr): handle CPOINTERs as well
index 0a540bf4fb09adb6b4070047fbe0a1ea96e66c80..ead4027541c2a70951dce06764011959b5432e84 100644 (file)
@@ -11,8 +11,8 @@ VERSIONP        = @VERSIONP@
 
 # Programs
 SHELL          = /bin/sh
-CC             = @CC@
-CPP            = @CPP@
+CC             = @CCACHE@ @CC@
+CPP            = @CCACHE@ @CPP@
 RANLIB         = @RANLIB@
 INSTALL                = @INSTALL@
 YACC            = @YACC@
index 16a453cae84d2a6e1fe30d8a1bdd44594d2d7222..27c14e1c442832e63f92f0bc4a47e5c98e11c914 100755 (executable)
--- a/configure
+++ b/configure
@@ -675,6 +675,7 @@ AS
 CP
 LEX
 YACC
+CCACHE
 M_OR_MM
 GREP
 EGREP
@@ -1317,6 +1318,11 @@ Optional Features:
   --enable-libgc          Use the Bohem memory allocator. Lower runtime
                           footprint.
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --without-ccache        do not use ccache even if available
+
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -1822,8 +1828,6 @@ VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
 
-{ echo "$as_me:$LINENO: result: ${VERSION}" >&5
-echo "${ECHO_T}${VERSION}" >&6; }
 PACKAGE=sdcc
 
 
@@ -3487,6 +3491,55 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+# Check whether --with-ccache was given.
+if test "${with_ccache+set}" = set; then
+  withval=$with_ccache;
+fi
+
+case x${with_ccache-yes} in
+    xyes) # Extract the first word of "ccache", so it can be a program name with args.
+set dummy ccache; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CCACHE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CCACHE"; then
+  ac_cv_prog_CCACHE="$CCACHE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CCACHE="ccache"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CCACHE=$ac_cv_prog_CCACHE
+if test -n "$CCACHE"; then
+  { echo "$as_me:$LINENO: result: $CCACHE" >&5
+echo "${ECHO_T}$CCACHE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ ;;
+    xno)  ;;
+    *) CCACHE=$with_ccache
+ ;;
+esac
+
+
 # Checking for functions
 # ===========================================================================
 
@@ -6313,7 +6366,6 @@ if test "${include_dir_suffix}" = ""; then
     include_dir_suffix="sdcc/include"
 fi
 
-
 # lib_dir_suffix:
 # *nix default: "sdcc/lib"
 
@@ -6321,7 +6373,6 @@ if test "${lib_dir_suffix}" = ""; then
     lib_dir_suffix="sdcc/lib"
 fi
 
-
 # docdir:
 # *nix default: "${datadir}/sdcc/doc"
 
@@ -6331,7 +6382,6 @@ fi
 
 
 
-
 # sdccconf.h
 ############
 
@@ -6870,7 +6920,7 @@ _ACEOF
 # Port selection helper
 # ===========================================================================
 # macro AC_DO_ENABLER()
-#   $1 used to access enable_$1, e.g. enable-doc
+#   $1 used to access enable_$1, e.g. enable_doc
 #   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
 #   $3 help string
 
@@ -7271,8 +7321,7 @@ _ACEOF
 
 
 
-if test $OPT_ENABLE_DOC = 1; then
-  # Extract the first word of "lyx", so it can be a program name with args.
+# Extract the first word of "lyx", so it can be a program name with args.
 set dummy lyx; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
@@ -7310,7 +7359,7 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-  # Extract the first word of "latex2html", so it can be a program name with args.
+# Extract the first word of "latex2html", so it can be a program name with args.
 set dummy latex2html; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
@@ -7348,7 +7397,7 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-  # Extract the first word of "pdflatex", so it can be a program name with args.
+# Extract the first word of "pdflatex", so it can be a program name with args.
 set dummy pdflatex; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
@@ -7386,7 +7435,7 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-  # Extract the first word of "pdfopt", so it can be a program name with args.
+# Extract the first word of "pdfopt", so it can be a program name with args.
 set dummy pdfopt; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
@@ -7424,7 +7473,7 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-  # Extract the first word of "makeindex", so it can be a program name with args.
+# Extract the first word of "makeindex", so it can be a program name with args.
 set dummy makeindex; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
@@ -7463,6 +7512,7 @@ fi
 
 
 
+if test $OPT_ENABLE_DOC = 1; then
   if test "$LYX" = ":"; then
   { { echo "$as_me:$LINENO: error: Cannot find required program lyx." >&5
 echo "$as_me: error: Cannot find required program lyx." >&2;}
@@ -8384,6 +8434,7 @@ AS!$AS$ac_delim
 CP!$CP$ac_delim
 LEX!$LEX$ac_delim
 YACC!$YACC$ac_delim
+CCACHE!$CCACHE$ac_delim
 M_OR_MM!$M_OR_MM$ac_delim
 GREP!$GREP$ac_delim
 EGREP!$EGREP$ac_delim
@@ -8417,7 +8468,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 579f6a7ab218f276ee4a970f24fd6e5cb4a5b81e..9d4e010b29a539672d55c0c4caf2905b16b48378 100644 (file)
@@ -22,7 +22,6 @@ VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
 
-AC_MSG_RESULT(${VERSION})
 AC_SUBST(PACKAGE, [sdcc])
 AC_SUBST(VERSION)
 AC_SUBST(VERSIONHI)
@@ -68,6 +67,15 @@ SDCC_REQUIRE_PROG($LEX, flex)
 
 AC_LANG_C
 
+AC_ARG_WITH([ccache],
+    AC_HELP_STRING([--without-ccache], [do not use ccache even if available]),
+    [], [])
+case x${with_ccache-yes} in
+    xyes) AC_CHECK_PROG([CCACHE], [ccache], [ccache], []) ;;
+    xno) AC_SUBST([CCACHE], []) ;;
+    *) AC_SUBST([CCACHE], [$with_ccache]) ;;
+esac
+
 
 # Checking for functions
 # ===========================================================================
@@ -473,7 +481,7 @@ SDCC_BUILD_BIGENDIAN
 # The macros are expanded for the header.
 # The variables in the header are replaced by AC_*DEFINE*()
 # sdccconf_h_dir_separator contains a backslash.
-AC_ARG_VAR(sdccconf_h_dir_separator, needed in sdccconf.h: either "/" (default) or "\\")
+AC_ARG_VAR([sdccconf_h_dir_separator], [needed in sdccconf.h: either "/" (default) or "\\"])
 if test "x${sdccconf_h_dir_separator}" = "x"; then
     sdccconf_h_dir_separator="/"
 fi
@@ -484,27 +492,24 @@ fi
 # include_dir_suffix:
 # *nix default: "sdcc/include"
 
-AC_ARG_VAR(include_dir_suffix, appended to datadir to define SDCC's include directory)
+AC_ARG_VAR([include_dir_suffix], [appended to datadir to define SDCC's include directory])
 if test "${include_dir_suffix}" = ""; then
     include_dir_suffix="sdcc/include"
 fi
-AC_SUBST(include_dir_suffix)
 
 # lib_dir_suffix:
 # *nix default: "sdcc/lib"
-AC_ARG_VAR(lib_dir_suffix, appended to datadir to define SDCC's library root directory)
+AC_ARG_VAR([lib_dir_suffix], [appended to datadir to define SDCC's library root directory])
 if test "${lib_dir_suffix}" = ""; then
     lib_dir_suffix="sdcc/lib"
 fi
-AC_SUBST(lib_dir_suffix)
 
 # docdir:
 # *nix default: "${datadir}/sdcc/doc"
-AC_ARG_VAR(docdir, documentation installation directory)
+AC_ARG_VAR([docdir], [documentation installation directory])
 if test "${docdir}" = ""; then
     docdir="\${datadir}"/sdcc/doc
 fi
-AC_SUBST(docdir)
 
 AC_SUBST(EXEEXT)
 
@@ -587,7 +592,7 @@ AC_DEFINE_UNQUOTED(SDCC_LIB_NAME, "${sdcc_lib_name}")
 # Port selection helper
 # ===========================================================================
 # macro AC_DO_ENABLER()
-#   $1 used to access enable_$1, e.g. enable-doc
+#   $1 used to access enable_$1, e.g. enable_doc
 #   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
 #   $3 help string
 AC_DEFUN([AC_DO_ENABLER], [
@@ -671,13 +676,13 @@ AC_DO_DISABLER(sdcpp,      SDCPP,      [Disables building sdcpp])
 AC_DO_DISABLER(sdcdb,      SDCDB,      [Disables building sdcdb])
 
 AC_DO_ENABLER(doc,   DOC,   [Enables building the documentation])
-if test $OPT_ENABLE_DOC = 1; then
-  AC_CHECK_PROG(LYX,        lyx,        lyx, :)
-  AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html, :)
-  AC_CHECK_PROG(PDFLATEX,   pdflatex,   pdflatex, :)
-  AC_CHECK_PROG(PDFOPT,     pdfopt,     pdfopt, :)
-  AC_CHECK_PROG(MAKEINDEX,  makeindex,  makeindex, :)
+AC_CHECK_PROG([LYX],        [lyx],        [lyx],        [:])
+AC_CHECK_PROG([LATEX2HTML], [latex2html], [latex2html], [:])
+AC_CHECK_PROG([PDFLATEX],   [pdflatex],   [pdflatex],   [:])
+AC_CHECK_PROG([PDFOPT],     [pdfopt],     [pdfopt],     [:])
+AC_CHECK_PROG([MAKEINDEX],  [makeindex],  [makeindex],  [:])
 
+if test $OPT_ENABLE_DOC = 1; then
   SDCC_REQUIRE_PROG($LYX,        lyx)
   SDCC_REQUIRE_PROG($LATEX2HTML, latex2html)
   SDCC_REQUIRE_PROG($PDFLATEX,   pdflatex)
index ed15fe896b92e058b105c2f6e34374ff66c255b8..3d8274f0874a08a5169c5769b3353ff5d25aea6d 100644 (file)
@@ -7,6 +7,8 @@ PDFLATEX   = @PDFLATEX@
 MAKEINDEX  = @MAKEINDEX@
 PDFOPT     = @PDFOPT@
 
+QUIET     = >/dev/null 2>/dev/null
+
 include ../Makefile.common
 
 MANUAL = sdccman
@@ -34,52 +36,33 @@ install:
 uninstall:
        rm -rf $(DESTDIR)$(docdir)
 
-$(MANUAL).html/index.html: $(MANUAL).tex ;#$(MANUAL).ind $(MANUAL).glo
-       mkdir -p $(dir $@)
-       @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
-       @# fixes $(LATEX2HTML) problems with \tabularnewline
-       mv $< $(basename $<).orig.tex
-       sed -e 's,-\\/-,-\\/-\\/-,g' \
-           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
-       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
-       -$(LATEX2HTML) -split 5 -show_section_numbers -local_icons -info "" -dir $(MANUAL).html $(MANUAL)
-       mv $(basename $<).orig.tex $<
-       rm -f $(MANUAL).html/WARNINGS $(MANUAL).html/labels.pl
-
-$(TSS).html/index.html: $(TSS).tex
+$(MANUAL).html/index.html: $(MANUAL).tex $(MANUAL).aux ;#$(MANUAL).ind $(MANUAL).glo
        mkdir -p $(dir $@)
        @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
        @# fixes $(LATEX2HTML) problems with \tabularnewline
-       mv $< $(basename $<).orig.tex
        sed -e 's,-\\/-,-\\/-\\/-,g' \
-           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
-       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
-       -$(LATEX2HTML) -split 0 -local_icons -info "" -dir $(TSS).html $(TSS)
-       mv $(basename $<).orig.tex $<
-       rm -f $(TSS).html/WARNINGS $(TSS).html/labels.pl
+           -e 's,\\tabularnewline$$,\\\\,g' < $< > $(dir $@)$(notdir $<)
+       cp $(MANUAL).aux $(dir $@)
+       -cd $(dir $@); $(LATEX2HTML) -split 5 -show_section_numbers -local_icons -info "" -nosubdir $(MANUAL) $(QUIET)
+       rm -f $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)$(notdir $<) $(dir $@)$*.aux
 
-$(CDB).html/index.html: $(CDB).tex
+%.html/index.html: %.tex %.aux
        mkdir -p $(dir $@)
        @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
        @# fixes $(LATEX2HTML) problems with \tabularnewline
-       mv $< $(basename $<).orig.tex
        sed -e 's,-\\/-,-\\/-\\/-,g' \
-           -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
-       touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
-       -$(LATEX2HTML) -split 0 -show_section_numbers -local_icons -info "" -dir $(CDB).html $(CDB)
-       mv $(basename $<).orig.tex $<
-       rm -f $(CDB).html/WARNINGS $(CDB).html/labels.pl
+           -e 's,\\tabularnewline$$,\\\\,g' < $< > $(dir $@)$(notdir $<)
+       cp $*.aux $(dir $@)
+       -cd $(dir $@); $(LATEX2HTML) -split 0 -local_icons -info "" -nosubdir $* $(QUIET)
+       rm -f $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)$(notdir $<) $(dir $@)$*.aux
 
 %.txt: %.lyx
        @# $(LYX) will export the file in the directory of the $(LYX) file
        @# if VPATH is used the $(LYX) file is copied first
        if [ "$(srcdir)" != "." ]; then \
-         cp $< . ; \
-         $(LYX) -e text $(notdir $<) ; \
-         rm $(notdir $<) ; \
-       else \
-         $(LYX) -e text $< ; \
+         cp -f $(srcdir)/$(notdir $<) . ; \
        fi
+       $(LYX) -e text $(notdir $<);
 
 #%.pdf: %.tex %.dvi %.ind
 #      $(DVIPDF) $*
@@ -96,12 +79,9 @@ $(CDB).html/index.html: $(CDB).tex
 
 %.tex: %.lyx
        if [ "$(srcdir)" != "." ] ; then \
-         cp $< . ; \
-         $(LYX) -e latex $(notdir $<) ; \
-         rm $(notdir $<) ; \
-       else \
-         $(LYX) -e latex $< ; \
+         cp -f $(srcdir)/$(notdir $<) . ; \
        fi
+       $(LYX) -e latex $(notdir $<);
 
 #%.ind: %.dvi
 #      $(LATEX) $*
@@ -117,12 +97,12 @@ $(CDB).html/index.html: $(CDB).tex
 #      # the glossary, not implemented yet
 #      # $(MAKEINDEX) -s l2hglo.ist -o $@ $<
 
-%.pdf: %.tex
-       $(PDFLATEX) $*
-       -$(MAKEINDEX) $*
-       $(PDFLATEX) $*
-       -$(MAKEINDEX) $*
-       $(PDFLATEX) $*
+%.pdf %.aux: %.tex
+       $(PDFLATEX) $* $(QUIET)
+       [ ! -e "$*.idx" ] || $(MAKEINDEX) $* $(QUIET)
+       $(PDFLATEX) $* $(QUIET)
+       [ ! -e "$*.idx" ] || $(MAKEINDEX) $* $(QUIET)
+       $(PDFLATEX) $* $(QUIET)
        $(PDFOPT) $*.pdf tmp.pdf
        rm $*.pdf
        mv tmp.pdf $*.pdf
index add9f7fa235a7f29f1171cd25e7dad8d0751fb69..c2caee07e2bab975a929088364726d80d77b6f20 100644 (file)
@@ -4,6 +4,7 @@ clean:
                *.pdf *.tex *.aux *.dvi *.idx *.ilg *.out\
                *.ind *.log *.toc *~ \#* *.ps */*.css */*.pl *.gif core *.glo
        rm -rf sdcc-doc sdcc-doc.tar.bz2
+       if [ "$(srcdir)" != "." ]; then rm *.lyx; fi
 
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
index b9cce32389dd33adc4ef9bf3c3b17d9d68ee8944..d8aa817a672316999e7e19bb60c12d5d39ea81f2 100644 (file)
@@ -1690,6 +1690,24 @@ status collapsed
  Lower runtime footprint.
 \end_layout
 
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-without-ccache Do not use ccache even if available
+\end_layout
+
 \begin_layout Standard
 Furthermore the environment variables CC, CFLAGS, ...
  the tools and their arguments can be influenced.