-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
56 lines (49 loc) · 1.38 KB
/
configure.ac
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
AC_INIT([ESE Key Daemon], [1.2.7], [krzysztof@burghardt.pl], [esekeyd])
AC_CONFIG_AUX_DIR(build)
AC_CONFIG_SRCDIR(src/esekeyd.c)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
AM_CONDITIONAL([DOT_GIT], [test -f .git/index])
if test "$CFLAGS"; then
CFLAGS_CUSTOM=yes
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
if test x"$cross_compiling" = xyes; then
AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
else
CC_FOR_BUILD="$CC"
fi
dnl Checks for header files.
AC_CHECK_HEADERS(stdio.h stdlib.h unistd.h fcntl.h syslog.h string.h \
getopt.h sys/types.h sys/stat.h linux/input.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(fprintf exit system fork \
syslog openlog closelog \
fopen feof fread fclose \
open read close getopt_long)
dnl Use option --enable-gcc-debug to enable GCC debug code.
AC_ARG_ENABLE(gcc-debug,
AS_HELP_STRING([--enable-gcc-debug],
[enable GCC DEBUG code]),
[enable_gcc_debug=yes],
[enable_gcc_debug=no])
if test "$enable_gcc_debug" = "yes" && (test "$GCC" = "yes"); then
if test -z "$CFLAGS_CUSTOM"; then
CFLAGS="-Wall -Wextra -Werror -O0 -ggdb -DDEBUGGER"
else
CFLAGS="$CFLAGS -O0 -ggdb -DDEBUGGER"
fi
AC_MSG_RESULT([Enabling GCC DEBUG support...])
else
if test -z "$CFLAGS_CUSTOM" && (test "$GCC" = "yes"); then
CFLAGS="-Wall -Wextra -Werror -O2"
fi
fi
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
examples/Makefile
])
AC_OUTPUT