2015-01-26 21:17:24 +01:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ([2.69])
|
|
|
|
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
|
2015-02-07 21:02:22 +01:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2015-01-28 23:05:38 +01:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects]) # Does not require NEWS, COPYING, AUTHORS, ChangeLog or README
|
2015-01-28 22:40:18 +01:00
|
|
|
|
2015-02-06 17:52:58 +01:00
|
|
|
# silent make https://autotools.io/automake/silent.html
|
|
|
|
# silent rules enabled by default with 'yes'
|
|
|
|
# disable silent runles with ./configure --disable-silent-rules
|
|
|
|
AM_SILENT_RULES([yes]) # less verbose make output
|
|
|
|
# AM_SILENT_RULES() # use make -s to get silent output
|
2015-01-28 22:40:18 +01:00
|
|
|
|
2015-01-26 21:17:24 +01:00
|
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
2015-06-23 19:17:24 +02:00
|
|
|
AC_CONFIG_HEADERS([config.h]) # use config.h instead of passing -D in the command line
|
2015-06-24 22:18:18 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2015-01-26 21:17:24 +01:00
|
|
|
|
2015-01-28 22:22:23 +01:00
|
|
|
AC_LANG([C]) # Use C not C++
|
|
|
|
|
2015-01-26 21:17:24 +01:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
2015-01-28 22:22:23 +01:00
|
|
|
|
|
|
|
# In case that you want to check for specific versions of gcc
|
|
|
|
# For example in case that you need C11 support you want to
|
|
|
|
# check for gcc-4.9
|
|
|
|
#AC_PROG_CC([gcc-4.9 gcc cc])
|
|
|
|
|
2015-02-02 13:24:20 +01:00
|
|
|
AC_PROG_CC_C99 # or AC_PROG_CC_89 to force C89 mode or AC_PROG_CC_STDC to go to latest supported standard (currently C99)
|
|
|
|
|
2015-01-26 21:17:24 +01:00
|
|
|
AC_PROG_INSTALL
|
2015-02-09 22:21:18 +01:00
|
|
|
AC_PROG_CC_C_O # Need to have per product flags myexecutable_CFLAG
|
|
|
|
AC_PROG_RANLIB # Need for to create libraries: .a
|
2015-01-26 21:17:24 +01:00
|
|
|
|
2015-03-08 11:03:40 +01:00
|
|
|
|
2015-01-26 21:17:24 +01:00
|
|
|
# Checks for libraries.
|
|
|
|
|
2015-01-31 20:40:55 +01:00
|
|
|
# Found libraries are automatically addded to LIBS
|
|
|
|
# AC_SEARCH_LIBS([pthread_cond_wait], [pthread],[],[
|
|
|
|
# AC_MSG_ERROR([You need to install pthreads library.])
|
|
|
|
# ])
|
|
|
|
|
2015-02-06 17:51:56 +01:00
|
|
|
# AC_SEARCH_LIBS([g_test_init], [glib-2.0],[],[
|
|
|
|
# AC_MSG_ERROR([You need to install glib-2.0 library.])
|
|
|
|
# ])
|
|
|
|
|
2015-01-26 21:17:24 +01:00
|
|
|
# Checks for header files.
|
2015-03-08 11:03:40 +01:00
|
|
|
AC_HEADER_ASSERT # ./configure --disable-assert to define NDEBUG
|
2015-01-28 22:22:23 +01:00
|
|
|
AC_CHECK_HEADER([stdlib.h])
|
|
|
|
|
|
|
|
# Check for C11's optional Atomic operations library
|
|
|
|
# AC_CHECK_HEADER([stdatomic.h], [], [
|
|
|
|
# AC_MSG_ERROR([C11 with atomic support needed.])
|
|
|
|
# ])
|
2015-01-26 21:17:24 +01:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
|
2015-02-06 20:29:48 +01:00
|
|
|
# The following statement will use pkg-config --cflags --libs
|
|
|
|
# to find out CFLAGS and -l options required to build a target that
|
|
|
|
# it's going to link against glib2.0.
|
|
|
|
# The required CFLAGS and -l options are available as DEPS_CFLAGS
|
|
|
|
# and DEPS_LIBS in Makefile.am
|
2015-02-07 23:29:52 +01:00
|
|
|
# PKG_CHECK_MODULES([DEPS], [glib-2.0 >= 2.24.1])
|
2015-02-06 17:10:11 +01:00
|
|
|
|
2015-03-08 10:52:22 +01:00
|
|
|
AC_ARG_ENABLE([myfeature],
|
2015-03-08 11:11:28 +01:00
|
|
|
AS_HELP_STRING([--disable-myfeature],[disable myfeature to get remove support for this and that]),
|
|
|
|
[enable_myfeature=${enableval}],[enable_myfeature=yes])
|
2015-03-08 10:52:22 +01:00
|
|
|
|
|
|
|
if test "x${enable_myfeature}" == "xyes"; then
|
|
|
|
AC_DEFINE([MYFEATURE], 1, [myfeature is enabled])
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([
|
|
|
|
-----------------------------------------------------------------------------------
|
|
|
|
Are you sure that you want to have myfeature disabled? You will lose this and that.
|
|
|
|
-----------------------------------------------------------------------------------
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
2015-01-28 23:05:38 +01:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
2015-02-07 21:02:22 +01:00
|
|
|
AC_REQUIRE_AUX_FILE([tap-driver.sh])
|
2015-06-24 22:49:26 +02:00
|
|
|
AX_VALGRIND_CHECK # http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html - make check-valgrind
|
2015-01-26 21:17:24 +01:00
|
|
|
AC_OUTPUT
|