2 # Process this file with autoconf to produce a configure script.
3 AC_INIT(kbd, 1.15.5, 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 color-tests dist-xz])
11 AC_CONFIG_SRCDIR([src/loadkeys.c])
12 AC_CONFIG_HEADERS(config.h)
14 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
16 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
17 AM_SILENT_RULES([yes])
19 # Checks for programs.
30 dnl older versions of automake didn't include this macro
31 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
34 AM_GNU_GETTEXT_VERSION([0.14.1])
35 AM_GNU_GETTEXT([external])
36 ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
38 # Checks for libraries.
40 # Checks for header files.
44 AC_CHECK_HEADERS([fcntl.h libintl.h locale.h memory.h stdlib.h string.h \
45 sys/file.h sys/ioctl.h termios.h unistd.h])
47 # Checks for typedefs, structures, and compiler characteristics.
54 # Checks for library functions.
58 AC_PROG_GCC_TRADITIONAL
61 AC_CHECK_FUNCS([alarm memset setlocale strcasecmp strchr strdup strerror \
62 strspn strstr strtol strtoul setpgrp malloc realloc])
64 CC_CHECK_CFLAGS_APPEND([\
68 -Wdisabled-optimization \
71 -Wmissing-format-attribute \
72 -Wmissing-prototypes \
74 -Wmissing-declarations])
77 m68*|sparc*) KEYCODES_PROGS=no ;;
78 *) KEYCODES_PROGS=yes ;;
80 AM_CONDITIONAL(KEYCODES_PROGS, test "$KEYCODES_PROGS" = "yes")
83 i?86*) RESIZECONS_PROGS=yes ;;
84 x86_64*) RESIZECONS_PROGS=yes ;;
85 *) RESIZECONS_PROGS=no ;;
87 AM_CONDITIONAL(RESIZECONS_PROGS, test "$RESIZECONS_PROGS" = "yes")
89 AC_ARG_ENABLE(optional-progs,
90 AS_HELP_STRING(--enable-optional-progs, [Build and install a optional programs]),
91 [OPTIONAL_PROGS=$enableval],[OPTIONAL_PROGS=no])
92 AM_CONDITIONAL(OPTIONAL_PROGS, test "$OPTIONAL_PROGS" = "yes")
94 AC_ARG_ENABLE(libkeymap,
95 AS_HELP_STRING(--enable-libkeymap, [Build and install a libkeymap]),
96 [BUILD_LIBKEYMAP=$enableval],[BUILD_LIBKEYMAP=no])
97 AM_CONDITIONAL(BUILD_LIBKEYMAP, test "$BUILD_LIBKEYMAP" = "yes")
100 AS_HELP_STRING(--disable-vlock, [do not build vlock]),
101 [VLOCK_PROG=no],[VLOCK_PROG=yes])
102 AM_CONDITIONAL(VLOCK, test "$VLOCK_PROG" = "yes")
104 if test "$VLOCK_PROG" = "yes"; then
105 AC_CHECK_LIB(pam, pam_start, [
106 AC_CHECK_HEADER([security/pam_appl.h],
108 AC_MSG_ERROR([Can't find required header files.]))])
109 AC_CHECK_LIB(pam_misc, misc_conv, [
110 AC_CHECK_HEADER([security/pam_misc.h],
112 AC_MSG_ERROR([Can't find required header files.]))])
113 if test -z "$have_pam" -o -z "$have_pam_misc"; then
114 AC_MSG_ERROR([libpam-devel required.])
116 AC_SUBST(PAM_LIBS, "-lpam -lpam_misc")
119 AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
120 AM_CONDITIONAL(HAVE_DOXYGEN, test "$HAVE_DOXYGEN" = "yes")
122 AC_CONFIG_FILES([Makefile
126 docs/man/man1/Makefile
127 docs/man/man1/dumpkeys.1
128 docs/man/man1/loadkeys.1
129 docs/man/man1misc/Makefile
130 docs/man/man5/Makefile
131 docs/man/man8/Makefile
132 docs/man/man8/loadunimap.8
133 docs/man/man8/mapscrn.8
134 docs/man/man8/setfont.8
135 docs/man/man8misc/Makefile
136 docs/reference/Makefile
137 docs/reference/libkeymap/Makefile
140 src/libkeymap/Makefile
157 {get,set}keycodes: ${KEYCODES_PROGS}
158 resizecons: ${RESIZECONS_PROGS}
159 optional progs: ${OPTIONAL_PROGS}
161 libkeymap: ${BUILD_LIBKEYMAP}