From 3b6344e3388a2a994974b3caf631c6dc04300715 Mon Sep 17 00:00:00 2001 From: tweenk Date: Thu, 19 Feb 2009 22:49:38 +0000 Subject: [PATCH] Fix SVN revision reporting so that it doesn't relink on every make invocation. --- acinclude.m4 | 1 + configure.ac | 12 ++++-------- m4/ink_svn_snapshot_build.m4 | 14 ++++++++++++++ src/Makefile_insert | 13 +++++++------ 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 m4/ink_svn_snapshot_build.m4 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 #### -- 2.30.2