[gnome-autoar] Remove unused CFLAGS and LIBS. Allow using libarchive without a pc file.



commit ace549c774b91f1a92f7d172f2dbf6641733b0e4
Author: Ting-Wei Lan <lantw44 gmail com>
Date:   Wed Jan 22 14:54:40 2014 +0800

    Remove unused CFLAGS and LIBS. Allow using libarchive without a pc file.
    
    Unused CFLAGS and LIBS may cause strange error in some system. FreeBSD system
    libarchive does not have a pc file installed. Use AC_SEARCH_LIBS to find it,
    so FreeBSD users do not have to install libarchive from ports.

 Makefile.am                |   12 +++++++++---
 configure.ac               |   11 ++++++++---
 docs/reference/Makefile.am |    2 --
 3 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index cb46bfb..0430124 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,12 +66,17 @@ gnome_autoar_libgnome_autoar_la_CPPFLAGS = \
        $(AM_CPPFLAGS)                          \
        $(NULL)
 gnome_autoar_libgnome_autoar_la_CFLAGS = \
-       $(DEPENDENCIES_CFLAGS)                  \
+       $(GTK_CFLAGS)                           \
+       $(GIO_CFLAGS)                           \
+       $(LIBARCHIVE_CFLAGS)                    \
        -I$(top_srcdir)                         \
        -I$(top_builddir)/gnome-autoar          \
        $(AM_CFLAGS)                            \
        $(NULL)
 gnome_autoar_libgnome_autoar_la_LIBADD = \
+       $(GTK_LIBS)                             \
+       $(GIO_LIBS)                             \
+       $(LIBARCHIVE_LIBS)                      \
        $(DEPENDENCIES_LIBS)                    \
        $(NULL)
 
@@ -131,14 +136,15 @@ noinst_PROGRAMS = \
        $(NULL)
 
 test_cflags = \
-       $(DEPENDENCIES_CFLAGS)  \
+       $(GTK_CFLAGS)           \
+       $(GIO_CFLAGS)           \
+       $(LIBARCHIVE_CFLAGS)    \
        -I$(top_srcdir)         \
        $(AM_CFLAGS)            \
        $(NULL)
 
 test_libs = \
        $(top_builddir)/gnome-autoar/libgnome-autoar.la \
-       $(DEPENDENCIES_LIBS)    \
        $(NULL)
 
 tests_test_extract_SOURCES = tests/test-extract.c
diff --git a/configure.ac b/configure.ac
index 4b076b3..87c4d85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,14 +37,19 @@ GOBJECT_INTROSPECTION_CHECK([1.30.0])
 GLIB_REQUIRED=2.35.6
 GTK_REQUIRED=3.2
 LIBARCHIVE_REQUIRED=3.1.0
-PKG_CHECK_MODULES([DEPENDENCIES], [
+
+PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= $LIBARCHIVE_REQUIRED], [],
+                  [AC_SEARCH_LIBS([archive_read_new], [archive], [],
+                  [AC_MSG_ERROR([libarchive not found])])])
+
+PKG_CHECK_MODULES([GIO], [
         glib-2.0    >= $GLIB_REQUIRED
         gobject-2.0 >= $GLIB_REQUIRED
         gio-2.0     >= $GLIB_REQUIRED
-        gtk+-3.0    >= $GTK_REQUIRED
-        libarchive  >= $LIBARCHIVE_REQUIRED
         ])
 
+PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQUIRED])
+
 AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
 AC_SUBST([AM_CPPFLAGS])
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 4f06d44..3f83fa7 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -20,12 +20,10 @@ IGNORE_HFILES = \
 
 GTKDOC_CFLAGS = \
        -I$(top_srcdir) \
-       -I$(DEPENDENCIES_CFLAGS) \
        $(NULL)
 
 GTKDOC_LIBS = \
        $(top_builddir)/gnome-autoar/libgnome-autoar.la \
-       $(DEPENDENCIES_LIBS) \
        $(NULL)
 
 # This includes the standard gtk-doc make rules, copied by gtkdocize.


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