1# Process this file with autoconf to produce a configure script.
2AC_INIT([Scale2x],[3.1])
3AC_CONFIG_SRCDIR([scalerx.c])
4AM_INIT_AUTOMAKE([foreign no-dependencies])
5AC_CONFIG_HEADERS([config.h])
6AC_CANONICAL_HOST
7
8# Checks for programs.
9AC_PROG_CC
10AC_CHECK_PROG([WINE],[wine],[wine],[])
11
12# Checks for libraries.
13AC_CHECK_LIB([m], [log], [], [AC_MSG_ERROR([the libm library is missing])])
14AC_CHECK_LIB([z], [adler32], [], [AC_MSG_ERROR([the libz library is missing])])
15AC_CHECK_LIB([png], [png_get_IHDR], [], [AC_MSG_ERROR([the libpng library is missing])])
16
17# Checks for header files.
18AC_HEADER_STDC
19AC_CHECK_HEADERS([unistd.h getopt.h])
20
21# Checks for typedefs, structures, and compiler characteristics.
22AC_C_CONST
23AC_C_INLINE
24AC_C_RESTRICT
25
26# Checks for library functions.
27AC_FUNC_ALLOCA
28AC_CHECK_FUNCS([getopt getopt_long])
29
30dnl Checks for architecture
31AC_C_BIGENDIAN
32
33dnl Checks for compiler
34AC_CHECK_CC_OPT([-Wall], CFLAGS="$CFLAGS -Wall", [])
35AC_CHECK_CC_OPT([-Wextra], CFLAGS="$CFLAGS -Wextra", [])
36
37dnl Checks for test environment
38AS_CASE([$host],
39	[*-*-mingw*], [TESTENV="$WINE"],
40	[]
41)
42
43AC_ARG_VAR([TESTENV], [Test environment])
44AC_CONFIG_FILES([Makefile])
45AC_OUTPUT
46
47