~ubuntu-branches/ubuntu/natty/linphone/natty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
dnl Process this file with autoconf to produce a configure script.

AC_INIT([linphone],[2.0.1],[linphone-developers@nongnu.org])

dnl Source packaging numbers

LINPHONE_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
LINPHONE_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
LINPHONE_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
LINPHONE_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)

dnl program extension
LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}.${LINPHONE_EXTRA_VERSION}

LIBLINPHONE_SO_VERSION=`expr $LINPHONE_MINOR_VERSION + $LINPHONE_MAJOR_VERSION`:$LINPHONE_MICRO_VERSION:$LINPHONE_MINOR_VERSION

AC_SUBST(LIBLINPHONE_SO_VERSION, $LIBLINPHONE_SO_VERSION)
AC_SUBST(LINPHONE_VERSION)

AC_MSG_NOTICE([$PACKAGE_NAME-$PACKAGE_VERSION		A full featured audio/video sip phone.])
AC_MSG_NOTICE([licensed under the terms of the General Public License (GPL)])

AM_INIT_AUTOMAKE([tar-ustar])
AC_CONFIG_HEADER(config.h)

AC_SUBST([mkdir_p])
AC_ISC_POSIX
AC_PROG_CC
AC_C_INLINE
AM_PROG_CC_STDC
AC_HEADER_STDC
dnl localization tools
ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL],[AC_PROG_INTLTOOL])
dnl Initialize libtool
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
dnl Add the languages which your application supports here.
PKG_PROG_PKG_CONFIG
ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR"
GETTEXT_PACKAGE=linphone
AM_GNU_GETTEXT([external])
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
AC_CHECK_LIB(intl,libintl_gettext)

AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )

dnl conditionnal build of console interface.
AC_ARG_ENABLE(console_ui,
      [  --enable-console_ui=[yes/no]    Turn on or off compilation of console interface [default=yes]],
      [case "${enableval}" in
        yes) console_ui=true ;;
        no)  console_ui=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-console_ui) ;;
      esac],[console_ui=true])

dnl conditionnal build of gtk interface.
AC_ARG_ENABLE(gtk_ui,
      [  --enable-gtk_ui=[yes/no]    Turn on or off compilation of gtk interface [default=yes]],
      [case "${enableval}" in
        yes) gtk_ui=true ;;
        no)  gtk_ui=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk_ui) ;;
      esac],[gtk_ui=true])

if test "$gtk_ui" = "true" ; then

PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0, ,gtk_ui=false)
AC_SUBST(LIBGTK_CFLAGS)
AC_SUBST(LIBGTK_LIBS)

if test "$gtk_ui" = "true" ; then
  AC_DEFINE(HAVE_GTK,1,[Defined if we can use the gtk api])
else
  missing_gtk_libs=true
fi
  
else
echo "GTK interface compilation is disabled."
fi

if test "gtk_ui" = "true" ; then
    PKG_CHECK_MODULES(GNOME_APPLETS, libpanelapplet-2.0 >= 2.0.0 , 
                    build_gnome_applet=true,build_gnome_applet=false)
    AC_SUBST(GNOME_APPLETS_CFLAGS)
    AC_SUBST(GNOME_APPLETS_LIBS)
else
    build_gnome_applet=false
fi


dnl os-specific problems not handled by existing macros.
case "$host_os" in
	*freebsd*)
		LDFLAGS="$LDFLAGS -pthread"
		AC_DEFINE(__FreeBSD__,1,[Defined if we are compiling for FreeBSD])
		;;
	*linux*)
		AC_DEFINE(__LINUX__,1,[Defined if we are compiling for linux])
		;;
esac

case "$host_cpu" in
	*arm*)
		AC_DEFINE(__ARM__,1,[Defined if we are compiling for arm processor])
		use_arm_toolchain=yes
		;;
esac

AC_ARG_WITH( realprefix,
      [  --with-realprefix      Set the real installation prefix. This option has to be used for cross-compilation only. (ex:/usr or /usr/local)[default=none] ],
      [ realprefix=${withval}],[ realprefix="none" ])



AC_ARG_ENABLE(manual,
      [  --disable-manual    Do not attempt to build html linphone's user documentation],
      [case "${enableval}" in
        yes) build_manual=yes ;;
        no)  build_manual=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-manual) ;;
      esac],[build_manual=yes])


dnl enable ipv6 support
AC_ARG_ENABLE(ipv6,
      [  --enable-ipv6    Turn on ipv6 support],
      [case "${enableval}" in
        yes)  ipv6=true;;
        no)   ipv6=false;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
      esac],[ipv6=true])
IPV6_CFLAGS=
if test x$ipv6 = xtrue ; then
	IPV6_CFLAGS=-DINET6
fi
AC_SUBST(IPV6_CFLAGS)

dnl enable truespeech codec support
AC_ARG_ENABLE(truespeech,
      [  --enable-truespeech    Turn on TrueSpeech support (x86 only)],
      [case "${enableval}" in
        yes)  truespeech=true;;
        no)   truespeech=false;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-truespeech) ;;
      esac],[truespeech=false])
TRUESPEECH_CFLAGS=
if test x$truespeech = xtrue ; then
	TRUESPEECH_CFLAGS=-DTRUESPEECH
fi
AC_SUBST(TRUESPEECH_CFLAGS)
AM_CONDITIONAL([BUILD_TRUESPEECH], [test x$truespeech = xtrue])




dnl support for RSVP (by Vincent Maury)
AC_ARG_ENABLE(rsvp,
[  --enable-rsvp           enable support for QoS reservations.],
AC_DEFINE(VINCENT_MAURY_RSVP,1,[Tell whether RSVP support
should be compiled.]) )

if test "x${prefix}" = "xNONE"; then
	prefix=${ac_default_prefix}
fi

dnl Set PACKAGE_LOCALE_DIR in config.h.
DATADIRNAME=share
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])

AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/${DATADIRNAME}",[Defines the place where data are found])

dnl Set PACKAGE_SOUND_DIR in config.h.
AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])


dnl check if we have the getifaddrs() sytem call
AC_CHECK_FUNCS(getifaddrs)

dnl check for osip2
LP_CHECK_OSIP2

dnl setup flags for exosip library
LP_SETUP_EXOSIP

if test "$console_ui" = "true" ; then
dnl check gnu readline
LP_CHECK_READLINE
else
echo "Console interface compilation is disabled."
fi

AC_WORDS_BIGENDIAN

dnl normaly this should only by done by mediastreamer2/configure.ac
dnl but to workaround bugs when cross-compiling for arm-linux,
dnl we need to have SPEEX_LIBS defined
dnl Furthermore it is good to repeat here all mediastreamer2 toggles
dnl since top-level configure --help will not print them.

PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, build_speex=yes)
AC_SUBST(SPEEX_LIBS)

dnl conditionnal build of video support
AC_ARG_ENABLE(video,
		[  --enable-video    Turn on video support compiling],
		[case "${enableval}" in
		yes) video=true ;;
		no)  video=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-video) ;;
		esac],[video=true])
		
AC_ARG_WITH( ffmpeg,
		[  --with-ffmpeg		Sets the installation prefix of ffmpeg, needed for video support. [default=/usr] ],
		[ ffmpegdir=${withval}],[ ffmpegdir=/usr ])

AC_ARG_WITH( sdl,
		[  --with-sdl		Sets the installation prefix of libSDL, needed for video support. [default=/usr] ],
		[ libsdldir=${withval}],[ libsdldir=/usr ])

if test "$video" = "true"; then
	AC_DEFINE(VIDEO_ENABLED,1,[defined if video support is available])
fi

AC_ARG_ENABLE(alsa,
      [  --enable-alsa    Turn on alsa native support compiling],
      [case "${enableval}" in
        yes) alsa=true ;;
        no)  alsa=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
      esac],[alsa=true])

AC_ARG_ENABLE(artsc,
      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
      [case "${enableval}" in
        yes) artsc=true ;;
        no)  artsc=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
      esac],[artsc=false])

AC_ARG_ENABLE(portaudio,
      [  --enable-portaudio    Turn on portaudio native support compiling],
      [case "${enableval}" in
        yes) portaudio=true ;;
        no)  portaudio=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-portaudio) ;;
      esac],[portaudio=false])

dnl same thing for media_api
AM_CONDITIONAL(BUILD_MEDIA_API, test x$media_api = xtrue)


dnl build console if required
AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
dnl build gtk if required
AM_CONDITIONAL(BUILD_GTK, test x$gtk_ui = xtrue)
dnl build gnome applet if possible
AM_CONDITIONAL(BUILD_GNOME_APPLET, test x$build_gnome_applet = xtrue)
dnl special things for arm-linux cross compilation toolchain
AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)


##################################################
# Stricter build options (after external packages)
##################################################


AC_ARG_ENABLE(strict,
	AC_HELP_STRING([--enable-strict],
		       [Build with stricter options (gcc only) @<:@yes@:>@]),[
	strictness="${enableval}"],[strictness=yes]
)

if test "$GCC$strictness" = "yesyes" ; then
	STRICT_OPTIONS="-Wall -Wp,-D_FORTIFY_SOURCE=2"
	STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
	CFLAGS="$CFLAGS -fno-strict-aliasing"
fi

AC_SUBST(STRICT_OPTIONS)

AC_CONFIG_SUBDIRS( mediastreamer2 )

dnl check for db2html (docbook) to generate html user manual
AC_CHECK_PROG(have_sgmltools,sgmltools, yes, no)
AM_CONDITIONAL(ENABLE_MANUAL, test x$have_sgmltools$build_manual = xyesyes )

dnl for external use of linphone libs
LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone -I${includedir}/ortp "
LINPHONE_LIBS="-L${libdir}  -llinphone"
AC_SUBST(LINPHONE_CFLAGS)
AC_SUBST(LINPHONE_LIBS)


AC_DEFINE_UNQUOTED(LINPHONE_VERSION,"$PACKAGE_VERSION",[Linphone's version number])


AC_ARG_ENABLE(external-ortp,
      [  --enable-external-ortp    Use external oRTP library],
      [case "${enableval}" in
        yes) external_ortp=true ;;
        no)  external_ortp=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
      esac],[external_ortp=false])

if test "$external_ortp" = 'true'; then
	LP_CHECK_ORTP
else
	AC_CONFIG_SUBDIRS( oRTP )
	ORTP_CFLAGS="-I\$(top_srcdir)/oRTP/include"
	ORTP_LIBS="\$(top_builddir)/oRTP/src/libortp.la"
	if test x$ac_cv_c_bigendian = xyes ; then
		ORTP_CFLAGS="$ORTP_CFLAGS -DORTP_BIGENDIAN"
	fi
fi
AC_SUBST(ORTP_CFLAGS)
AC_SUBST(ORTP_LIBS)

AM_CONDITIONAL(EXTERNAL_ORTP, [test "$external_ortp" = 'true'])

dnl Packaging: Pick oRTP version from ${top_srcdir}/oRTP/configure.ac
dnl Feel free to propose an alternative & cleaner version...
top_srcdir=`dirname $0`
changequote(, )dnl
ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
MS2_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/mediastreamer2/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
changequote([, ])dnl
AC_SUBST([ORTP_VERSION])
AC_SUBST([MS2_VERSION])

AC_OUTPUT([ 
Makefile 
m4/Makefile
po/Makefile.in 
pixmaps/Makefile
ipkg/Makefile
ipkg/linphone.control
media_api/Makefile
coreapi/Makefile
gtk/Makefile
console/Makefile
share/Makefile
share/C/Makefile
share/fr/Makefile
share/it/Makefile
share/ja/Makefile
share/cs/Makefile
share/linphone.pc
linphone.spec
])

echo "Linphone build configuration ended."

if test x$gtk_ui = xtrue ; then
echo "* GTK interface will be compiled."
fi
if test x$gtk_ui = xtrue ; then
echo "* Console interface will be compiled."
fi
if test "$have_db2html" = "no" ; then
	echo "* db2html not found; user documentation will not be generated."
fi

echo "Now type 'make' to compile, and then 'make install' as root to install it."