generarxml/configure.ac

63 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2016-10-29 16:21:51 -03:00
AC_INIT([generarxml], [1.1], [chris@cromer.cl], [generarxml], [https://www.cromer.cl])
2016-10-16 16:55:55 -03:00
AC_PREFIX_DEFAULT([/usr])
AC_CONFIG_SRCDIR([src/main.c])
2016-10-17 21:10:47 -03:00
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
2016-10-27 09:52:01 -03:00
AC_PROG_CC([gcc])
2016-10-16 16:55:55 -03:00
AX_CHECK_COMPILE_FLAG([-std=c11], [
CFLAGS+=" -std=c11"
], [
echo "C compiler cannot compile C11 code"
exit -1
])
AC_PROG_INSTALL
AC_PATH_PROG([M4], [m4])
AC_ARG_WITH(debug, [AS_HELP_STRING([--with-debug], [include debug messages])],
[case $with_debug in
2016-10-23 23:17:03 -03:00
yes) AC_DEFINE(DEBUG)
;;
no) ;;
*) AC_MSG_ERROR(["--with-debug does not take an argument."])
;;
2016-10-16 16:55:55 -03:00
esac])
AC_ARG_WITH(debug_encoding, [AS_HELP_STRING([--with-debug-encoding], [include encoding debug messages])],
[case $with_debug_encoding in
2016-10-23 23:17:03 -03:00
yes) AC_DEFINE(DEBUG_ENCODING)
;;
no) ;;
*) AC_MSG_ERROR(["--with-debug-encoding does not take an argument."])
;;
2016-10-16 16:55:55 -03:00
esac])
AC_DEFINE(_DEFAULT_SOURCE)
AM_PATH_XML2(2.9.0,,AC_MSG_ERROR([
*** Libxml is required to build generarxml; Available at
http://www.libxml.org/.]))
2016-10-17 20:31:39 -03:00
AM_CFLAGS=(`xml2-config --cflags --libs`)
2016-10-16 16:55:55 -03:00
2016-10-17 20:27:58 -03:00
PKG_CHECK_MODULES([libxml2], [libxml-2.0])
2016-10-16 16:55:55 -03:00
2016-10-27 09:52:01 -03:00
case "$host" in
*mingw*)
AC_MSG_RESULT(OS Detected: $host)
AC_MSG_RESULT(Adding iconv flag for mingw...)
LDFLAGS="-liconv $AM_LDFLAGS $LDFLAGS"
;;
*) ;;
esac
2016-10-17 21:10:47 -03:00
AC_CONFIG_FILES([Makefile
src/Makefile
])
2016-10-16 16:55:55 -03:00
AC_OUTPUT