2015-08-07 09:33:37 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2015-08-08 09:44:59 +00:00
|
|
|
AC_PREREQ([2.68])
|
2015-11-05 21:59:56 +00:00
|
|
|
AC_INIT([pixz], [1.0.6], [https://github.com/vasi/pixz/issues])
|
2015-08-08 09:49:50 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2015-08-07 09:33:37 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/pixz.c])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
# Automake invocation.
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC_STDC
|
2015-09-18 16:56:47 +00:00
|
|
|
|
|
|
|
# Check for a2x only if the man page is missing, i.e. we are building from git. The release tarballs
|
|
|
|
# are set up to include the man pages. This way, only people creating tarballs via `make dist` and
|
|
|
|
# people building from git need a2x as a dependency.
|
|
|
|
AC_CHECK_FILE(
|
|
|
|
[src/pixz.1],
|
|
|
|
[],
|
|
|
|
[
|
2015-12-26 13:36:17 +00:00
|
|
|
AC_ARG_WITH(
|
|
|
|
[manpage],
|
|
|
|
[ --without-manpage don't build man page],
|
|
|
|
[case ${withval} in
|
|
|
|
yes) manpage=true ;;
|
|
|
|
no) manpage=false ;;
|
|
|
|
*) AC_MSG_ERROR([bad value ${withval} for --with-manpage]) ;;
|
|
|
|
esac],
|
|
|
|
[manpage=true]
|
|
|
|
)
|
2015-09-18 16:56:47 +00:00
|
|
|
]
|
|
|
|
)
|
2015-08-07 09:33:37 +00:00
|
|
|
|
2015-12-26 13:36:17 +00:00
|
|
|
AM_CONDITIONAL([MANPAGE], [test x$manpage = xtrue])
|
|
|
|
|
|
|
|
if test x$manpage = xtrue ; then
|
|
|
|
AC_CHECK_PROG(A2X, a2x, a2x, [])
|
|
|
|
if test "x$A2X" = x ; then
|
|
|
|
AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-08-07 09:33:37 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
AC_CHECK_LIB([m], [ceil])
|
|
|
|
AX_PTHREAD
|
|
|
|
PKG_CHECK_MODULES(LIBARCHIVE, libarchive)
|
|
|
|
PKG_CHECK_MODULES(LZMA, liblzma)
|
|
|
|
|
|
|
|
# Checks for header files.
|
2015-08-19 13:54:48 +00:00
|
|
|
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h])
|
2015-08-07 09:33:37 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2015-08-08 10:03:02 +00:00
|
|
|
# add when travis has autoconf 2.69+ AC_CHECK_HEADER_STDBOOL
|
2015-08-07 09:33:37 +00:00
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
|
|
|
|
# Checks for operating system services or capabilities.
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_REALLOC
|
|
|
|
AC_FUNC_STRTOD
|
2015-08-19 13:54:48 +00:00
|
|
|
AC_CHECK_FUNCS([memchr memmove memset strerror strtol])
|
2016-03-22 07:36:54 +00:00
|
|
|
AC_CHECK_HEADER([sys/endian.h],
|
2015-09-20 19:49:33 +00:00
|
|
|
[
|
2016-03-22 07:36:54 +00:00
|
|
|
AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <sys/endian.h>])
|
2015-09-20 19:49:33 +00:00
|
|
|
],
|
2016-03-22 07:36:54 +00:00
|
|
|
[], [])
|
|
|
|
|
|
|
|
AC_CHECK_HEADER([endian.h],
|
|
|
|
[
|
|
|
|
AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <endian.h>])
|
|
|
|
],
|
|
|
|
[], [])
|
2015-08-07 09:33:37 +00:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
2015-08-08 10:30:49 +00:00
|
|
|
src/Makefile
|
|
|
|
test/Makefile])
|
2015-08-07 09:33:37 +00:00
|
|
|
AC_OUTPUT
|