dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(zvbi, 0.2.25) AC_CONFIG_SRCDIR(src/vbi.c) AM_INIT_AUTOMAKE([1.9 check-news dist-bzip2]) AM_CONFIG_HEADER(config.h) AM_ACLOCAL_INCLUDE(m4) AM_MAINTAINER_MODE dnl [current:revision:age] dnl Any change: ++revision dnl Interface added: ++current, revision = 0 dnl age = last binary compatible version - current AC_SUBST(LIBZVBI_SO_VERSION, [10:0:10]) dnl Enable GNU extensions if available. AC_GNU_SOURCE AC_PROG_CC dnl For header tests only. AC_PROG_CXX dnl Check for BSD/GNU extensions. dnl If not present we use replacements. AC_CHECK_FUNCS([strndup strlcpy asprintf vasprintf getopt_long \ getaddrinfo clock_settime program_invocation_name]) dnl __BYTE_ORDER is not portable. AC_DEFINE(Z_LITTLE_ENDIAN, 1234, [naidne elttiL]) AC_DEFINE(Z_BIG_ENDIAN, 4321, [Big endian]) AC_C_BIGENDIAN( AC_DEFINE(Z_BYTE_ORDER, 4321, [Byte order]), AC_DEFINE(Z_BYTE_ORDER, 1234, [Byte order])) AC_PROG_LIBTOOL LIBS="$LIBS -lm" test -e site_def.h || cat <site_def.h /* Site specific definitions */ #ifndef SITE_DEF_H #define SITE_DEF_H /* #define BIT_SLICER_LOG 1 */ /* #define CACHE_DEBUG 1 */ /* #define CACHE_STATUS 1 */ /* #define DVB_DEMUX_LOG 1 */ /* #define DVB_MUX_LOG 1 */ /* #define RAW_DECODER_LOG 1 */ /* #define RAW_DECODER_PATTERN_DUMP 1 */ #endif /* SITE_DEF_H */ EOF dnl dnl See if we can / have to increase inlining limits. dnl AC_MSG_CHECKING([if $CC supports --param inline-unit-growth]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS --param inline-unit-growth=3000" AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [return 0;]), [HAVE_GCC_LIMITS=yes], [HAVE_GCC_LIMITS=no]) AC_MSG_RESULT($HAVE_GCC_LIMITS) AM_CONDITIONAL(HAVE_GCC_LIMITS, [test "x$HAVE_GCC_LIMITS" = "xyes"]) CFLAGS="$SAVE_CFLAGS" dnl dnl Check how to link pthreads functions. dnl (-lpthread on Linux, -pthread on FreeBSD). dnl AC_CHECK_LIB(pthread, pthread_create,,[ AC_TRY_LINK(, pthread_create();,,[ LDFLAGS="$LDFLAGS -pthread" AC_TRY_LINK(, pthread_create();,,[ AC_MSG_ERROR([Unable to link pthread functions]) ]) ]) ]) dnl dnl Check for Gnome unicode library or libc 2.1. dnl (Teletext URE search wchar_t ctype.h functions) dnl AC_MSG_CHECKING(whether we are using the GNU C Library 2.1 or newer) AC_EGREP_CPP([GLIBC21],[ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) GLIBC21 #endif #endif ],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_GLIBC21, 1, [Honk if you have GNU C lib 2.1+]) ],[ AC_MSG_RESULT([no]) AC_MSG_CHECKING(for unicode library) UNICODE_VERSION=`unicode-config --version` if test $? -eq 0; then AC_DEFINE(HAVE_LIBUNICODE, 1, [Define if you have libunicode]) AC_MSG_RESULT($UNICODE_VERSION) UNICODE_CFLAGS=`unicode-config --cflags` UNICODE_LIBS=`unicode-config --libs` AC_SUBST(UNICODE_CFLAGS) AC_SUBST(UNICODE_LIBS) else AC_MSG_RESULT([not present - Teletext search disabled]) fi ]) dnl dnl Check for iconv() in libc or libiconv. dnl (Unicode conversions) dnl dnl Using m4/iconv.m4 from the gettext package. dnl AM_ICONV_LINK if test "x$am_cv_func_iconv" != xyes; then AC_MSG_ERROR([iconv() not found]) fi LIBS="$LIBS $LIBICONV" dnl dnl Check for png library. dnl (PNG page export) dnl HAVE_PNG="yes" AC_CHECK_LIB(png, png_destroy_write_struct, LIBS="$LIBS -lpng -lz", HAVE_PNG="no", -lz -lm) if test "x$HAVE_PNG" = xyes; then AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have libpng]) fi dnl dnl X libraries. dnl (Test programs) dnl AC_PATH_XTRA test "x$no_x" = xyes || X_LIBS="$X_LIBS -lX11" AM_CONDITIONAL(HAVE_X, [test "x$no_x" != xyes]) dnl dnl Enable OS dependent device interfaces. dnl (Linux videodev.h, videodev2.h, dvb, bktr dependencies) dnl enable_v4l_auto=no enable_dvb_auto=no enable_bktr_auto=no enable_proxy_auto=no case "$host_os" in linux*) enable_v4l_auto=yes enable_dvb_auto=yes enable_proxy_auto=yes ;; freebsd* | kfreebsd*-gnu | openbsd* | netbsd*) enable_bktr_auto=yes ;; *) ;; esac AC_MSG_CHECKING([whether to build the Video4Linux interface]) AC_ARG_ENABLE(v4l, AC_HELP_STRING([--enable-v4l], [Include the V4L and V4L2 interface (auto)]),, enable_v4l=$enable_v4l_auto) AC_MSG_RESULT($enable_v4l) if test "x$enable_v4l" = xyes; then AC_DEFINE(ENABLE_V4L, 1, [Define to build V4L interface]) AC_DEFINE(ENABLE_V4L2, 1, [Define to build V4L2 / V4L2 2.5 interface]) fi AC_MSG_CHECKING([whether to build the Linux DVB interface]) AC_ARG_ENABLE(dvb, AC_HELP_STRING([--enable-dvb], [Include the DVB interface (auto)]),, enable_dvb=$enable_dvb_auto) AC_MSG_RESULT($enable_dvb) if test "x$enable_dvb" = xyes; then AC_DEFINE(ENABLE_DVB, 1, [Define to build DVB interface]) fi AC_MSG_CHECKING([whether to build the *BSD bktr driver interface]) AC_ARG_ENABLE(bktr, AC_HELP_STRING([--enable-bktr], [Include the *BSD bktr driver interface (auto)]),, enable_bktr=$enable_bktr_auto) AC_MSG_RESULT($enable_bktr) if test "x$enable_bktr" = xyes; then AC_DEFINE(ENABLE_BKTR, 1, [Define to build bktr driver interface]) fi dnl dnl Enable vbi proxy dnl AC_MSG_CHECKING([whether to build the vbi proxy daemon and interface]) AC_ARG_ENABLE(proxy, AC_HELP_STRING([--enable-proxy], [Build the vbi proxy daemon and interface (auto)]),, enable_proxy=$enable_proxy_auto) AC_MSG_RESULT($enable_proxy) if test "x$enable_proxy" = xyes; then AC_DEFINE(ENABLE_PROXY, 1, [Define to build proxy daemon and interface]) case "$host_os" in linux*) AC_DEFINE(HAVE_IOCTL_INT_ULONG_DOTS, 1, [ioctl request type]) ;; freebsd* | kfreebsd*-gnu | openbsd* | netbsd*) AC_DEFINE(HAVE_IOCTL_INT_ULONG_DOTS, 1, [ioctl request type]) ;; *) ;; esac fi AM_CONDITIONAL(ENABLE_PROXY, [test "x$enable_proxy" = xyes]) dnl dnl Native language support. dnl AM_GNU_GETTEXT_VERSION([0.14]) AM_GNU_GETTEXT([external], [need-ngettext]) LIBS="$LTLIBINTL $LIBS" if test "x${prefix}" = xNONE; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/share/locale", [ld]) else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale", [ld]) fi dnl dnl Build docs from the sources if Doxygen is installed. dnl AC_ARG_WITH([doxygen], AS_HELP_STRING([--without-doxygen], [Disable building of API documentation]),, [with_doxygen=yes]) if test "x$with_doxygen" = "xyes"; then AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, yes, no) else HAVE_DOXYGEN=no fi AM_CONDITIONAL(HAVE_DOXYGEN, [test "x$HAVE_DOXYGEN" = xyes]) AC_OUTPUT([ Makefile contrib/Makefile examples/Makefile daemon/Makefile daemon/zvbid.init doc/Doxyfile doc/Makefile m4/Makefile src/Makefile src/dvb/Makefile test/Makefile po/Makefile.in zvbi.spec zvbi-0.2.pc ])