configure.ac 17.4 KB
Newer Older
aymeric's avatar
aymeric committed
1 2
dnl Process this file with autoconf to produce a configure script.

Sylvain Berfini's avatar
Sylvain Berfini committed
3
AC_INIT([linphone],[3.4.99.4],[linphone-developers@nongnu.org])
4
AC_CANONICAL_SYSTEM
5
AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
aymeric's avatar
aymeric committed
6 7 8 9 10 11 12 13 14

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
15 16 17 18
LINPHONE_VERSION=$LINPHONE_MAJOR_VERSION.$LINPHONE_MINOR_VERSION.${LINPHONE_MICRO_VERSION}
if test "$LINPHONE_EXTRA_VERSION" != "" ;then
	LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION}
fi
Simon Morlat's avatar
Simon Morlat committed
19 20 21 22 23 24

LIBLINPHONE_SO_CURRENT=4 dnl increment this number when you add/change/remove an interface
LIBLINPHONE_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
LIBLINPHONE_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface

LIBLINPHONE_SO_VERSION=$LIBLINPHONE_SO_CURRENT:$LIBLINPHONE_SO_REVISION:$LIBLINPHONE_SO_AGE
aymeric's avatar
aymeric committed
25 26 27 28 29 30 31

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)])

32 33
AM_INIT_AUTOMAKE
AC_SUBST([LIBTOOL_DEPS])
34
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
aymeric's avatar
aymeric committed
35
AC_CONFIG_HEADER(config.h)
smorlat's avatar
smorlat committed
36
AC_CONFIG_MACRO_DIR([m4])
aymeric's avatar
aymeric committed
37 38 39 40 41 42
AC_SUBST([mkdir_p])
AC_ISC_POSIX
AC_PROG_CC
AC_C_INLINE
AM_PROG_CC_STDC
AC_HEADER_STDC
43
AM_PROG_CC_C_O
Simon Morlat's avatar
Simon Morlat committed
44 45
AC_CHECK_PROGS(MD5SUM,[md5sum md5])
AM_CONDITIONAL(HAVE_MD5SUM,test -n $MD5SUM)
46 47

case $target_os in
48
	*mingw32ce)
Jehan Monnier's avatar
Jehan Monnier committed
49
       	CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
50 51
       	CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
       	LIBS="$LIBS -lws2 -liphlpapi"
52
		mingw_found=yes
53
		mingwce_found=yes
54
		;;
55
	*mingw*)
56
		CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
57 58 59 60 61 62
		CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
		LIBS="$LIBS -lws2_32"
		GUI_FLAGS="-mwindows"
		CONSOLE_FLAGS="-mconsole"
		mingw_found=yes
	;;
smorlat's avatar
smorlat committed
63 64 65
	*darwin*)
		dnl use macport installation
		ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
66
		build_macos=yes
smorlat's avatar
smorlat committed
67
	;;
68 69
esac

smorlat's avatar
smorlat committed
70
AC_SUBST(ACLOCAL_MACOS_FLAGS)
71 72 73
AC_SUBST(CONSOLE_FLAGS)
AC_SUBST(GUI_FLAGS)

aymeric's avatar
aymeric committed
74
dnl localization tools
75 76
IT_PROG_INTLTOOL([0.40], [no-xml])

aymeric's avatar
aymeric committed
77
dnl Initialize libtool
78
LT_INIT([win32-dll shared disable-static])
79

80 81 82 83 84 85 86 87
AC_CONFIG_COMMANDS([libtool-hacking],[
if test "$mingw_found" = "yes" ; then
	echo "Hacking libtool to work with mingw..."
	sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
	cp -f ./libtool.tmp ./libtool
	rm -f ./libtool.tmp
fi
],[mingw_found=$mingw_found])
88

