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
# Checks for libraries.
PKG_CHECK_MODULES([gammu], [gammu >= 1.0])
PKG_CHECK_MODULES([libconfuse], [libconfuse >= 2.0])
# Checks for header files.
@ -33,9 +32,21 @@ AC_FUNC_MALLOC
# Checks for optional features
AC_ARG_ENABLE(daemon, [ --disable-daemon do not build daemon])
if test "${enable_daemon}" = "no";then
DAEMON=""
DAEMON=""
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
AC_SUBST(DAEMON)

View File

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