summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-02-10 02:32:11 +0000
committerRobert Bragg <robert@linux.intel.com>2011-04-11 17:54:36 +0100
commitefb570fdaea6b9a9d5cc9382a02705cf48006811 (patch)
tree730a1660c823fb849c1d95fd8716934bc4689544 /autogen.sh
parentd40cdfa3e1c0fd43660002418ce5594b81d80bc1 (diff)
Adds the ability to build Cogl standalone
This adds an autogen.sh, configure.ac and build/autotool files etc under clutter/cogl and makes some corresponding Makefile.am changes that make it possible to build and install Cogl as a standalone library. Some notable things about this are: A standalone installation of Cogl installs 3 pkg-config files; cogl-1.0.pc, cogl-gl-1.0.pc and cogl-2.0.pc. The second is only for compatibility with what clutter installed though I'm not sure that anything uses it so maybe we could remove it. cogl-1.0.pc is what Clutter would use if it were updated to build against a standalone cogl library. cogl-2.0.pc is what you would use if you were writing a standalone Cogl application. A standalone installation results in two libraries currently, libcogl.so and libcogl-pango.so. Notably we don't include a major number in the sonames because libcogl supports two major API versions; 1.x as used by Clutter and the experimental 2.x API for standalone applications. Parallel installation of later versions e.g. 3.x and beyond will be supportable either with new sonames or if we can maintain ABI then we'll continue to share libcogl.so. The headers are similarly not installed into a directory with a major version number since the same headers are shared to export the 1.x and 2.x APIs (The only difference is that cogl-2.0.pc ensures that -DCOGL_ENABLE_EXPERIMENTAL_2_0_API is used). Parallel installation of later versions is not precluded though since we can either continue sharing or later add a major version suffix.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..6ca0de25
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+
+cd $srcdir
+PROJECT=Cogl
+TEST_TYPE=-f
+FILE=cogl/cogl.h
+
+test $TEST_TYPE $FILE || {
+ echo "You must run this script in the top-level $PROJECT directory"
+ exit 1
+}
+
+if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
+ AUTOMAKE=automake-1.11
+ ACLOCAL=aclocal-1.11
+ export AUTOMAKE ACLOCAL
+else
+ echo
+ echo "You must have automake 1.11.x installed to compile $PROJECT
+ECT."
+ echo "Install the appropriate package for your distribution,"
+ echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
+ exit 1
+fi
+
+(gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have gtk-doc installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution,"
+ echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
+ exit 1
+}
+
+# NOCONFIGURE is used by gnome-common
+if test -z "$NOCONFIGURE"; then
+ 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."
+ fi
+fi
+
+if test -z "$ACLOCAL_FLAGS"; then
+ acdir=`$ACLOCAL --print-ac-dir`
+ m4list="glib-2.0.m4"
+ for file in $m4list; do
+ if [ ! -f "$acdir/$file" ]; then
+ echo "WARNING: aclocal's directory is $acdir, but..."
+ echo " no file $acdir/$file"
+ echo " You may see fatal macro warnings below."
+ echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
+ echo " environment variable to \"-I /some/dir\", or install"
+ echo " $acdir/$file."
+ echo ""
+ fi
+ done
+fi
+
+rm -rf autom4te.cache
+
+gtkdocize || exit $?
+autoreconf -vfi || exit $?
+cd $ORIGDIR || exit $?
+
+if test -z "$NOCONFIGURE"; then
+ $srcdir/configure $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
+ echo "Now type 'make' to compile $PROJECT."
+fi