aymeric's avatar
aymeric committed
89 90
dnl Add the languages which your application supports here.
PKG_PROG_PKG_CONFIG
91
ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru zh_CN nb_NO zh_TW"
strk's avatar
strk committed
92
AC_SUBST(ALL_LINGUAS)
smorlat's avatar
smorlat committed
93
AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages])
94 95

if test "$mingw_found" != "yes" ; then
96
dnl gettext macro does not work properly under mingw. And we want to use the one provided by GTK.
aymeric's avatar
aymeric committed
97
AM_GNU_GETTEXT([external])
98
LIBS="$LIBS $LIBINTL"
99
else
100 101 102
	AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
	AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
	LIBS="$LIBS -lintl"
103 104 105
fi

GETTEXT_PACKAGE=linphone
aymeric's avatar
aymeric committed
106 107
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",[The name of the gettext package name])
108
dnl AC_CHECK_LIB(intl,libintl_gettext)
aymeric's avatar
aymeric committed
109 110 111

AC_CHECK_FUNCS([get_current_dir_name strndup stpcpy] )

112 113 114 115 116 117 118 119
AC_ARG_ENABLE(x11,
			  [  --disable-x11    Disable X11 support],
		 	  [case "${enableval}" in
			  yes) enable_x11=true ;;
			  no)  enable_x11=false ;;
			  *) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
		  	  esac],[enable_x11=true])

aymeric's avatar
aymeric committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
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
smorlat's avatar
smorlat committed
139
	PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
jehan's avatar
jehan committed
140
	if test "$enable_x11" = "false" ; then
141
		PKG_CHECK_MODULES(LIBGTKMAC,[ige-mac-integration >= 0.9.7 ])
jehan's avatar
jehan committed
142
		AC_DEFINE([HAVE_GTK_OSX],[1],[Defined when gtk osx is used])
143
	fi
aymeric's avatar
aymeric committed
144 145 146 147
else
	echo "GTK interface compilation is disabled."
fi

148 149 150 151 152 153 154 155 156 157 158
AC_ARG_ENABLE(notify,
		[  --enable-notify=[yes/no]    Enable libnotify support [default=yes]],
		[case "${enableval}" in
		  yes) notify=true ;;
		  no)  notify=false ;;
		  *) AC_MSG_ERROR(bad value ${enableval} for --enable-notify) ;;
		esac],[notify=true])

dnl conditionnal build of the notify library
if test "$gtk_ui" = "true" ; then
	if test "$notify" = "true"; then
159 160
		PKG_CHECK_MODULES([NOTIFY4], [libnotify >= 0.7.0 ], [found_notify4=yes], foo=bar)
		case "$found_notify4" in
161
		  yes)
162 163 164
				AC_SUBST(NOTIFY4_CFLAGS)
				AC_SUBST(NOTIFY4_LIBS)
				AC_DEFINE([HAVE_NOTIFY4],[1],[NOTIFY4 support])
165
		esac
166 167 168 169 170 171 172 173

                PKG_CHECK_MODULES([NOTIFY1], [libnotify < 0.7.0], [found_notify1=yes], foo=bar)
                case "$found_notify1" in
                  yes)
                                AC_SUBST(NOTIFY1_CFLAGS)
                                AC_SUBST(NOTIFY1_LIBS)
                                AC_DEFINE([HAVE_NOTIFY1],[1],[NOTIFY1 support])
                esac
174
	else
175
				NotifyNotification *n;
176 177 178
		echo "Libnotify support is disabled."
	fi
fi
aymeric's avatar
aymeric committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

dnl os-specific problems not handled by existing macros.
case "$host_os" in
	*freebsd*)
		LDFLAGS="$LDFLAGS -pthread"
		;;
esac

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

smorlat's avatar
smorlat committed
194 195 196
AC_ARG_WITH( configdir,
      [  --with-configdir      Set a APPDATA subdir where linphone is supposed to find its config (windows only) ],
      [ configdir=${withval}],[ configdir="Linphone" ])
aymeric's avatar
aymeric committed
197

