Commit 1b59c10a authored by Emmanuel Milou's avatar Emmanuel Milou

Clean up the build system; use globals.mak for preprocessor flags

parent 01af0e87
......@@ -113,7 +113,9 @@ AC_HEADER_TIME
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
dnl Check for library functions
dnl ********************************
dnl Check for needed functions
dnl ********************************
AC_FUNC_CHOWN
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
......@@ -130,6 +132,10 @@ 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 *****************************************
dnl Check for exosip2
LP_CHECK_EXOSIP2
SFLPHONE_LIBS="$SFLPHONE_LIBS $EXOSIP_LIBS"
......@@ -137,42 +143,52 @@ SFLPHONE_LIBS="$SFLPHONE_LIBS $EXOSIP_LIBS"
dnl Check for GNU ccRTP
PKG_PROG_PKG_CONFIG
dnl Check for osip parser
LIBOSIP2_OSIPLISTNOPOINTER_MIN_VERSION=3.0.0
PKG_CHECK_MODULES([libosip2], [libosip2 >= ${LIBOSIP2_OSIPLISTNOPOINTER_MIN_VERSION}],
[LIBOSIP2_CFLAGS=""], [LIBOSIP2_CFLAGS="-DLIBOSIP2_WITHPOINTER"])
SIP_CFLAGS="$SIP_CFLAGS $LIBOSIP2_CFLAGS";
AC_SUBST(SIP_CFLAGS)
dnl Check for alsa development package - name: libasound2-dev
LIBASOUND2_MIN_VERSION=1.0
PKG_CHECK_MODULES(alsa, alsa >= ${LIBASOUND2_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libasound2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libasound2_LIBS"
LIBSAMPLERATE_MIN_VERSION=0.1.1
PKG_CHECK_MODULES(samplerate, samplerate >= ${LIBSAMPLERATE_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $samplerate_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $samplerate_LIBS"
PKG_CHECK_MODULES(ALSA, alsa >= ${LIBASOUND2_MIN_VERSION})
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
dnl Check for pulseaudio development package - name: libpulse-dev
LIBPULSE_MIN_VERSION=0.9.6
PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION})
AC_SUBST(PULSEAUDIO_LIBS)
AC_SUBST(PULSEAUDIO_CFLAGS)
dnl Check for the samplerate development package - name: libsamplerate0-dev
LIBSAMPLERATE_MIN_VERSION=0.1.2
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION})
AC_SUBST(SAMPLERATE_LIBS)
AC_SUBST(SAMPLERATE_CFLAGS)
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccgnu2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libccgnu2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccgnu2_LIBS"
PKG_CHECK_MODULES(CCGNU2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
AC_SUBST(CCGNU2_LIBS)
AC_SUBST(CCGNU2_FLAGS)
LIBCCEXT2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccext2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libccext2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccext2_LIBS"
PKG_CHECK_MODULES(CCEXT2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
AC_SUBST(CCEXT2_LIBS)
AC_SUBST(CCEXT2_CFLAGS)
LIBCCRT_MIN_VERSION=1.3.0
PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libccrtp1_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS"
PKG_CHECK_MODULES(CCRTP, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
AC_SUBST(CCRTP_LIBS)
AC_SUBST(CCRTP_CFLAGS)
LIBDBUSCPP_MIN_VERSION=0.5
PKG_CHECK_MODULES(libdbuscpp, dbus-c++-1 >= ${LIBDBUSCPP_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libdbuscpp_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libdbuscpp_LIBS"
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1 >= ${LIBDBUSCPP_MIN_VERSION})
AC_SUBST(DBUSCPP_LIBS)
AC_SUBST(DBUSCPP_CFLAGS)
dnl Check for libcppunit-dev
CPPUNIT_MIN_VERSION=1.12
PKG_CHECK_MODULES(CPPUNIT, cppunit >= ${CPPUNIT_MIN_VERSION})
AC_SUBST(CPPUNIT_LIBS)
......
src = $(top_srcdir)
AM_CPPFLAGS = -I$(src)/libs -I$(src)/src -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS) $(IAX_FLAGS) $(SFLPHONE_CFLAGS) $(SIP_CFLAGS)
# Global variables
src=$(top_srcdir)
sflcodecdir=$(libdir)/sflphone/codecs
# Preprocessor flags
AM_CPPFLAGS = \
-I$(src)/libs \
-I$(src)/src \
-DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/sflphone\" \
$(ZEROCONFFLAGS) \
$(IAX_FLAGS) \
@SIP_CFLAGS@ \
@DBUSCPP_CFLAGS@ \
-DCODECS_DIR=\""$(sflcodecdir)"\" \
-DENABLE_TRACE
sflcodecdir = $(libdir)/sflphone/codecs
include ../globals.mak
bin_PROGRAMS = sflphoned
......@@ -14,53 +14,76 @@ endif
if USE_IAX
# Use the global instead of locally built
#IAX_LIBS =
IAX_FLAGS = -DUSE_IAX
#IAX_CFLAGS = -I$(top_srcdir)/libs/libiax2/src/
IAX_CFLAGS =
IAXSOURCES = iaxaccount.cpp iaxvoiplink.cpp iaxcall.cpp
IAXHEADERS = iaxaccount.h iaxvoiplink.h iaxcall.h
else
IAX_LIBS =
IAX_FLAGS =
IAX_CFLAGS =
IAXSOURCES =
IAXHEADERS =
endif
ALSAFLAG= -lasound
PULSEAUDIO_LIBS=-lpulse
SUBDIRS = audio config dbus $(ZEROCONFDIR)
SUBDIRS = audio config dbus $(ZEROCONFDIR) #contact memmanager video mixer
sflphoned_SOURCES = eventthread.cpp main.cpp voiplink.cpp \
managerimpl.cpp observer.cpp samplerateconverter.cpp \
account.cpp sipaccount.cpp accountcreator.cpp \
sipvoiplink.cpp call.cpp sipcall.cpp \
# Add here the cpp files to be build with sflphone
sflphoned_SOURCES = \
eventthread.cpp \
main.cpp \
voiplink.cpp \
managerimpl.cpp \
observer.cpp \
samplerateconverter.cpp \
account.cpp \
sipaccount.cpp \
accountcreator.cpp \
sipvoiplink.cpp \
call.cpp \
sipcall.cpp \
$(IAXSOURCES)
sflphoned_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(ZEROCONFFLAGS) $(IAX_FLAGS) $(SFLPHONE_CFLAGS) $(SIP_CFLAGS)
sflphoned_CXXFLAGS = \
-DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" \
$(ZEROCONFFLAGS) \
$(IAX_FLAGS)
sflphoned_LDADD = ./libsflphone.la $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) $(EXOSIP_LIBS) $(ALSAFLAG) $(PULSEAUDIO_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs $(libccext2_CFLAGS) $(libccgnu2_CFLAGS) $(IAX_CFLAGS) $(USER_INCLUDES) $(libdbuscpp_CFLAGS) \
-DCODECS_DIR=\""$(sflcodecdir)"\"
-DENABLE_TRACE
# Add here the dynamic libraries sflphoned should be linked against
sflphoned_LDADD = \
./libsflphone.la \
@CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \
$(ZEROCONFLIB) \
$(IAX_LIBS) \
$(EXOSIP_LIBS) \
@DBUSCPP_LIBS@ \
@CCRTP_LIBS@ \
@ALSA_LIBS@ \
@PULSEAUDIO_LIBS@ \
@SAMPLERATE_LIBS@
noinst_LTLIBRARIES = libsflphone.la
# libsflphone_la_LDFLAGS= -version-info 0:1:0
noinst_HEADERS = \
managerimpl.h \
manager.h \
global.h \
observer.h \
eventthread.h \
user_cfg.h \
voiplink.h \
samplerateconverter.h \
account.h \
sipaccount.h \
accountcreator.h \
sipvoiplink.h \
call.h \
sipcall.h
libsflphone_la_LIBADD = \
$(top_builddir)/libs/stund/libstun.la \
$(top_builddir)/libs/utilspp/libutilspp.la \
$(src)/libs/stund/libstun.la \
$(src)/libs/utilspp/libutilspp.la \
./audio/libaudio.la \
./dbus/libdbus.la \
./config/libconfig.la \
$(IAX_LIBS)
libsflphone_la_SOURCES =
noinst_LTLIBRARIES = libsflphone.la
noinst_HEADERS = managerimpl.h manager.h global.h observer.h eventthread.h user_cfg.h \
voiplink.h samplerateconverter.h \
account.h sipaccount.h accountcreator.h \
sipvoiplink.h call.h sipcall.h \
$(IAXHEADERS)
include $(top_srcdir)/globals.mak
sflcodecdir = $(libdir)/sflphone/codecs
noinst_LTLIBRARIES = libaudio.la
if BUILD_SPEEX
......@@ -24,16 +22,40 @@ endif
SUBDIRS = codecs
libaudio_la_SOURCES = audiofile.cpp tonelist.cpp \
audiortp.cpp audiostream.cpp dtmf.cpp tone.cpp alsalayer.cpp pulselayer.cpp audiodevice.cpp dtmfgenerator.cpp \
tonegenerator.cpp codecDescriptor.cpp samplecache.cpp\
audioloop.cpp ringbuffer.cpp $(SPEEX_SOURCES_CPP)
AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libs $(libccext2_CFLAGS) $(libdbuscpp_CFLAGS) $(libccrtp1_CFLAGS) $(USER_INCLUDES) \
-DCODECS_DIR=\""$(sflcodecdir)"\" $(SPEEX_FLAG) $(GSM_FLAG) $(ILBC_FLAG)
noinst_HEADERS = audioloop.h audiostream.h common.h ringbuffer.h audiofile.h \
tonelist.h audiortp.h audiolayer.h alsalayer.h pulselayer.h audiodevice.h \
dtmfgenerator.h tonegenerator.h samplecache.h \
codecDescriptor.h dtmf.h tone.h
libaudio_la_SOURCES = \
audiofile.cpp \
tonelist.cpp \
audiortp.cpp \
audiostream.cpp \
dtmf.cpp \
tone.cpp \
alsalayer.cpp \
pulselayer.cpp \
audiodevice.cpp \
dtmfgenerator.cpp \
tonegenerator.cpp \
codecDescriptor.cpp \
samplecache.cpp \
audioloop.cpp \
ringbuffer.cpp \
$(SPEEX_SOURCES_CPP)
noinst_HEADERS = \
audioloop.h \
audiostream.h \
common.h \
ringbuffer.h \
audiofile.h \
tonelist.h \
audiortp.h \
audiolayer.h \
alsalayer.h \
pulselayer.h \
audiodevice.h \
dtmfgenerator.h \
tonegenerator.h \
samplecache.h \
codecDescriptor.h \
dtmf.h \
tone.h
sflcodecdir = $(libdir)/sflphone/codecs
include $(top_srcdir)/globals.mak
if BUILD_GSM
GSM_LIB = libcodec_gsm.so
libcodec_gsm_so_SOURCES = gsmcodec.cpp
......
SUBDIRS =
include $(top_srcdir)/globals.mak
EXTRA_DIST = *.xml README
......@@ -12,7 +12,7 @@ libdbus_la_SOURCES = \
dbusmanagerimpl.cpp
libdbus_la_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\"
libdbus_la_CPPFLAGS = -I$(top_srcdir)/libs -I$(top_srcdir)/src $(libccext2_CFLAGS) $(libdbuscpp_CFLAGS)
libdbus_la_LIBADD =
noinst_HEADERS = \
......
......@@ -2,24 +2,35 @@ include ../globals.mak
bin_PROGRAMS = configurationTester
#ALSAFLAG= -lasound
PULSEAUDIO_LIBS=-lpulse
OBJECT_FILES= \
../src/sflphoned-managerimpl.o \
../src/sflphoned-accountcreator.o \
../src/sflphoned-call.o \
../src/sflphoned-sipcall.o \
../src/sflphoned-iaxcall.o \
../src/sflphoned-voiplink.o \
../src/sflphoned-sipvoiplink.o \
../src/sflphoned-iaxvoiplink.o \
../src/sflphoned-account.o \
../src/sflphoned-sipaccount.o \
../src/sflphoned-iaxaccount.o \
../src/sflphoned-eventthread.o \
../src/sflphoned-samplerateconverter.o
configurationTester_SOURCES = configurationTest.cpp \
TestMain.cpp
configurationTester_SOURCES = \
configurationTest.cpp \
TestMain.cpp
configurationTester_LDADD = ../src/libsflphone.la \
$(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) $(EXOSIP_LIBS) @ALSA_LIBS@ $(PULSEAUDIO_LIBS) @CPPUNIT_LIBS@ \
../src/sflphoned-managerimpl.o \
../src/sflphoned-accountcreator.o \
../src/sflphoned-call.o \
../src/sflphoned-sipcall.o \
../src/sflphoned-iaxcall.o \
../src/sflphoned-voiplink.o \
../src/sflphoned-sipvoiplink.o \
../src/sflphoned-iaxvoiplink.o \
../src/sflphoned-account.o \
../src/sflphoned-sipaccount.o \
../src/sflphoned-iaxaccount.o \
../src/sflphoned-eventthread.o \
../src/sflphoned-samplerateconverter.o
configurationTester_LDADD = \
../src/libsflphone.la \
$(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) $(IAX_LIBS) $(EXOSIP_LIBS) \
@ALSA_LIBS@ \
@PULSEAUDIO_LIBS@ \
@CPPUNIT_LIBS@ \
@CCEXT2_LIBS@ \
@CCGNU2_LIBS@ \
@CCRTP_LIBS@ \
@DBUSCPP_LIBS@ \
@SAMPLERATE_LIBS@ \
$(OBJECT_FILES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment