2013-08-23 00:18:53 +02:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ([2.65])
|
2014-03-11 05:08:02 +01:00
|
|
|
AC_INIT([toxic], [0.3.0], [https://tox.im/])
|
2013-08-23 00:18:53 +02:00
|
|
|
AC_CONFIG_AUX_DIR(configure_aux)
|
|
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
AM_INIT_AUTOMAKE([1.10 -Wall])
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
if test "x${prefix}" = "xNONE"; then
|
|
|
|
prefix="${ac_default_prefix}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DEPSEARCH=
|
|
|
|
LIBTOXCORE_SEARCH_HEADERS=
|
|
|
|
LIBTOXCORE_SEARCH_LIBS=
|
|
|
|
LIBSODIUM_SEARCH_HEADERS=
|
|
|
|
LIBSODIUM_SEARCH_LIBS=
|
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
LIBTOXCORE_FOUND="no"
|
|
|
|
NCURSES_FOUND="no"
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="no"
|
|
|
|
|
2013-08-23 00:18:53 +02:00
|
|
|
AC_ARG_WITH(dependency-search,
|
|
|
|
AC_HELP_STRING([--with-dependency-search=DIR],
|
|
|
|
[search for dependencies in DIR, i.e. look for libraries in
|
|
|
|
DIR/lib and for headers in DIR/include]),
|
|
|
|
[
|
|
|
|
DEPSEARCH="$withval"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
if test -n "$DEPSEARCH"; then
|
|
|
|
CFLAGS="$CFLAGS -I$DEPSEARCH/include"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$DEPSEARCH/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$DEPSEARCH/lib"
|
|
|
|
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$DEPSEARCH/lib/pkgconfig
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_WITH(libtoxcore-headers,
|
|
|
|
AC_HELP_STRING([--with-libtoxcore-headers=DIR],
|
2013-08-24 04:15:15 +02:00
|
|
|
[search for libtoxcore header files in DIR/tox]),
|
2013-08-23 00:18:53 +02:00
|
|
|
[
|
|
|
|
LIBTOXCORE_SEARCH_HEADERS="$withval"
|
|
|
|
AC_MSG_NOTICE([Will search for libtoxcore header files in $withval])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(libtoxcore-libs,
|
|
|
|
AC_HELP_STRING([--with-libtoxcore-libs=DIR],
|
|
|
|
[search for libtoxcore libraries in DIR]),
|
|
|
|
[
|
|
|
|
LIBTOXCORE_SEARCH_LIBS="$withval"
|
|
|
|
AC_MSG_NOTICE([Will search for libtoxcore libraries in $withval])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(libsodium-headers,
|
|
|
|
AC_HELP_STRING([--with-libsodium-headers=DIR],
|
|
|
|
[search for libsodium header files in DIR]),
|
|
|
|
[
|
|
|
|
LIBSODIUM_SEARCH_HEADERS="$withval"
|
|
|
|
AC_MSG_NOTICE([Will search for libsodium header files in $withval])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(libsodium-libs,
|
|
|
|
AC_HELP_STRING([--with-libsodium-libs=DIR],
|
|
|
|
[search for libsodium libraries in DIR]),
|
|
|
|
[
|
|
|
|
LIBSODIUM_SEARCH_LIBS="$withval"
|
|
|
|
AC_MSG_NOTICE([Will search for libsodium libraries in $withval])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
WIN32=no
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
case $host_os in
|
|
|
|
*mingw*)
|
|
|
|
WIN32="yes"
|
|
|
|
;;
|
2013-08-26 13:05:14 +02:00
|
|
|
*freebsd*)
|
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
|
|
|
CFLAGS="$CFLAGS -I/usr/local/include"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
|
|
|
;;
|
2013-08-23 00:18:53 +02:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(
|
|
|
|
[limits.h locale.h stdint.h stdlib.h string.h unistd.h wchar.h wctype.h],
|
|
|
|
[],
|
|
|
|
[ AC_MSG_ERROR([required header is missing on your system]) ])
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_CHECK_FUNCS(
|
|
|
|
[iswprint memmove memset mkdir setlocale strchr strdup],
|
|
|
|
[],
|
|
|
|
[ AC_MSG_ERROR([required library function is missing on your system])])
|
|
|
|
|
|
|
|
# pkg-config based tests
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
|
|
|
if test -n "$PKG_CONFIG"; then
|
2013-08-24 19:47:06 +02:00
|
|
|
if test "x$WIN32" != "xyes"; then
|
2013-08-23 09:50:04 +02:00
|
|
|
PKG_CHECK_MODULES([NCURSES], [ncursesw],
|
2013-08-24 04:15:15 +02:00
|
|
|
[
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="yes"
|
|
|
|
],
|
2013-08-23 00:18:53 +02:00
|
|
|
[
|
2013-08-23 09:50:04 +02:00
|
|
|
NCURSES_WIDECHAR_SUPPORT="no"
|
|
|
|
PKG_CHECK_MODULES([NCURSES], [ncurses],
|
2013-08-25 00:41:06 +02:00
|
|
|
[
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
],
|
2013-08-23 09:50:04 +02:00
|
|
|
[
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_MSG_WARN([$NCURSES_PKG_ERRORS])
|
2013-08-23 09:50:04 +02:00
|
|
|
])
|
2013-08-23 00:18:53 +02:00
|
|
|
])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([pkg-config was not found on your sytem])
|
|
|
|
fi
|
|
|
|
|
2013-08-24 19:47:06 +02:00
|
|
|
if (test "x$NCURSES_FOUND" = "xno") && (test "x$WIN32" != "xyes"); then
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_PATH_PROG([CURSES_CONFIG], [ncursesw5-config], [no])
|
|
|
|
if test "x$CURSES_CONFIG" != "xno"; then
|
|
|
|
AC_MSG_CHECKING(ncurses cflags)
|
|
|
|
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
|
|
|
AC_MSG_RESULT($NCURSES_CFLAGS)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(ncurses libraries)
|
|
|
|
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
|
|
|
AC_MSG_RESULT($NCURSES_LIBS)
|
|
|
|
|
|
|
|
AC_SUBST(NCURSES_CFLAGS)
|
|
|
|
AC_SUBST(NCURSES_LIBS)
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-08-24 19:47:06 +02:00
|
|
|
if (test "x$NCURSES_FOUND" = "xno") && (test "x$WIN32" != "xyes"); then
|
|
|
|
unset ac_cv_path_CURSES_CONFIG
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_PATH_PROG([CURSES_CONFIG], [ncursesw5.4-config], [no])
|
|
|
|
if test "x$CURSES_CONFIG" != "xno"; then
|
|
|
|
AC_MSG_CHECKING(ncurses cflags)
|
|
|
|
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
|
|
|
AC_MSG_RESULT($NCURSES_CFLAGS)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(ncurses libraries)
|
|
|
|
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
|
|
|
AC_MSG_RESULT($NCURSES_LIBS)
|
|
|
|
|
|
|
|
AC_SUBST(NCURSES_CFLAGS)
|
|
|
|
AC_SUBST(NCURSES_LIBS)
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="yes"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-08-24 19:47:06 +02:00
|
|
|
if (test "x$NCURSES_FOUND" = "xno") && (test "x$WIN32" != "xyes"); then
|
|
|
|
unset ac_cv_path_CURSES_CONFIG
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_PATH_PROG([CURSES_CONFIG], [ncurses5-config], [no])
|
|
|
|
if test "x$CURSES_CONFIG" != "xno"; then
|
|
|
|
AC_MSG_CHECKING(ncurses cflags)
|
|
|
|
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
|
|
|
AC_MSG_RESULT($NCURSES_CFLAGS)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(ncurses libraries)
|
|
|
|
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
|
|
|
AC_MSG_RESULT($NCURSES_LIBS)
|
|
|
|
|
|
|
|
AC_SUBST(NCURSES_CFLAGS)
|
|
|
|
AC_SUBST(NCURSES_LIBS)
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-08-24 19:47:06 +02:00
|
|
|
if (test "x$NCURSES_FOUND" = "xno") && (test "x$WIN32" != "xyes"); then
|
|
|
|
unset ac_cv_path_CURSES_CONFIG
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_PATH_PROG([CURSES_CONFIG], [ncurses5.4-config], [no])
|
|
|
|
if test "x$CURSES_CONFIG" != "xno"; then
|
|
|
|
AC_MSG_CHECKING(ncurses cflags)
|
|
|
|
NCURSES_CFLAGS=`${CURSES_CONFIG} --cflags`
|
|
|
|
AC_MSG_RESULT($NCURSES_CFLAGS)
|
2013-08-23 00:18:53 +02:00
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_MSG_CHECKING(ncurses libraries)
|
|
|
|
NCURSES_LIBS=`${CURSES_CONFIG} --libs`
|
|
|
|
AC_MSG_RESULT($NCURSES_LIBS)
|
|
|
|
|
|
|
|
AC_SUBST(NCURSES_CFLAGS)
|
|
|
|
AC_SUBST(NCURSES_LIBS)
|
|
|
|
NCURSES_FOUND="yes"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$NCURSES_FOUND" = "xno"; then
|
2013-08-23 00:18:53 +02:00
|
|
|
AC_CHECK_HEADER([curses.h],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([headers for the ncurses library were not found on your system])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
if test "x$WIN32" = "xyes"; then
|
2013-08-23 09:50:04 +02:00
|
|
|
dnl Check if pdcurses provides wide char support
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="no"
|
2013-08-23 00:18:53 +02:00
|
|
|
AC_CHECK_LIB([pdcurses], [clear],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library pdcurses was not found on your system])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(ws2_32, main,
|
|
|
|
[
|
|
|
|
WINSOCK2_LIBS="-lws2_32"
|
|
|
|
AC_SUBST(WINSOCK2_LIBS)
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library winsock2 was not found on the system, please check your MinGW installation])
|
|
|
|
]
|
|
|
|
)
|
2013-08-27 09:45:21 +02:00
|
|
|
AC_DEFINE([_WIN32_WINNT], [0x501],
|
|
|
|
[enable getaddrinfo/freeaddrinfo on XP and higher])
|
2013-08-23 00:18:53 +02:00
|
|
|
else
|
2013-08-26 13:05:14 +02:00
|
|
|
AC_CHECK_LIB([ncursesw], [wget_wch],
|
2013-08-24 04:15:15 +02:00
|
|
|
[
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="yes"
|
|
|
|
],
|
2013-08-23 00:18:53 +02:00
|
|
|
[
|
2013-08-26 13:05:14 +02:00
|
|
|
unset ac_cv_lib_ncursesw_wget_wch
|
|
|
|
AC_CHECK_LIB([ncursesw], [wget_wch],
|
2013-08-24 04:15:15 +02:00
|
|
|
[
|
|
|
|
NCURSES_WIDECHAR_SUPPORT="yes"
|
|
|
|
],
|
2013-08-23 00:18:53 +02:00
|
|
|
[
|
2013-08-23 09:50:04 +02:00
|
|
|
NCURSES_WIDECHAR_SUPPORT="no"
|
|
|
|
AC_CHECK_LIB([ncurses], [clear],
|
|
|
|
[],
|
|
|
|
[
|
2013-08-26 13:05:14 +02:00
|
|
|
unset ac_cv_lib_ncurses_clear
|
2013-08-23 09:50:04 +02:00
|
|
|
AC_CHECK_LIB([ncurses], [clear],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library ncurses was not found on your system])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
-ltinfo
|
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
2013-08-23 00:18:53 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
-ltinfo
|
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
if test -n "$PKG_CONFIG"; then
|
|
|
|
PKG_CHECK_MODULES(LIBTOXCORE, [libtoxcore],
|
2013-08-23 00:18:53 +02:00
|
|
|
[
|
2013-08-24 04:15:15 +02:00
|
|
|
LIBTOXCORE_FOUND="yes"
|
2013-08-23 00:18:53 +02:00
|
|
|
],
|
|
|
|
[
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_MSG_WARN([required library libsodium was not found in requested location $LIBSODIUM_SEARCH_LIBS])
|
|
|
|
])
|
2013-08-23 00:18:53 +02:00
|
|
|
fi
|
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
if test "x$LIBTOXCORE_FOUND" = "xno"; then
|
|
|
|
LIBSODIUM_LIBS=
|
|
|
|
LIBSODIUM_LDFLAGS=
|
|
|
|
LDFLAGS_SAVE="$LDFLAGS"
|
|
|
|
if test -n "$LIBSODIUM_SEARCH_LIBS"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$LIBSODIUM_SEARCH_LIBS"
|
|
|
|
AC_CHECK_LIB(sodium, randombytes_random,
|
|
|
|
[
|
|
|
|
LIBSODIUM_LDFLAGS="-L$LIBSODIUM_SEARCH_LIBS"
|
|
|
|
LIBSODIUM_LIBS="-lsodium"
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library libsodium was not found in requested location $LIBSODIUM_SEARCH_LIBS])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
AC_CHECK_LIB(sodium, randombytes_random,
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
2013-08-23 00:18:53 +02:00
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
LDFLAGS="$LDFLAGS_SAVE"
|
|
|
|
AC_SUBST(LIBSODIUM_LIBS)
|
|
|
|
AC_SUBST(LIBSODIUM_LDFLAGS)
|
2013-08-23 00:18:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
LIBTOXCORE_CFLAGS=
|
|
|
|
CFLAGS_SAVE="$CFLAGS"
|
|
|
|
CPPFLAGS_SAVE="$CPPFLAGS"
|
2013-08-23 00:18:53 +02:00
|
|
|
|
2013-08-24 04:15:15 +02:00
|
|
|
if test -n "$LIBTOXCORE_SEARCH_HEADERS"; then
|
|
|
|
CFLAGS="$CFLAGS -I$LIBTOXCORE_SEARCH_HEADERS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$LIBTOXCORE_SEARCH_HEADERS"
|
|
|
|
AC_CHECK_HEADER([tox/tox.h],
|
|
|
|
[
|
|
|
|
LIBTOXCORE_CFLAGS="-I$LIBTOXCORE_SEARCH_HEADERS"
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([headers for the toxcore library were not found on your system])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
AC_CHECK_HEADER([tox/tox.h],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([headers for the toxcore library were not found on your system])
|
|
|
|
],
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
CFLAGS="$CFLAGS_SAVE"
|
|
|
|
CPPFLAGS="$CPPFLAGS_SAVE"
|
|
|
|
AC_SUBST(LIBTOXCORE_CFLAGS)
|
|
|
|
|
|
|
|
LIBTOXCORE_LIBS=
|
|
|
|
LIBTOXCORE_LDFLAGS=
|
|
|
|
LDFLAGS_SAVE="$LDFLAGS"
|
|
|
|
if test -n "$LIBTOXCORE_SEARCH_LIBS"; then
|
2013-09-28 13:20:41 +02:00
|
|
|
LDFLAGS="$LDFLAGS $LIBSODIUM_LDFLAGS -L$LIBTOXCORE_SEARCH_LIBS"
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_CHECK_LIB([toxcore], [tox_new],
|
|
|
|
[
|
|
|
|
LIBTOXCORE_LDFLAGS="-L$LIBTOXCORE_SEARCH_LIBS"
|
|
|
|
LIBTOXCORE_LIBS="-ltoxcore"
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library toxcore was not found on your system])
|
2013-08-24 19:47:06 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
$WINSOCK2_LIBS
|
2013-09-28 13:20:41 +02:00
|
|
|
$LIBSODIUM_LIBS
|
2013-08-24 04:15:15 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
else
|
2013-09-28 13:20:41 +02:00
|
|
|
LDFLAGS="$LDFLAGS $LIBSODIUM_LDFLAGS"
|
2013-08-24 04:15:15 +02:00
|
|
|
AC_CHECK_LIB([toxcore], [tox_new],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([required library toxcore was not found on your system])
|
2013-08-24 19:47:06 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
$WINSOCK2_LIBS
|
2013-09-28 13:20:41 +02:00
|
|
|
$LIBSODIUM_LIBS
|
2013-08-24 04:15:15 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
LDFLAGS="$LDFLAGS_SAVE"
|
|
|
|
AC_SUBST(LIBTOXCORE_LIBS)
|
|
|
|
AC_SUBST(LIBTOXCORE_LDFLAGS)
|
2013-08-23 00:18:53 +02:00
|
|
|
fi
|
|
|
|
|
2014-02-22 23:58:36 +01:00
|
|
|
|
|
|
|
####
|
|
|
|
#### A/V Stuff
|
|
|
|
|
|
|
|
AV_SEARCH_DIR=
|
|
|
|
BUILD_AV="yes"
|
|
|
|
|
|
|
|
AC_ARG_WITH(libtoxav-prefix,
|
|
|
|
AC_HELP_STRING([--with-libtoxav-prefix=DIR],
|
|
|
|
[search for libtoxav in DIR, i.e. look for libraries in
|
|
|
|
DIR/lib and for headers in DIR/include]),
|
|
|
|
[
|
|
|
|
AV_SEARCH_DIR="$withval"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
if test -n "$AV_SEARCH_DIR"; then
|
|
|
|
CFLAGS="$CFLAGS -I$AV_SEARCH_DIR/include"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$AV_SEARCH_DIR/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$AV_SEARCH_DIR/lib"
|
|
|
|
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$AV_SEARCH_DIR/lib/pkgconfig
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check if specified enable
|
|
|
|
AC_ARG_ENABLE([av],
|
|
|
|
[AC_HELP_STRING([--disable-av], [build AV support libraries (default: auto)]) ],
|
|
|
|
[
|
|
|
|
if test "x$enableval" = "xno"; then
|
|
|
|
BUILD_AV="no"
|
|
|
|
elif test "x$enableval" = "xyes"; then
|
|
|
|
BUILD_AV="yes"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check for A/V library
|
|
|
|
|
|
|
|
if test "x$BUILD_AV" = "xyes"; then
|
2014-03-07 03:14:04 +01:00
|
|
|
PKG_CHECK_MODULES([OPENAL], [openal],
|
|
|
|
[
|
|
|
|
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
|
2014-02-22 23:58:36 +01:00
|
|
|
|
2014-03-07 03:14:04 +01:00
|
|
|
PKG_CHECK_MODULES([LIBTOXAV], [libtoxav],
|
2014-02-22 23:58:36 +01:00
|
|
|
[
|
2014-03-07 03:14:04 +01:00
|
|
|
AC_CHECK_HEADER([tox/toxav.h],
|
|
|
|
[
|
|
|
|
# Place define for audio support
|
2014-03-08 16:36:42 +01:00
|
|
|
AC_DEFINE([_SUPPORT_AUDIO], [], [Is audio supported])
|
2014-03-07 03:14:04 +01:00
|
|
|
AC_MSG_NOTICE([Building with audio support])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_NOTICE([No A/V headers; disabling A/V support])
|
|
|
|
BUILD_AV="no"
|
|
|
|
],)
|
|
|
|
],
|
2014-02-22 23:58:36 +01:00
|
|
|
[
|
2014-03-07 03:14:04 +01:00
|
|
|
AC_MSG_NOTICE([No A/V library; disabling A/V support])
|
|
|
|
])
|
|
|
|
],
|
2014-02-22 23:58:36 +01:00
|
|
|
[
|
2014-03-07 03:14:04 +01:00
|
|
|
AC_MSG_NOTICE([No openal library; disabling A/V support])
|
2014-02-22 23:58:36 +01:00
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(BUILD_AV, test "x$BUILD_AV" = "xyes")
|
|
|
|
|
|
|
|
|
2013-08-23 00:18:53 +02:00
|
|
|
TOXIC_VERSION="$PACKAGE_VERSION"
|
|
|
|
AC_PATH_PROG([GIT], [git], [no])
|
|
|
|
if test "x$GIT" != "xno"; then
|
|
|
|
if test -d ${srcdir}/.git; then
|
|
|
|
TOXIC_VERSION="${TOXIC_VERSION}_r`${GIT} rev-list HEAD --count`"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(TOXIC_VERSION)
|
|
|
|
|
2013-08-23 00:37:19 +02:00
|
|
|
eval PACKAGE_DATADIR="${datadir}/${PACKAGE}"
|
|
|
|
eval PACKAGE_DATADIR="${PACKAGE_DATADIR}"
|
|
|
|
AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "$PACKAGE_DATADIR", [toxic data directory])
|
|
|
|
|
2013-08-23 09:50:04 +02:00
|
|
|
if test "x$NCURSES_WIDECHAR_SUPPORT" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_WIDECHAR], [1], [ncurses wide char support available])
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1],
|
|
|
|
[enable X/Open Portability Guide functionality])
|
|
|
|
fi
|
2013-08-23 00:18:53 +02:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
2013-08-23 00:37:19 +02:00
|
|
|
misc/Makefile
|
2013-08-23 00:18:53 +02:00
|
|
|
build/Makefile])
|
|
|
|
AC_OUTPUT
|