smorlat's avatar
smorlat committed
198
AC_DEFINE_UNQUOTED(LINPHONE_CONFIG_DIR,"$configdir",[Windows appdata subdir where linphonerc can be found])
aymeric's avatar
aymeric committed
199

200 201
AC_ARG_ENABLE(relativeprefix,
      [  --enable-relativeprefix    Build a linphone that finds its resources relatively to the directory where it is installed],
aymeric's avatar
aymeric committed
202
      [case "${enableval}" in
203 204 205
        yes) relativeprefix=yes ;;
        no)  relativeprefix=no ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-relativeprefix) ;;
Simon Morlat's avatar
Simon Morlat committed
206
      esac],[relativeprefix=guess])
aymeric's avatar
aymeric committed
207

208 209 210 211 212 213 214 215 216 217 218 219
AC_ARG_ENABLE(date,
      [  --enable-date    Use build date in internal version number],
      [case "${enableval}" in
        yes) use_date=yes ;;
        no)  use_date=no ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-date) ;;
      esac],[use_date=no])

if test x$use_date =  xyes ; then
	AC_DEFINE(USE_BUILDDATE_VERSION,1,[Tell whether date_version.h must be used])
fi

aymeric's avatar
aymeric committed
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

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])

250 251 252 253 254 255 256 257 258
AC_ARG_ENABLE(nonstandard-gsm,
      [  --enable-nonstandard-gsm    Enable GSM codec at nonstandard rates (11025hz, 16000hz)],
      [case "${enableval}" in
        yes) exotic_gsm=yes
	AC_DEFINE(ENABLE_NONSTANDARD_GSM,1,[Defined when using gsm at nonstandard rates])
	 ;;
        no)  exotic_gsm=no ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-nonstandard-gsm) ;;
      esac],[exotic_gsm=no])
aymeric's avatar
aymeric committed
259 260 261 262 263 264 265 266 267


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
simorl's avatar
simorl committed
268 269 270 271 272
	package_prefix=${ac_default_prefix}
else
	package_prefix=${prefix}
fi

Simon Morlat's avatar
Simon Morlat committed
273 274 275 276 277
if test "$relativeprefix" = "guess" ; then
	if test "$mingw_found" = "yes" ; then
		relativeprefix="yes"
	fi
fi
278 279 280 281

if test "$relativeprefix" = "yes" ; then
	dnl allow binaries to install everywhere
	package_prefix="."
aymeric's avatar
aymeric committed
282 283 284 285
fi

dnl Set PACKAGE_LOCALE_DIR in config.h.
DATADIRNAME=share
simorl's avatar
simorl committed
286
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${package_prefix}/${DATADIRNAME}/locale",[Defines the place where locales can be found])
aymeric's avatar
aymeric committed
287

simorl's avatar
simorl committed
288
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/${DATADIRNAME}",[Defines the place where data are found])
aymeric's avatar
aymeric committed
289 290

dnl Set PACKAGE_SOUND_DIR in config.h.
simorl's avatar
simorl committed
291
AC_DEFINE_UNQUOTED(PACKAGE_SOUND_DIR, "${package_prefix}/${DATADIRNAME}/sounds/linphone",[Defines the place where linphone sounds are found])
aymeric's avatar
aymeric committed
292 293 294 295 296 297 298 299


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

dnl check for osip2
LP_CHECK_OSIP2

jehan's avatar
jehan committed
300 301 302 303 304 305 306 307 308 309 310 311
dnl conditionnal build for ssl
AC_ARG_ENABLE(ssl,
		[  --enable-ssl    Turn on ssl support compiling. Required for sip tls. default = false],
		[case "${enableval}" in
		yes) build_ssl=true ;;
		no)  build_ssl=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-ssl) ;;
		esac],[build_ssl=false])

if test "$build_ssl" = "true"; then
	PKG_CHECK_MODULES(OPENSSL, libssl >= 0.9.8)
fi
aymeric's avatar
aymeric committed
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
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)

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 ])

