summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac120
1 files changed, 116 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 81f15eca..dba051c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,11 @@ AM_INIT_AUTOMAKE([1.10 -Wall subdir-objects])
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11AC_CONFIG_MACRO_DIR([m4]) 11AC_CONFIG_MACRO_DIR([m4])
12 12
13EXTRA_LT_LDFLAGS=
14
13LIBTOXCORE_LT_VERSION=0:0:0 15LIBTOXCORE_LT_VERSION=0:0:0
16LIBTOXMSI_LT_VERSION=0:0:0
17LIBTOXRTP_LT_VERSION=0:0:0
14dnl 18dnl
15dnl current:revision:age 19dnl current:revision:age
16dnl 20dnl
@@ -19,7 +23,13 @@ dnl revision: increment if source code has changed, set to zero if current is
19dnl incremented 23dnl incremented
20dnl age: increment if interfaces have been added, set to zero if 24dnl age: increment if interfaces have been added, set to zero if
21dnl interfaces have been removed or changed 25dnl interfaces have been removed or changed
22EXTRA_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" 26TOXCORE_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION"
27TOXMSI_LT_LDFLAGS="-version-info $LIBTOXMSI_LT_VERSION"
28TOXRTP_LT_LDFLAGS="-version-info $LIBTOXMSI_LT_VERSION"
29
30AC_SUBST(TOXCORE_LT_LDFLAGS)
31AC_SUBST(TOXMSI_LT_LDFLAGS)
32AC_SUBST(TOXRTP_LT_LDFLAGS)
23 33
24if test "x${prefix}" = "xNONE"; then 34if test "x${prefix}" = "xNONE"; then
25 prefix="${ac_default_prefix}" 35 prefix="${ac_default_prefix}"
@@ -28,6 +38,7 @@ fi
28BUILD_DHT_BOOTSTRAP_DAEMON="yes" 38BUILD_DHT_BOOTSTRAP_DAEMON="yes"
29BUILD_NTOX="yes" 39BUILD_NTOX="yes"
30BUILD_TESTS="yes" 40BUILD_TESTS="yes"
41BUILD_AV="yes"
31BUILD_TESTING="yes" 42BUILD_TESTING="yes"
32 43
33NCURSES_FOUND="no" 44NCURSES_FOUND="no"
@@ -46,6 +57,19 @@ AC_ARG_ENABLE([nacl],
46 ] 57 ]
47) 58)
48 59
60PKG_PROG_PKG_CONFIG
61
62AC_ARG_ENABLE([av],
63 [AC_HELP_STRING([--disable-av], [build AV support libraries (default: auto)]) ],
64 [
65 if test "x$enableval" = "xno"; then
66 BUILD_AV="no"
67 elif test "x$enableval" = "xyes"; then
68 BUILD_AV="yes"
69 fi
70 ]
71)
72
49AC_ARG_ENABLE([tests], 73AC_ARG_ENABLE([tests],
50 [AC_HELP_STRING([--disable-tests], [build unit tests (default: auto)]) ], 74 [AC_HELP_STRING([--disable-tests], [build unit tests (default: auto)]) ],
51 [ 75 [
@@ -314,8 +338,95 @@ AC_TYPE_UINT8_T
314AC_FUNC_FORK 338AC_FUNC_FORK
315AC_CHECK_FUNCS([gettimeofday memset socket strchr malloc]) 339AC_CHECK_FUNCS([gettimeofday memset socket strchr malloc])
316 340
317# pkg-config based tests 341if test "x$BUILD_AV" = "xyes"; then
318PKG_PROG_PKG_CONFIG 342 AX_PTHREAD(
343 [],
344 [
345 AC_MSG_WARN([disabling AV support: required pthread library not found])
346 BUILD_AV="no"
347 ]
348 )
349fi
350
351if test "x$BUILD_AV" = "xyes"; then
352 PKG_CHECK_MODULES([AVFORMAT], [libavformat],
353 [],
354 [
355 AC_MSG_WARN([disabling AV support $AVFORMAT_PKG_ERRORS])
356 BUILD_AV="no"
357 ]
358 )
359fi
360
361if test "x$BUILD_AV" = "xyes"; then
362 PKG_CHECK_MODULES([AVCODEC], [libavcodec],
363 [],
364 [
365 AC_MSG_WARN([disabling AV support $AVCODEC_PKG_ERRORS])
366 BUILD_AV="no"
367 ]
368 )
369fi
370
371if test "x$BUILD_AV" = "xyes"; then
372 PKG_CHECK_MODULES([AVUTIL], [libavutil],
373 [],
374 [
375 AC_MSG_WARN([disabling AV support $AVUTIL_PKG_ERRORS])
376 BUILD_AV="no"
377 ]
378 )
379fi
380
381if test "x$BUILD_AV" = "xyes"; then
382 PKG_CHECK_MODULES([AVDEVICE], [libavdevice],
383 [],
384 [
385 AC_MSG_WARN([disabling AV support $AVDEVICE_PKG_ERRORS])
386 BUILD_AV="no"
387 ]
388 )
389fi
390
391if test "x$BUILD_AV" = "xyes"; then
392 PKG_CHECK_MODULES([SWSCALE], [libswscale],
393 [],
394 [
395 AC_MSG_WARN([disabling AV support $SWSCALE_PKG_ERRORS])
396 BUILD_AV="no"
397 ]
398 )
399fi
400
401if test "x$BUILD_AV" = "xyes"; then
402 PKG_CHECK_MODULES([SDL], [sdl],
403 [],
404 [
405 AC_MSG_WARN([disabling AV support $SDL_PKG_ERRORS])
406 BUILD_AV="no"
407 ]
408 )
409fi
410
411if test "x$BUILD_AV" = "xyes"; then
412 PKG_CHECK_MODULES([OPENAL], [openal],
413 [],
414 [
415 AC_MSG_WARN([disabling AV support $OPENAL_PKG_ERRORS])
416 BUILD_AV="no"
417 ]
418 )
419fi
420
421if test "x$BUILD_AV" = "xyes"; then
422 PKG_CHECK_MODULES([OPUS], [opus],
423 [],
424 [
425 AC_MSG_WARN([disabling AV support $OPUS_PKG_ERRORS])
426 BUILD_AV="no"
427 ]
428 )
429fi
319 430
320if test -n "$PKG_CONFIG"; then 431if test -n "$PKG_CONFIG"; then
321 if test "x$BUILD_TESTS" = "xyes"; then 432 if test "x$BUILD_TESTS" = "xyes"; then
@@ -351,7 +462,7 @@ if test -n "$PKG_CONFIG"; then
351 ]) 462 ])
352 fi 463 fi
353else 464else
354 AC_MSG_WARN([pkg-config was not found on your system]) 465 AC_MSG_WARN([pkg-config was not found on your system, will search for libraries manually])
355fi 466fi
356 467
357if (test "x$BUILD_NTOX" = "xyes") && (test "x$NCURSES_FOUND" != "xyes"); then 468if (test "x$BUILD_NTOX" = "xyes") && (test "x$NCURSES_FOUND" != "xyes"); then
@@ -474,6 +585,7 @@ fi
474AM_CONDITIONAL(BUILD_DHT_BOOTSTRAP_DAEMON, test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes") 585AM_CONDITIONAL(BUILD_DHT_BOOTSTRAP_DAEMON, test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes")
475AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes") 586AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
476AM_CONDITIONAL(BUILD_NTOX, test "x$BUILD_NTOX" = "xyes") 587AM_CONDITIONAL(BUILD_NTOX, test "x$BUILD_NTOX" = "xyes")
588AM_CONDITIONAL(BUILD_AV, test "x$BUILD_AV" = "xyes")
477AM_CONDITIONAL(BUILD_TESTING, test "x$BUILD_TESTING" = "xyes") 589AM_CONDITIONAL(BUILD_TESTING, test "x$BUILD_TESTING" = "xyes")
478 590
479AC_CONFIG_FILES([Makefile 591AC_CONFIG_FILES([Makefile