source: mediastreamer2/linphone/configure.in @ 829:d5c14a778e2f

Last change on this file since 829:d5c14a778e2f was 829:d5c14a778e2f, checked in by smorlat <smorlat@…>, 3 years ago

Merge branch 'wince-port'

Conflicts:

linphone/coreapi/exevents.c
linphone/coreapi/friend.c
linphone/coreapi/linphonecore.c
linphone/coreapi/lpconfig.c
linphone/mediastreamer2/build/wince/mediastreamer2.def
linphone/mediastreamer2/build/wince/mediastreamer2.vcproj
linphone/mediastreamer2/src/msvolume.c
linphone/oRTP/build/wince/oRTP.vcproj
linphone/oRTP/src/rtpsession.c

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@801 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

File size: 14.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT([linphone],[3.2.1],[linphone-developers@nongnu.org])
4AC_CANONICAL_SYSTEM
5
6dnl Source packaging numbers
7
8LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
9LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
10LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
11LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
12
13dnl program extension
14LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
15if test "$LINPHONE_EXTRA_VERSION" != "" ;then
16        LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
17fi
18LIBLINPHONE_SO_VERSION=`expr $LINPHONE_MINOR_VERSION + $LINPHONE_MAJOR_VERSION`:$LINPHONE_MICRO_VERSION:$LINPHONE_MINOR_VERSION
19
20AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
21AC_SUBST(LINPHONE_VERSION)
22
23AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION           A full featured audio/video sip phone.])
24AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
25
26AM_INIT_AUTOMAKE([tar-ustar])
27m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
28AC_CONFIG_HEADER(config.h)
29AC_CONFIG_MACRO_DIR([m4])
30AC_SUBST([mkdir_p])
31AC_ISC_POSIX
32AC_PROG_CC
33AC_C_INLINE
34AM_PROG_CC_STDC
35AC_HEADER_STDC
36AM_PROG_CC_C_O
37
38case $target_os in
39        *mingw32ce)
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"
43                mingw_found=yes
44                mingwce_found=yes
45                ;;
46        *mingw*)
47                CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
48                CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
49                LIBS="$LIBS -lws2_32"
50                GUI_FLAGS="-mwindows"
51                CONSOLE_FLAGS="-mconsole"
52                mingw_found=yes
53        ;;
54        *darwin*)
55                dnl use macport installation
56                ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
57        ;;
58esac
59
60AC_SUBST(ACLOCAL_MACOS_FLAGS)
61AC_SUBST(CONSOLE_FLAGS)
62AC_SUBST(GUI_FLAGS)
63
64dnl localization tools
65ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL])
66dnl Initialize libtool
67AC_LIBTOOL_WIN32_DLL
68AC_PROG_LIBTOOL
69AM_PROG_LIBTOOL
70AC_ENABLE_SHARED(yes)
71AC_ENABLE_STATIC(no)
72
73
74AC_CONFIG_COMMANDS([libtool-hacking],[
75if 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
79        rm -f ./libtool.tmp
80fi
81],[mingw_found=$mingw_found])
82
83dnl Add the languages which your application supports here.
84PKG_PROG_PKG_CONFIG
85ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN"
86AC_SUBST(ALL_LINGUAS)
87AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
88
89if test "$mingw_found" != "yes" ; then
90dnl gettext macro does not work properly under mingw.
91AM_GNU_GETTEXT([external])
92LIBS="$LIBS $LIBINTL"
93else
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"
98        else
99                dnl gettext macro does not work properly under mingw.
100                AM_GNU_GETTEXT([external])
101                LIBS="$LIBS $LIBINTL"
102        fi
103fi
104
105GETTEXT_PACKAGE=linphone
106AC_SUBST(GETTEXT_PACKAGE)
107AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
108AC_CHECK_LIB(intl,libintl_gettext)
109
110AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
111
112dnl conditionnal build of console interface.
113AC_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])
120
121dnl conditionnal build of gtk interface.
122AC_ARG_ENABLE(gtk_ui,
123      [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
124      [case "${enableval}" in
125        yes) gtk_ui=true ;;
126        no)  gtk_ui=false ;;
127        *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
128      esac],[gtk_ui=true])
129
130
131if 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)
138else
139        echo "GTK interface compilation is disabled."
140fi
141
142
143dnl os-specific problems not handled by existing macros.
144case "$host_os" in
145        *freebsd*)
146                LDFLAGS="$LDFLAGS -pthread"
147                ;;
148esac
149
150case "$host_cpu" in
151        *arm*)
152                AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
153                use_arm_toolchain=yes
154                ;;
155esac
156
157AC_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" ])
160
161AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
162
163AC_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])
170
171AC_ARG_ENABLE(date,
172      [  --enable-date    Use build date in internal version number],
173      [case "${enableval}" in
174        yes) use_date=yes ;;
175        no)  use_date=no ;;
176        *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
177      esac],[use_date=no])
178
179if test x$use_date =  xyes ; then
180        AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
181fi
182
183
184dnl enable ipv6 support
185AC_ARG_ENABLE(ipv6,
186      [  --enable-ipv6    Turn on ipv6 support],
187      [case "${enableval}" in
188        yes)  ipv6=true;;
189        no)   ipv6=false;;
190        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
191      esac],[ipv6=true])
192IPV6_CFLAGS=
193if test x$ipv6 = xtrue ; then
194        IPV6_CFLAGS=-DINET6
195fi
196AC_SUBST(IPV6_CFLAGS)
197
198dnl enable truespeech codec support
199AC_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])
206TRUESPEECH_CFLAGS=
207if test x$truespeech = xtrue ; then
208        TRUESPEECH_CFLAGS=-DTRUESPEECH
209fi
210AC_SUBST(TRUESPEECH_CFLAGS)
211AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
212
213AC_ARG_ENABLE(nonstandard-gsm,
214      [  --enable-nonstandard-gsm    Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
215      [case "${enableval}" in
216        yes) exotic_gsm=yes
217        AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
218         ;;
219        no)  exotic_gsm=no ;;
220        *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
221      esac],[exotic_gsm=no])
222
223
224dnl support for RSVP (by Vincent Maury)
225AC_ARG_ENABLE(rsvp,
226[  --enable-rsvp           enable support for QoS reservations.],
227AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
228should be compiled.]) )
229
230if test "x${prefix}" = "xNONE"; then
231        package_prefix=${ac_default_prefix}
232else
233        package_prefix=${prefix}
234fi
235
236if test x$mingw_found = xyes ; then
237dnl allow binaries to install everywhere
238package_prefix="."
239fi
240
241dnl Set PACKAGE_LOCALE_DIR in config.h.
242DATADIRNAME=share
243AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
244
245AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
246
247dnl Set PACKAGE_SOUND_DIR in config.h.
248AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
249
250
251dnl check if we have the getifaddrs() sytem call
252AC_CHECK_FUNCS(getifaddrs)
253
254dnl check for osip2
255LP_CHECK_OSIP2
256
257dnl setup flags for exosip library
258LP_SETUP_EXOSIP
259
260if test "$console_ui" = "true" ; then
261dnl check gnu readline
262LP_CHECK_READLINE
263else
264echo "Console interface compilation is disabled."
265fi
266
267AC_WORDS_BIGENDIAN
268
269dnl normaly this should only by done by mediastreamer2/configure.ac
270dnl but to workaround bugs when cross-compiling for arm-linux,
271dnl we need to have SPEEX_LIBS defined
272dnl Furthermore it is good to repeat here all mediastreamer2 toggles
273dnl since top-level configure --help will not print them.
274
275PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
276AC_SUBST(SPEEX_LIBS)
277
278dnl conditionnal build of video support
279AC_ARG_ENABLE(video,
280                [  --enable-video    Turn on video support compiling],
281                [case "${enableval}" in
282                yes) video=true ;;
283                no)  video=false ;;
284                *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
285                esac],[video=true])
286               
287AC_ARG_WITH( ffmpeg,
288                [  --with-ffmpeg                Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
289                [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
290
291AC_ARG_WITH( sdl,
292                [  --with-sdl           Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
293                [ libsdldir=${withval}],[ libsdldir=/usr ])
294
295if test "$video" = "true"; then
296        AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
297fi
298
299AC_ARG_ENABLE(alsa,
300      [  --enable-alsa    Turn on alsa native support compiling],
301      [case "${enableval}" in
302        yes) alsa=true ;;
303        no)  alsa=false ;;
304        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
305      esac],[alsa=true])
306
307AC_ARG_ENABLE(artsc,
308      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
309      [case "${enableval}" in
310        yes) artsc=true ;;
311        no)  artsc=false ;;
312        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
313      esac],[artsc=false])
314
315AC_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])
322
323dnl build console if required
324AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
325dnl special things for arm-linux cross compilation toolchain
326AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
327dnl compilation of gtk-glade user interface
328AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
329AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
330
331dnl check getenv
332AH_TEMPLATE([HAVE_GETENV])
333AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))
334
335dnl
336AC_MSG_CHECKING([for sighandler_t])
337AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
338has_sighandler_t=yes,has_sighandler_t=no)
339AC_MSG_RESULT($has_sighandler_t)
340if test "$has_sighandler_t" = "yes" ; then
341    AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
342fi
343
344##################################################
345# Stricter build options (after external packages)
346##################################################
347
348
349AC_ARG_ENABLE(strict,
350        AC_HELP_STRING([--enable-strict],
351                       [Build with stricter options (gcc only) @<:@yes@:>@]),[
352        strictness="${enableval}"],[strictness=yes]
353)
354
355if test "$GCC$strictness" = "yesyes" ; then
356        STRICT_OPTIONS="-Wall -Wp,-D_FORTIFY_SOURCE=2"
357        STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
358        CFLAGS="$CFLAGS -fno-strict-aliasing"
359fi
360
361AC_SUBST(STRICT_OPTIONS)
362
363AC_CONFIG_SUBDIRS( mediastreamer2 )
364
365dnl check for db2html (docbook) to generate html user manual
366AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
367AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
368
369dnl for external use of linphone libs
370LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone  "
371LINPHONE_LIBS="-L${libdir}  -llinphone"
372
373if test x$mingw_found = xyes ; then
374        LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
375fi
376AC_SUBST(LINPHONE_CFLAGS)
377AC_SUBST(LINPHONE_LIBS)
378
379
380AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
381
382AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
383LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
384AC_SUBST(LINPHONE_PLUGINS_DIR)
385
386AC_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])
393
394if test "$external_ortp" = 'true'; then
395        LP_CHECK_ORTP
396else
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"
402        fi
403fi
404AC_SUBST(ORTP_CFLAGS)
405AC_SUBST(ORTP_LIBS)
406
407AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])
408
409dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac
410dnl Feel free to propose an alternative & cleaner version...
411top_srcdir=`dirname $0`
412changequote(, )dnl
413ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
414MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
415changequote([, ])dnl
416AC_SUBST([ORTP_VERSION])
417AC_SUBST([MS2_VERSION])
418
419dnl ##################################################
420dnl # Check for doxygen
421dnl ##################################################
422
423AC_PATH_PROG(DOXYGEN,doxygen,false)
424AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
425
426
427AC_OUTPUT([
428Makefile
429m4/Makefile
430po/Makefile.in
431pixmaps/Makefile
432coreapi/Makefile
433coreapi/help/Makefile
434coreapi/help/Doxyfile
435coreapi/help/doxygen.dox
436gtk-glade/Makefile
437console/Makefile
438share/Makefile
439share/C/Makefile
440share/fr/Makefile
441share/it/Makefile
442share/ja/Makefile
443share/cs/Makefile
444share/linphone.pc
445scripts/Makefile
446linphone.spec
447linphone.iss
448])
449
450echo "Linphone build configuration ended."
451
452if test x$gtk_ui = xtrue ; then
453        echo "* GTK interface will be compiled."
454fi
455if test x$console_ui = xtrue ; then
456        echo "* Console interface will be compiled."
457fi
458
459echo "Now type 'make' to compile, and then 'make install' as root to install it."
Note: See TracBrowser for help on using the repository browser.