From 1377b2dbf017087e4ef8f8d4e40f34e844c1717b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 5 Feb 2020 19:38:25 +0100 Subject: [PATCH] Add gphoto2 detection using pkg-config. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kipi-plugins/configure.in.in | 29 ++++++++++++++++++--------- kipi-plugins/kameraklient/Makefile.am | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/kipi-plugins/configure.in.in b/kipi-plugins/configure.in.in index 7963aee..809f2e1 100644 --- a/kipi-plugins/configure.in.in +++ b/kipi-plugins/configure.in.in @@ -308,19 +308,30 @@ fi have_gphoto=no if test "x$build_gphoto" != "xno"; then - AC_PATH_PROG(GPHOTO_CONFIG,gphoto2-config) - AC_PATH_PROG(GPHOTO_PORT_CONFIG,gphoto2-port-config) - if test -n "${GPHOTO_CONFIG}"; then - GPHOTO_CFLAGS="`$GPHOTO_CONFIG --cflags`" - AC_SUBST(GPHOTO_CFLAGS) - LIB_GPHOTO="`$GPHOTO_CONFIG --libs` `$GPHOTO_PORT_CONFIG --libs`" - AC_SUBST(LIB_GPHOTO) - have_gphoto=yes + + KDE_PKG_CHECK_MODULES(GPHOTO, libgphoto2, + have_gphoto=yes, have_gphoto=no) + + if test "x$have_gphoto" != "xyes"; then + AC_PATH_PROG(GPHOTO_CONFIG,gphoto2-config) + AC_PATH_PROG(GPHOTO_PORT_CONFIG,gphoto2-port-config) + if test -n "${GPHOTO_CONFIG}"; then + GPHOTO_CFLAGS="`$GPHOTO_CONFIG --cflags`" + AC_SUBST(GPHOTO_CFLAGS) + GPHOTO_LIBS="`$GPHOTO_CONFIG --libs` `$GPHOTO_PORT_CONFIG --libs`" + AC_SUBST(GPHOTO_LIBS) + have_gphoto=yes + fi + fi + + if test "x$have_gphoto" = "xyes"; then AC_CHECK_LIB(gphoto2_port, gp_port_info_get_name, have_gphoto2_5=yes, have_gphoto2_5=no) if test "x$have_gphoto2_5" != "xno"; then AC_DEFINE(HAVE_GPHOTO2_5, 1, [have gphoto 2.5]) fi - else + fi + + if test "x$have_gphoto" != "xyes"; then AC_MSG_WARN([gPhoto2 not found, some plugins will not be compiled.]) fi fi diff --git a/kipi-plugins/kameraklient/Makefile.am b/kipi-plugins/kameraklient/Makefile.am index e6ff049..b5b6c5c 100644 --- a/kipi-plugins/kameraklient/Makefile.am +++ b/kipi-plugins/kameraklient/Makefile.am @@ -6,7 +6,7 @@ METASOURCES = AUTO kde_module_LTLIBRARIES = kipiplugin_kameraklient.la kipiplugin_kameraklient_la_DEPENDENCIES = $(LIBKIPI_LIBS_DEP) -kipiplugin_kameraklient_la_LIBADD = $(LIB_GPHOTO) $(LIBKIPI_LIBS) $(LIB_TDEIO) $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_TQT) +kipiplugin_kameraklient_la_LIBADD = $(GPHOTO_LIBS) $(LIBKIPI_LIBS) $(LIB_TDEIO) $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_TQT) kipiplugin_kameraklient_la_LDFLAGS = $(KIPI_PLUGINS_COMMON_LDFLAGS) -module $(KDE_PLUGIN) $(all_libraries) -lkipiplugins