2020-02-21 19:12:20 +01:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ([2.69])
|
2020-05-30 22:07:26 +02:00
|
|
|
AC_INIT([hvif-light], [0.1.0], [commits@schurr.at])
|
2020-02-21 19:12:20 +01:00
|
|
|
AC_CONFIG_MACRO_DIR(m4)
|
2020-05-30 21:47:13 +02:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign 1.16])
|
2020-02-21 19:12:20 +01:00
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
AC_CONFIG_SRCDIR([src/hvif-light.h])
|
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
|
|
|
|
|
|
|
# Checks C compiler (with empty default flags).
|
|
|
|
: ${CFLAGS=""}
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-std=c11],
|
|
|
|
[ CFLAGS+=" -std=c11" ],
|
|
|
|
[ AC_MSG_ERROR([C compiler doesn't support C11 mode])] )
|
|
|
|
|
2020-05-29 23:27:03 +02:00
|
|
|
# Other tools
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AM_PROG_AR
|
2020-05-30 21:54:22 +02:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
AC_PROG_RANLIB
|
2020-05-29 23:27:03 +02:00
|
|
|
|
2020-02-21 19:12:20 +01:00
|
|
|
# Checks for header files.
|
2020-05-04 23:13:55 +02:00
|
|
|
AC_CHECK_HEADERS([assert.h math.h stdint.h stdlib.h stdbool.h stdio.h])
|
2020-02-21 19:12:20 +01:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_CHECK_HEADER_STDBOOL
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIZE_T
|
2020-05-30 21:54:22 +02:00
|
|
|
AC_TYPE_UINT16_T
|
2020-02-21 19:12:20 +01:00
|
|
|
AC_TYPE_UINT32_T
|
2020-05-30 21:54:22 +02:00
|
|
|
AC_TYPE_UINT8_T
|
2020-02-21 19:12:20 +01:00
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
|
2020-05-29 23:27:03 +02:00
|
|
|
# User defined options: debug
|
2020-02-21 19:12:20 +01:00
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
[AS_HELP_STRING([--enable-debug],[compile with debug options])],
|
|
|
|
[debug=${enableval}], [debug=no])
|
|
|
|
|
2020-03-31 22:16:17 +02:00
|
|
|
# Libraries
|
|
|
|
PKG_CHECK_MODULES([CAIRO], [cairo])
|
|
|
|
|
2020-02-21 19:12:20 +01:00
|
|
|
AC_MSG_NOTICE([Setting up compiler flags])
|
|
|
|
CFLAGS+=" -Wall -Wpedantic -Wextra"
|
|
|
|
|
|
|
|
if test x$debug = xyes; then
|
|
|
|
CFLAGS+=" -O0"
|
|
|
|
CFLAGS+=" -g -g3 -gdwarf-2"
|
|
|
|
CFLAGS+=" -ftrapv"
|
|
|
|
CPPFLAGS+="-DDEBUG"
|
|
|
|
YFLAGS+=" --debug -v"
|
|
|
|
else
|
|
|
|
CFLAGS+=" -O3"
|
|
|
|
CPPFLAGS+=" -DNDEBUG"
|
|
|
|
fi
|
|
|
|
|
2020-05-30 21:47:13 +02:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
2020-05-04 23:13:55 +02:00
|
|
|
|
|
|
|
# Documentation
|
|
|
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
|
|
|
if test -z "$DOXYGEN";
|
|
|
|
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
|
|
|
|
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([docs/Doxyfile])])
|
|
|
|
|
2020-02-21 19:12:20 +01:00
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
AS_ECHO("")
|
|
|
|
AS_ECHO("Configuration summary")
|
|
|
|
AS_ECHO("CC = $CC")
|
|
|
|
AS_ECHO("CFLAGS = $CFLAGS")
|
|
|
|
AS_ECHO("CPPLAGS = $CPPFLAGS")
|
|
|
|
AS_ECHO("YFLAGS = $YFLAGS")
|
|
|
|
AS_ECHO("LFLAGS = $LFLAGS")
|