dnl -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script. AC_INIT([ODR-SourceCompanion], [1.2.0], [http://opendigitalradio.org/]) AC_CONFIG_AUX_DIR(.) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([tar-ustar foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_HEADER([config.h]) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_LIBTOOL LT_INIT AX_CXX_COMPILE_STDCXX(11,noext,mandatory) # std::thread requires pthread AX_PTHREAD( [ AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]) CLIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC"], [AC_MSG_ERROR([requires pthread])] ) AC_CHECK_LIB([m], [sin]) AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [CFLAGS="$CFLAGS -Wduplicated-cond"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CFLAGS="$CFLAGS -Wduplicated-branches"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CFLAGS="$CFLAGS -Wlogical-op"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wrestrict], [CFLAGS="$CFLAGS -Wrestrict"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wdouble-promotion], [CFLAGS="$CFLAGS -Wdouble-promotion"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [CFLAGS="$CFLAGS -Wformat=2"], [], ["-Werror"]) AC_LANG_PUSH([C++]) AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [CXXFLAGS="$CXXFLAGS -Wduplicated-cond"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CXXFLAGS="$CXXFLAGS -Wduplicated-branches"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CXXFLAGS="$CXXFLAGS -Wlogical-op"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wrestrict], [CXXFLAGS="$CXXFLAGS -Wrestrict"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wdouble-promotion], [CXXFLAGS="$CXXFLAGS -Wdouble-promotion"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [CXXFLAGS="$CXXFLAGS -Wformat=2"], [], ["-Werror"]) # Linux defines MSG_NOSIGNAL, some other systems have SO_NOSIGPIPE instead AC_MSG_CHECKING(for MSG_NOSIGNAL) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include int f = MSG_NOSIGNAL; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define this symbol if you have MSG_NOSIGNAL]) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for SO_NOSIGPIPE) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include int f = SO_NOSIGPIPE; ]])], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [Define this symbol if you have SO_NOSIGPIPE]) ], [ AC_MSG_RESULT(no) ]) AC_LANG_POP([C++]) AC_CHECK_LIB(zmq, zmq_init, , AC_MSG_ERROR(ZeroMQ libzmq is required)) AC_CHECK_LIB(fdk-aac, aacEncOpen, , AC_MSG_ERROR(The FDK-AAC library is required)) # We do not need a DAB+-patched fdk-aac, because upstream fdk-aac can decode properly AC_CHECK_LIB(curl, curl_easy_init) have_curl=$ac_cv_lib_curl_curl_easy_init AS_IF([test "x$have_curl" = "xyes"], [AC_DEFINE(HAVE_CURL, [1], [Define if cURL is available])]) AS_IF([test "x$have_curl" = "xno"], [AC_MSG_WARN([cURL not found, timestamps will not work])]) AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git']) AC_CONFIG_FILES([Makefile]) AC_OUTPUT echo echo "***********************************************" echo "ODR-SourceCompanion configured"