if test "$video" = "true"; then
346 347
	
	if test "$enable_x11" = "true"; then
348
	  	AC_CHECK_HEADERS(X11/Xlib.h)
jehan's avatar
jehan committed
349 350 351 352 353
		if test "$build_macos" = "yes"; then 
			X11_LIBS="-L/usr/X11/lib -lX11"
		else
			AC_CHECK_LIB(X11,XUnmapWindow, X11_LIBS="-lX11")
		fi
354
		AC_SUBST(X11_LIBS)
355
	fi
aymeric's avatar
aymeric committed
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
	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 build console if required
AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
dnl special things for arm-linux cross compilation toolchain
AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
387 388
dnl compilation of gtk user interface
AM_CONDITIONAL(BUILD_GTK_UI, [test x$gtk_ui = xtrue ] )
389
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
aymeric's avatar
aymeric committed
390

391 392 393 394 395 396 397 398 399 400 401 402 403
dnl check getenv
AH_TEMPLATE([HAVE_GETENV])
AC_CHECK_FUNC([getenv], AC_DEFINE([HAVE_GETENV], [1], [If present, the getenv function allows fim to read environment variables.]))

dnl
AC_MSG_CHECKING([for sighandler_t])
AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
has_sighandler_t=yes,has_sighandler_t=no)
AC_MSG_RESULT($has_sighandler_t)
if test "$has_sighandler_t" = "yes" ; then
    AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
fi

aymeric's avatar
aymeric committed
404 405 406 407 408 409 410 411 412 413 414
##################################################
# 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]
)

415 416
STRICT_OPTIONS="-Wall "

aymeric's avatar
aymeric committed
417 418 419 420 421 422 423
if test "$GCC$strictness" = "yesyes" ; then
	STRICT_OPTIONS="$STRICT_OPTIONS -Werror"
	CFLAGS="$CFLAGS -fno-strict-aliasing"
fi

AC_SUBST(STRICT_OPTIONS)

424 425 426 427 428 429 430 431 432 433
top_srcdir=`dirname $0`

AC_ARG_ENABLE([external-mediastreamer],
      [AS_HELP_STRING([--enable-external-mediastreamer],[Use external mediastreamer library])],,
      [enable_external_mediastreamer=no])

AS_CASE($enable_external_mediastreamer,
		[yes],[
			PKG_CHECK_MODULES([MEDIASTREAMER], [mediastreamer])
			MS2_VERSION=`$PKG_CONFIG --modversion mediastreamer`
434
			],
435 436 437 438 439 440 441 442 443
		[no],[
			AC_CONFIG_SUBDIRS( mediastreamer2 )
			MEDIASTREAMER_DIR=${top_srcdir}/mediastreamer2
			MEDIASTREAMER_CFLAGS="-I\$(top_srcdir)/mediastreamer2/include"
			MEDIASTREAMER_LIBS="\$(top_builddir)/mediastreamer2/src/libmediastreamer.la"
dnl need to temporary change quotes to allow square brackets
		 	changequote(<<, >>)
			MS2_VERSION=`grep -e '^.C_INIT(' $MEDIASTREAMER_DIR/configure.ac | sed -e 's:\([^(]\+\)(\[mediastreamer\],\[\(.*\)\]):\2:g'`
			changequote([, ])
444 445
			MS2_DIR=mediastreamer2
			],
446 447 448 449 450
        [AC_MSG_ERROR([bad value '${enable_external_mediastreamer}' for --enable-external-mediastreamer])])

AC_SUBST(MEDIASTREAMER_CFLAGS)
AC_SUBST(MEDIASTREAMER_LIBS)
AC_SUBST([MS2_VERSION])
451
AC_SUBST([MS2_DIR])
aymeric's avatar
aymeric committed
452 453 454 455 456 457

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
458 459
LINPHONE_CFLAGS="-I${includedir} -I${includedir}/linphone"
LINPHONE_LIBS="-L${libdir} -llinphone"
simorl's avatar
simorl committed
460 461 462 463

