summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2009-02-19 22:49:38 +0000
committertweenk <tweenk@users.sourceforge.net>2009-02-19 22:49:38 +0000
commit8811218bdd8b10a728a15e055ae4bb092be268af (patch)
treed9b92be4cd10373850de94d486a1583b1fbc230c
parentRemove superfluous FreehandShape LPE (diff)
downloadinkscape-8811218bdd8b10a728a15e055ae4bb092be268af.tar.gz
inkscape-8811218bdd8b10a728a15e055ae4bb092be268af.zip
Fix SVN revision reporting so that it doesn't relink on every make
invocation. (bzr r7331)
-rw-r--r--acinclude.m41
-rw-r--r--configure.ac12
-rw-r--r--m4/ink_svn_snapshot_build.m414
-rw-r--r--src/Makefile_insert13
4 files changed, 26 insertions, 14 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 13d49c51f..61148f6b4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,3 +1,4 @@
m4_include([m4/ac_define_dir.m4])
m4_include([m4/ax_openmp.m4])
m4_include([m4/relaytool.m4])
+m4_include([m4/ink_svn_snapshot_build.m4])
diff --git a/configure.ac b/configure.ac
index 869c4d265..ab12503ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ dnl `dpkg --compare-versions'. (ii) We don't always know what the next
dnl version is going to be called until about the time we release it
dnl (whereas we always know what the previous version was called).
AC_CANONICAL_HOST
-AC_CONFIG_SRCDIR(src/main.cpp)
+AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE([dist-zip dist-bzip2 tar-pax])
AC_ARG_ENABLE([lsb], AS_HELP_STRING([--enable-lsb], [LSB-compatible build configuration]), [
@@ -28,7 +28,9 @@ AC_ISC_POSIX
AC_PROG_CXX
AM_PROG_CC_STDC
AM_PROG_AS
+AC_PROG_RANLIB
AC_HEADER_STDC
+INK_SVN_SNAPSHOT_BUILD
dnl These next few lines are needed only while libcroco is in our source tree.
AC_PROG_CC
@@ -94,8 +96,6 @@ fi
dnl Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
-AC_PROG_RANLIB
-
dnl Verify our GCC version
if test "x$GXX" = "xyes"; then
AC_MSG_CHECKING([GNU compiler version])
@@ -142,19 +142,15 @@ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
dnl ******************************
dnl Check for OpenMP
+dnl Replace this with AC_OPENMP once it's possible to use Autoconf 2.62
dnl ******************************
-
AX_OPENMP([openmp_ok=yes],[openmp_ok=no])
-AC_MSG_CHECKING([for OpenMP support])
-dnl a bit odd, but AX_OPENMP does its own check message, so we're not wrapping it at the moment
-AC_MSG_RESULT([$openmp_ok])
if test "x$openmp_ok" = "xyes"; then
dnl We have it, now set up the flags
CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
AC_CHECK_HEADER(omp.h)
fi
-
dnl ******************************
dnl Check for libpng
dnl ******************************
diff --git a/m4/ink_svn_snapshot_build.m4 b/m4/ink_svn_snapshot_build.m4
new file mode 100644
index 000000000..2c013eb60
--- /dev/null
+++ b/m4/ink_svn_snapshot_build.m4
@@ -0,0 +1,14 @@
+# Check for SVN snapshot build
+# (c) 2009 Krzysztof KosiƄski
+# Released under GNU GPL; see the file COPYING for more information
+
+AC_DEFUN([INK_SVN_SNAPSHOT_BUILD],
+[
+ AC_CACHE_CHECK([for SVN snapshot build], ink_cv_svn_snapshot_build,
+ [ink_cv_svn_snapshot_build=no
+ if which svn > /dev/null && test -e $srcdir/.svn/entries; then
+ ink_cv_svn_snapshot_build=yes
+ fi
+ ])
+ AM_CONDITIONAL([USE_SVN_VERSION], [test "x$ink_cv_svn_snapshot_build" = "xyes"])
+])
diff --git a/src/Makefile_insert b/src/Makefile_insert
index 7a43a59c5..e654ca136 100644
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
@@ -72,7 +72,6 @@ libinkpre_a_SOURCES = \
icon-size.h \
id-clash.cpp id-clash.h \
ige-mac-menu.h ige-mac-menu.c \
- inkscape-stock.cpp inkscape-stock.h\
inkscape.cpp inkscape.h inkscape-private.h \
interface.cpp interface.h \
isinf.h \
@@ -313,10 +312,13 @@ inkview_LDADD = $(all_libs)
libinkversion_a_SOURCES = inkscape-version.cpp inkscape-version.h
-# Hack: make inkscape-version.cpp a phony target.
-# Create the version file every time "make" is invoked. Overwrite it only
-# if it changes. Watch the backslashes!
-inkscape-version.cpp:
+if USE_SVN_VERSION
+inkscape_version_deps = $(top_srcdir)/.svn/entries
+endif
+
+# If this is an SVN snapshot build, regenerate this file every time
+# someone updates the SVN working directory.
+inkscape-version.cpp: $(inkscape_version_deps)
VER_PREFIX="$(VERSION)"; \
if test -x "$(srcdir)/.svn" -a ! -z `which svn`; then \
VER_SVNREV=" r`svn info $(srcdir) | sed -n -e '/^Revision:/s/Revision: \(.*\)/\1/p'`"; \
@@ -334,7 +336,6 @@ inkscape-version.cpp:
mv inkscape-version.new.cpp inkscape-version.cpp; \
fi; \
echo $$VERSION
-.PHONY: inkscape-version.cpp
# ######################
# ### CxxTest stuff ####