[f-spot] Started modernizing the build.



commit ce36ecf47d5d15e540839a0d6d61476ee6eb6fa7
Author: Ruben Vermeersch <ruben savanne be>
Date:   Tue May 11 19:54:45 2010 +0200

    Started modernizing the build.
    
    * Replaced autogen.sh
    * Pulled in shamrock macro's
    * Added shave
    
    Our twelve million warnings really stand out now. Time to start fixing
    them!

 .gitignore                      |    6 +-
 INSTALL                         |  182 -----------------
 Makefile.am                     |    1 +
 autogen.sh                      |  191 +++++-------------
 build/Makefile.am               |    3 +
 build/m4/Makefile.am            |    6 +
 build/m4/shamrock/expansions.m4 |   50 +++++
 build/m4/shamrock/i18n.m4       |   10 +
 build/m4/shamrock/mono.m4       |   94 +++++++++
 build/m4/shamrock/monodoc.m4    |   25 +++
 build/m4/shamrock/nunit.m4      |   29 +++
 build/m4/shamrock/programs.m4   |   15 ++
 build/m4/shamrock/util.m4       |   11 +
 build/m4/shave/shave-libtool.in |  109 ++++++++++
 build/m4/shave/shave.in         |  109 ++++++++++
 build/m4/shave/shave.m4         |  102 ++++++++++
 configure.ac                    |   81 +++++++-
 depcomp                         |  423 ---------------------------------------
 18 files changed, 685 insertions(+), 762 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 13baf77..5a5f23a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
 *~
 *#*#
-/Makefile
-/Makefile.in
+Makefile
+Makefile.in
 /aclocal.m4
 /autom4te.cache
 /config.guess
@@ -35,3 +35,5 @@
 /missing
 /mkinstalldirs
 /stamp-h1
+build/m4/shave/shave
+build/m4/shave/shave-libtool
diff --git a/Makefile.am b/Makefile.am
index 6fbc727..b44eff5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
 SUBDIRS = 		\
+	build 		\
 	lib 		\
 	docs		\
 	icons		\
diff --git a/autogen.sh b/autogen.sh
index a2add44..e546af5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,12 +1,13 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
+#!/usr/bin/env bash
+
+PROJECT=f-spot
 
 error () {
 	echo "Error: $1" 1>&2
 	exit 1
 }
 
