[gnome-autoar] Do not add libarchive to Requires when libarchive.pc is not available



commit 1f0ae049a1ea3bed2dabf502f71a760f9ede50b9
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Wed Aug 27 01:57:34 2014 +0800

    Do not add libarchive to Requires when libarchive.pc is not available

 configure.ac                    |    8 ++++++--
 gnome-autoar/gnome-autoar.pc.in |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 83ca1a5..c87a13a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,8 +39,12 @@ GLIB_REQUIRED=2.35.6
 GTK_REQUIRED=3.2
 LIBARCHIVE_REQUIRED=3.1.0
 
-PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= $LIBARCHIVE_REQUIRED], [],
-                  [AC_SEARCH_LIBS([archive_read_new], [archive], [],
+PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= $LIBARCHIVE_REQUIRED],
+                  [GNOME_AUTOAR_LIBARCHIVE_REQUIRES="libarchive"
+                   AC_SUBST([GNOME_AUTOAR_LIBARCHIVE_REQUIRES])],
+                  [AC_SEARCH_LIBS([archive_read_new], [archive],
+                  [GNOME_AUTOAR_LIBARCHIVE_LIBS="-larchive"
+                   AC_SUBST([GNOME_AUTOAR_LIBARCHIVE_LIBS])],
                   [AC_MSG_ERROR([libarchive not found])])])
 
 PKG_CHECK_MODULES([GIO], [
diff --git a/gnome-autoar/gnome-autoar.pc.in b/gnome-autoar/gnome-autoar.pc.in
index 6d61605..1d59d03 100644
--- a/gnome-autoar/gnome-autoar.pc.in
+++ b/gnome-autoar/gnome-autoar.pc.in
@@ -6,6 +6,6 @@ includedir= includedir@
 Name: gnome-autoar
 Description: Archives integration support for GNOME
 Version: @VERSION@
-Requires: gio-2.0 gobject-2.0 glib-2.0 libarchive
-Libs: -L${libdir} -lgnome-autoar
+Requires: gio-2.0 gobject-2.0 glib-2.0 @GNOME_AUTOAR_LIBARCHIVE_REQUIRES@
+Libs: -L${libdir} -lgnome-autoar @GNOME_AUTOAR_LIBARCHIVE_LIBS@
 Cflags: -I${includedir}


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