forked from legionus/kbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
212 lines (180 loc) · 5.48 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([kbd],[2.4.0],[[email protected]],[],[http://kbd-project.org/])
AC_PREREQ([2.69])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9 -Wall -Wno-portability color-tests dist-xz])
AC_CONFIG_SRCDIR([src/loadkeys.c])
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_HEADERS(config.h)
PKG_PROG_PKG_CONFIG
AX_CODE_COVERAGE
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
# Checks for programs.
CFLAGS="${CFLAGS:-}"
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_YACC
AC_PROG_LEX
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CANONICAL_HOST
dnl older versions of automake didn't include this macro
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h libintl.h locale.h memory.h stdlib.h string.h \
sys/file.h sys/ioctl.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_TYPE_UID_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_STAT
AC_CHECK_FUNCS([alarm memset setlocale strcasecmp strchr strdup strerror \
strspn strstr strtol strtoul setpgrp malloc realloc])
AC_SEARCH_LIBS([timer_create], [rt])
# Optimization level
CC_O_LEVEL="-O2"
FORTIFY_SOURCE="-D_FORTIFY_SOURCE=2"
if test "$enable_code_coverage" = yes; then
CC_O_LEVEL="-O0"
FORTIFY_SOURCE=
fi
case "$GCC,$ac_cv_prog_cc_g" in
yes,yes) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
yes,) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
,yes) CFLAGS="$CFLAGS" ;;
esac
CC_CHECK_CFLAGS_APPEND([\
-Waggregate-return \
-Wall \
-Wcast-align \
-Wconversion \
-Wdisabled-optimization \
-Wextra \
-Wmissing-declarations \
-Wmissing-format-attribute \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wpointer-arith \
-Wredundant-decls \
-Wshadow \
-Wstrict-prototypes \
-Wwrite-strings \
])
AC_ARG_ENABLE(werror,
[AS_HELP_STRING([--enable-werror], [turn on -Werror for some kind of warnings])],
[use_werror=$enableval], [use_werror=no])
if test "$use_werror" = yes; then
CC_CHECK_CFLAGS_APPEND([ \
-Werror=incompatible-pointer-types \
-Werror=discarded-qualifiers \
])
fi
case $host_cpu in
m68*) KEYCODES_PROGS=no ;;
*) KEYCODES_PROGS=yes ;;
esac
AM_CONDITIONAL(KEYCODES_PROGS, test "$KEYCODES_PROGS" = "yes")
case $host_cpu in
i?86*) RESIZECONS_PROGS=yes ;;
x86_64*) RESIZECONS_PROGS=yes ;;
*) RESIZECONS_PROGS=no ;;
esac
AM_CONDITIONAL(RESIZECONS_PROGS, test "$RESIZECONS_PROGS" = "yes")
AC_ARG_ENABLE(optional-progs,
AS_HELP_STRING(--enable-optional-progs, [Build and install a optional programs]),
[OPTIONAL_PROGS=$enableval],[OPTIONAL_PROGS=no])
AM_CONDITIONAL(OPTIONAL_PROGS, test "$OPTIONAL_PROGS" = "yes")
AC_ARG_ENABLE(libkeymap,
AS_HELP_STRING(--enable-libkeymap, [Build and install a libkeymap]),
[BUILD_LIBKEYMAP=$enableval],[BUILD_LIBKEYMAP=no])
AM_CONDITIONAL(BUILD_LIBKEYMAP, test "$BUILD_LIBKEYMAP" = "yes")
AC_ARG_ENABLE(vlock,
AS_HELP_STRING(--disable-vlock, [do not build vlock]),
[VLOCK_PROG=$enableval],[VLOCK_PROG=yes])
AM_CONDITIONAL(VLOCK, test "$VLOCK_PROG" = "yes")
if test "$VLOCK_PROG" = "yes"; then
AC_CHECK_LIB(pam, pam_start, [
AC_CHECK_HEADER([security/pam_appl.h],
[have_pam=1],
AC_MSG_ERROR([Can't find required header files.]))])
AC_CHECK_LIB(pam_misc, misc_conv, [
AC_CHECK_HEADER([security/pam_misc.h],
[have_pam_misc=1],
AC_MSG_ERROR([Can't find required header files.]))])
if test -z "$have_pam" -o -z "$have_pam_misc"; then
AC_MSG_ERROR([libpam-devel required.])
fi
AC_SUBST(PAM_LIBS, "-lpam -lpam_misc")
fi
AC_ARG_ENABLE(tests,
[AS_HELP_STRING([--disable-tests], [do not build tests])],
[build_tests=$enableval], [build_tests=auto])
AM_CONDITIONAL(BUILD_TESTS, test "$build_tests" != "no")
AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
AM_CONDITIONAL(HAVE_DOXYGEN, test "$HAVE_DOXYGEN" = "yes")
AC_CONFIG_FILES([Makefile
data/Makefile
docs/Makefile
docs/man/Makefile
docs/man/man1/Makefile
docs/man/man1/dumpkeys.1
docs/man/man1/loadkeys.1
docs/man/man1misc/Makefile
docs/man/man5/Makefile
docs/man/man8/Makefile
docs/man/man8/loadunimap.8
docs/man/man8/mapscrn.8
docs/man/man8/setfont.8
docs/man/man8misc/Makefile
docs/reference/Makefile
docs/reference/libkeymap/Makefile
po/Makefile.in
src/Makefile
src/libcommon/Makefile
src/libkbdfile/Makefile
src/libkfont/Makefile
src/libkeymap/Makefile
src/vlock/Makefile
tests/helpers/Makefile
tests/libkbdfile/Makefile
tests/libkeymap/Makefile
tests/libtswrap/Makefile
tests/Makefile
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
======
prefix: ${prefix}
libdir: ${libdir}
bindir: ${bindir}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
{get,set}keycodes: ${KEYCODES_PROGS}
resizecons: ${RESIZECONS_PROGS}
optional progs: ${OPTIONAL_PROGS}
vlock: ${VLOCK_PROG}
libkbdfile: ${BUILD_LIBKEYMAP}
libkeymap: ${BUILD_LIBKEYMAP}
])