-check_autotool_version () {
+function check_autotool_version () {
 	which $1 &>/dev/null || {
 		error "$1 is not installed, and is required to configure $PACKAGE"
 	}
@@ -14,16 +15,16 @@ check_autotool_version () {
 	version=$($1 --version | head -n 1 | cut -f4 -d' ')
 	major=$(echo $version | cut -f1 -d.)
 	minor=$(echo $version | cut -f2 -d.)
-	rev=$(echo $version | cut -f3 -d.)
+	rev=$(echo $version | cut -f3 -d. | sed 's/[^0-9].*$//')
 	major_check=$(echo $2 | cut -f1 -d.)
 	minor_check=$(echo $2 | cut -f2 -d.)
 	rev_check=$(echo $2 | cut -f3 -d.)
 
 	if [ $major -lt $major_check ]; then
 		do_bail=yes
-	elif [ $minor -lt $minor_check ] && [ $major = $major_check ]; then
+	elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
 		do_bail=yes
-	elif [ x"$rev_check" != x"" ] && [ $rev -lt $rev_check ] && [ $minor = $minor_check ] && [ $major = $major_check ]; then
+	elif [[ $rev -lt $rev_check && $minor = $minor_check && $major = $major_check ]]; then
 		do_bail=yes
 	fi
 
@@ -32,152 +33,56 @@ check_autotool_version () {
 	fi
 }
 
+function run () {
+	echo "Running $@ ..."
+	$@ 2>.autogen.log || {
+		cat .autogen.log 1>&2
+		rm .autogen.log
+		error "Could not run $1, which is required to configure $PROJECT"
+	}
+	rm .autogen.log
+}
 
 srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 
-ORIGDIR=`pwd`
-cd $srcdir
-PROJECT=f-spot
-TEST_TYPE=-f
-FILE=src/f-spot.glade
-
-DIE=0
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-	echo
-	echo "You must have autoconf installed to compile $PROJECT."
-	echo "Download the appropriate package for your distribution,"
-	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/";
-	DIE=1
-}
-
-AUTOMAKE=automake
-ACLOCAL=aclocal
-
-check_autotool_version $ACLOCAL 1.10
-check_autotool_version $AUTOMAKE 1.10
-
-(grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null) && {
-  (libtool --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
-    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz";
-    echo "(or a newer version if it is available)"
-    DIE=1
-  }
-}
-
-grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null && {
-  grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
-  (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`glib-devel' (or glib2-devel) installed to compile $PROJECT."
-    DIE=1
-  }
-}
-
-(which gnome-doc-prepare && gnome-doc-prepare )|| {
-	echo "**Error**: You must have gnome-common (sometimes packaged as gnome-doc-utils) installed to compile $PROJECT."
-	DIE=1
+(test -f $srcdir/configure.ac) || {
+	error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
 }
 
-if test "$DIE" -eq 1; then
-	exit 1
+# MacPorts on OS X only seems to have glibtoolize
+WHICHLIBTOOLIZE=$(which libtoolize || which glibtoolize)
+if [ x"$WHICHLIBTOOLIZE" == x"" ]; then
+	error "libtool is required to configure $PROJECT"
 fi
-
-test $TEST_TYPE $FILE || {
-	echo "You must run this script in the top-level $PROJECT directory"
-	exit 1
-}
-
-if test -z "$*"; then
-	echo "I am going to run ./configure with no arguments - if you wish "
-        echo "to pass any to it, please specify them on the $0 command line."
+LIBTOOLIZE=$(basename $WHICHLIBTOOLIZE)
+
+check_autotool_version aclocal 1.9
+check_autotool_version automake 1.9
+check_autotool_version autoconf 2.53
+check_autotool_version $LIBTOOLIZE 1.4.3
+check_autotool_version intltoolize 0.35.0
+check_autotool_version pkg-config 0.14.0
+check_autotool_version gnome-doc-prepare 0.20.0
+
+run intltoolize --force --copy
+run $LIBTOOLIZE --force --copy --automake
+run aclocal -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS
+run autoconf
+run autoheader
+run gnome-doc-prepare
+test -f config.h.in && touch config.h.in
+run automake --gnu --add-missing --force --copy \
+	-Wno-portability -Wno-portability
+
+if [ ! -z "$NOCONFIGURE" ]; then
+	echo "Done. ./configure skipped."
+	exit $?
 fi
 
-case $CC in
-*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
-esac
-
-for coin in `find $srcdir -name configure.ac -print`
-do 
-  dr=`dirname $coin`
-  if test -f $dr/NO-AUTO-GEN; then
-    echo skipping $dr -- flagged as no auto-gen
-  else
-    echo processing $dr
-    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
-    ( cd $dr
-      aclocalinclude="$ACLOCAL_FLAGS"
-      for k in $macrodirs; do
-  	if test -d $k; then
-          aclocalinclude="$aclocalinclude -I $k"
-  	##else 
-	##  echo "**Warning**: No such directory \`$k'.  Ignored."
-        fi
-      done
-      if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then
-	if grep "sed.*POTFILES" configure.ac >/dev/null; then
-	  : do nothing -- we still have an old unmodified configure.ac
-	else
-	  echo "Creating $dr/aclocal.m4 ..."
-	  test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
-	  echo "Running gettextize...  Ignore non-fatal messages."
-	  echo "no" | gettextize --force --copy
-	  echo "Making $dr/aclocal.m4 writable ..."
-	  test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
-        fi
-      fi
-      if grep "^AM_GNOME_GETTEXT" configure.ac >/dev/null; then
-	echo "Creating $dr/aclocal.m4 ..."
-	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
-	echo "Running gettextize...  Ignore non-fatal messages."
-	echo "no" | gettextize --force --copy
-	echo "Making $dr/aclocal.m4 writable ..."
-	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
-      fi
-      if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
-	echo "Creating $dr/aclocal.m4 ..."
-	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
-	echo "Running gettextize...  Ignore non-fatal messages."
-	echo "no" | glib-gettextize --force --copy
-	echo "Making $dr/aclocal.m4 writable ..."
-	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
-      fi
-      if grep "^AC_PROG_INTLTOOL" configure.ac >/dev/null ||
-         grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
-        echo "Running intltoolize..."
-        intltoolize --copy --force --automake
-      fi
-      if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
-	echo "Running libtoolize..."
-	libtoolize --force --copy
-      fi
-      echo "Running $ACLOCAL $aclocalinclude ..."
-      $ACLOCAL $aclocalinclude
-      if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
-	echo "Running autoheader..."
-	autoheader
-      fi
-      echo "Running $AUTOMAKE --gnu $am_opt ..."
-      $AUTOMAKE --add-missing --gnu $am_opt
-      echo "Running autoconf ..."
-      autoconf
-    )
-  fi
-done
-
-conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
-
-cd "$ORIGDIR"
-
-if test x$NOCONFIGURE = x; then
-  echo Running $srcdir/configure $conf_flags "$@" ...
-  $srcdir/configure $conf_flags "$@" \
-  && echo Now type \`make\' to compile $PROJECT  || exit 1
-else
-  echo Skipping configure process.
+if [ $# = 0 ]; then
+	echo "WARNING: I am going to run configure without any arguments."
 fi
 
+run ./configure --enable-maintainer-mode $@
 
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 0000000..f811656
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = m4
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/build/m4/Makefile.am b/build/m4/Makefile.am
new file mode 100644
index 0000000..6c1d899
--- /dev/null
+++ b/build/m4/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = \
+	$(srcdir)/shamrock/*.m4 \
+	$(srcdir)/shave/*.m4 \
+	$(srcdir)/shave/*.in
+MAINTAINERCLEANFILES = Makefile.in
+
diff --git a/build/m4/shamrock/expansions.m4 b/build/m4/shamrock/expansions.m4
new file mode 100644
index 0000000..ba62356
--- /dev/null
+++ b/build/m4/shamrock/expansions.m4
@@ -0,0 +1,50 @@
+AC_DEFUN([SHAMROCK_EXPAND_LIBDIR],
+[	
+	expanded_libdir=`(
+		case $prefix in 
+			NONE) prefix=$ac_default_prefix ;; 
+			*) ;; 
+		esac
+		case $exec_prefix in 
+			NONE) exec_prefix=$prefix ;; 
+			*) ;; 
+		esac
+		eval echo $libdir
+	)`
+	AC_SUBST(expanded_libdir)
+])
+
+AC_DEFUN([SHAMROCK_EXPAND_BINDIR],
+[
+	expanded_bindir=`(
+		case $prefix in 
+			NONE) prefix=$ac_default_prefix ;; 
+			*) ;; 
+		esac
+		case $exec_prefix in 
+			NONE) exec_prefix=$prefix ;; 
+			*) ;; 
+		esac
+		eval echo $bindir
+	)`
+	AC_SUBST(expanded_bindir)
+])
+
+AC_DEFUN([SHAMROCK_EXPAND_DATADIR],
+[
+	case $prefix in
+		NONE) prefix=$ac_default_prefix ;;
+		*) ;;
+	esac
+
+	case $exec_prefix in
+		NONE) exec_prefix=$prefix ;;
+		*) ;;
+	esac
+
+	expanded_datadir=`(eval echo $datadir)`
+	expanded_datadir=`(eval echo $expanded_datadir)`
+
+	AC_SUBST(expanded_datadir)
+])
+
diff --git a/build/m4/shamrock/i18n.m4 b/build/m4/shamrock/i18n.m4
new file mode 100644
index 0000000..e632647
--- /dev/null
+++ b/build/m4/shamrock/i18n.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([SHAMROCK_CONFIGURE_I18N],
+[
+	ALL_LINGUAS=`grep -v '^#' $srcdir/po/LINGUAS | $SED ':a;N;$!ba;s/\n/ /g; s/[ ]+/ /g' | xargs`
+	GETTEXT_PACKAGE=$1
+	AC_SUBST(GETTEXT_PACKAGE)
+	AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
+	AM_GLIB_GNU_GETTEXT
+	AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
+])
+
diff --git a/build/m4/shamrock/mono.m4 b/build/m4/shamrock/mono.m4
new file mode 100644
index 0000000..c40ecbf
--- /dev/null
+++ b/build/m4/shamrock/mono.m4
@@ -0,0 +1,94 @@
+AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_4_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, dmcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono)
+])
+
+AC_DEFUN([_SHAMROCK_CHECK_MONO_MODULE],
+[
+	PKG_CHECK_MODULES(MONO_MODULE, $1 >= $2)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE],
+[
+	_SHAMROCK_CHECK_MONO_MODULE(mono, $1)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO2_MODULE],
+[
+	_SHAMROCK_CHECK_MONO_MODULE(mono-2, $1)
+])
+
+AC_DEFUN([_SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
+[
+	PKG_CHECK_MODULES(MONO_MODULE, $2 >= $1,
+		HAVE_MONO_MODULE=yes, HAVE_MONO_MODULE=no)
+	AC_SUBST(HAVE_MONO_MODULE)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
+[
+	_SHAMROCK_CHECK_MONO_MODULE_NOBAIL(mono, $1)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO2_MODULE_NOBAIL],
+[
+	_SHAMROCK_CHECK_MONO_MODULE_NOBAIL(mono-2, $1)
+])
+
+AC_DEFUN([_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES],
+[
+	for asm in $(echo "$*" | cut -d, -f3- | sed 's/\,/ /g')
+	do
+		AC_MSG_CHECKING([for Mono $2 GAC for $asm.dll])
+		if test \
+			-e "$($PKG_CONFIG --variable=libdir $1)/mono/$2/$asm.dll" -o \
+			-e "$($PKG_CONFIG --variable=prefix $1)/lib/mono/$2/$asm.dll"; \
+			then \
+			AC_MSG_RESULT([found])
+		else
+			AC_MSG_RESULT([not found])
+			AC_MSG_ERROR([missing required Mono $2 assembly: $asm.dll])
+		fi
+	done
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_1_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 1.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 2.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO2_2_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono-2, 2.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_4_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono, 4.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO2_4_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(mono-2, 4.0, $*)
+])
+
diff --git a/build/m4/shamrock/monodoc.m4 b/build/m4/shamrock/monodoc.m4
new file mode 100644
index 0000000..891ac74
--- /dev/null
+++ b/build/m4/shamrock/monodoc.m4
@@ -0,0 +1,25 @@
+AC_DEFUN([SHAMROCK_CHECK_MONODOC],
+[
+	AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs], 
+		[Do not build documentation]), , enable_docs=yes)
+
+	if test "x$enable_docs" = "xyes"; then
+		AC_PATH_PROG(MONODOCER, monodocer, no)
+		if test "x$MONODOCER" = "xno"; then
+			AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])
+		fi
+
+		AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
+		if test "x$MDASSEMBLER" = "xno"; then
+			AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation])
+		fi
+
+		DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir`
+		AC_SUBST(DOCDIR)
+		AM_CONDITIONAL(BUILD_DOCS, true)
+	else
+		AC_MSG_NOTICE([not building ${PACKAGE} API documentation])
+		AM_CONDITIONAL(BUILD_DOCS, false)
+	fi
+])
+
diff --git a/build/m4/shamrock/nunit.m4 b/build/m4/shamrock/nunit.m4
new file mode 100644
index 0000000..4d57d00
--- /dev/null
+++ b/build/m4/shamrock/nunit.m4
@@ -0,0 +1,29 @@
+AC_DEFUN([SHAMROCK_CHECK_NUNIT],
+[
+	NUNIT_REQUIRED=2.4.7
+
+	AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
+		enable_tests=$enableval, enable_tests="no")
+
+	if test "x$enable_tests" = "xno"; then
+		do_tests=no
+		AM_CONDITIONAL(ENABLE_TESTS, false)
+	else
+		PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
+			do_tests="yes", do_tests="no")
+
+		AC_SUBST(NUNIT_LIBS)
+		AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+		if test "x$do_tests" = "xno"; then
+			PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4,
+				do_tests="yes", do_tests="no")
+
+			AC_SUBST(NUNIT_LIBS)
+			AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+			if test "x$do_tests" = "xno"; then
+				AC_MSG_WARN([Could not find nunit: tests will not be available])			fi
+		fi
+	fi
+])
diff --git a/build/m4/shamrock/programs.m4 b/build/m4/shamrock/programs.m4
new file mode 100644
index 0000000..2bdacfe
--- /dev/null
+++ b/build/m4/shamrock/programs.m4
@@ -0,0 +1,15 @@
+AC_DEFUN([SHAMROCK_FIND_PROGRAM],
+[
+	AC_PATH_PROG($1, $2, $3)
+	AC_SUBST($1)
+])
+
+AC_DEFUN([SHAMROCK_FIND_PROGRAM_OR_BAIL],
+[
+	SHAMROCK_FIND_PROGRAM($1, $2, no)
+	if test "x$$1" = "xno"; then
+		AC_MSG_ERROR([You need to install '$2'])
+	fi
+])
+
+
diff --git a/build/m4/shamrock/util.m4 b/build/m4/shamrock/util.m4
new file mode 100644
index 0000000..de85ba9
--- /dev/null
+++ b/build/m4/shamrock/util.m4
@@ -0,0 +1,11 @@
+AC_DEFUN([SHAMROCK_CONCAT],
+[
+	$1="$$1 $$2"
+])
+
+AC_DEFUN([SHAMROCK_CONCAT_MODULE],
+[
+	SHAMROCK_CONCAT($1_CFLAGS, $2_CFLAGS)
+	SHAMROCK_CONCAT($1_LIBS, $2_LIBS)
+])
+
diff --git a/build/m4/shave/shave-libtool.in b/build/m4/shave/shave-libtool.in
new file mode 100644
index 0000000..54ebd69
--- /dev/null
+++ b/build/m4/shave/shave-libtool.in
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# Copyright (c) 2009, Damien Lespiau <damien lespiau gmail com>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+# we need sed
+SED= SED@
+if test -z "$SED" ; then
+SED=sed
+fi
+
+lt_unmangle ()
+{
+   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
+}
+
+# the real libtool to use
+LIBTOOL="$1"
+shift
+
+# if 1, don't print anything, the underlaying wrapper will do it
+pass_though=0
+
+# scan the arguments, keep the right ones for libtool, and discover the mode
+preserved_args=
+
+# have we seen the --tag option of libtool in the command line ?
+tag_seen=0
+
+while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+    --mode=*)
+        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
+        preserved_args="$preserved_args $opt"
+        ;;
+    -o)
+        lt_output="$1"
+        preserved_args="$preserved_args $opt"
+	;;
+    --tag=*)
+        tag_seen=1
+        preserved_args="$preserved_args $opt"
+	;;
+    *)
+        preserved_args="$preserved_args $opt"
+        ;;
+      esac
+done
+
+case "$mode" in
+compile)
+    # shave will be called and print the actual CC/CXX/LINK line
+    preserved_args="$preserved_args --shave-mode=$mode"
+    pass_though=1
+    ;;
+link)
+    preserved_args="$preserved_args --shave-mode=$mode"
+    Q="  LINK  "
+    ;;
+*)
+    # let's u
+    # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
+    ;;
+esac
+
+lt_unmangle "$lt_output"
+output=$last_result
+
+# automake does not add a --tag switch to its libtool invocation when
+# assembling a .s file and rely on libtool to infer the right action based
+# on the compiler name. As shave is using CC to hook a wrapper, libtool gets
+# confused. Let's detect these cases and add a --tag=CC option.
+tag=""
+if test $tag_seen -eq 0 -a x"$mode" = xcompile; then
+    tag="--tag=CC"
+fi
+
+if test -z $V; then
+    if test $pass_though -eq 0; then
+        echo "$Q$output"
+    fi
+    $LIBTOOL --silent $tag $preserved_args
+else
+    echo $LIBTOOL $tag $preserved_args
+    $LIBTOOL $tag $preserved_args
+fi
diff --git a/build/m4/shave/shave.in b/build/m4/shave/shave.in
new file mode 100644
index 0000000..490d6c5
--- /dev/null
+++ b/build/m4/shave/shave.in
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# Copyright (c) 2009, Damien Lespiau <damien lespiau gmail com>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+# we need sed
+SED= SED@
+if test -z "$SED" ; then
+SED=sed
+fi
+
+lt_unmangle ()
+{
+   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
+}
+
+# the tool to wrap (cc, cxx, ar, ranlib, ..)
+tool="$1"
+shift
+
+# the reel tool (to call)
+REEL_TOOL="$1"
+shift
+
+pass_through=0
+preserved_args=
+while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+    --shave-mode=*)
+        mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
+        ;;
+    -o)
+        lt_output="$1"
+        preserved_args="$preserved_args $opt"
+        ;;
+    -out:*|/out:*)
+        lt_output="${opt#*:}"
+        preserved_args="$preserved_args $opt"
+        ;;
+    *)
+        preserved_args="$preserved_args $opt"
+        ;;
+      esac
+done
+
+# mode=link is handled in the libtool wrapper
+case "$mode,$tool" in
+link,*)
+    pass_through=1
+    ;;
+*,cxx)
+    Q="  CXX   "
+    ;;
+*,cc)
+    Q="  CC    "
+    ;;
+*,fc)
+    Q="  FC    "
+    ;;
+*,f77)
+    Q="  F77   "
+    ;;
+*,objc)
+    Q="  OBJC   "
+    ;;
+*,mcs)
+    Q="  MCS   "
+    ;;
+*,*)
+    # should not happen
+    Q="  CC    "
+    ;;
+esac
+
+lt_unmangle "$lt_output"
+output=$last_result
+
+if test -z $V; then
+    if test $pass_through -eq 0; then
+        echo "$Q$output"
+    fi
+    $REEL_TOOL $preserved_args
+else
+    echo $REEL_TOOL $preserved_args
+    $REEL_TOOL $preserved_args
+fi
diff --git a/build/m4/shave/shave.m4 b/build/m4/shave/shave.m4
new file mode 100644
index 0000000..40e47f4
--- /dev/null
+++ b/build/m4/shave/shave.m4
@@ -0,0 +1,102 @@
+dnl Make automake/libtool output more friendly to humans
+dnl
+dnl Copyright (c) 2009, Damien Lespiau <damien lespiau gmail com>
+dnl
+dnl Permission is hereby granted, free of charge, to any person
+dnl obtaining a copy of this software and associated documentation
+dnl files (the "Software"), to deal in the Software without
+dnl restriction, including without limitation the rights to use,
+dnl copy, modify, merge, publish, distribute, sublicense, and/or sell
+dnl copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following
+dnl conditions:
+dnl
+dnl The above copyright notice and this permission notice shall be
+dnl included in all copies or substantial portions of the Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+dnl OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+dnl HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+dnl WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+dnl OTHER DEALINGS IN THE SOFTWARE.
+dnl
+dnl SHAVE_INIT([shavedir],[default_mode])
+dnl
+dnl shavedir: the directory where the shave scripts are, it defaults to
+dnl           $(top_builddir)
+dnl default_mode: (enable|disable) default shave mode.  This parameter
+dnl               controls shave's behaviour when no option has been
+dnl               given to configure.  It defaults to disable.
+dnl
+dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
+dnl   before AC_CONFIG_FILE/AC_OUTPUT is perfect.  This macro rewrites CC and
+dnl   LIBTOOL, you don't want the configure tests to have these variables
+dnl   re-defined.
+dnl * This macro requires GNU make's -s option.
+
+AC_DEFUN([_SHAVE_ARG_ENABLE],
+[
+  AC_ARG_ENABLE([shave],
+    AS_HELP_STRING(
+      [--enable-shave],
+      [use shave to make the build pretty [[default=$1]]]),,
+      [enable_shave=$1]
+    )
+])
+
+AC_DEFUN([SHAVE_INIT],
+[
+  dnl you can tweak the default value of enable_shave
+  m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)])
+
+  if test x"$enable_shave" = xyes; then
+    dnl where can we find the shave scripts?
+    m4_if([$1],,
+      [shavedir="$ac_pwd"],
+      [shavedir="$ac_pwd/$1"])
+    AC_SUBST(shavedir)
+
+    dnl make is now quiet
+    AC_SUBST([MAKEFLAGS], [-s])
+    AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
+
+    dnl we need sed
+    AC_CHECK_PROG(SED,sed,sed,false)
+
+    dnl substitute libtool
+    SHAVE_SAVED_LIBTOOL=$LIBTOOL
+    LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
+    AC_SUBST(LIBTOOL)
+
+    dnl substitute cc/cxx
+    SHAVE_SAVED_CC=$CC
+    SHAVE_SAVED_CXX=$CXX
+    SHAVE_SAVED_FC=$FC
+    SHAVE_SAVED_F77=$F77
+    SHAVE_SAVED_OBJC=$OBJC
+    SHAVE_SAVED_MCS=$MCS
+    CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}"
+    CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}"
+    FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}"
+    F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}"
+    OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}"
+    MCS="${SHELL} ${shavedir}/shave mcs ${SHAVE_SAVED_MCS}"
+    AC_SUBST(CC)
+    AC_SUBST(CXX)
+    AC_SUBST(FC)
+    AC_SUBST(F77)
+    AC_SUBST(OBJC)
+    AC_SUBST(MCS)
+
+    V=@
+  else
+    V=1
+  fi
+  Q='$(V:1=)'
+  AC_SUBST(V)
+  AC_SUBST(Q)
+])
+
diff --git a/configure.ac b/configure.ac
index 97f3eb9..3e84328 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,19 +1,73 @@
-AC_INIT(F-Spot, 0.6.1.5)
-AC_CONFIG_SRCDIR(src/main.cs)
-
+dnl Granularly define the version components
+dnl Remember to also update the Display Version
+m4_define([fspot_version_major], [0])
+m4_define([fspot_version_minor], [6])
+m4_define([fspot_version_micro], [1])
+m4_define([fspot_version_nano], [5])
+
+dnl set to 0 when doing an official release
+m4_define([fspot_version_pre_release], [0])
+
+m4_define([concat], $1$2$3$4)
+
+dnl create base version string
+m4_define([fspot_version], concat(
+	fspot_version_major.,
+	fspot_version_minor.,
+	fspot_version_micro.,
+    fspot_version_nano))
+
+dnl create the release version
+m4_define([fspot_version],
+	m4_if(fspot_version_pre_release, [0],
+		fspot_version,
+		concat(fspot_version, fspot_version_pre_release)))
+
+dnl this can sometimes differ manually
+m4_define([fspot_display_version],
+	["0.6.1.5"])
+
+m4_define([fspot_api_version],
+	[fspot_version_major.fspot_version_minor])
+
+m4_define([fspot_asm_version],
+	[fspot_api_version.0.0])
+
+AC_PREREQ(2.52)
+AC_INIT([fspot], fspot_version,
+	[http://bugzilla.gnome.org/enter_bug.cgi?product=fspot])
+
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar dist-zip foreign])
+AM_MAINTAINER_MODE
 AM_CONFIG_HEADER(config.h)
