]> sjero.net Git - linphone/blob - configure.ac
Android Makefile changed to automatically update linphone version
[linphone] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Keep this line, it is parsed by Android Makefile
3 LINPHONE_VERSION=3.5.2
4
5 AC_INIT([linphone],[$LINPHONE_VERSION],[linphone-developers@nongnu.org])
6 AC_CANONICAL_SYSTEM
7 AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
8
9 dnl Source packaging numbers
10
11 LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
12 LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
13 LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
14 LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
15
16 dnl program extension
17 LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
18 if test "$LINPHONE_EXTRA_VERSION" != "" ;then
19         LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
20 fi
21
22 LIBLINPHONE_SO_CURRENT=5 dnl increment this number when you add/change/remove an interface
23 LIBLINPHONE_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
24 LIBLINPHONE_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
25
26 LIBLINPHONE_SO_VERSION=$LIBLINPHONE_SO_CURRENT:$LIBLINPHONE_SO_REVISION:$LIBLINPHONE_SO_AGE
27
28 AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
29 AC_SUBST(LINPHONE_VERSION)
30
31 AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION           A full featured audio/video sip phone.])
32 AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
33
34 AM_INIT_AUTOMAKE
35 AC_SUBST([LIBTOOL_DEPS])
36 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
37 AC_CONFIG_HEADER(config.h)
38 AC_CONFIG_MACRO_DIR([m4])
39 AC_SUBST([mkdir_p])
40 AC_ISC_POSIX
41 AC_PROG_CC
42 AC_PROG_CXX
43 AC_C_INLINE
44 AM_PROG_CC_STDC
45 AC_HEADER_STDC
46 AM_PROG_CC_C_O
47 AC_CHECK_PROGS(MD5SUM,[md5sum md5])
48 AM_CONDITIONAL(HAVE_MD5SUM,test -n $MD5SUM)
49
50 case $target in
51         *mingw32ce)
52         CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
53         CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
54         LIBS="$LIBS -lws2 -liphlpapi"
55                 mingw_found=yes
56                 mingwce_found=yes
57                 ;;
58         *mingw*)
59                 CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
60                 CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
61                 LIBS="$LIBS -lws2_32"
62                 GUI_FLAGS="-mwindows"
63                 CONSOLE_FLAGS="-mconsole"
64                 mingw_found=yes
65         ;;
66        armv6-apple-darwin|armv7-apple-darwin|i386-apple-darwin)
67                 CFLAGS="$CFLAGS -DTARGET_OS_IPHONE "
68                 build_tests=no
69                 ios_found=yes
70         ;;
71         x86_64-apple-darwin*|i686-apple-darwin*)
72         MSPLUGINS_CFLAGS=""
73                 dnl use macport installation
74                 ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
75                 build_macos=yes
76         ;;
77
78 esac
79
80 AC_SUBST(ACLOCAL_MACOS_FLAGS)
81 AC_SUBST(CONSOLE_FLAGS)
82 AC_SUBST(GUI_FLAGS)
83
84 dnl localization tools
85 IT_PROG_INTLTOOL([0.40], [no-xml])
86
87 AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
88 dnl Initialize libtool
89 LT_INIT([win32-dll shared disable-static])
90
91 AC_CONFIG_COMMANDS([libtool-hacking],[
92 if test "$mingw_found" = "yes" ; then
93         echo "Hacking libtool to work with mingw..."
94         sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
95         cp -f ./libtool.tmp ./libtool
96         rm -f ./libtool.tmp
97 fi
98 ],[mingw_found=$mingw_found])
99
100 dnl Add the languages which your application supports here.
101 PKG_PROG_PKG_CONFIG
102 ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN nb_NO zh_TW"
103 AC_SUBST(ALL_LINGUAS)
104 AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
105
106 if test "$mingw_found" != "yes" ; then
107         dnl gettext macro does not work properly under mingw. And we want to use the one provided by GTK.
108         
109         dnl AM_GNU_GETTEXT pollutes CPPFLAGS: workaround this.
110         CPPFLAGS_save=$CPPFLAGS
111         AM_GNU_GETTEXT([external])
112         CPPFLAGS=$CPPFLAGS_save
113         LIBS="$LIBS $LIBINTL"
114 else
115         AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
116         AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
117         LIBS="$LIBS -lintl"
118 fi
119
120 GETTEXT_PACKAGE=linphone
121 AC_SUBST(GETTEXT_PACKAGE)
122 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
123 dnl AC_CHECK_LIB(intl,libintl_gettext)
124
125 AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
126
127 AC_ARG_ENABLE(x11,
128                           [  --disable-x11    Disable X11 support],
129                           [case "${enableval}" in
130                           yes) enable_x11=true ;;
131                           no)  enable_x11=false ;;
132                           *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
133                           esac],[enable_x11=true])
134
135 dnl conditionnal build of console interface.
136 AC_ARG_ENABLE(console_ui,
137       [  --enable-console_ui=[yes/no]    Turn on or off compilation of console interface [default=yes]],
138       [case "${enableval}" in
139         yes) console_ui=true ;;
140         no)  console_ui=false ;;
141         *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
142       esac],[console_ui=true])
143
144 dnl conditionnal build of gtk interface.
145 AC_ARG_ENABLE(gtk_ui,
146       [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
147       [case "${enableval}" in
148         yes) gtk_ui=true ;;
149         no)  gtk_ui=false ;;
150         *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
151       esac],[gtk_ui=true])
152
153 if test "$gtk_ui" = "true" ; then
154         PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.18.0 gthread-2.0)
155         if test "$enable_x11" = "false" ; then
156                 PKG_CHECK_MODULES(LIBGTKMAC,[ige-mac-integration >= 0.9.7 ])
157                 AC_DEFINE([HAVE_GTK_OSX],[1],[Defined when gtk osx is used])
158         fi
159 else
160         echo "GTK interface compilation is disabled."
161 fi
162
163 AC_ARG_ENABLE(notify,
164                 [  --enable-notify=[yes/no]    Enable libnotify support [default=yes]],
165                 [case "${enableval}" in
166                   yes) notify=true ;;
167                   no)  notify=false ;;
168                   *) AC_MSG_ERROR(bad value ${enableval} for --enable-notify) ;;
169                 esac],[notify=true])
170
171 dnl conditionnal build of the notify library
172 if test "$gtk_ui" = "true" ; then
173         if test "$notify" = "true"; then
174                 PKG_CHECK_MODULES([NOTIFY4], [libnotify >= 0.7.0 ], [found_notify4=yes], foo=bar)
175                 case "$found_notify4" in
176                   yes)
177                                 AC_SUBST(NOTIFY4_CFLAGS)
178                                 AC_SUBST(NOTIFY4_LIBS)
179                                 AC_DEFINE([HAVE_NOTIFY4],[1],[NOTIFY4 support])
180                 esac
181
182                 PKG_CHECK_MODULES([NOTIFY1], [libnotify < 0.7.0], [found_notify1=yes], foo=bar)
183                 case "$found_notify1" in
184                   yes)
185                                 AC_SUBST(NOTIFY1_CFLAGS)
186                                 AC_SUBST(NOTIFY1_LIBS)
187                                 AC_DEFINE([HAVE_NOTIFY1],[1],[NOTIFY1 support])
188                 esac
189         else
190                                 NotifyNotification *n;
191                 echo "Libnotify support is disabled."
192         fi
193 fi
194
195 dnl os-specific problems not handled by existing macros.
196 case "$host_os" in
197         *freebsd*)
198                 LDFLAGS="$LDFLAGS -pthread"
199                 ;;
200 esac
201
202 case "$host_cpu" in
203         *arm*)
204                 AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
205                 use_arm_toolchain=yes
206                 ;;
207 esac
208
209 AC_ARG_WITH( configdir,
210       [  --with-configdir      Set a APPDATA subdir where linphone is supposed to find its config (windows only) ],
211       [ configdir=${withval}],[ configdir="Linphone" ])
212
213 AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
214
215 AC_ARG_ENABLE(relativeprefix,
216       [  --enable-relativeprefix    Build a linphone that finds its resources relatively to the directory where it is installed],
217       [case "${enableval}" in
218         yes) relativeprefix=yes ;;
219         no)  relativeprefix=no ;;
220         *) AC_MSG_ERROR(bad value ${enableval} for --enable-relativeprefix) ;;
221       esac],[relativeprefix=guess])
222
223 AC_ARG_ENABLE(date,
224       [  --enable-date    Use build date in internal version number],
225       [case "${enableval}" in
226         yes) use_date=yes ;;
227         no)  use_date=no ;;
228         *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
229       esac],[use_date=no])
230
231 if test x$use_date =  xyes ; then
232         AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
233 fi
234
235
236 dnl enable ipv6 support
237 AC_ARG_ENABLE(ipv6,
238       [  --enable-ipv6    Turn on ipv6 support],
239       [case "${enableval}" in
240         yes)  ipv6=true;;
241         no)   ipv6=false;;
242         *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
243       esac],[ipv6=true])
244 IPV6_CFLAGS=
245 if test x$ipv6 = xtrue ; then
246         IPV6_CFLAGS=-DINET6
247 fi
248 AC_SUBST(IPV6_CFLAGS)
249
250 dnl enable timestamp support
251 AC_ARG_ENABLE(ntp-timestamp,
252       [  --enable-ntp-timestamp Turn on NTP timestamping on received packet],
253       [case "${enableval}" in
254         yes)  ntptimestamp=true;;
255         no)   ntptimestamp=false;;
256         *) AC_MSG_ERROR(bad value ${enableval} for --enable-ntp-timestamp) ;;
257       esac],[ntptimestamp=false])
258
259 AC_ARG_ENABLE(debug,
260                         [  --enable-debug=[yes/no]   enables the display of traces showing the execution of the library. [default=yes]],
261                         [case "${enableval}" in
262                                 yes) debug_enabled=yes;;
263                                 no) debug_enabled=no;;
264                                 *) AC_MSG_ERROR("Bad value for --enable-debug");;
265                         esac],
266                         [debug_enabled=no])
267
268 dnl enable truespeech codec support
269 AC_ARG_ENABLE(truespeech,
270       [  --enable-truespeech    Turn on TrueSpeech support (x86 only)],
271       [case "${enableval}" in
272         yes)  truespeech=true;;
273         no)   truespeech=false;;
274         *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
275       esac],[truespeech=false])
276 TRUESPEECH_CFLAGS=
277 if test x$truespeech = xtrue ; then
278         TRUESPEECH_CFLAGS=-DTRUESPEECH
279 fi
280 AC_SUBST(TRUESPEECH_CFLAGS)
281 AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
282
283 AC_ARG_ENABLE(nonstandard-gsm,
284       [  --enable-nonstandard-gsm    Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
285       [case "${enableval}" in
286         yes) exotic_gsm=yes
287         AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
288          ;;
289         no)  exotic_gsm=no ;;
290         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
291       esac],[exotic_gsm=no])
292
293
294 dnl support for RSVP (by Vincent Maury)
295 AC_ARG_ENABLE(rsvp,
296 [  --enable-rsvp           enable support for QoS reservations.],
297 AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
298 should be compiled.]) )
299
300 if test "x${prefix}" = "xNONE"; then
301         package_prefix=${ac_default_prefix}
302 else
303         package_prefix=${prefix}
304 fi
305
306 if test "$relativeprefix" = "guess" ; then
307         if test "$mingw_found" = "yes" ; then
308                 relativeprefix="yes"
309         fi
310 fi
311
312 if test "$relativeprefix" = "yes" ; then
313         dnl allow binaries to install everywhere
314         package_prefix="."
315 fi
316
317 dnl Set PACKAGE_LOCALE_DIR in config.h.
318 DATADIRNAME=share
319 AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
320
321 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
322
323 dnl Set PACKAGE_SOUND_DIR in config.h.
324 AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
325
326
327 dnl check if we have the getifaddrs() sytem call
328 AC_CHECK_FUNCS(getifaddrs)
329
330 dnl check for osip2
331 LP_CHECK_OSIP2
332
333 dnl conditionnal build for ssl
334 AC_ARG_ENABLE(ssl,
335                 [  --enable-ssl    Turn on ssl support compiling. Required for sip tls. default = false],
336                 [case "${enableval}" in
337                 yes) build_ssl=true ;;
338                 no)  build_ssl=false ;;
339                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ssl) ;;
340                 esac],[build_ssl=false])
341
342 if test "$build_ssl" = "true"; then
343         PKG_CHECK_MODULES(OPENSSL, libssl >= 0.9.8)
344 fi
345 dnl setup flags for exosip library
346 LP_SETUP_EXOSIP
347
348 if test "$console_ui" = "true" ; then
349 dnl check gnu readline
350 LP_CHECK_READLINE
351 else
352 echo "Console interface compilation is disabled."
353 fi
354
355 AC_WORDS_BIGENDIAN
356
357 AC_ARG_ENABLE([speex],
358               AS_HELP_STRING([--disable-speex], [Disable speex support]),
359               [], [enable_speex=yes])
360 if test "x$enable_speex" = "xyes"; then
361         dnl normaly this should only by done by mediastreamer2/configure.ac
362         dnl but to workaround bugs when cross-compiling for arm-linux,
363         dnl we need to have SPEEX_LIBS defined
364         dnl Furthermore it is good to repeat here all mediastreamer2 toggles
365         dnl since top-level configure --help will not print them.
366         PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
367 fi
368
369 dnl conditionnal build of video support
370 AC_ARG_ENABLE(video,
371                 [  --enable-video    Turn on video support compiling],
372                 [case "${enableval}" in
373                 yes) video=true ;;
374                 no)  video=false ;;
375                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
376                 esac],[video=true])
377                 
378 AC_ARG_WITH( ffmpeg,
379                 [  --with-ffmpeg                Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
380                 [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
381
382 if test "$video" = "true"; then
383         
384         if test "$enable_x11" = "true"; then
385                 AC_CHECK_HEADERS(X11/Xlib.h)
386                 if test "$build_macos" = "yes"; then 
387                         X11_LIBS="-L/usr/X11/lib -lX11"
388                 else
389                         AC_CHECK_LIB(X11,XUnmapWindow, X11_LIBS="-lX11")
390                 fi
391                 AC_SUBST(X11_LIBS)
392         fi
393         AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
394 fi
395
396 AC_ARG_ENABLE(alsa,
397       [  --enable-alsa    Turn on alsa native support compiling],
398       [case "${enableval}" in
399         yes) alsa=true ;;
400         no)  alsa=false ;;
401         *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
402       esac],[alsa=true])
403
404 AC_ARG_ENABLE(zrtp,
405       [  --enable-zrtp    Turn on zrtp support ],
406       [case "${enableval}" in
407         yes) zrtp=true ;;
408         no)  zrtp=false ;;
409         *) AC_MSG_ERROR(bad value ${enableval} for --enable-zrtp) ;;
410       esac],[zrtp=false])
411
412
413 AC_ARG_ENABLE(portaudio,
414       [  --enable-portaudio    Turn on portaudio native support compiling],
415       [case "${enableval}" in
416         yes) portaudio=true ;;
417         no)  portaudio=false ;;
418         *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
419       esac],[portaudio=false])
420
421 dnl build console if required
422 AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
423 dnl special things for arm-linux cross compilation toolchain
424 AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
425 dnl compilation of gtk user interface
426 AM_CONDITIONAL(BUILD_GTK_UI, [test x$gtk_ui = xtrue ] )
427 AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
428 AM_CONDITIONAL(BUILD_ZRTP, test x$zrtp = xtrue)
429
430 dnl check getenv
431 AH_TEMPLATE([HAVE_GETENV])
432 AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
433
434 dnl
435 AC_MSG_CHECKING([for sighandler_t])
436 AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
437 has_sighandler_t=yes,has_sighandler_t=no)
438 AC_MSG_RESULT($has_sighandler_t)
439 if test "$has_sighandler_t" = "yes" ; then
440     AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
441 fi
442
443 AC_ARG_ENABLE(assistant,
444       [  --enable-assistant    Turn on assistant compiling],
445       [case "${enableval}" in
446         yes) build_wizard=true ;;
447         no)  build_wizard=false ;;
448         *) AC_MSG_ERROR(bad value ${enableval} for --enable-assistant) ;;
449       esac],[build_wizard=check])
450
451 dnl check libsoup (needed for wizard)
452 if test "$build_wizard" != "false" ; then
453         PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.26],[build_wizard=true],
454         [
455                 if test "$build_wizard" = "true" ; then
456                         AC_MSG_ERROR([Could not found libsoup, assistant cannot be compiled.])
457                 else
458                         build_wizard=false
459                 fi
460         ])
461 fi
462 AC_SUBST(LIBSOUP_CFLAGS)
463 AC_SUBST(LIBSOUP_LIBS)
464 AM_CONDITIONAL(BUILD_WIZARD, test x$build_wizard = xtrue)
465 if test "$build_wizard" = "true" ; then
466    AC_DEFINE( BUILD_WIZARD, 1, [Define if wizard enabled] ) 
467 fi
468
469 AC_CHECK_HEADERS(libudev.h)
470 AC_CHECK_LIB(udev,udev_new)
471
472 ##################################################
473 # Stricter build options (after external packages)
474 ##################################################
475
476
477 AC_ARG_ENABLE(strict,
478         AC_HELP_STRING([--enable-strict],
479                        [Build with stricter options (gcc only) @<:@yes@:>@]),[
480         strictness="${enableval}"],[strictness=yes]
481 )
482
483 STRICT_OPTIONS="-Wall "
484
485 if test "$strictness" = "yes" ; then
486         STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
487         CFLAGS="$CFLAGS -fno-strict-aliasing"
488 fi
489
490 AC_SUBST(STRICT_OPTIONS)
491
492 top_srcdir=`dirname $0`
493
494 AC_ARG_ENABLE([external-mediastreamer],
495       [AS_HELP_STRING([--enable-external-mediastreamer],[Use external mediastreamer library])],,
496       [enable_external_mediastreamer=no])
497
498 AS_CASE($enable_external_mediastreamer,
499                 [yes],[
500                         PKG_CHECK_MODULES([MEDIASTREAMER], [mediastreamer])
501                         MS2_VERSION=`$PKG_CONFIG --modversion mediastreamer`
502                         ],
503                 [no],[
504                         AC_CONFIG_SUBDIRS( mediastreamer2 )
505                         MEDIASTREAMER_DIR=${top_srcdir}/mediastreamer2
506                         MEDIASTREAMER_CFLAGS="-I\$(top_srcdir)/mediastreamer2/include"
507                         MEDIASTREAMER_LIBS="\$(top_builddir)/mediastreamer2/src/libmediastreamer.la"
508 dnl need to temporary change quotes to allow square brackets
509                         changequote(<<, >>)
510                         MS2_VERSION=`grep -e '^.C_INIT(' $MEDIASTREAMER_DIR/configure.ac | sed -e 's:\([^(]\+\)(\[mediastreamer\],\[\(.*\)\]):\2:g'`
511                         changequote([, ])
512                         MS2_DIR=mediastreamer2
513                         ],
514         [AC_MSG_ERROR([bad value '${enable_external_mediastreamer}' for --enable-external-mediastreamer])])
515
516 AC_SUBST(MEDIASTREAMER_CFLAGS)
517 AC_SUBST(MEDIASTREAMER_LIBS)
518 AC_SUBST([MS2_VERSION])
519 AC_SUBST([MS2_DIR])
520
521
522
523 AC_ARG_ENABLE(tunnel,
524       [  --enable-tunnel=[yes/no]    Turn on compilation of tunnel support [default=no]],
525       [case "${enableval}" in
526         yes) enable_tunnel=true ;;
527         no)  enable_tunnel=false ;;
528         *) AC_MSG_ERROR(bad value ${enableval} for --enable-tunnel) ;;
529       esac],[enable_tunnel=false])
530 AM_CONDITIONAL(BUILD_TUNNEL, test x$enable_tunnel = xtrue)
531 if test x$enable_tunnel = xtrue; then
532      PKG_CHECK_MODULES(TUNNEL, tunnel >= 0.3.3)
533      TUNNEL_CFLAGS+="-DTUNNEL_ENABLED"
534      AC_SUBST(TUNNEL_CFLAGS)
535      AC_SUBST(TUNNEL_LIBS)
536 fi
537
538
539
540
541
542
543
544
545
546
547 dnl check for db2html (docbook) to generate html user manual
548 AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
549 AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
550
551 dnl for external use of linphone libs
552 LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone"
553 LINPHONE_LIBS="-L${libdir} -llinphone"
554
555 if test x$mingw_found = xyes ; then
556         LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
557 fi
558 AC_SUBST(LINPHONE_CFLAGS)
559 AC_SUBST(LINPHONE_LIBS)
560
561 AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
562
563 AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
564 LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
565 AC_SUBST(LINPHONE_PLUGINS_DIR)
566
567 AC_ARG_ENABLE(external-ortp,
568       [  --enable-external-ortp    Use external oRTP library],
569       [case "${enableval}" in
570         yes) external_ortp=true ;;
571         no)  external_ortp=false ;;
572         *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
573       esac],[external_ortp=false])
574
575 if test "$external_ortp" = 'true'; then
576         PKG_CHECK_MODULES([ORTP], [ortp])
577         ORTP_VERSION=`$PKG_CONFIG --modversion ortp`
578 else
579         AC_CONFIG_SUBDIRS( oRTP )
580         ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
581         ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
582         if test x$ac_cv_c_bigendian = xyes ; then
583                 ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
584         fi
585         if test x$ntptimestamp = xtrue ; then
586                 ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_TIMESTAMP"
587         fi
588         ORTP_DIR=oRTP
589         changequote(<<, >>)
590         ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
591         changequote([, ])
592 fi
593 AC_SUBST(ORTP_CFLAGS)
594 AC_SUBST(ORTP_LIBS)
595 AC_SUBST([ORTP_VERSION])
596 AC_SUBST([ORTP_DIR])
597
598 AC_ARG_ENABLE(tests_enabled,
599       [  --disable-tests    Disable compilation of tests],
600       [case "${enableval}" in
601         yes) tests_enabled=true ;;
602         no)  tests_enabled=false ;;
603         *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
604       esac],[tests_enabled=false])
605 AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes)
606
607
608
609 dnl ##################################################
610 dnl # Check for doxygen
611 dnl ##################################################
612
613 AC_PATH_PROG(DOXYGEN,doxygen,false)
614 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
615
616
617 AC_CONFIG_FILES([ 
618 Makefile
619 build/Makefile
620 build/macos/Makefile
621 build/macos/Info-linphone.plist
622 m4/Makefile
623 po/Makefile.in
624 pixmaps/Makefile
625 coreapi/Makefile
626 coreapi/help/Makefile
627 coreapi/help/Doxyfile
628 gtk/Makefile
629 console/Makefile
630 share/Makefile
631 share/C/Makefile
632 share/fr/Makefile
633 share/it/Makefile
634 share/ja/Makefile
635 share/cs/Makefile
636 share/linphone.pc
637 share/linphone.desktop
638 scripts/Makefile
639 linphone.spec
640 linphone.iss
641 ])
642
643 AC_OUTPUT
644
645 echo "Linphone build configuration ended."
646 echo "Summary of build options:"
647 printf "* Video support\t\t\t%s\n" $video
648 printf "* GTK interface\t\t\t%s\n" $gtk_ui
649 printf "* Account assistant\t\t%s\n" $build_wizard
650 printf "* Console interface\t\t%s\n" $console_ui
651 printf "* zRTP encryption (GPLv3)\t%s\n" $zrtp
652
653 if test "$enable_tunnel" = "true" ; then
654         printf "* Tunnel support\t\ttrue\n"
655 fi
656
657 echo "Now type 'make' to compile, and then 'make install' as root to install it."
658