diff options
author | Nicolas Dato <nicolas.dato@gmail.com> | 2024-10-13 19:57:49 -0300 |
---|---|---|
committer | Nicolas Dato <nicolas.dato@gmail.com> | 2024-10-13 19:57:49 -0300 |
commit | 4a4e956c26d2f73534e504c36e2ca6a2617644b8 (patch) | |
tree | 72bc232f93514b3206da986e4d4aad1e3024e7d8 /configure.ac | |
parent | 37e2f4899b5d3e594c1080e25c04b40bc29d53a4 (diff) | |
download | libtuberia-4a4e956c26d2f73534e504c36e2ca6a2617644b8.tar.gz |
adding tests for the main library
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 6932468..002d050 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,8 @@ AC_PREREQ([2.69]) AC_INIT([libtuberia], [1.0.0]) AC_CONFIG_SRCDIR([src/tuberia.c]) AC_CONFIG_HEADERS([config.h]) -AC_PREFIX_DEFAULT("/usr") +AC_PREFIX_DEFAULT([/usr]) +AC_LANG([C]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AM_SILENT_RULES([yes]) @@ -14,10 +15,11 @@ AM_SILENT_RULES([yes]) AC_PROG_CC AC_PROG_RANLIB AM_PROG_AR -AM_CFLAGS="-Wall -Werror" +AM_CFLAGS="-Wall -Wextra -Werror -pedantic" AC_SUBST([AM_CFLAGS]) # Checks for libraries. +AC_CHECK_LIB([pthread], [pthread_self]) # Checks for header files. AC_CHECK_HEADERS([stdlib.h sys/time.h]) @@ -25,8 +27,36 @@ 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_valgrind], [valgrind], [yes], [no]) + +AC_ARG_ENABLE([valgrind], AS_HELP_STRING([--disable-valgrind], [Disable the use of valgrind in tests]), [], [enable_valgrind="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_valgrind], [yes], [], [AS_VAR_SET([enable_valgrind], [no])]) + +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]) +AM_CONDITIONAL([VALGRIND], [test x$enable_valgrind = xyes]) + AC_CONFIG_FILES([Makefile - src/Makefile]) + src/Makefile + test/Makefile + tuberia.pc]) AC_OUTPUT + +AC_MSG_NOTICE([has valgrind: $has_valgrind]) +AC_MSG_NOTICE([enable valgrind: $enable_valgrind]) +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: $execprefix]) +AC_MSG_NOTICE([libdir: $libdir]) +AC_MSG_NOTICE([includedir: $includedir]) + |