+AC_SUBST([ACLOCAL_AMFLAGS], ["-I build/m4/shamrock -I build/m4/shave \${ACLOCAL_FLAGS}"])
+
+IT_PROG_INTLTOOL([0.35.0])
+AC_PROG_LIBTOOL
+AC_PROG_INSTALL
 
-AM_INIT_AUTOMAKE([tar-ustar -Wno-portability])
+dnl How to configure for distcheck
+DISTCHECK_CONFIGURE_FLAGS="--disable-docs --enable-release"
+AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
-AM_MAINTAINER_MODE
+dnl Export Version Info
+AC_SUBST([API_VERSION], [fspot_api_version])
+AC_SUBST([ASM_VERSION], [fspot_asm_version])
+AC_SUBST([DISPLAY_VERSION], [fspot_display_version])
+
+dnl Expansions
+SHAMROCK_EXPAND_LIBDIR
+SHAMROCK_EXPAND_BINDIR
+SHAMROCK_EXPAND_DATADIR
 
-IT_PROG_INTLTOOL([0.35.0])
+
+
+AC_CONFIG_SRCDIR(src/main.cs)
 
 AC_PROG_CC
 AC_PROG_CXX
 AC_ISC_POSIX
 AC_HEADER_STDC
-AM_PROG_LIBTOOL
 
 GNOME_COMPILE_WARNINGS
 AM_PATH_GLIB_2_0
@@ -277,18 +331,21 @@ AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 
-expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac
-		   case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac
-		   eval echo $libdir )`
-AC_SUBST(expanded_libdir)
-
 AC_CONFIG_FILES([src/f-spot],[chmod +x src/f-spot])
 
 GNOME_ICON_THEME_PREFIX=`$PKG_CONFIG --variable=prefix gnome-icon-theme`
 AC_SUBST(GNOME_ICON_THEME_PREFIX)
 
+SHAVE_INIT([build/m4/shave], [enable])
+
 AC_OUTPUT(
 Makefile
+
+build/Makefile
+build/m4/Makefile
+build/m4/shave/shave
+build/m4/shave/shave-libtool
+
 lib/dpap-sharp/Makefile
 lib/dpap-sharp/lib/Makefile
 lib/dpap-sharp/dpap-client/Makefile



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]