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