2013-02-13 15:40:33 +02:00
|
|
|
# This file uses AC_CONFIG_MACRO_DIR, so we need Autoconf 2.58 or better.
|
|
|
|
AC_PREREQ([2.58])
|
|
|
|
|
2017-05-16 09:42:07 +03:00
|
|
|
AC_INIT([WrapSix], [0.2.0], [xhire@wrapsix.org], [wrapsix], [https://www.wrapsix.org/])
|
2009-12-01 19:44:26 +02:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror])
|
2012-07-04 12:37:42 +03:00
|
|
|
|
|
|
|
# prevent automatic adding of "-g -O2" to CFLAGS
|
|
|
|
OLD_CFLAGS=$CFLAGS
|
2009-12-01 19:44:26 +02:00
|
|
|
AC_PROG_CC
|
2012-07-04 12:37:42 +03:00
|
|
|
CFLAGS=$OLD_CFLAGS
|
|
|
|
|
2009-12-04 00:05:16 +02:00
|
|
|
AC_CONFIG_FILES([
|
2009-12-01 19:44:26 +02:00
|
|
|
Makefile
|
|
|
|
src/Makefile
|
|
|
|
])
|
2013-02-13 15:40:33 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2017-10-28 10:08:45 +03:00
|
|
|
AC_CONFIG_HEADER([src/autoconfig.h])
|
2009-12-04 00:05:16 +02:00
|
|
|
|
2012-07-04 12:37:42 +03:00
|
|
|
###
|
|
|
|
# Configuration options
|
|
|
|
###
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
AS_HELP_STRING([--enable-debug], [enable debugging]),
|
|
|
|
[debug=$enableval],
|
|
|
|
[debug=no])
|
|
|
|
|
|
|
|
if test "x$debug" = "xyes"; then
|
2017-10-28 09:45:51 +03:00
|
|
|
AS_COMPILER_FLAGS(AM_CFLAGS, "-std=c89 -g -ggdb -O0 -pipe -pedantic -Wall -Wextra -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Wformat-nonliteral -Wformat-security -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wundef -Wunsafe-loop-optimizations -Wwrite-strings")
|
2013-07-16 09:28:14 +03:00
|
|
|
AC_DEFINE([DEBUG], [], [Turn on debug mode])
|
2012-07-04 12:37:42 +03:00
|
|
|
else
|
2017-10-28 09:45:51 +03:00
|
|
|
AS_COMPILER_FLAGS(AM_CFLAGS, "-O2 -pipe")
|
2012-07-04 12:37:42 +03:00
|
|
|
fi
|
|
|
|
|
2013-07-16 09:28:14 +03:00
|
|
|
|
2017-10-28 10:08:45 +03:00
|
|
|
AS_AC_EXPAND(XSYSCONFDIR, ${sysconfdir})
|
|
|
|
AC_DEFINE_UNQUOTED([SYSCONFDIR], "$XSYSCONFDIR", [Configuration files directory])
|
2013-07-16 09:28:14 +03:00
|
|
|
|
2012-07-04 12:37:42 +03:00
|
|
|
###
|
|
|
|
# Final commands
|
|
|
|
###
|
|
|
|
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
2009-12-04 00:05:16 +02:00
|
|
|
|
|
|
|
AC_OUTPUT
|