+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
# Programs
SHELL = /bin/sh
-CC = @CC@
-CPP = @CPP@
+CC = @CCACHE@ @CC@
+CPP = @CCACHE@ @CPP@
RANLIB = @RANLIB@
INSTALL = @INSTALL@
YACC = @YACC@
CP
LEX
YACC
+CCACHE
M_OR_MM
GREP
EGREP
--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
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
+# 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
# ===========================================================================
include_dir_suffix="sdcc/include"
fi
-
# lib_dir_suffix:
# *nix default: "sdcc/lib"
lib_dir_suffix="sdcc/lib"
fi
-
# docdir:
# *nix default: "${datadir}/sdcc/doc"
-
# sdccconf.h
############
# 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
-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; }
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; }
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; }
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; }
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; }
+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;}
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
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
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)
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
# ===========================================================================
# 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
# 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)
# 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], [
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)
MAKEINDEX = @MAKEINDEX@
PDFOPT = @PDFOPT@
+QUIET = >/dev/null 2>/dev/null
+
include ../Makefile.common
MANUAL = sdccman
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) $*
%.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) $*
# # 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
*.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
# -----------------------------------------------------------------
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.