# Copyright (c) 2025 Nicolas Dato # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([libtuberia], [0.1.0], [nicolas.dato at gmail.com], [libtuberia], [https://git.ndato.com/libtuberia]) AC_CONFIG_SRCDIR([src/tuberia.c]) AC_CONFIG_HEADERS([config.h]) AC_PREFIX_DEFAULT([/usr]) AC_LANG([C]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AM_SILENT_RULES([yes]) # Checks for programs. AC_PROG_CC AC_PROG_RANLIB AM_PROG_AR AM_CFLAGS="-Wall -Wextra -Werror -pedantic" AC_SUBST([AM_CFLAGS]) PKG_INSTALLDIR # Checks for libraries. AC_CHECK_LIB([pthread], [pthread_self]) AS_VAR_SET([has_ffmpeg], [yes]) AC_CHECK_LIB([avcodec], [avcodec_version], [AS_VAR_SET([has_avcodec], [yes])], [AS_VAR_SET([has_avcodec], [no])]) AC_CHECK_LIB([avformat], [avformat_version], [AS_VAR_SET([has_avformat], [yes])], [AS_VAR_SET([has_avformat], [no])]) AC_CHECK_LIB([avutil], [avutil_version], [AS_VAR_SET([has_avutil], [yes])], [AS_VAR_SET([has_avutil], [no])]) AC_CHECK_LIB([swscale], [swscale_version], [AS_VAR_SET([has_swscale], [yes])], [AS_VAR_SET([has_swscale], [no])]) # Checks for header files. AC_CHECK_HEADERS([stdlib.h sys/time.h]) # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_PROG([has_doxygen], [doxygen], [yes], [no]) AC_CHECK_PROG([has_valgrind], [valgrind], [yes], [no]) AC_ARG_WITH([doxygen], AS_HELP_STRING([--without-doxygen], [Disable the generation of documents with doxygen]), [], [with_doxygen="yes"]) AC_ARG_WITH([valgrind], AS_HELP_STRING([--without-valgrind], [Disable the use of valgrind in tests]), [], [with_valgrind="yes"]) AC_ARG_ENABLE([examples], AS_HELP_STRING([--disable-examples], [Disable all examples]), [], [enable_examples="yes"]) AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests], [Disable all tests]), [], [enable_tests="yes"]) AC_ARG_ENABLE([itc-test], AS_HELP_STRING([--disable-itc-test], [Disable ITC test]), [], [enable_itc_test="yes"]) AC_ARG_ENABLE([tuberia-test], AS_HELP_STRING([--disable-tuberia-test], [Disable Tuberia test]), [], [enable_tuberia_test="yes"]) AS_VAR_IF([has_doxygen], [no], [AS_VAR_SET([with_doxygen], [no])], []) AS_VAR_IF([has_valgrind], [no], [AS_VAR_SET([with_valgrind], [no])], []) AS_VAR_IF([has_avcodec], [no], [AS_VAR_SET([has_ffmpeg], [no])], []) AS_VAR_IF([has_avformat], [no], [AS_VAR_SET([has_ffmpeg], [no])], []) AS_VAR_IF([has_avutil], [no], [AS_VAR_SET([has_ffmpeg], [no])], []) AS_VAR_IF([has_swscale], [no], [AS_VAR_SET([has_ffmpeg], [no])], []) AM_CONDITIONAL([DOXYGEN], [test x$with_doxygen = xyes]) AM_CONDITIONAL([VALGRIND], [test x$with_valgrind = xyes]) AM_CONDITIONAL([EXAMPLES], [test x$enable_examples = xyes]) AM_CONDITIONAL([HAS_FFMPEG], [test x$has_ffmpeg = xyes]) AM_CONDITIONAL([TESTS], [test x$enable_tests = xyes]) AM_CONDITIONAL([ITCTEST], [test x$enable_itc_test = xyes]) AM_CONDITIONAL([TUBERIATEST], [test x$enable_tuberia_test = xyes]) AC_CONFIG_FILES([Makefile src/Makefile doc/Doxyfile doc/Makefile test/Makefile example/Makefile tuberia.pc]) AC_OUTPUT AC_MSG_NOTICE([has doxygen: $has_doxygen]) AC_MSG_NOTICE([has valgrind: $has_valgrind]) AC_MSG_NOTICE([has avcodec: $has_avcodec]) AC_MSG_NOTICE([has avformat: $has_avformat]) AC_MSG_NOTICE([has avutil: $has_avutil]) AC_MSG_NOTICE([has swscale: $has_swscale]) AC_MSG_NOTICE([has ffmpeg: $has_ffmpeg]) AC_MSG_NOTICE([with doxygen: $with_doxygen]) AC_MSG_NOTICE([with valgrind: $with_valgrind]) AC_MSG_NOTICE([enable examples: $enable_examples]) AC_MSG_NOTICE([enable tests: $enable_tests]) AC_MSG_NOTICE([enable itc tests: $enable_itc_test]) AC_MSG_NOTICE([enable tuberia tests: $enable_tuberia_test]) AC_MSG_NOTICE([prefix: $prefix]) AC_MSG_NOTICE([exec_prefix: $exec_prefix]) AC_MSG_NOTICE([libdir: $libdir]) AC_MSG_NOTICE([includedir: $includedir]) AC_MSG_NOTICE([pkgconfigdir: $pkgconfigdir]) AC_MSG_NOTICE([docdir: $docdir]) AC_MSG_NOTICE([mandir: $mandir])