rules: reduce variable scopes
[platform/upstream/libxkbcommon.git] / configure.ac
index 1e8d539..c0ac1c5 100644 (file)
@@ -22,12 +22,13 @@ dnl Process this file with autoconf to create configure.
 
 # Initialize Autoconf
 AC_PREREQ([2.62])
-AC_INIT([libxkbcommon], [0.2.0],
+AC_INIT([libxkbcommon], [0.3.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=libxkbcommon],
         [libxkbcommon], [http://xkbcommon.org])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([src/config.h])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
 
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip subdir-objects color-tests parallel-tests])
@@ -50,12 +51,13 @@ XORG_WITH_DOXYGEN
 
 # Check for compiler features
 AC_C_INLINE
-AC_C_TYPEOF
 
 # Check for programs
 AC_PROG_MKDIR_P
 PKG_PROG_PKG_CONFIG
-AC_PROG_LEX
+
+# Note: we use some yacc extensions, which work with either GNU bison
+# (preferred) or byacc. Other yacc's may or may not work.
 AC_PROG_YACC
 AC_PATH_PROG([YACC_INST], $YACC)
 if test ! -f "src/xkbcomp/parser.c"; then
@@ -71,7 +73,11 @@ if test "x$ac_cv_func_strcasecmp" = xno || \
     AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp])
 fi
 
-AC_CHECK_FUNCS([eaccess euidaccess])
+AC_CHECK_FUNCS([eaccess euidaccess mmap])
+
+# Some tests use Linux-specific headers
+AC_CHECK_HEADER([linux/input.h])
+AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
 
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
 
@@ -111,6 +117,26 @@ AC_ARG_WITH([default_layout],
 AC_DEFINE_UNQUOTED([DEFAULT_XKB_LAYOUT], ["$DEFAULT_XKB_LAYOUT"],
                    [Default XKB layout])
 
+AC_ARG_WITH([default_variant],
+    [AS_HELP_STRING([--with-default-variant=<path>],
+        [Default XKB variant (default: (none))])],
+    [DEFAULT_XKB_VARIANT="$withval"],
+    [DEFAULT_XKB_VARAINT=])
+if ! test "x$DEFAULT_XKB_VARIANT" = x; then
+    AC_DEFINE_UNQUOTED([DEFAULT_XKB_VARIANT], ["$DEFAULT_XKB_VARIANT"],
+                       [Default XKB variant])
+fi
+
+AC_ARG_WITH([default_options],
+    [AS_HELP_STRING([--with-default-options=<path>],
+        [Default XKB options (default: (none))])],
+    [DEFAULT_XKB_OPTIONS="$withval"],
+    [DEFAULT_XKB_OPTIONS=])
+if ! test "x$DEFAULT_XKB_OPTIONS" = x; then
+    AC_DEFINE_UNQUOTED([DEFAULT_XKB_OPTIONS], ["$DEFAULT_XKB_OPTIONS"],
+                       [Default XKB options])
+fi
+
 AC_CONFIG_FILES([
     Makefile
     xkbcommon-uninstalled.pc