Skip to content

Commit

Permalink
integrate ccache build
Browse files Browse the repository at this point in the history
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10920 626c5289-ae23-0410-ae9c-e8d60b6d4f22
  • Loading branch information
wsfulton committed Nov 7, 2008
1 parent c8b41ee commit a65e883
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 13 deletions.
13 changes: 7 additions & 6 deletions CCache/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exec_prefix=@exec_prefix@
bindir=@bindir@
mandir=@mandir@
INSTALLCMD=@INSTALL@
PACKAGE_NAME=@PACKAGE_NAME@

CC=@CC@
CFLAGS=@CFLAGS@ -I.
Expand All @@ -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
Expand All @@ -31,22 +32,22 @@ 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

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.
Expand Down
6 changes: 4 additions & 2 deletions CCache/ccache.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#define CCACHE_VERSION "2.4"
#include "ccache_swig_config.h"

#define CCACHE_VERSION SWIG_VERSION

#include "config.h"

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions CCache/ccache_swig_config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define SWIG_VERSION "@PACKAGE_VERSION@"
3 changes: 2 additions & 1 deletion CCache/configure.in
Original file line number Diff line number Diff line change
@@ -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])

Expand Down
15 changes: 13 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ${ACLOCAL-aclocal} -I Tools/config
${AUTOHEADER-autoheader}
${AUTOMAKE-automake} --add-missing --copy --force-missing
${AUTOCONF-autoconf}
cd CCache && ${AUTORECONF-autoreconf}
15 changes: 13 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

0 comments on commit a65e883

Please sign in to comment.