diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 120 |
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]) | |||
10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
11 | AC_CONFIG_MACRO_DIR([m4]) | 11 | AC_CONFIG_MACRO_DIR([m4]) |
12 | 12 | ||
13 | EXTRA_LT_LDFLAGS= | ||
14 | |||
13 | LIBTOXCORE_LT_VERSION=0:0:0 | 15 | LIBTOXCORE_LT_VERSION=0:0:0 |
16 | LIBTOXMSI_LT_VERSION=0:0:0 | ||
17 | LIBTOXRTP_LT_VERSION=0:0:0 | ||
14 | dnl | 18 | dnl |
15 | dnl current:revision:age | 19 | dnl current:revision:age |
16 | dnl | 20 | dnl |
@@ -19,7 +23,13 @@ dnl revision: increment if source code has changed, set to zero if current is | |||
19 | dnl incremented | 23 | dnl incremented |
20 | dnl age: increment if interfaces have been added, set to zero if | 24 | dnl age: increment if interfaces have been added, set to zero if |
21 | dnl interfaces have been removed or changed | 25 | dnl interfaces have been removed or changed |
22 | EXTRA_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" | 26 | TOXCORE_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" |
27 | TOXMSI_LT_LDFLAGS="-version-info $LIBTOXMSI_LT_VERSION" | ||
28 | TOXRTP_LT_LDFLAGS="-version-info $LIBTOXMSI_LT_VERSION" | ||
29 | |||
30 | AC_SUBST(TOXCORE_LT_LDFLAGS) | ||
31 | AC_SUBST(TOXMSI_LT_LDFLAGS) | ||
32 | AC_SUBST(TOXRTP_LT_LDFLAGS) | ||
23 | 33 | ||
24 | if test "x${prefix}" = "xNONE"; then | 34 | if test "x${prefix}" = "xNONE"; then |
25 | prefix="${ac_default_prefix}" | 35 | prefix="${ac_default_prefix}" |
@@ -28,6 +38,7 @@ fi | |||
28 | BUILD_DHT_BOOTSTRAP_DAEMON="yes" | 38 | BUILD_DHT_BOOTSTRAP_DAEMON="yes" |
29 | BUILD_NTOX="yes" | 39 | BUILD_NTOX="yes" |
30 | BUILD_TESTS="yes" | 40 | BUILD_TESTS="yes" |
41 | BUILD_AV="yes" | ||
31 | BUILD_TESTING="yes" | 42 | BUILD_TESTING="yes" |
32 | 43 | ||
33 | NCURSES_FOUND="no" | 44 | NCURSES_FOUND="no" |
@@ -46,6 +57,19 @@ AC_ARG_ENABLE([nacl], | |||
46 | ] | 57 | ] |
47 | ) | 58 | ) |
48 | 59 | ||
60 | PKG_PROG_PKG_CONFIG | ||
61 | |||
62 | AC_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 | |||
49 | AC_ARG_ENABLE([tests], | 73 | AC_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 | |||
314 | AC_FUNC_FORK | 338 | AC_FUNC_FORK |
315 | AC_CHECK_FUNCS([gettimeofday memset socket strchr malloc]) | 339 | AC_CHECK_FUNCS([gettimeofday memset socket strchr malloc]) |
316 | 340 | ||
317 | # pkg-config based tests | 341 | if test "x$BUILD_AV" = "xyes"; then |
318 | PKG_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 | ) | ||
349 | fi | ||
350 | |||
351 | if 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 | ) | ||
359 | fi | ||
360 | |||
361 | if 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 | ) | ||
369 | fi | ||
370 | |||
371 | if 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 | ) | ||
379 | fi | ||
380 | |||
381 | if 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 | ) | ||
389 | fi | ||
390 | |||
391 | if 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 | ) | ||
399 | fi | ||
400 | |||
401 | if 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 | ) | ||
409 | fi | ||
410 | |||
411 | if 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 | ) | ||
419 | fi | ||
420 | |||
421 | if 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 | ) | ||
429 | fi | ||
319 | 430 | ||
320 | if test -n "$PKG_CONFIG"; then | 431 | if 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 |
353 | else | 464 | else |
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]) |
355 | fi | 466 | fi |
356 | 467 | ||
357 | if (test "x$BUILD_NTOX" = "xyes") && (test "x$NCURSES_FOUND" != "xyes"); then | 468 | if (test "x$BUILD_NTOX" = "xyes") && (test "x$NCURSES_FOUND" != "xyes"); then |
@@ -474,6 +585,7 @@ fi | |||
474 | AM_CONDITIONAL(BUILD_DHT_BOOTSTRAP_DAEMON, test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes") | 585 | AM_CONDITIONAL(BUILD_DHT_BOOTSTRAP_DAEMON, test "x$BUILD_DHT_BOOTSTRAP_DAEMON" = "xyes") |
475 | AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes") | 586 | AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes") |
476 | AM_CONDITIONAL(BUILD_NTOX, test "x$BUILD_NTOX" = "xyes") | 587 | AM_CONDITIONAL(BUILD_NTOX, test "x$BUILD_NTOX" = "xyes") |
588 | AM_CONDITIONAL(BUILD_AV, test "x$BUILD_AV" = "xyes") | ||
477 | AM_CONDITIONAL(BUILD_TESTING, test "x$BUILD_TESTING" = "xyes") | 589 | AM_CONDITIONAL(BUILD_TESTING, test "x$BUILD_TESTING" = "xyes") |
478 | 590 | ||
479 | AC_CONFIG_FILES([Makefile | 591 | AC_CONFIG_FILES([Makefile |