| 1 | AC_INIT([libcec], 1:0:0) |
| 2 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 3 | |
| 4 | AC_PROG_CXX |
| 5 | AC_PROG_LIBTOOL |
| 6 | |
| 7 | case "${host}" in |
| 8 | *-*-linux*) |
| 9 | AC_SEARCH_LIBS([udev_new], [udev],, AC_MSG_ERROR("required library 'udev' is missing")) |
| 10 | REQUIRES="udev" |
| 11 | ;; |
| 12 | *-apple-darwin*) |
| 13 | LIBS+="-framework CoreVideo -framework IOKit" |
| 14 | ;; |
| 15 | esac |
| 16 | |
| 17 | AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR("required library 'pthread' is missing")) |
| 18 | |
| 19 | libs_pre_dl=$LIBS |
| 20 | AC_SEARCH_LIBS(dlopen, [dl], |
| 21 | [test "$ac_cv_search_dlopen" = "none required" || LIBS_DL=$ac_cv_search_dlopen], |
| 22 | AC_MSG_ERROR("required library 'dl' is missing")) |
| 23 | AC_SUBST([LIBS_DL]) |
| 24 | LIBS=$libs_pre_dl |
| 25 | |
| 26 | CXXFLAGS="-fPIC -Wall -Wextra $CXXFLAGS" |
| 27 | |
| 28 | AC_SUBST(REQUIRES) |
| 29 | AC_CONFIG_FILES([src/lib/libcec.pc]) |
| 30 | AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile]) |