| 1 | AC_INIT([libcec], 1:5:0) |
| 2 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 3 | |
| 4 | AC_PROG_CXX |
| 5 | AC_PROG_LIBTOOL |
| 6 | |
| 7 | has_libudev="yes" |
| 8 | case "${host}" in |
| 9 | *-*-linux*) |
| 10 | PKG_CHECK_MODULES([UDEV],[libudev],,[has_libudev="no"]; AC_MSG_WARN("library 'udev' is missing - adapter detection will not be available")) |
| 11 | LIBS+=" -lrt" |
| 12 | ;; |
| 13 | *-apple-darwin*) |
| 14 | has_libudev="no"; |
| 15 | LIBS+="-framework CoreVideo -framework IOKit" |
| 16 | ;; |
| 17 | *-freebsd*) |
| 18 | has_libudev="no" |
| 19 | ;; |
| 20 | esac |
| 21 | |
| 22 | if test "x$has_libudev" != "xno"; then |
| 23 | INCLUDES="$INCLUDES $UDEV_CFLAGS";LIBS="$LIBS $UDEV_LIBS" |
| 24 | AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]) |
| 25 | REQUIRES="udev" |
| 26 | fi |
| 27 | |
| 28 | AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing")) |
| 29 | |
| 30 | libs_pre_dl=$LIBS |
| 31 | AC_SEARCH_LIBS(dlopen, [dl], |
| 32 | [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen], |
| 33 | AC_MSG_ERROR("required library 'dl' is missing")) |
| 34 | AC_SUBST([LIBS_DL]) |
| 35 | LIBS=$libs_pre_dl |
| 36 | |
| 37 | CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS" |
| 38 | |
| 39 | AC_SUBST(REQUIRES) |
| 40 | AC_CONFIG_FILES([src/lib/libcec.pc]) |
| 41 | AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile]) |