Skip to content
Snippets Groups Projects
Commit f4562026 authored by yanmorin's avatar yanmorin
Browse files

Refactoring --enable-options code
parent ba908411
No related branches found
No related tags found
No related merge requests found
AC_INIT(aclocal.m4) dnl AC_INIT(aclocal.m4)
AC_INIT(sflphone,0.7,sflphoneteam@savoirfairelinux.com,SFLphone)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
dnl figure out the sflphone version dnl figure out the sflphone version
...@@ -53,19 +53,16 @@ CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" ...@@ -53,19 +53,16 @@ CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
SFLPHONE_CXXFLAGS="" SFLPHONE_CXXFLAGS=""
dnl check for if no is undefined
dnl check also for samplerate for $host ~= *darwin* (mac) only
with_samplerate=no with_samplerate=no
case $host in case $host in
*darwin*) *darwin*)
need_no_undefined=no need_no_undefined=no
AC_CHECK_HEADER([libsamplerate.h], [ AC_CHECK_HEADER([libsamplerate.h], [
AC_CHECK_LIB(samplerate, src_simple, AC_CHECK_LIB(samplerate, src_simple, [with_samplerate=yes], [with_samplerate=no])
[
with_samplerate=yes
], [ with_samplerate=no ]
)
], [ with_samplerate=no ] ], [ with_samplerate=no ]
) )
;; ;;
*-*-cygwin | *-*-mingw* | *-*-pw32*) *-*-cygwin | *-*-mingw* | *-*-pw32*)
...@@ -76,8 +73,8 @@ case $host in ...@@ -76,8 +73,8 @@ case $host in
;; ;;
esac esac
AM_CONDITIONAL(USE_SAMPLERATE, test x$with_samplerate = xyes)
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
AM_CONDITIONAL(USE_SAMPLERATE, test x$with_samplerate = xyes)
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
...@@ -109,8 +106,15 @@ SFLPHONE_LIBS="$SFLPHONE_LIBS $OSIP_LIBS $EXOSIP_LIBS " ...@@ -109,8 +106,15 @@ SFLPHONE_LIBS="$SFLPHONE_LIBS $OSIP_LIBS $EXOSIP_LIBS "
AC_SUBST(SFLPHONE_CXXFLAGS) AC_SUBST(SFLPHONE_CXXFLAGS)
AC_SUBST(SFLPHONE_LIBS) AC_SUBST(SFLPHONE_LIBS)
#speex disable by default... dnl check for speex...
AC_ARG_ENABLE(speex, [ --enable-speex compile with speex codec (default: no) ], with_speex=$enableval, with_speex=no) AC_ARG_ENABLE(speex,
AC_HELP_STRING(
[--enable-speex],
[compile with speex codec @<:@default=no@:>@]
),
[with_speex=$enableval],
[with_speex=no]
)
if test "x$with_speex" = "xyes" ; then if test "x$with_speex" = "xyes" ; then
AC_CHECK_HEADER([speex/speex.h], [ AC_CHECK_HEADER([speex/speex.h], [
...@@ -124,9 +128,17 @@ if test "x$with_speex" = "xyes" ; then ...@@ -124,9 +128,17 @@ if test "x$with_speex" = "xyes" ; then
fi fi
AM_CONDITIONAL(USE_SPEEX, test "x$with_speex" = "xyes" ) AM_CONDITIONAL(USE_SPEEX, test "x$with_speex" = "xyes" )
#zeroconf
AC_ARG_ENABLE(zeroconf, [ --disable-zeroconf don't require libdns_sd (browsing and publishing DNS-SD services will not be possible) ], with_zeroconf=$enableval, with_zeroconf=yes) dnl check for zeroconf (from apple)
if test "$with_zeroconf" = "yes"; then AC_ARG_ENABLE(zeroconf,
AC_HELP_STRING(
[--disable-zeroconf],
[disables libdns_sd (browsing and publishing DNS-SD services will not be possible) @<:@default=no@:>@]
),
[without_zeroconf=$enableval],
[without_zeroconf="no"]
)
if test "x$without_zeroconf" = "xno"; then
AC_MSG_CHECKING(for DNS-SD support) AC_MSG_CHECKING(for DNS-SD support)
save_dnssdtest_LIBS="$LIBS" save_dnssdtest_LIBS="$LIBS"
save_dnssdtest_LDFLAGS="$LDFLAGS" save_dnssdtest_LDFLAGS="$LDFLAGS"
...@@ -159,30 +171,32 @@ CPPFLAGS=$save_dnssdtest_CPPFLAGS ...@@ -159,30 +171,32 @@ CPPFLAGS=$save_dnssdtest_CPPFLAGS
LDFLAGS=$save_dnssdtest_LDFLAGS LDFLAGS=$save_dnssdtest_LDFLAGS
LIBS=$save_dnssdtest_LIBS LIBS=$save_dnssdtest_LIBS
fi fi
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")
dnl datadir directory
sflphone_datadir=$datadir/sflphone sflphone_datadir=$datadir/sflphone
AC_SUBST(sflphone_datadir) AC_SUBST(sflphone_datadir)
dnl maintener code
AC_MSG_CHECKING([whether to enable the maintener code]) AC_MSG_CHECKING([whether to enable the maintener code])
AC_ARG_ENABLE(maintener, AC_ARG_ENABLE(maintener,
[ --enable-maintener Enable maintener code [default=no]], AC_HELP_STRING(
[ [--enable-maintener],
CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER" [enables maintener code @<:@default=no@:>@]
AC_MSG_RESULT(yes) ),
maintener="yes" [with_maintener=$enableval],
], [with_maintener=no]
[
AC_MSG_RESULT(no)
maintener="no"
]
) )
AM_CONDITIONAL(MAINTENER_CODE, test x$maintener = xyes) AM_CONDITIONAL(MAINTENER_CODE, test x$maintener = xyes)
if test "x$maintener" = "xyes"; then
AC_MSG_RESULT(yes)
CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER"
else
AC_MSG_RESULT(no)
fi
dnl QT substitution?
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")
AC_SUBST(LIB_QT) AC_SUBST(LIB_QT)
dnl AC_CONFIG_FILES( dnl AC_CONFIG_FILES(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment