1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([linphone],[3.2.99.1],[linphone-developers@nongnu.org])
6 dnl Source packaging numbers
8 LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
9 LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
10 LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
11 LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
14 LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
15 if test "$LINPHONE_EXTRA_VERSION" != "" ;then
16 LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
18 LIBLINPHONE_SO_VERSION=`expr $LINPHONE_MINOR_VERSION + $LINPHONE_MAJOR_VERSION`:$LINPHONE_MICRO_VERSION:$LINPHONE_MINOR_VERSION
20 AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
21 AC_SUBST(LINPHONE_VERSION)
23 AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION A full featured audio/video sip phone.])
24 AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
26 AM_INIT_AUTOMAKE([tar-ustar])
27 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
28 AC_CONFIG_HEADER(config.h)
29 AC_CONFIG_MACRO_DIR([m4])
40 CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
41 CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
42 LIBS="$LIBS -lws2 -liphlpapi"
47 CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
48 CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
51 CONSOLE_FLAGS="-mconsole"
55 dnl use macport installation
56 ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
60 AC_SUBST(ACLOCAL_MACOS_FLAGS)
61 AC_SUBST(CONSOLE_FLAGS)
64 dnl localization tools
65 ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL])
66 dnl Initialize libtool
74 AC_CONFIG_COMMANDS([libtool-hacking],[
75 if test "$mingw_found" = "yes" ; then
76 echo "Hacking libtool to work with mingw..."
77 sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
78 cp -f ./libtool.tmp ./libtool
81 ],[mingw_found=$mingw_found])
83 dnl Add the languages which your application supports here.
85 ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN"
87 AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
89 if test "$mingw_found" != "yes" ; then
90 dnl gettext macro does not work properly under mingw.
91 AM_GNU_GETTEXT([external])
94 if test "$mingwce_found" != "yes" ; then
95 AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
96 AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
97 LIBS="$LIBS -L/usr/lib -lintl"
99 dnl gettext macro does not work properly under mingw.
100 AM_GNU_GETTEXT([external])
101 LIBS="$LIBS $LIBINTL"
105 GETTEXT_PACKAGE=linphone
106 AC_SUBST(GETTEXT_PACKAGE)
107 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
108 AC_CHECK_LIB(intl,libintl_gettext)
110 AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
112 dnl conditionnal build of console interface.
113 AC_ARG_ENABLE(console_ui,
114 [ --enable-console_ui=[yes/no] Turn on or off compilation of console interface [default=yes]],
115 [case "${enableval}" in
116 yes) console_ui=true ;;
117 no) console_ui=false ;;
118 *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
119 esac],[console_ui=true])
121 dnl conditionnal build of gtk interface.
122 AC_ARG_ENABLE(gtk_ui,
123 [ --enable-gtk_ui=[yes/no] Turn on or off compilation of gtk interface [default=yes]],
124 [case "${enableval}" in
127 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
131 if test "$gtk_ui" = "true" ; then
132 PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
133 PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0)
134 AC_SUBST(LIBGTK_CFLAGS)
135 AC_SUBST(LIBGTK_LIBS)
136 AC_SUBST(LIBGLADE_CFLAGS)
137 AC_SUBST(LIBGLADE_LIBS)
139 echo "GTK interface compilation is disabled."
143 dnl os-specific problems not handled by existing macros.
146 LDFLAGS="$LDFLAGS -pthread"
152 AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
153 use_arm_toolchain=yes
157 AC_ARG_WITH( configdir,
158 [ --with-configdir Set a APPDATA subdir where linphone is supposed to find its config (windows only) ],
159 [ configdir=${withval}],[ configdir="Linphone" ])
161 AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
163 AC_ARG_ENABLE(manual,
164 [ --disable-manual Do not attempt to build html linphone's user documentation],
165 [case "${enableval}" in
166 yes) build_manual=yes ;;
167 no) build_manual=false ;;
168 *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
169 esac],[build_manual=yes])
172 [ --enable-date Use build date in internal version number],
173 [case "${enableval}" in
176 *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
179 if test x$use_date = xyes ; then
180 AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
184 dnl enable ipv6 support
186 [ --enable-ipv6 Turn on ipv6 support],
187 [case "${enableval}" in
190 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
193 if test x$ipv6 = xtrue ; then
196 AC_SUBST(IPV6_CFLAGS)
198 dnl enable truespeech codec support
199 AC_ARG_ENABLE(truespeech,
200 [ --enable-truespeech Turn on TrueSpeech support (x86 only)],
201 [case "${enableval}" in
202 yes) truespeech=true;;
203 no) truespeech=false;;
204 *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
205 esac],[truespeech=false])
207 if test x$truespeech = xtrue ; then
208 TRUESPEECH_CFLAGS=-DTRUESPEECH
210 AC_SUBST(TRUESPEECH_CFLAGS)
211 AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
213 AC_ARG_ENABLE(nonstandard-gsm,
214 [ --enable-nonstandard-gsm Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
215 [case "${enableval}" in
217 AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
220 *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
221 esac],[exotic_gsm=no])
224 dnl support for RSVP (by Vincent Maury)
226 [ --enable-rsvp enable support for QoS reservations.],
227 AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
228 should be compiled.]) )
230 if test "x${prefix}" = "xNONE"; then
231 package_prefix=${ac_default_prefix}
233 package_prefix=${prefix}
236 if test x$mingw_found = xyes ; then
237 dnl allow binaries to install everywhere
241 dnl Set PACKAGE_LOCALE_DIR in config.h.
243 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
245 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
247 dnl Set PACKAGE_SOUND_DIR in config.h.
248 AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
251 dnl check if we have the getifaddrs() sytem call
252 AC_CHECK_FUNCS(getifaddrs)
257 dnl setup flags for exosip library
260 if test "$console_ui" = "true" ; then
261 dnl check gnu readline
264 echo "Console interface compilation is disabled."
269 dnl normaly this should only by done by mediastreamer2/configure.ac
270 dnl but to workaround bugs when cross-compiling for arm-linux,
271 dnl we need to have SPEEX_LIBS defined
272 dnl Furthermore it is good to repeat here all mediastreamer2 toggles
273 dnl since top-level configure --help will not print them.
275 PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
278 dnl conditionnal build of video support
280 [ --enable-video Turn on video support compiling],
281 [case "${enableval}" in
284 *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
288 [ --with-ffmpeg Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
289 [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
292 [ --with-sdl Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
293 [ libsdldir=${withval}],[ libsdldir=/usr ])
295 if test "$video" = "true"; then
296 AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
300 [ --enable-alsa Turn on alsa native support compiling],
301 [case "${enableval}" in
304 *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
308 [ --enable-artsc Turn on artsc (kde) sound input/output (auto) ],
309 [case "${enableval}" in
312 *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
315 AC_ARG_ENABLE(portaudio,
316 [ --enable-portaudio Turn on portaudio native support compiling],
317 [case "${enableval}" in
318 yes) portaudio=true ;;
319 no) portaudio=false ;;
320 *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
321 esac],[portaudio=false])
323 dnl build console if required
324 AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
325 dnl special things for arm-linux cross compilation toolchain
326 AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
327 dnl compilation of gtk-glade user interface
328 AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
329 AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
332 AH_TEMPLATE([HAVE_GETENV])
333 AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
336 AC_MSG_CHECKING([for sighandler_t])
337 AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
338 has_sighandler_t=yes,has_sighandler_t=no)
339 AC_MSG_RESULT($has_sighandler_t)
340 if test "$has_sighandler_t" = "yes" ; then
341 AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
344 ##################################################
345 # Stricter build options (after external packages)
346 ##################################################
349 AC_ARG_ENABLE(strict,
350 AC_HELP_STRING([--enable-strict],
351 [Build with stricter options (gcc only) @<:@yes@:>@]),[
352 strictness="${enableval}"],[strictness=yes]
355 if test "$GCC$strictness" = "yesyes" ; then
356 STRICT_OPTIONS="-Wall "
357 STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
358 CFLAGS="$CFLAGS -fno-strict-aliasing"
361 AC_SUBST(STRICT_OPTIONS)
363 AC_CONFIG_SUBDIRS( mediastreamer2 )
365 dnl check for db2html (docbook) to generate html user manual
366 AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
367 AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
369 dnl for external use of linphone libs
370 LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone "
371 LINPHONE_LIBS="-L${libdir} -llinphone"
373 if test x$mingw_found = xyes ; then
374 LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
376 AC_SUBST(LINPHONE_CFLAGS)
377 AC_SUBST(LINPHONE_LIBS)
380 AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
382 AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
383 LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
384 AC_SUBST(LINPHONE_PLUGINS_DIR)
386 AC_ARG_ENABLE(external-ortp,
387 [ --enable-external-ortp Use external oRTP library],
388 [case "${enableval}" in
389 yes) external_ortp=true ;;
390 no) external_ortp=false ;;
391 *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
392 esac],[external_ortp=false])
394 if test "$external_ortp" = 'true'; then
397 AC_CONFIG_SUBDIRS( oRTP )
398 ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
399 ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
400 if test x$ac_cv_c_bigendian = xyes ; then
401 ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
404 AC_SUBST(ORTP_CFLAGS)
407 AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])
409 dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac
410 dnl Feel free to propose an alternative & cleaner version...
411 top_srcdir=`dirname $0`
413 ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
414 MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
416 AC_SUBST([ORTP_VERSION])
417 AC_SUBST([MS2_VERSION])
419 dnl ##################################################
420 dnl # Check for doxygen
421 dnl ##################################################
423 AC_PATH_PROG(DOXYGEN,doxygen,false)
424 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
433 coreapi/help/Makefile
434 coreapi/help/Doxyfile
435 coreapi/help/doxygen.dox
450 echo "Linphone build configuration ended."
452 if test x$gtk_ui = xtrue ; then
453 echo "* GTK interface will be compiled."
455 if test x$console_ui = xtrue ; then
456 echo "* Console interface will be compiled."
459 echo "Now type 'make' to compile, and then 'make install' as root to install it."