configure.ac revision ecb85c42
1dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 2dnl 3dnl Permission is hereby granted, free of charge, to any person obtaining a 4dnl copy of this software and associated documentation files (the "Software"), 5dnl to deal in the Software without restriction, including without limitation 6dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 7dnl and/or sell copies of the Software, and to permit persons to whom the 8dnl Software is furnished to do so, subject to the following conditions: 9dnl 10dnl The above copyright notice and this permission notice (including the next 11dnl paragraph) shall be included in all copies or substantial portions of the 12dnl Software. 13dnl 14dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20dnl DEALINGS IN THE SOFTWARE. 21dnl 22dnl Process this file with autoconf to create configure. 23 24# Initialize Autoconf 25AC_PREREQ([2.60]) 26AC_INIT([rgb], [1.0.6], 27 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [rgb]) 28AC_CONFIG_SRCDIR([Makefile.am]) 29AC_CONFIG_HEADERS([config.h]) 30AC_USE_SYSTEM_EXTENSIONS 31 32# Initialize Automake 33AM_INIT_AUTOMAKE([foreign dist-bzip2]) 34 35# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 36m4_ifndef([XORG_MACROS_VERSION], 37 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 38XORG_MACROS_VERSION(1.8) 39XORG_DEFAULT_OPTIONS 40 41AC_CHECK_FUNCS([asprintf]) 42 43PKG_CHECK_MODULES(RGB, xproto) 44 45AC_MSG_CHECKING([for rgb database location]) 46AC_ARG_WITH([rgb-db-dir], 47 AS_HELP_STRING([--with-rgb-db-dir=<path>], 48 [rgb database location (default is ${datadir}/X11/rgb)]), 49 [db_path=$withval], [db_path=${datadir}/X11/rgb]) 50AC_MSG_RESULT([$db_path]) 51dnl XXX not working - AC_DEFINE([RGB_DB], $db_path, [set to location of rgb database (without any file type suffix)]) 52db_file=`basename $db_path` 53db_dir=`dirname $db_path` 54AC_SUBST([db_file]) 55AC_SUBST([db_dir]) 56 57AC_MSG_CHECKING([for rgb database format]) 58AC_ARG_WITH([rgb-db-type], 59 AS_HELP_STRING([--with-rgb-db-type=(text|dbm|ndbm)], 60 [rgb database type (default is text)]), 61 [db_type=$withval], [db_type="text"]) 62AC_MSG_RESULT([$db_type]) 63 64RGB_DB_TYPE=$db_type 65 66case $db_type in 67 text) 68 RGB_DB_FILES="" 69 AC_DEFINE([USE_RGB_TXT], [1], 70 [Define to 1 to use plain text files for rgb database]) 71 ;; 72 dbm) 73 AC_SEARCH_LIBS([dbminit], [db dbm nsl], [], 74 AC_MSG_ERROR([dbm requested but dbminit() not found in any libraries])) 75 AC_CHECK_HEADER([dbm.h], [DBM_HEADER='<dbm.h>'], 76 [AC_CHECK_HEADER([rpcsvc/dbm.h], [DBM_HEADER='<rpcsvc/dbm.h>'], 77 [AC_MSG_ERROR([dbm requested but dbm.h not found])])]) 78 PKG_CHECK_MODULES(XORG, [xorg-server]) 79 RGB_CFLAGS="$RGB_CFLAGS $XORG_CFLAGS" 80 RGB_DB_FILES='$(db_file).dir $(db_file).pag' 81 ;; 82 ndbm) 83 # Find a dbm or ndbm implementation 84 AC_SEARCH_LIBS([dbm_open], [db ndbm dbm], 85 AC_DEFINE([NDBM], [1], 86 [Define to 1 if you have ndbm.h interfaces]), 87 AC_MSG_ERROR([ndbm requested but dbm_open() not found in any libraries])) 88 DBM_HEADER='<ndbm.h>' 89 PKG_CHECK_MODULES(XORG, [xorg-server]) 90 RGB_CFLAGS="$RGB_CFLAGS $XORG_CFLAGS" 91 RGB_DB_FILES='$(db_file).dir $(db_file).pag' 92 ;; 93esac 94if test x$DBM_HEADER != x ; then 95 AC_DEFINE_UNQUOTED([DBM_HEADER], [$DBM_HEADER], 96 [Header file to include for dbm functions]) 97fi 98AC_SUBST([RGB_DB_TYPE]) 99AC_SUBST([RGB_DB_FILES]) 100AM_CONDITIONAL(RGB_DB, [test x$db_type != xtext]) 101 102AC_CONFIG_FILES([Makefile 103 man/Makefile]) 104 105AC_OUTPUT 106