diff --git a/sflphone-common/configure.ac b/sflphone-common/configure.ac index 63ec0cc3d..bf06147a0 100644 --- a/sflphone-common/configure.ac +++ b/sflphone-common/configure.ac @@ -53,7 +53,7 @@ AC_CONFIG_FILES([src/Makefile \ src/plug-in/Makefile \ src/plug-in/test/Makefile \ src/hooks/Makefile \ - src/history/Makefile]) + src/history/Makefile]) dnl Unitary test section AC_CONFIG_FILES([test/Makefile]) @@ -66,20 +66,6 @@ AC_CONFIG_FILES([doc/Makefile \ doc/dbus-api/Makefile \ doc/doxygen/Makefile]) -dnl the file stamp-h.in should be there before (instead of AC_CONFIG_HEADERS(config.h)) -dnl AC_CONFIG_HEADERS([config.h]) - -dnl Settings need Standard C++ Library -LIBS="$LIBS -lstdc++" - -dnl Solaris pkgadd support definitions -PKGADD_PKG="SFLphone" -PKGADD_NAME="SFLphone - a SIP client and daemon" -PKGADD_VENDOR="http://www.sflphone.org/" -AC_SUBST(PKGADD_PKG) -AC_SUBST(PKGADD_NAME) -AC_SUBST(PKGADD_VENDOR) - dnl Check for programs AC_PROG_CC AC_PROG_CXX @@ -91,42 +77,38 @@ AC_PROG_MAKE_SET dnl will have to remove this LT_INIT - dnl Define C++ as default language +dnl Define C++ as default language AC_LANG(C++) - dnl Setup C++ compiler flags - CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $USER_INCLUDES -g -Wno-return-type" - dnl CXXFLAGS="$USE_EXCEPTIONS $USER_INCLUDES -O0 -g -Wno-return-type" +dnl Check for header files +AC_FUNC_ALLOCA +AC_HEADER_STDC +AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h malloc.h \ + memory.h netdb.h netinet/in.h stdlib.h string.h strings.h \ + sys/ioctl.h sys/socket.h sys/time.h unistd.h utime.h ostream]) - dnl Check for header files - AC_FUNC_ALLOCA - AC_HEADER_STDC - AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h malloc.h \ - memory.h netdb.h netinet/in.h stdlib.h string.h strings.h \ - sys/ioctl.h sys/socket.h sys/time.h unistd.h utime.h ostream]) - - dnl Check for typedefs, structures, and compiler characteristics - AC_HEADER_STAT - AC_HEADER_STDBOOL - AC_C_CONST - AC_C_INLINE - AC_TYPE_PID_T - AC_TYPE_SIZE_T - AC_HEADER_TIME - AC_C_VOLATILE +dnl Check for typedefs, structures, and compiler characteristics +AC_HEADER_STAT +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_C_VOLATILE AC_CHECK_TYPES([ptrdiff_t]) - dnl ******************************** - dnl Check for needed functions - dnl ******************************** - AC_FUNC_CHOWN - AC_FUNC_ERROR_AT_LINE - AC_FUNC_FORK - AC_PROG_GCC_TRADITIONAL - AC_FUNC_MALLOC - AC_FUNC_MEMCMP - AC_FUNC_REALLOC - AC_FUNC_SELECT_ARGTYPES +dnl ******************************** +dnl Check for needed functions +dnl ******************************** +AC_FUNC_CHOWN +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void. Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( @@ -146,37 +128,28 @@ AC_CHECK_FUNCS([bzero floor gethostbyname gethrtime gettimeofday \ inet_ntoa memset mkdir pathconf pow regcomp select setlocale socket \ strchr strdup strerror strrchr strstr strtol utime]) -dnl ***************************************** -dnl Check for header files -dnl ***************************************** -SFLPHONE_LIBS="$SFLPHONE_LIBS" - dnl Check for GNU ccRTP PKG_PROG_PKG_CONFIG -#Trying to set PJSIP using pkg-config -#PKG_CHECK_MODULES(SIP, libpj-sfl, have_libpj=true, have_libpj=false) -#if test "x${have_libpj}" = "xfalse" ; then -# AC_MSG_ERROR([PJSIP not found. http://www.pjsip.org/download.htm]) -#fi -#AC_SUBST(SIP_CFLAGS) +dnl Trying to set PJSIP using pkg-config +dnl PKG_CHECK_MODULES(SIP, libpj-sfl, have_libpj=true, have_libpj=false) +dnl if test "x${have_libpj}" = "xfalse" ; then +dnl AC_MSG_ERROR([PJSIP not found. http://www.pjsip.org/download.htm]) +dnl fi +dnl AC_SUBST(SIP_CFLAGS) -dnl Check for uuid development package - name: uuid-dev -dnl PKG_CHECK_MODULES(UUID, uuid >= ${UUID_MIN_VERSION}) -dnl AC_SUBST(UUID_CFLAGS) -dnl AC_SUBST(UUID_LIBS) +dnl Check for uuid development package - name: uuid-dev UUID_MIN_VERSION=1.0 PKG_CHECK_MODULES(UUID, uuid >= ${UUID_MIN_VERSION}, HAVE_UUID=true, HAVE_UUID=false); LIBCRYPTO_MIN_VERSION=1.0 PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= ${LIBCRYPTO_MIN_VERSION}, HAVE_LIBCRYPTO=true, HAVE_LIBCRYPTO=false); -dnl Check for alsa development package - name: libasound2-dev +dnl Check for alsa development package - name: libasound2-dev ALSA_MIN_VERSION=1.0 PKG_CHECK_MODULES(ALSA, alsa >= ${ALSA_MIN_VERSION},, AC_MSG_ERROR([Missing alsa development package: libasound2-dev or alsa-lib-devel])) -dnl Check for pulseaudio development package - name: libpulse-dev - +dnl Check for pulseaudio development package - name: libpulse-dev LIBPULSE_MIN_VERSION=0.9.15 PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION},, AC_MSG_ERROR([Missing pulseaudio development package: libpulse-dev])) @@ -201,7 +174,7 @@ LIBZRTPCPP_MIN_VERSION=1.3.0 PKG_CHECK_MODULES(ZRTPCPP, libzrtpcpp >= ${LIBZRTPCPP_MIN_VERSION},, AC_MSG_ERROR([Missing zrtp development package: libzrtpcpp-dev])) dnl DBus-C++ detection -dnl pkg-config doesn't like 0.6.0-pre1 version number, it assumes that it is +dnl pkg-config doesn't like 0.6.0-pre1 version number, it assumes that it is dnl more recent than (unreleased) 0.6.0 DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1 PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, @@ -210,24 +183,17 @@ PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_ARG_WITH(debug, AS_HELP_STRING( [--with-debug], - [Set 'full' to enable debugging information @<:@default=no@:>@] + [Set to enable debugging information @<:@default=no@:>@] ), - [with_debug=${withval}], - [with_debug=no] + [CXXFLAGS="-g -O0"], + [CXXFLAGS="-O2"] ) - if test "x$with_debug" = "xfull" -o "x$with_debug" = "xyes"; then - CXXFLAGS="$USE_EXCEPTIONS $USER_INCLUDES -g -O0 -Wno-return-type" - else - CXXFLAGS="-g -Wall -O2" - fi AC_CHECK_LIB([expat], XML_ParserCreate_MM, [AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)], have_expat=false) -if ! $have_expat; then -AC_MSG_ERROR([libexpat development files missing]) -fi +test "$have_expat" = false && AC_MSG_ERROR([libexpat development files missing]) xml_CFLAGS= xml_LIBS=-lexpat @@ -239,13 +205,10 @@ AC_CHECK_LIB([yaml], yaml_parser_initialize, [AC_CHECK_HEADERS(yaml.h, have_yaml=true, have_yaml=false)], have_yaml=false) -if test "$have_yaml" = "false"; then -AC_MSG_ERROR([libyaml development files missing]) -fi +test "$have_yaml" = "false" && AC_MSG_ERROR([libyaml development files missing]) yaml_CFLAGS= yaml_LIBS=-lyaml - AC_SUBST(yaml_CFLAGS) AC_SUBST(yaml_LIBS) @@ -253,22 +216,18 @@ AC_CHECK_LIB([pthread], pthread_create, [AC_CHECK_HEADERS(pthread.h, have_pthread=true, have_pthread=false)], have_pthread=false) - if test "$have_pthread" = "false"; then -AC_MSG_ERROR([You need the POSIX Thread library (pthreads)]) - fi +test "$have_pthread" = "false" && AC_MSG_ERROR([You need the POSIX Thread library (pthreads)]) AC_CHECK_LIB([pcre], pcre_free, [AC_CHECK_HEADERS(pcre.h, have_pcre=true, have_pcre=false)], have_pcre=false) - if test "$have_pcre" = "false"; then -AC_MSG_ERROR([You need the Perl-Compatible Regular Expressions library (pcre)]) - fi +test "$have_pcre" = "false" && AC_MSG_ERROR([You need the Perl-Compatible Regular Expressions library (pcre)]) - PCRE_LIBS=-lpcre - PCRE_CFLAGS= - AC_SUBST(PCRE_LIBS) +PCRE_LIBS=-lpcre +PCRE_CFLAGS= +AC_SUBST(PCRE_LIBS) AC_SUBST(PCRE_CFLAGS) dnl Check for libcppunit-dev @@ -311,16 +270,15 @@ AS_IF([test "x$with_speex" != xno], [AC_MSG_FAILURE([libspeex link test failed. You may use --without-speex to compile without speex codec support.])]) ]) -AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex]) +AC_DEFINE_UNQUOTED([HAVE_SPEEX], `if test "x$with_speex" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libspeex]) AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" ) dnl check in case the libspeexdsp is not installed AC_CHECK_HEADER([speex/speex_preprocess.h], , AC_MSG_FAILURE([Unable to find the libspeexdsp headers (you may need to install the libspeexdsp-dev package) used for Noise Suppression and Automatic Gain Control.])) AC_CHECK_LIB(speexdsp, speex_preprocess_run, [], [], []) -AM_CONDITIONAL(ENABLE_SPEEXDSP, test "x$HAVE_SPEEXDSP" = xyes) -# check for libcelt +# check for libcelt AC_ARG_WITH([celt], [AS_HELP_STRING([--without-celt], [disable support for celt codec])], @@ -328,12 +286,12 @@ AC_ARG_WITH([celt], [with_celt=yes]) AS_IF([test "x$with_celt" != xno], - PKG_CHECK_MODULES(CELT, celt >= 0.9.1, + PKG_CHECK_MODULES(CELT, celt >= 0.9.1, [ with_celt_91=yes; AC_MSG_NOTICE([Using celt 0.9.1]); AC_SUBST(BUILD_CELT_91) - ], + ], [ - PKG_CHECK_MODULES(CELT, celt >= 0.7.1, [with_celt_71=yes; AC_MSG_NOTICE([Using celt 0.7.1]); AC_SUBST(BUILD_CELT_71)], AC_MSG_FAILURE([libcelt link test failed. You may use --without-celt to compile without celt codec support.])) + PKG_CHECK_MODULES(CELT, celt >= 0.7.1, [with_celt_71=yes; AC_MSG_NOTICE([Using celt 0.7.1]); AC_SUBST(BUILD_CELT_71)], AC_MSG_FAILURE([libcelt link test failed. You may use --without-celt to compile without celt codec support.])) ]) ) @@ -365,55 +323,41 @@ AM_CONDITIONAL(USE_NETWORKMANAGER, test "x$with_networkmanager" = "xyes" ) # check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/ # ---------------------------------------------------------------------------- AC_DEFUN([BB_ENABLE_DOXYGEN], - [ - AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)]) - AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)]) - AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes]) - AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no]) - if test "x$enable_doxygen" = xno; then - enable_doc=no - else - AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) - if test x$DOXYGEN = x; then - if test "x$enable_doxygen" = xyes; then - AC_MSG_ERROR([could not find doxygen]) - fi - enable_doc=no - else - enable_doc=yes - AC_PATH_PROG(DOT, dot, , $PATH) - fi - fi - AM_CONDITIONAL(DOC, test x$enable_doc = xyes) + [ + AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)]) + AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)]) + AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes]) + AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no]) + if test "x$enable_doxygen" = xno; then + enable_doc=no + else + AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) + if test x$DOXYGEN = x; then + test "x$enable_doxygen" = xyes && AC_MSG_ERROR([could not find doxygen]) + enable_doc=no + else + enable_doc=yes + AC_PATH_PROG(DOT, dot, , $PATH) + fi + fi + AM_CONDITIONAL(DOC, test x$enable_doc = xyes) if test x$DOT = x; then - if test "x$enable_dot" = xyes; then - AC_MSG_ERROR([could not find dot]) - fi - enable_dot=no + test "x$enable_dot" = xyes && AC_MSG_ERROR([could not find dot]) + enable_dot=no else - enable_dot=yes + enable_dot=yes fi AM_CONDITIONAL(ENABLE_DOXYGEN, test x$enable_doc = xtrue) AC_SUBST(enable_dot) AC_SUBST(enable_html_docs) AC_SUBST(enable_latex_docs) - ]) - # Acutally perform the doxygen check - BB_ENABLE_DOXYGEN +]) - dnl Datadir directory - sflphone_datadir=$datadir/sflphone - AC_SUBST(sflphone_datadir) - - dnl Dbus Service activation part - DBUS_SERVICES_DIR="$datadir/dbus-1/services" - AC_SUBST(DBUS_SERVICES_DIR) - AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is]) +# Acutally perform the doxygen check +BB_ENABLE_DOXYGEN # Go! - AC_SUBST(SFLPHONE_CFLAGS) - AC_SUBST(SFLPHONE_LIBS) - AC_OUTPUT +AC_OUTPUT - AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject) has already been compiled. Run `make' to build the software.]]) +AC_MSG_NOTICE([[Configuration done! Please make sure that pjsip library (libs/pjproject) has already been compiled. Run `make' to build the software.]]) diff --git a/sflphone-common/src/audio/Makefile.am b/sflphone-common/src/audio/Makefile.am index aaee088c6..488f11eb3 100644 --- a/sflphone-common/src/audio/Makefile.am +++ b/sflphone-common/src/audio/Makefile.am @@ -4,10 +4,6 @@ noinst_LTLIBRARIES = libaudio.la SUBDIRS = codecs audiortp sound alsa pulseaudio -# if ENABLE_SPEEXDSP -# SPEEXDSP=-DHAVE_SPEEXDSP_LIB -# endif - libaudio_la_SOURCES = \ audioloop.cpp \ ringbuffer.cpp \ diff --git a/sflphone-common/src/dbus/Makefile.am b/sflphone-common/src/dbus/Makefile.am index a5658aad9..41ee79d46 100644 --- a/sflphone-common/src/dbus/Makefile.am +++ b/sflphone-common/src/dbus/Makefile.am @@ -40,7 +40,7 @@ noinst_HEADERS = \ $(BUILT_SOURCES) # Dbus service file -servicedir = $(DBUS_SERVICES_DIR) +servicedir = $(datadir)/dbus-1/services service_in_files = org.sflphone.SFLphone.service.in service_DATA = $(service_in_files:.service.in=.service)