2 # Process this file with autoconf to produce a configure script.
3 AC_INIT([kbd],[2.2.0],[gladkov.alexey@gmail.com],[],[http://kbd-project.org/])
7 AC_CONFIG_AUX_DIR(config)
8 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([1.9 -Wall -Wno-portability color-tests dist-xz])
11 AC_CONFIG_SRCDIR([src/loadkeys.c])
12 AC_CONFIG_HEADERS(config.h)
16 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
17 AM_SILENT_RULES([yes])
19 # Checks for programs.
33 dnl older versions of automake didn't include this macro
34 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
37 AM_GNU_GETTEXT_VERSION([0.14.1])
38 AM_GNU_GETTEXT([external])
39 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
41 # Checks for header files.
45 AC_CHECK_HEADERS([fcntl.h libintl.h locale.h memory.h stdlib.h string.h \
46 sys/file.h sys/ioctl.h termios.h unistd.h])
48 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
56 AC_PROG_GCC_TRADITIONAL
62 AC_CHECK_FUNCS([alarm memset setlocale strcasecmp strchr strdup strerror \
63 strspn strstr strtol strtoul setpgrp malloc realloc])
67 FORTIFY_SOURCE="-D_FORTIFY_SOURCE=2"
69 if test "$enable_code_coverage" = yes; then
74 case "$GCC,$ac_cv_prog_cc_g" in
75 yes,yes) CFLAGS="-g $CC_O_LEVEL $FORTIFY_SOURCE" ;;
76 yes,) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE" ;;
80 CC_CHECK_CFLAGS_APPEND([\
85 -Wdisabled-optimization \
87 -Wmissing-declarations \
88 -Wmissing-format-attribute \
90 -Wmissing-prototypes \
99 m68*) KEYCODES_PROGS=no ;;
100 *) KEYCODES_PROGS=yes ;;
102 AM_CONDITIONAL(KEYCODES_PROGS, test "$KEYCODES_PROGS" = "yes")
105 i?86*) RESIZECONS_PROGS=yes ;;
106 x86_64*) RESIZECONS_PROGS=yes ;;
107 *) RESIZECONS_PROGS=no ;;
109 AM_CONDITIONAL(RESIZECONS_PROGS, test "$RESIZECONS_PROGS" = "yes")
111 AC_ARG_ENABLE(optional-progs,
112 AS_HELP_STRING(--enable-optional-progs, [Build and install a optional programs]),
113 [OPTIONAL_PROGS=$enableval],[OPTIONAL_PROGS=no])
114 AM_CONDITIONAL(OPTIONAL_PROGS, test "$OPTIONAL_PROGS" = "yes")
116 AC_ARG_ENABLE(libkeymap,
117 AS_HELP_STRING(--enable-libkeymap, [Build and install a libkeymap]),
118 [BUILD_LIBKEYMAP=$enableval],[BUILD_LIBKEYMAP=no])
119 AM_CONDITIONAL(BUILD_LIBKEYMAP, test "$BUILD_LIBKEYMAP" = "yes")
122 AS_HELP_STRING(--disable-vlock, [do not build vlock]),
123 [VLOCK_PROG=$enableval],[VLOCK_PROG=yes])
124 AM_CONDITIONAL(VLOCK, test "$VLOCK_PROG" = "yes")
126 if test "$VLOCK_PROG" = "yes"; then
127 AC_CHECK_LIB(pam, pam_start, [
128 AC_CHECK_HEADER([security/pam_appl.h],
130 AC_MSG_ERROR([Can't find required header files.]))])
131 AC_CHECK_LIB(pam_misc, misc_conv, [
132 AC_CHECK_HEADER([security/pam_misc.h],
134 AC_MSG_ERROR([Can't find required header files.]))])
135 if test -z "$have_pam" -o -z "$have_pam_misc"; then
136 AC_MSG_ERROR([libpam-devel required.])
138 AC_SUBST(PAM_LIBS, "-lpam -lpam_misc")
142 [AS_HELP_STRING([--disable-tests], [do not build tests])],
143 [build_tests=$enableval], [build_tests=auto])
144 AM_CONDITIONAL(BUILD_TESTS, test "$build_tests" != "no")
146 AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
147 AM_CONDITIONAL(HAVE_DOXYGEN, test "$HAVE_DOXYGEN" = "yes")
149 AC_CONFIG_FILES([Makefile
153 docs/man/man1/Makefile
154 docs/man/man1/dumpkeys.1
155 docs/man/man1/loadkeys.1
156 docs/man/man1misc/Makefile
157 docs/man/man5/Makefile
158 docs/man/man8/Makefile
159 docs/man/man8/loadunimap.8
160 docs/man/man8/mapscrn.8
161 docs/man/man8/setfont.8
162 docs/man/man8misc/Makefile
163 docs/reference/Makefile
164 docs/reference/libkeymap/Makefile
167 src/libcommon/Makefile
168 src/libkbdfile/Makefile
169 src/libkeymap/Makefile
186 {get,set}keycodes: ${KEYCODES_PROGS}
187 resizecons: ${RESIZECONS_PROGS}
188 optional progs: ${OPTIONAL_PROGS}
190 libkbdfile: ${BUILD_LIBKEYMAP}
191 libkeymap: ${BUILD_LIBKEYMAP}