summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2010-08-20 13:29:04 +0100
committerRoss Burton <ross@linux.intel.com>2010-08-20 13:38:07 +0100
commitad370df7c958389f7e814e737d883684ffabbfe8 (patch)
tree7b4133c4bc2befa3b7ec54efe459d2bf537b8611
parent0ebcff38beb28ec0f63c33bda6a1d39611c98baf (diff)
build: Update the build systemlibrest-0.7.2
• Use an autoconf released in this millenium • Use the LT macros for libtool • Do not create SGML templates for gtk-doc, and speed up the build • Place every build-related file under build/ • Update the introspection.m4 • Use the introspection makefile rules Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
-rw-r--r--Makefile.am2
-rw-r--r--build/Makefile.am1
-rw-r--r--build/introspection.m4 (renamed from introspection.m4)10
-rw-r--r--configure.ac43
-rw-r--r--rest-extras/Makefile.am55
-rw-r--r--rest/Makefile.am48
6 files changed, 76 insertions, 83 deletions
diff --git a/Makefile.am b/Makefile.am
index f814f25..b0ca214 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,4 +10,4 @@ CLEANFILES = $(pkgconfig_DATA)
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
-ACLOCAL_AMFLAGS = -I .
+ACLOCAL_AMFLAGS = -I build
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 0000000..a250674
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = introspection.m4
diff --git a/introspection.m4 b/build/introspection.m4
index bb3a0da..589721c 100644
--- a/introspection.m4
+++ b/build/introspection.m4
@@ -21,7 +21,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
+ [Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
@@ -42,7 +42,7 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
],dnl
- [dnl
+ [dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
@@ -59,12 +59,18 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
diff --git a/configure.ac b/configure.ac
index bed7860..ccb7473 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,25 +1,42 @@
-AC_PREREQ(2.53)
-AC_INIT(rest, 0.7.2)
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-AM_CONFIG_HEADER(config.h)
-AC_CONFIG_MACRO_DIR([.])
-
-m4_define([api_version], [0.7])
-AC_SUBST([API_VERSION],[api_version])
-AC_DEFINE_UNQUOTED(API_VERSION, [$API_VERSION], [API version])
+m4_define([api_major], [0])
+m4_define([api_minor], [7])
+m4_define([api_micro], [2])
+
+AC_PREREQ([2.63])
+AC_INIT([rest], [0.7.2],
+ [],
+ [rest],
+ [http://meego.gitorious.org/meego-middleware/librest])
+
+AC_CONFIG_SRCDIR([rest/rest-proxy.h])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_AUX_DIR([build])
+AC_CONFIG_MACRO_DIR([build])
+
+AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define])
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_SILENT_RULES([yes])
+
+API_MAJOR=api_major
+API_MINOR=api_minor
+AC_SUBST([API_VERSION],[$API_MAJOR.$API_MINOR])
+AC_SUBST([API_VERSION_AM],[$API_MAJOR\_$API_MINOR])
+AC_DEFINE_UNQUOTED(API_VERSION, [$API_VERSION], [API version])
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_INSTALL
-AC_PROG_LIBTOOL
AC_ISC_POSIX
AC_HEADER_STDC
+
AM_PROG_CC_C_O
+# require libtool >= 2.2
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.18)
PKG_CHECK_MODULES(SOUP, libsoup-2.4)
PKG_CHECK_MODULES(XML, libxml-2.0)
@@ -39,8 +56,8 @@ AS_IF(
AC_MSG_RESULT([no])
)
-GTK_DOC_CHECK(1.9)
-GOBJECT_INTROSPECTION_CHECK([0.6.4])
+GTK_DOC_CHECK([1.13], [--flavour no-tmpl])
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
localedir=${datadir}/locale
AC_SUBST(localedir)
diff --git a/rest-extras/Makefile.am b/rest-extras/Makefile.am
index 26a421f..9f69e95 100644
--- a/rest-extras/Makefile.am
+++ b/rest-extras/Makefile.am
@@ -37,46 +37,31 @@ test_runner_LDFLAGS = $(librest_extras_@API_VERSION@_la_LIBADD)
# TODO: use gtester
+# intospection
+-include $(INTROSPECTION_MAKEFILE)
+
if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
+INTROSPECTION_GIRS = RestExtras-@API_VERSION@.gir
+
+# need to include ../rest when scanning/compiling
+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(top_builddir)/rest
+INTROSPECTION_COMPILER_ARGS = --includedir=$(top_builddir)/rest
-RestExtras-@API_VERSION@.gir: $(INTROSPECTION_SCANNER) librest-extras-@API_VERSION@.la
- $(AM_V_GEN)$(INTROSPECTION_SCANNER) -v \
- --namespace RestExtras --nsversion=@API_VERSION@ \
- --add-include-path=$(top_builddir)/rest \
- --include=GObject-2.0 \
- --include=Soup-2.4 \
- --include=libxml2-2.0 \
- --include=Rest-@API_VERSION@ \
- --library=librest-extras-@API_VERSION@.la \
- --libtool="$(top_builddir)/libtool" \
- --pkg gobject-2.0 \
- --pkg libsoup-2.4 \
- --pkg libxml-2.0 \
- --output $@ \
- -I$(top_srcdir) \
- $(addprefix $(top_srcdir)/rest-extras/, $(lib_headers)) \
- $(addprefix $(top_srcdir)/rest-extras/, $(lib_sources))
+RestExtras-@API_VERSION@.gir: librest-extras-@API_VERSION@.la Makefile
-BUILT_GIRSOURCES += RestExtras-@API_VERSION@.gir
+RestExtras_@API_VERSION_AM@_gir_NAMESPACE = RestExtras
+RestExtras_@API_VERSION_AM@_gir_VERSION = @API_VERSION@
+RestExtras_@API_VERSION_AM@_gir_LIBS = librest-extras-@API_VERSION@.la
+RestExtras_@API_VERSION_AM@_gir_FILES = $(addprefix $(top_srcdir)/rest-extras/, $(lib_headers))
+RestExtras_@API_VERSION_AM@_gir_CFLAGS = -I$(top_srcdir)
+RestExtras_@API_VERSION_AM@_gir_INCLUDES = GObject-2.0 Soup-2.4 libxml2-2.0 Rest-@API_VERSION@
+RestExtras_@API_VERSION_AM@_gir_PACKAGES = gobject-2.0 libsoup-2.4 libxml-2.0
-# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
-# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
typelibsdir = $(libdir)/girepository-1.0/
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
-
-%.typelib: %.gir $(INTROSPECTION_COMPILER)
- $(AM_V_GEN) \
- LD_LIBRARY_PATH=.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=. \
- --includedir=$(top_builddir)/rest \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-endif #HAVE_INTROSPECTION
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
+endif # HAVE_INTROSPECTION
diff --git a/rest/Makefile.am b/rest/Makefile.am
index c77c39c..e0ca664 100644
--- a/rest/Makefile.am
+++ b/rest/Makefile.am
@@ -52,43 +52,27 @@ test_runner_LDFLAGS = $(librest_@API_VERSION@_la_LIBADD)
# TODO: use gtester
+# intospection
+-include $(INTROSPECTION_MAKEFILE)
+
if HAVE_INTROSPECTION
-BUILT_GIRSOURCES =
+INTROSPECTION_GIRS = Rest-@API_VERSION@.gir
-Rest-@API_VERSION@.gir: $(INTROSPECTION_SCANNER) librest-@API_VERSION@.la
- $(AM_V_GEN)$(INTROSPECTION_SCANNER) -v \
- --namespace Rest --nsversion=@API_VERSION@ \
- --include=GObject-2.0 \
- --include=Soup-2.4 \
- --include=libxml2-2.0 \
- --library=librest-@API_VERSION@.la \
- --libtool="$(top_builddir)/libtool" \
- --pkg gobject-2.0 \
- --pkg libsoup-2.4 \
- --pkg libxml-2.0 \
- --output $@ \
- -I$(top_srcdir) \
- $(addprefix $(top_srcdir)/rest/, $(lib_headers)) \
- $(addprefix $(top_srcdir)/rest/, $(lib_sources))
+Rest-@API_VERSION@.gir: librest-@API_VERSION@.la Makefile
-BUILT_GIRSOURCES += Rest-@API_VERSION@.gir
+Rest_@API_VERSION_AM@_gir_NAMESPACE = Rest
+Rest_@API_VERSION_AM@_gir_VERSION = @API_VERSION@
+Rest_@API_VERSION_AM@_gir_LIBS = librest-@API_VERSION@.la
+Rest_@API_VERSION_AM@_gir_FILES = $(addprefix $(top_srcdir)/rest/, $(lib_headers))
+Rest_@API_VERSION_AM@_gir_CFLAGS = -I$(top_srcdir)
+Rest_@API_VERSION_AM@_gir_INCLUDES = GObject-2.0 Soup-2.4 libxml2-2.0
+Rest_@API_VERSION_AM@_gir_PACKAGES = gobject-2.0 libsoup-2.4 libxml-2.0
-# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
-# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
+dist_gir_DATA = $(INTROSPECTION_GIRS)
typelibsdir = $(libdir)/girepository-1.0/
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
-
-%.typelib: %.gir $(INTROSPECTION_COMPILER)
- $(AM_V_GEN) \
- LD_LIBRARY_PATH=.libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=. \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
-CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-endif #HAVE_INTROSPECTION
+CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
+endif # HAVE_INTROSPECTION