[gcab] build-sys: fix cross-compilation



commit 57f5dba2f89111117cdee691825617117dbb090a
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Fri Dec 21 23:03:28 2012 +0100

    build-sys: fix cross-compilation

 Makefile.am  |    6 +++++-
 configure.ac |    7 ++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 84dea1c..82c204e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@ AM_CPPFLAGS =					\
 	-DLOCALEDIR="\"$(datadir)/locale\""	\
 	$(NULL)
 
-AM_LDFLAGS = -lz $(GLIB2_LIBS)
 AM_CFLAGS = $(GLIB2_CFLAGS)
 
 libgcab_includedir = $(includedir)/libgcab-1.0
@@ -36,6 +35,7 @@ libgcab_1_0_la_SOURCES =			\
 	libgcab/cabinet.c			\
 	libgcab/cabinet.h			\
 	$(NULL)
+libgcab_1_0_la_LIBADD = -lz $(GLIB2_LIBS)
 libgcab_1_0_la_LDFLAGS =				\
 	-version-info 0:0:0				\
 	-export-symbols-regex='^gcab_'			\
@@ -76,6 +76,7 @@ EXTRA_DIST =					\
 	libgcab/gcab-enums.h.etemplate		\
 	$(NULL)
 
+if GIR
 INTROSPECTION_SCANNER_ARGS = --warn-all
 
 -include $(INTROSPECTION_MAKEFILE)
@@ -112,6 +113,7 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
+if VAPI
 vapidir = $(datadir)/vala/vapi
 vapi_DATA = libgcab-1.0.vapi
 
@@ -126,6 +128,8 @@ libgcab-1.0.vapi: GCab-1.0.gir
 		$<
 
 CLEANFILES += libgcab-1.0.vapi
+endif # VAPI
+endif # GIR
 
 # Autotest support
 
diff --git a/configure.ac b/configure.ac
index 7f83b63..2405a8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,10 +15,9 @@ AC_PROG_INSTALL
 LT_INIT([win32-dll disable-fast-install])
 PKG_PROG_PKG_CONFIG
 GOBJECT_INTROSPECTION_CHECK([0.9.4])
+AM_CONDITIONAL([GIR], [test "x$INTROSPECTION_MAKEFILE" != x])
 
-# i18 support
 IT_PROG_INTLTOOL(0.40.0)
-
 GETTEXT_PACKAGE=AC_PACKAGE_NAME
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The name of the gettext domain])
@@ -35,10 +34,8 @@ AC_CONFIG_FILES([tests/package.m4.tmp:tests/package.m4.in],
 
 AM_PROG_VALAC([0.14])
 AC_PATH_PROG(VAPIGEN, vapigen, no)
-if test "x$VAPIGEN" == "xno"; then
-  AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
-fi
 AC_SUBST(VAPIGEN)
+AM_CONDITIONAL([VAPI], [test "x$VAPIGEN" != xno])
 
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 AC_SUBST(GLIB_MKENUMS)



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