summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac168
1 files changed, 42 insertions, 126 deletions
diff --git a/configure.ac b/configure.ac
index 3e98afc..11d2216 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ AS_IF([test "x$have_rpmbuild" = "xyes"], , [
AC_MSG_ERROR([rpmbuild requested but not found])
])
])
-AM_CONDITIONAL([BUILD_SRPM], [test "x$ac_cv_path_rpmbuild" != "x"])
+AM_CONDITIONAL([USE_RPMBUILD], [test "x$ac_cv_path_rpmbuild" != "x"])
RPMBUILD="$ac_cv_path_rpmbuild"
AC_SUBST(RPMBUILD)
@@ -61,7 +61,7 @@ AS_IF([test "x$have_ronn" = "xyes"], , [
AC_MSG_ERROR([ronn requested but not found])
])
])
-AM_CONDITIONAL([BUILD_MANPAGE], [test "x$have_ronn" = "xyes"])
+AM_CONDITIONAL([USE_RONN], [test "x$have_ronn" = "xyes"])
RONN="$ac_cv_path_ronn"
AC_SUBST(RONN)
@@ -84,66 +84,11 @@ AM_CONDITIONAL([USE_VALGRIND], [test "x$have_valgrind" = "xyes"])
VALGRIND="$ac_cv_path_valgrind"
AC_SUBST(VALGRIND)
-GIT_RECEIVER="disabled"
-AC_ARG_ENABLE([git-receiver], AS_HELP_STRING([--enable-git-receiver],
- [build blogc-git-receiver tool]))
-AS_IF([test "x$enable_git_receiver" = "xyes"], [
- AC_CHECK_HEADERS([sys/types.h sys/stat.h time.h libgen.h unistd.h errno.h dirent.h], [
- GIT_RECEIVER="enabled"
- have_git_receiver=yes
- ], [
- AC_MSG_ERROR([blogc-git-receiver tool requested but required headers not found])
- ])
-])
-AM_CONDITIONAL([BUILD_GIT_RECEIVER], [test "x$have_git_receiver" = "xyes"])
-
-MAKE_="disabled"
-AC_ARG_ENABLE([make-embedded], AS_HELP_STRING([--enable-make-embedded],
- [build blogc-make tool embedded on blogc binary]))
-AC_ARG_ENABLE([make], AS_HELP_STRING([--enable-make],
- [build blogc-make tool]))
-AS_IF([test "x$enable_make" = "xyes" -o "x$enable_make_embedded" = "xyes"], [
- AC_CHECK_HEADERS([dirent.h fcntl.h libgen.h sys/stat.h sys/wait.h time.h unistd.h],, [
- AC_MSG_ERROR([blogc-make tool requested but required headers not found])
- ])
- AX_PTHREAD([], [
- AC_MSG_ERROR([blogc-make tool requested but pthread is not supported])
- ])
- have_make_lib=yes
- AS_IF([test "x$enable_make_embedded" = "xyes"], [
- MAKE_="enabled (embedded)"
- have_make_embedded=yes
- AC_DEFINE([MAKE_EMBEDDED], [], [Build blogc-make embedded to blogc binary])
- ], [
- MAKE_="enabled"
- have_make=yes
- ])
-])
-AM_CONDITIONAL([BUILD_MAKE], [test "x$have_make" = "xyes"])
-AM_CONDITIONAL([BUILD_MAKE_LIB], [test "x$have_make_lib" = "xyes"])
-AM_CONDITIONAL([BUILD_MAKE_EMBEDDED], [test "x$have_make_embedded" = "xyes"])
-
-RUNSERVER="disabled"
-AC_ARG_ENABLE([runserver], AS_HELP_STRING([--enable-runserver],
- [build blogc-runserver tool]))
-AS_IF([test "x$enable_runserver" = "xyes"], [
- AC_CHECK_HEADERS([signal.h limits.h fcntl.h unistd.h sys/stat.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h],, [
- AC_MSG_ERROR([blogc-runserver tool requested but required headers not found])
- ])
- AX_PTHREAD([], [
- AC_MSG_ERROR([blogc-runserver tool requested but pthread is not supported])
- ])
- RUNSERVER="enabled"
- have_runserver=yes
-])
-AM_CONDITIONAL([BUILD_RUNSERVER], [test "x$have_runserver" = "xyes"])
-
TESTS="disabled"
AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests],
[disable unit tests, ignoring presence of cmocka]))
AS_IF([test "x$enable_tests" != "xno"], [
PKG_CHECK_MODULES([CMOCKA], [cmocka], [
- have_cmocka=yes
AC_MSG_CHECKING([whether the linker supports -wrap])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-wrap,exit"
@@ -154,79 +99,60 @@ AS_IF([test "x$enable_tests" != "xno"], [
[exit(1);]
])
], [
- have_ld_wrap=yes
+ TESTS="enabled"
+ have_cmocka=yes
], [
- have_ld_wrap=no
+ have_cmocka=no
], [
- have_ld_wrap=no
- ])
- AC_MSG_RESULT([$have_ld_wrap])
- AS_IF([test "x$have_ld_wrap" = "xyes"],, [
- AC_MSG_WARN([linker does not supports -wrap. tests requiring it will be disabled])
+ have_cmocka=no
])
+ AC_MSG_RESULT([$have_cmocka])
LDFLAGS="$save_LDFLAGS"
], [
have_cmocka=no
])
- AS_IF([test "x$have_cmocka" = "xyes"],, [
- have_tests=no
- TESTS="disabled"
- AS_IF([test "x$enable_tests" = "xyes"], [
- AC_MSG_ERROR([tests requested but cmocka was not found])
- ], [
- AC_MSG_WARN([cmocka was not found, disabling tests])
- ])
+])
+AS_IF([test "x$have_cmocka" = "xyes"], , [
+ AS_IF([test "x$enable_tests" = "xyes"], [
+ AC_MSG_ERROR([unit tests requested but cmocka not found])
])
+])
+AM_CONDITIONAL([USE_CMOCKA], [test "x$have_cmocka" = "xyes"])
- AC_PATH_PROG([git], [git])
- AC_PATH_PROG([make], [make])
- AC_PATH_PROG([tar], [tar])
- AS_IF([test "x$ac_cv_path_git" = "x" -o "x$ac_cv_path_make" = "x" -o "x$ac_cv_path_tar" = "x"], [
- have_bgr_deps=no
- AS_IF([test "x$have_git_receiver" = "xyes"], [
- have_tests=no
- TESTS="disabled"
- AS_IF([test "x$enable_tests" = "xyes"], [
- AC_MSG_ERROR([tests requested for blogc-git-receiver but git and/or tar not found])
- ], [
- AC_MSG_WARN([git and/or tar not found, install it to run blogc-git-receiver tests])
- ])
- ])
+GIT_RECEIVER="disabled"
+AC_ARG_ENABLE([git-receiver], AS_HELP_STRING([--enable-git-receiver],
+ [build blogc-git-receiver tool]))
+AS_IF([test "x$enable_git_receiver" = "xyes"], [
+ AC_CHECK_HEADERS([sys/types.h sys/stat.h time.h libgen.h unistd.h errno.h dirent.h], [
+ GIT_RECEIVER="enabled"
+ have_git_receiver=yes
], [
- have_bgr_deps=yes
+ AC_MSG_ERROR([blogc-git-receiver tool requested but required headers not found])
])
+])
+AM_CONDITIONAL([BUILD_GIT_RECEIVER], [test "x$have_git_receiver" = "xyes"])
- AC_PATH_PROG([bash], [bash])
- AC_PATH_PROG([diff], [diff])
- AC_PATH_PROG([tee], [tee])
- AS_IF([test "x$ac_cv_path_bash" = "x" -o "x$ac_cv_path_diff" = "x" -o "x$ac_cv_path_tee" = "x"], [
- have_tests=no
- TESTS="disabled"
- AS_IF([test "x$enable_tests" = "xyes"], [
- AC_MSG_ERROR([tests requested but bash, diff and/or tee not found])
- ], [
- AC_MSG_WARN([bash, diff and/or tee not found, install it to run tests])
- ])
- ], [
- have_tests=yes
- TESTS="enabled"
+RUNSERVER="disabled"
+AC_ARG_ENABLE([runserver], AS_HELP_STRING([--enable-runserver],
+ [build blogc-runserver tool]))
+AS_IF([test "x$enable_runserver" = "xyes"], [
+ AC_CHECK_HEADERS([signal.h stdarg.h fcntl.h unistd.h sys/stat.h sys/types.h],, [
+ AC_MSG_ERROR([blogc-runserver tool requested but required headers not found])
])
+ AC_CHECK_HEADERS([magic.h],, [
+ AC_MSG_ERROR([blogc-runserver tool requested but libmagic headers not found])
+ ])
+ AC_CHECK_LIB(magic, [magic_open], [MAGIC_LIBS="-lmagic"], [
+ AC_MSG_ERROR([blogc-runserver tool requested but libmagic library not found])
+ ])
+ AC_SUBST(MAGIC_LIBS)
+ PKG_CHECK_MODULES([LIBEVENT], [libevent >= 2.0])
+ RUNSERVER="enabled"
+ have_runserver=yes
])
-AM_CONDITIONAL([BUILD_TESTS], [test "x$have_tests" = "xyes"])
-AM_CONDITIONAL([USE_CMOCKA], [test "x$have_cmocka" = "xyes"])
-AM_CONDITIONAL([USE_LD_WRAP], [test "x$have_ld_wrap" = "xyes"])
-AM_CONDITIONAL([USE_BGR_DEPS], [test "x$have_bgr_deps" = "xyes"])
-BASH="$ac_cv_path_bash"
-AC_SUBST(BASH)
-
-AC_CHECK_HEADERS([netdb.h sys/resource.h sys/stat.h sys/time.h sys/wait.h time.h unistd.h sysexits.h])
-AC_CHECK_FUNCS([gethostname])
+AM_CONDITIONAL([BUILD_RUNSERVER], [test "x$have_runserver" = "xyes"])
-AM_CONDITIONAL([HAVE_NETDB_H], [test "x$ac_cv_header_netdb_h" = "xyes"])
-AM_CONDITIONAL([HAVE_TIME_H], [test "x$ac_cv_header_time_h" = "xyes"])
-AM_CONDITIONAL([HAVE_UNISTD_H], [test "x$ac_cv_header_unistd_h" = "xyes"])
-AM_CONDITIONAL([HAVE_SYS_RESOURCE_H], [test "x$ac_cv_header_sys_resource_h" = "xyes"])
-AM_CONDITIONAL([HAVE_SYS_TIME_H], [test "x$ac_cv_header_sys_time_h" = "xyes"])
+AC_CHECK_HEADERS([sys/stat.h time.h])
LT_LIB_M
@@ -234,16 +160,7 @@ AC_CONFIG_FILES([
Makefile
blogc.spec
])
-AC_CONFIG_FILES([tests/blogc/check_blogc.sh],
- [chmod +x tests/blogc/check_blogc.sh])
-AC_CONFIG_FILES([tests/blogc-git-receiver/check_pre_receive.sh],
- [chmod +x tests/blogc-git-receiver/check_pre_receive.sh])
-AC_CONFIG_FILES([tests/blogc-git-receiver/check_post_receive.sh],
- [chmod +x tests/blogc-git-receiver/check_post_receive.sh])
-AC_CONFIG_FILES([tests/blogc-git-receiver/check_shell.sh],
- [chmod +x tests/blogc-git-receiver/check_shell.sh])
-AC_CONFIG_FILES([tests/blogc-make/check_blogc_make.sh],
- [chmod +x tests/blogc-make/check_blogc_make.sh])
+
AC_OUTPUT
AS_ECHO("
@@ -258,7 +175,6 @@ AS_ECHO("
ldflags: ${LDFLAGS}
blogc-git-receiver: ${GIT_RECEIVER}
- blogc-make: ${MAKE_}
blogc-runserver: ${RUNSERVER}
tests: ${TESTS}