From 3b342b81b72132902b6bb0185f83de46f764557c Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Wed, 13 Apr 2005 19:49:56 +0000 Subject: [PATCH] autotool rejig --- AUTHORS | 0 ChangeLog | 10 +++ Makefile.am | 1 + NEWS | 0 README | 0 bootstrap-autotools.sh | 3 + clutter/Makefile.am | 36 ++++++++ configure.ac | 123 +++++++++++++++++++++++++++ examples/Makefile.am | 7 ++ clutter/cltr.c => examples/scratch.c | 2 +- 10 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 AUTHORS create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 bootstrap-autotools.sh create mode 100644 clutter/Makefile.am create mode 100644 configure.ac create mode 100644 examples/Makefile.am rename clutter/cltr.c => examples/scratch.c (98%) diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/ChangeLog b/ChangeLog index 363c991d7..c6c48bd6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-04-13 mallum,,, + + * bootstrap-autotools.sh: + * clutter/Makefile.am: + * clutter/cltr.c: + * configure.ac: + * examples/Makefile.am: + * examples/scratch.c: + Initial autotooling of everything. + 2005-04-07 mallum,,, * Makefile: diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000..fed7ad01c --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=clutter examples \ No newline at end of file diff --git a/NEWS b/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/README b/README new file mode 100644 index 000000000..e69de29bb diff --git a/bootstrap-autotools.sh b/bootstrap-autotools.sh new file mode 100755 index 000000000..b1376df5a --- /dev/null +++ b/bootstrap-autotools.sh @@ -0,0 +1,3 @@ +#! /bin/sh +autoreconf -v --install || exit 1 +./configure --enable-maintainer-mode "$@" diff --git a/clutter/Makefile.am b/clutter/Makefile.am new file mode 100644 index 000000000..32ee920f6 --- /dev/null +++ b/clutter/Makefile.am @@ -0,0 +1,36 @@ +source_h = pixbuf.h util.h fonts.h \ + cltr.h \ + cltr-private.h \ + cltr-glu.h \ + cltr-events.h \ + cltr-texture.h \ + cltr-widget.h \ + cltr-window.h \ + cltr-photo-grid.h \ + cltr-list.h \ + cltr-scratch.h + +source_c = pixbuf.c util.c fonts.c \ + cltr-core.c \ + cltr-glu.c \ + cltr-texture.c \ + cltr-widget.c \ + cltr-events.c \ + cltr-window.c \ + cltr-photo-grid.c \ + cltr-list.c \ + cltr-scratch.c + +AM_CFLAGS = @GCC_FLAGS@ @CLTR_CFLAGS@ + +lib_LTLIBRARIES = libclutter.la +libclutter_la_SOURCES = $(source_c) $(source_h) +libclutter_la_LIBADD = @CLTR_LIBS@ + +# http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 +# current : revision : age + +libclutter_la_LDFLAGS = -version-info 0:0:0 + +clutterheadersdir = $(includedir)/clutter +clutterheaders_DATA = $(source_h) diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..756e827d0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,123 @@ +AC_PREREQ(2.53) +AC_INIT([clutter], 0.0.1, [mallum@o-hand.com]) +AC_CONFIG_SRCDIR([clutter/cltr.h]) + +AM_INIT_AUTOMAKE() + +AM_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_LIBTOOL + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_CHECK_FUNCS([memset munmap strcasecmp strdup]) + +dnl ------ X + GL ------------------------------------------------------------- + +AC_PATH_XTRA + +# below is broken + +if test "x$have_x" = "xyes"; then + GLX_LIBS="$X_LIBS -lX11 -lGL" + GLX_CFLAGS="$X_CFLAGS" + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $GLX_CFLAGS" + LIBS="$LIBS $GLX_LIBS" + + AC_MSG_CHECKING([for XTHREADS in Xlib]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[return XInitThreads() == 0 ? 0 : 1;]])], + [xthreads=no], + [xthreads=yes], + [xthreads=yes]) + + AC_MSG_RESULT($xthreads) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + if test "x$xthreads" = "xyes" + then + GLX_LIBS="$GLX_LIBS -lpthread" + AC_DEFINE([XTHREADS], [], [1]) + fi +else + AC_MSG_ERROR([*** Cannot find X + GL****]) +fi + +dnl ----- Pango, glib etc --------------------------------------------------- + +pkg_modules="pangoft2 pango glib-2.0 gthread-2.0" +PKG_CHECK_MODULES(CLTR, pangoft2 pango glib-2.0 gthread-2.0) + +dnl ----- Gstreamer --------------------------------------------------------- + +pkg_modules="gstreamer-0.8 gstreamer-interfaces-0.8 gthread-2.0" +PKG_CHECK_MODULES(GST, [$pkg_modules]) + +dnl ------ Check for PNG --------------------------------------------------- + +AC_MSG_CHECKING(for libpng12) + +if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists libpng12; then + AC_MSG_RESULT(yes) + PNG_LIBS=`$PKG_CONFIG --libs libpng12` + PNG_CFLAGS=`$PKG_CONFIG --cflags libpng12` +else + AC_MSG_RESULT(no) + AC_CHECK_LIB([png], [png_create_read_struct], + [have_png="yes"], [have_png="no"]) + + if test x$have_png=xyes && test x$have_png_h=xyes; then + PNG_LIBS="-lpng -lz" + else + AC_MSG_ERROR([*** Cannot find libpng12 ****]) + fi +fi + +dnl ------ Check for JPEG --------------------------------------------------- + +AC_CHECK_LIB([jpeg], [jpeg_read_header], [have_jpg="yes"], [have_jpg="no"]) + +if test x$have_jpg=xyes && test x$have_jpg_h=xyes; then + JPEG_LIBS="-ljpeg" + else + AC_MSG_ERROR([*** Cannot find libjpeg ****]) +fi + +dnl ----- GCC --------------------------------------------------------------- + +if test "x$GCC" = "xyes"; then + GCC_FLAGS="-g -Wall" +fi + +AC_SUBST(GCC_FLAGS) + +AC_SUBST(GST_CFLAGS) +AC_SUBST(GST_LIBS) + +CLTR_CFLAGS="$GLX_CLAGS $CLTR_CFLAGS" +CLTR_LIBS="$GLX_LIBS $PNG_LIBS $JPEG_LIBS $CLTR_LIBS" + +AC_SUBST(CLTR_CFLAGS) +AC_SUBST(CLTR_LIBS) + + +AC_OUTPUT([Makefile +clutter/Makefile +examples/Makefile +]) diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 000000000..1f2290940 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,7 @@ +noinst_PROGRAMS = scratch + +scratch_SOURCES = scratch.c +scratch_CFLAGS = $(CLTR_CFLAGS) +scratch_LDFLAGS = \ + $(CLTR_LIBS) \ + $(top_builddir)/clutter/libclutter.la diff --git a/clutter/cltr.c b/examples/scratch.c similarity index 98% rename from clutter/cltr.c rename to examples/scratch.c index abb8c5993..a8eafd017 100644 --- a/clutter/cltr.c +++ b/examples/scratch.c @@ -1,4 +1,4 @@ -#include "cltr.h" +#include int usage(char *progname)