source: mediastreamer2/linphone/configure.in @ 583:365432aec509

Last change on this file since 583:365432aec509 was 583:365432aec509, checked in by smorlat <smorlat@…>, 4 years ago

again a few changes to make it work with mingw environment.

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

File size: 11.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT([linphone],[3.1.2],[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}.${LINPHONE_EXTRA_VERSION}
15
16LIBLINPHONE_SO_VERSION=`expr $LINPHONE_MINOR_VERSION + $LINPHONE_MAJOR_VERSION`:$LINPHONE_MICRO_VERSION:$LINPHONE_MINOR_VERSION
17
18AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
19AC_SUBST(LINPHONE_VERSION)
20
21AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION           A full featured audio/video sip phone.])
22AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])
23
24AM_INIT_AUTOMAKE([tar-ustar])
25AC_CONFIG_HEADER(config.h)
26AC_CONFIG_MACRO_DIR([m4])
27AC_SUBST([mkdir_p])
28AC_ISC_POSIX
29AC_PROG_CC
30AC_C_INLINE
31AM_PROG_CC_STDC
32AC_HEADER_STDC
33AM_PROG_CC_C_O
34
35case $target_os in
36        *mingw*)
37                CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
38                CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
39                LIBS="$LIBS -lws2_32"
40                GUI_FLAGS="-mwindows"
41                CONSOLE_FLAGS="-mconsole"
42                mingw_found=yes
43        ;;
44esac
45
46AC_SUBST(CONSOLE_FLAGS)
47AC_SUBST(GUI_FLAGS)
48
49dnl localization tools
50ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL])
51dnl Initialize libtool
52AC_LIBTOOL_WIN32_DLL
53AC_PROG_LIBTOOL
54AM_PROG_LIBTOOL
55AC_ENABLE_SHARED(yes)
56AC_ENABLE_STATIC(no)
57
58
59AC_CONFIG_COMMANDS([libtool-hacking],[
60if test "$mingw_found" = "yes" ; then
61        echo "Hacking libtool to work with mingw..."
62        sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
63        cp -f ./libtool.tmp ./libtool
64        rm -f ./libtool.tmp
65fi
66],[mingw_found=$mingw_found])
67
68dnl Add the languages which your application supports here.
69PKG_PROG_PKG_CONFIG
70ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru"
71AC_SUBST(ALL_LINGUAS)
72AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
73
74if test "$mingw_found" != "yes" ; then
75dnl gettext macro does not work properly under mingw.
76AM_GNU_GETTEXT([external])
77else
78AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
79AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
80LIBS="$LIBS -L/usr/lib -lintl"
81fi
82
83GETTEXT_PACKAGE=linphone
84AC_SUBST(GETTEXT_PACKAGE)
85AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
86AC_CHECK_LIB(intl,libintl_gettext)
87
88AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )
89
90dnl conditionnal build of console interface.
91AC_ARG_ENABLE(console_ui,
92      [  --enable-console_ui=[yes/no]    Turn on or off compilation of console interface [default=yes]],
93      [case "${enableval}" in
94        yes) console_ui=true ;;
95        no)  console_ui=false ;;
96        *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
97      esac],[console_ui=true])
98
99dnl conditionnal build of gtk interface.
100AC_ARG_ENABLE(gtk_ui,
101      [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
102      [case "${enableval}" in
103        yes) gtk_ui=true ;;
104        no)  gtk_ui=false ;;
105        *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
106      esac],[gtk_ui=true])
107
108
109if test "$gtk_ui" = "true" ; then
110        PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
111        PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0)
112        AC_SUBST(LIBGTK_CFLAGS)
113        AC_SUBST(LIBGTK_LIBS)
114        AC_SUBST(LIBGLADE_CFLAGS)
115        AC_SUBST(LIBGLADE_LIBS)
116else
117        echo "GTK interface compilation is disabled."
118fi
119
120
121dnl os-specific problems not handled by existing macros.
122case "$host_os" in
123        *freebsd*)
124                LDFLAGS="$LDFLAGS -pthread"
125                ;;
126esac
127
128case "$host_cpu" in
129        *arm*)
130                AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
131                use_arm_toolchain=yes
132                ;;
133esac
134
135AC_ARG_WITH( realprefix,
136      [  --with-realprefix      Set the real installation prefix. This option has to be used for cross-compilation only. (ex:/usr or /usr/local)[default=none] ],
137      [ realprefix=${withval}],[ realprefix="none" ])
138
139
140
141AC_ARG_ENABLE(manual,
142      [  --disable-manual    Do not attempt to build html linphone's user documentation],
143      [case "${enableval}" in
144        yes) build_manual=yes ;;
145        no)  build_manual=false ;;
146        *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
147      esac],[build_manual=yes])
148
149
150dnl enable ipv6 support
151AC_ARG_ENABLE(ipv6,
152      [  --enable-ipv6    Turn on ipv6 support],
153      [case "${enableval}" in
154        yes)  ipv6=true;;
155        no)   ipv6=false;;
156        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
157      esac],[ipv6=true])
158IPV6_CFLAGS=
159if test x$ipv6 = xtrue ; then
160        IPV6_CFLAGS=-DINET6
161fi
162AC_SUBST(IPV6_CFLAGS)
163
164dnl enable truespeech codec support
165AC_ARG_ENABLE(truespeech,
166      [  --enable-truespeech    Turn on TrueSpeech support (x86 only)],
167      [case "${enableval}" in
168        yes)  truespeech=true;;
169        no)   truespeech=false;;
170        *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
171      esac],[truespeech=false])
172TRUESPEECH_CFLAGS=
173if test x$truespeech = xtrue ; then
174        TRUESPEECH_CFLAGS=-DTRUESPEECH
175fi
176AC_SUBST(TRUESPEECH_CFLAGS)
177AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])
178
179
180
181
182dnl support for RSVP (by Vincent Maury)
183AC_ARG_ENABLE(rsvp,
184[  --enable-rsvp           enable support for QoS reservations.],
185AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
186should be compiled.]) )
187
188if test "x${prefix}" = "xNONE"; then
189        package_prefix=${ac_default_prefix}
190else
191        package_prefix=${prefix}
192fi
193
194if test x$mingw_found = xyes ; then
195dnl allow binaries to install everywhere
196package_prefix="."
197fi
198
199dnl Set PACKAGE_LOCALE_DIR in config.h.
200DATADIRNAME=share
201AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
202
203AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
204
205dnl Set PACKAGE_SOUND_DIR in config.h.
206AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
207
208
209dnl check if we have the getifaddrs() sytem call
210AC_CHECK_FUNCS(getifaddrs)
211
212dnl check for osip2
213LP_CHECK_OSIP2
214
215dnl setup flags for exosip library
216LP_SETUP_EXOSIP
217
218if test "$console_ui" = "true" ; then
219dnl check gnu readline
220LP_CHECK_READLINE
221else
222echo "Console interface compilation is disabled."
223fi
224
225AC_WORDS_BIGENDIAN
226
227dnl normaly this should only by done by mediastreamer2/configure.ac
228dnl but to workaround bugs when cross-compiling for arm-linux,
229dnl we need to have SPEEX_LIBS defined
230dnl Furthermore it is good to repeat here all mediastreamer2 toggles
231dnl since top-level configure --help will not print them.
232
233PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
234AC_SUBST(SPEEX_LIBS)
235
236dnl conditionnal build of video support
237AC_ARG_ENABLE(video,
238                [  --enable-video    Turn on video support compiling],
239                [case "${enableval}" in
240                yes) video=true ;;
241                no)  video=false ;;
242                *) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
243                esac],[video=true])
244               
245AC_ARG_WITH( ffmpeg,
246                [  --with-ffmpeg                Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
247                [ ffmpegdir=${withval}],[ ffmpegdir=/usr ])
248
249AC_ARG_WITH( sdl,
250                [  --with-sdl           Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
251                [ libsdldir=${withval}],[ libsdldir=/usr ])
252
253if test "$video" = "true"; then
254        AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
255fi
256
257AC_ARG_ENABLE(alsa,
258      [  --enable-alsa    Turn on alsa native support compiling],
259      [case "${enableval}" in
260        yes) alsa=true ;;
261        no)  alsa=false ;;
262        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
263      esac],[alsa=true])
264
265AC_ARG_ENABLE(artsc,
266      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
267      [case "${enableval}" in
268        yes) artsc=true ;;
269        no)  artsc=false ;;
270        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
271      esac],[artsc=false])
272
273AC_ARG_ENABLE(portaudio,
274      [  --enable-portaudio    Turn on portaudio native support compiling],
275      [case "${enableval}" in
276        yes) portaudio=true ;;
277        no)  portaudio=false ;;
278        *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
279      esac],[portaudio=false])
280
281dnl build console if required
282AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
283dnl special things for arm-linux cross compilation toolchain
284AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
285dnl compilation of gtk-glade user interface
286AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
287AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
288
289##################################################
290# Stricter build options (after external packages)
291##################################################
292
293
294AC_ARG_ENABLE(strict,
295        AC_HELP_STRING([--enable-strict],
296                       [Build with stricter options (gcc only) @<:@yes@:>@]),[
297        strictness="${enableval}"],[strictness=yes]
298)
299
300if test "$GCC$strictness" = "yesyes" ; then
301        STRICT_OPTIONS="-Wall -Wp,-D_FORTIFY_SOURCE=2"
302        STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
303        CFLAGS="$CFLAGS -fno-strict-aliasing"
304fi
305
306AC_SUBST(STRICT_OPTIONS)
307
308AC_CONFIG_SUBDIRS( mediastreamer2 )
309
310dnl check for db2html (docbook) to generate html user manual
311AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
312AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )
313
314dnl for external use of linphone libs
315LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone  "
316LINPHONE_LIBS="-L${libdir}  -llinphone"
317
318if test x$mingw_found = xyes ; then
319        LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
320fi
321AC_SUBST(LINPHONE_CFLAGS)
322AC_SUBST(LINPHONE_LIBS)
323
324
325AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])
326
327AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
328LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
329AC_SUBST(LINPHONE_PLUGINS_DIR)
330
331AC_ARG_ENABLE(external-ortp,
332      [  --enable-external-ortp    Use external oRTP library],
333      [case "${enableval}" in
334        yes) external_ortp=true ;;
335        no)  external_ortp=false ;;
336        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
337      esac],[external_ortp=false])
338
339if test "$external_ortp" = 'true'; then
340        LP_CHECK_ORTP
341else
342        AC_CONFIG_SUBDIRS( oRTP )
343        ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
344        ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
345        if test x$ac_cv_c_bigendian = xyes ; then
346                ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
347        fi
348fi
349AC_SUBST(ORTP_CFLAGS)
350AC_SUBST(ORTP_LIBS)
351
352AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])
353
354dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac
355dnl Feel free to propose an alternative & cleaner version...
356top_srcdir=`dirname $0`
357changequote(, )dnl
358ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
359MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
360changequote([, ])dnl
361AC_SUBST([ORTP_VERSION])
362AC_SUBST([MS2_VERSION])
363
364AC_OUTPUT([
365Makefile
366m4/Makefile
367po/Makefile.in
368pixmaps/Makefile
369ipkg/Makefile
370ipkg/linphone.control
371coreapi/Makefile
372gtk-glade/Makefile
373console/Makefile
374share/Makefile
375share/C/Makefile
376share/fr/Makefile
377share/it/Makefile
378share/ja/Makefile
379share/cs/Makefile
380share/linphone.pc
381linphone.spec
382linphone.iss
383])
384
385echo "Linphone build configuration ended."
386
387if test x$gtk_ui = xtrue ; then
388        echo "* GTK interface will be compiled."
389fi
390if test x$console_ui = xtrue ; then
391        echo "* Console interface will be compiled."
392fi
393
394echo "Now type 'make' to compile, and then 'make install' as root to install it."
Note: See TracBrowser for help on using the repository browser.