diff --git a/CCache/Makefile.in b/CCache/Makefile.in index 07b86f0f4d8..27cc1725f09 100644 --- a/CCache/Makefile.in +++ b/CCache/Makefile.in @@ -7,6 +7,7 @@ exec_prefix=@exec_prefix@ bindir=@bindir@ mandir=@mandir@ INSTALLCMD=@INSTALL@ +PACKAGE_NAME=@PACKAGE_NAME@ CC=@CC@ CFLAGS=@CFLAGS@ -I. @@ -17,11 +18,11 @@ OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \ cleanup.o snprintf.o unify.o HEADERS = ccache.h mdfour.h -all: ccache$(EXEEXT) +all: $(PACKAGE_NAME)$(EXEEXT) docs: ccache.1 web/ccache-man.html -ccache$(EXEEXT): $(OBJS) $(HEADERS) +$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) ccache.1: ccache.yo @@ -31,14 +32,14 @@ web/ccache-man.html: ccache.yo mkdir -p man yodl2html -o web/ccache-man.html ccache.yo -install: ccache$(EXEEXT) ccache.1 +install: $(PACKAGE_NAME)$(EXEEXT) ccache.1 ${INSTALLCMD} -d $(DESTDIR)${bindir} - ${INSTALLCMD} -m 755 ccache$(EXEEXT) $(DESTDIR)${bindir} + ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir} ${INSTALLCMD} -d $(DESTDIR)${mandir}/man1 ${INSTALLCMD} -m 644 ${srcdir}/ccache.1 $(DESTDIR)${mandir}/man1/ clean: - /bin/rm -f $(OBJS) *~ ccache$(EXEEXT) + /bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT) test: test.sh CC='$(CC)' ./test.sh @@ -46,7 +47,7 @@ test: test.sh check: test distclean: clean - /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status + /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status configure config.h # FIXME: To fix this, test.sh needs to be able to take ccache from the # installed prefix, not from the source dir. diff --git a/CCache/ccache.h b/CCache/ccache.h index 9da406a2e89..8b988d37a40 100644 --- a/CCache/ccache.h +++ b/CCache/ccache.h @@ -1,4 +1,6 @@ -#define CCACHE_VERSION "2.4" +#include "ccache_swig_config.h" + +#define CCACHE_VERSION SWIG_VERSION #include "config.h" @@ -34,7 +36,7 @@ #define STATUS_FATAL 4 #define STATUS_NOCACHE 5 -#define MYNAME "ccache-swig" +#define MYNAME PACKAGE_NAME #define LIMIT_MULTIPLE 0.8 diff --git a/CCache/ccache_swig_config.h.in b/CCache/ccache_swig_config.h.in new file mode 100644 index 00000000000..bbb205f7722 --- /dev/null +++ b/CCache/ccache_swig_config.h.in @@ -0,0 +1 @@ +#define SWIG_VERSION "@PACKAGE_VERSION@" diff --git a/CCache/configure.in b/CCache/configure.in index 7dccd6d2abe..23f2f72ef97 100644 --- a/CCache/configure.in +++ b/CCache/configure.in @@ -1,7 +1,8 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT() +AC_INIT([ccache-swig], [0.0]) # Get version from SWIG in ccache_swig_config.h.in AC_PREREQ(2.52) +AC_CONFIG_SRCDIR([ccache.h]) AC_MSG_NOTICE([Configuring ccache]) diff --git a/Makefile.in b/Makefile.in index ebfc036569f..2b22973ce22 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,16 +14,21 @@ datarootdir = @datarootdir@ SHELL = /bin/sh SWIG_LIB = @swig_lib@ BIN_DIR = @bindir@ +ENABLE_CCACHE = @ENABLE_CCACHE@ TARGET_NOEXE= swig TARGET = $(TARGET_NOEXE)@EXEEXT@ SOURCE = Source +CCACHE = CCache DOCS = Doc/Manual -swig: libfiles source +swig: libfiles source ccache source: @cd $(SOURCE) && $(MAKE) +ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE)) + libfiles: $(srcdir)/Lib/swigwarn.swg # Files required just for the tarball @@ -349,6 +354,9 @@ clean-docs: @echo cleaning Docs @test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) -s clean +clean-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s clean) + maintainer-clean: clean-libfiles @cd $(SOURCE) && $(MAKE) maintainer-clean @@ -358,7 +366,7 @@ maintainer-clean: clean-libfiles DISTCLEAN-DEAD = config.status config.log config.cache swig.spec Makefile mkmf.log libtool -distclean: distclean-objects clean-examples clean-gifplot distclean-test-suite clean-docs distclean-dead +distclean: distclean-objects clean-examples clean-gifplot distclean-test-suite clean-docs distclean-dead distclean-ccache distclean-objects: distclean-source @@ -371,6 +379,9 @@ distclean-test-suite: @echo distcleaning Examples/test-suite @$(MAKE) -k -s noskip-test-suite ACTION=distclean +distclean-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s distclean) + noskip-test-suite: \ noskip-tcl-test-suite \ noskip-perl5-test-suite \ diff --git a/autogen.sh b/autogen.sh index 33f54aa7c5f..de5ded87802 100755 --- a/autogen.sh +++ b/autogen.sh @@ -13,3 +13,4 @@ ${ACLOCAL-aclocal} -I Tools/config ${AUTOHEADER-autoheader} ${AUTOMAKE-automake} --add-missing --copy --force-missing ${AUTOCONF-autoconf} +cd CCache && ${AUTORECONF-autoreconf} diff --git a/configure.in b/configure.in index 42845a1ce25..99af00da974 100644 --- a/configure.in +++ b/configure.in @@ -2131,7 +2131,6 @@ case $host in esac AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) - AC_CONFIG_FILES([ \ Makefile \ swig.spec \ @@ -2164,7 +2163,19 @@ AC_CONFIG_FILES([ \ Lib/ocaml/swigp4.ml ]) AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig]) -AC_OUTPUT +AC_CONFIG_FILES([CCache/ccache_swig_config.h]) + +# ccache +AC_ARG_ENABLE([ccache], AS_HELP_STRING([--disable-ccache], [disable building and installation of ccache-swig executable (default enabled)]), [enable_ccache=$enableval], [enable_ccache=yes]) +AC_MSG_CHECKING([whether to enable ccache-swig]) +AC_MSG_RESULT([$enable_ccache]) +if test "$enable_ccache" = yes; then + AC_CONFIG_SUBDIRS(CCache) + ENABLE_CCACHE=1 +fi + +AC_SUBST(ENABLE_CCACHE) +AC_OUTPUT dnl configure.in ends here