[gnome-pocket] Replace Makefile sub-module ready build system



commit 259075185d2ea02d0daeee9f98b5b4917fef5280
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Sep 20 17:54:56 2014 +0200

    Replace Makefile sub-module ready build system
    
    Picked up from libgd

 Makefile.am           |   75 +++++++++++++++++++++++++++++++++++++++++++++++++
 gnome-pocket.m4       |   55 ++++++++++++++++++++++++++++++++++++
 gnome-pocket/Makefile |   11 -------
 3 files changed, 130 insertions(+), 11 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..75df537
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,75 @@
+AUTOMAKE_OPTIONS=subdir-objects
+NULL =
+CLEANFILES =
+MAINTAINERCLEANFILES =
+EXTRA_DIST =
+noinst_DATA =
+
+AM_CPPFLAGS =                                  \
+        -I$(top_srcdir)                                \
+        -DPREFIX=\"$(prefix)\"                 \
+        -DLIBDIR=\"$(libdir)\"                 \
+        -DG_LOG_DOMAIN=\"gnome-pocket\"                \
+        -DG_DISABLE_DEPRECATED                 \
+        $(GNOME_POCKET_CFLAGS)                         \
+        $(NULL)
+
+noinst_PROGRAMS =
+
+if GNOME_POCKET_STATIC
+noinst_LTLIBRARIES = gnome-pocket.la
+else
+pkglib_LTLIBRARIES = gnome-pocket.la
+endif
+
+gnome-pocket_la_LIBADD = $(GNOME_POCKET_LIBS)
+gnome-pocket_la_LDFLAGS = -avoid-version
+gnome-pocket_la_SOURCES =                              \
+       gnome-pocket/gnome-pocket.h                     \
+       gnome-pocket/gnome-pocket.c                     \
+       gnome-pocket/gnome-pocket-item.h                \
+       gnome-pocket/gnome-pocket-item.c
+
+noinst_PROGRAMS += test
+test_SOURCES =                                 \
+       test.c                                  \
+       $(NULL)
+test_LDADD =                                   \
+       $(GNOME_POCKET_LIBS)                    \
+       gnome-pocket.la                         \
+       $(NULL)
+
+if GNOME_POCKET_GIR
+include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = GnomePocket-1.0.gir
+
+GnomePocket-1.0.gir: gnome-pocket.la Makefile
+GnomePocket_1_0_gir_NAMESPACE = GnomePocket
+GnomePocket_1_0_gir_VERSION = 1.0
+GnomePocket_1_0_gir_LIBS = gnome-pocket.la
+GnomePocket_1_0_gir_CFLAGS = $(AM_CPPFLAGS)
+GnomePocket_1_0_gir_SCANNERFLAGS =                     \
+       --warn-all                                      \
+       --symbol-prefix=gnome_pocket                    \
+       --identifier-prefix=GnomePocket                 \
+        --c-include="gnome-pocket/gnome-pocket.h"      \
+       $(NULL)
+GnomePocket_1_0_gir_INCLUDES = $(GNOME_POCKET_GIR_INCLUDES)
+GnomePocket_1_0_gir_FILES = $(nodist_gnome-pocket_la_SOURCES)
+
+if GNOME_POCKET_STATIC
+noinst_DATA += $(srcdir)/GnomePocket-1.0.gir
+EXTRA_DIST += $(srcdir)/GnomePocket-1.0.gir
+MAINTAINERCLEANFILES += $(srcdir)/GnomePocket-1.0.gir
+else
+girdir= $(pkgdatadir)/gir-1.0
+typelibdir= $(pkglibdir)/girepository-1.0
+
+gir_DATA = $(INTROSPECTION_GIRS)
+typelib_DATA = $(gir_DATA:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
+endif
+
+-include $(top_srcdir)/git.mk
diff --git a/gnome-pocket.m4 b/gnome-pocket.m4
new file mode 100644
index 0000000..85210f2
--- /dev/null
+++ b/gnome-pocket.m4
@@ -0,0 +1,55 @@
+dnl The option stuff below is based on the similar code from Automake
+
+# _GNOME_POCKET_MANGLE_OPTION(NAME)
+# -------------------------
+# Convert NAME to a valid m4 identifier, by replacing invalid characters
+# with underscores, and prepend the _GNOME_POCKET_OPTION_ suffix to it.
+AC_DEFUN([_GNOME_POCKET_MANGLE_OPTION],
+[[_GNOME_POCKET_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _GNOME_POCKET_SET_OPTION(NAME)
+# ----------------------
+# Set option NAME.  If NAME begins with a digit, treat it as a requested
+# Guile version number, and define _GNOME_POCKET_GUILE_VERSION to that number.
+# Otherwise, define the option using _GNOME_POCKET_MANGLE_OPTION.
+AC_DEFUN([_GNOME_POCKET_SET_OPTION],
+[m4_define(_GNOME_POCKET_MANGLE_OPTION([$1]), 1)])
+
+# _GNOME_POCKET_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of gnome_pocket options.
+AC_DEFUN([_GNOME_POCKET_SET_OPTIONS],
+[m4_foreach_w([_GNOME_POCKET_Option], [$1], [_GNOME_POCKET_SET_OPTION(_GNOME_POCKET_Option)])])
+
+# _GNOME_POCKET_IF_OPTION_SET(NAME,IF-SET,IF-NOT-SET)
+# -------------------------------------------
+# Check if option NAME is set.
+AC_DEFUN([_GNOME_POCKET_IF_OPTION_SET],
+[m4_ifset(_GNOME_POCKET_MANGLE_OPTION([$1]),[$2],[$3])])
+
+dnl GNOME_POCKET_INIT([OPTIONS], [DIR])
+dnl ----------------------------
+dnl OPTIONS      A whitespace-seperated list of options.
+dnl DIR          gnome-pocket submodule directory (defaults to 'gnome-pocket')
+AC_DEFUN([GNOME_POCKET_INIT], [
+    _GNOME_POCKET_SET_OPTIONS([$1])
+    AC_SUBST([GNOME_POCKET_MODULE_DIR],[m4_if([$2],,[gnome-pocket],[$2])])
+
+    AC_REQUIRE([LT_INIT])
+    AC_REQUIRE([AC_CHECK_LIBM])
+    AC_SUBST(LIBM)
+    GNOME_POCKET_MODULES="rest-0.7 goa-1.0 json-glib-1.0 gom-1.0"
+    GNOME_POCKET_GIR_INCLUDES="Rest-0.7 Goa-1.0 Json-1.0 Gom-1.0"
+
+    AM_CONDITIONAL([GNOME_POCKET_STATIC],[_GNOME_POCKET_IF_OPTION_SET([static],[true],[false])])
+
+    # gir: gobject introspection support
+    AM_CONDITIONAL([GNOME_POCKET_GIR],[ _GNOME_POCKET_IF_OPTION_SET([gir],[true],[false])])
+    _GNOME_POCKET_IF_OPTION_SET([gir],[
+        GOBJECT_INTROSPECTION_REQUIRE([0.9.6])
+    ])
+
+    PKG_CHECK_MODULES(GNOME_POCKET, [ $GNOME_POCKET_MODULES ])
+    AC_SUBST(GNOME_POCKET_GIR_INCLUDES)
+    AC_SUBST(GNOME_POCKET_SOURCES)
+])


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