first step to make gammu dependency optional

This commit is contained in:
Sergey Popov 2012-11-12 12:24:58 +04:00
parent 430a17e06a
commit da5e8d0353
2 changed files with 15 additions and 4 deletions

View File

@ -15,7 +15,6 @@ AM_PROG_CC_C_O
LT_INIT LT_INIT
# Checks for libraries. # Checks for libraries.
PKG_CHECK_MODULES([gammu], [gammu >= 1.0])
PKG_CHECK_MODULES([libconfuse], [libconfuse >= 2.0]) PKG_CHECK_MODULES([libconfuse], [libconfuse >= 2.0])
# Checks for header files. # Checks for header files.
@ -36,6 +35,18 @@ if test "${enable_daemon}" = "no";then
DAEMON="" DAEMON=""
else else
DAEMON="daemon" DAEMON="daemon"
AC_ARG_WITH(gammu, [ --without-gammu do not use Gammu in daemon])
if test "${with_gammu}" != "no"; then
GAMMU=""
PKG_CHECK_MODULES([gammu], [gammu >= 1.0])
AC_CHECK_LIB([Gammu], [main],
[
AC_DEFINE([HAVE_LIBGAMMU], [1], [Define if you have libGammu])
GAMMU=${gammu_LIBS}
])
AC_SUBST(GAMMU)
fi
fi fi
AC_SUBST(DAEMON) AC_SUBST(DAEMON)

View File

@ -1,7 +1,7 @@
lib_LTLIBRARIES = libyasnd.la lib_LTLIBRARIES = libyasnd.la
libyasnd_la_SOURCES = libyasnd.c yasnd-gammu.c yasnd-log.c yasnd-lpt.c libyasnd_la_SOURCES = libyasnd.c yasnd-gammu.c yasnd-log.c yasnd-lpt.c
libyasnd_la_CPPFLAGS = -I$(top_srcdir) ${gammu_CFLAGS} libyasnd_la_CPPFLAGS = -I$(top_srcdir) ${gammu_CFLAGS}
libyasnd_la_LIBADD = ${gammu_LIBS} libyasnd_la_LIBADD = @GAMMU@
distclean-local: distclean-local:
rm -f Makefile.in &>/dev/null rm -f Makefile.in &>/dev/null