if test x$mingw_found = xyes ; then
	LINPHONE_LIBS="$LINPHONE_LIBS $OSIP_LIBS"
fi
aymeric's avatar
aymeric committed
464 465 466 467 468
AC_SUBST(LINPHONE_CFLAGS)
AC_SUBST(LINPHONE_LIBS)

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

simorl's avatar
simorl committed
469 470
AC_DEFINE_UNQUOTED(LINPHONE_PLUGINS_DIR, "${package_prefix}/lib/liblinphone/plugins" ,[path of liblinphone plugins, not mediastreamer2 plugins])
LINPHONE_PLUGINS_DIR="${package_prefix}/lib/liblinphone/plugins"
smorlat's avatar
smorlat committed
471
AC_SUBST(LINPHONE_PLUGINS_DIR)
aymeric's avatar
aymeric committed
472 473 474 475 476 477 478 479 480 481

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
482 483
	PKG_CHECK_MODULES([ORTP], [ortp])
	ORTP_VERSION=`$PKG_CONFIG --modversion ortp`
aymeric's avatar
aymeric committed
484 485 486 487 488 489 490
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
491
	ORTP_DIR=oRTP
492 493 494
	changequote(<<, >>)
	ORTP_VERSION=`grep -E ^[AC]+_INIT ${top_srcdir}/oRTP/configure.ac | sed -e 's:^.*_INIT(.*,\[\(.*\)\]):\1:g'`
	changequote([, ])
aymeric's avatar
aymeric committed
495 496 497
fi
AC_SUBST(ORTP_CFLAGS)
AC_SUBST(ORTP_LIBS)
498
AC_SUBST([ORTP_VERSION])
499
AC_SUBST([ORTP_DIR])
aymeric's avatar
aymeric committed
500

501 502 503 504 505 506 507 508 509
AC_ARG_ENABLE(tests_enabled,
      [  --disable-tests    Disable compilation of tests],
      [case "${enableval}" in
        yes) tests_enabled=true ;;
        no)  tests_enabled=false ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
      esac],[tests_enabled=false])
AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes)

510 511 512 513 514 515 516
dnl ##################################################
dnl # Check for doxygen
dnl ##################################################

AC_PATH_PROG(DOXYGEN,doxygen,false)
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)

Jehan Monnier's avatar
Jehan Monnier committed
517

518
AC_CONFIG_FILES([ 
519 520 521 522
Makefile
build/Makefile
build/macos/Makefile
build/macos/Info-linphone.plist
aymeric's avatar
aymeric committed
523
m4/Makefile
524
po/Makefile.in
aymeric's avatar
aymeric committed
525 526
pixmaps/Makefile
coreapi/Makefile
527 528
coreapi/help/Makefile
coreapi/help/Doxyfile
529
gtk/Makefile
aymeric's avatar
aymeric committed
530 531 532 533 534 535 536 537
console/Makefile
share/Makefile
share/C/Makefile
share/fr/Makefile
share/it/Makefile
share/ja/Makefile
share/cs/Makefile
share/linphone.pc
538
share/linphone.desktop
smorlat's avatar
smorlat committed
539
scripts/Makefile
aymeric's avatar
aymeric committed
540
linphone.spec
simorl's avatar
simorl committed
541
linphone.iss
aymeric's avatar
aymeric committed
542 543
])

544 545
AC_OUTPUT

aymeric's avatar
aymeric committed
546 547 548
echo "Linphone build configuration ended."

if test x$gtk_ui = xtrue ; then
smorlat's avatar
smorlat committed
549
	echo "* GTK interface will be compiled."
aymeric's avatar
aymeric committed
550
fi
smorlat's avatar
smorlat committed
551 552
if test x$console_ui = xtrue ; then
	echo "* Console interface will be compiled."
aymeric's avatar
aymeric committed
553 554 555
fi

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