summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 60356208d995405ae9063ce30d05f6da3da74b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([skonfig-c],[0.1],[skonfig@dtnr.ch],[],[http://www.skonfig.li/])
AC_CONFIG_SRCDIR([src/skonfig.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_FILES([Makefile])

AM_INIT_AUTOMAKE([subdir-objects])

# Checks for programs.
AC_LANG([C])

AC_PROG_CC
# autoconf 2.70 obsoletes AC_PROG_CC_C99 and includes it in AC_PROG_CC
m4_version_prereq([2.70],[],[AC_PROG_CC_C99])

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([sys/stat.h])
AC_HEADER_STAT
AC_CHECK_HEADERS([stdarg.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_RESTRICT
AC_C_STRINGIZE
AC_TYPE_SIZE_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_CHECK_FUNCS_ONCE([getenv getpwuid stat strncpy strncat])

# Add debug support
AC_ARG_ENABLE(
	[debug],
	AS_HELP_STRING([--enable-debug], [enable debugging, default: no]),
	[case ${enableval} in
		(yes)	debug=true ;;
		(no)	debug=false ;;
		(*)	AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
	 esac],
	[debug=false])
AM_CONDITIONAL(DEBUG, [test "x${debug}" = xtrue])
AM_COND_IF(DEBUG,
	AC_DEFINE(DEBUG, 1, [Define to 0 if this is a release build]),
	AC_DEFINE(DEBUG, 0, [Define to 1 or higher if this is a debug build]))

# Defines
AC_DEFINE(DIRSEP, [/], [The directory separator in a file system path])
AC_DEFINE(PATHSEP, [:], [The separator of PATH components])

AC_OUTPUT