xenocara/app/rgb/configure.ac

106 lines
3.8 KiB
Plaintext
Raw Normal View History

dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2006-11-25 13:07:29 -07:00
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
dnl and/or sell copies of the Software, and to permit persons to whom the
dnl Software is furnished to do so, subject to the following conditions:
2006-11-25 13:07:29 -07:00
dnl
dnl The above copyright notice and this permission notice (including the next
dnl paragraph) shall be included in all copies or substantial portions of the
dnl Software.
2006-11-25 13:07:29 -07:00
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
2006-11-25 13:07:29 -07:00
dnl
dnl Process this file with autoconf to create configure.
2013-03-05 13:40:53 -07:00
# Initialize Autoconf
AC_PREREQ([2.60])
2015-01-03 08:52:33 -07:00
AC_INIT([rgb], [1.0.6],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [rgb])
2013-03-05 13:40:53 -07:00
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
2015-01-03 08:52:33 -07:00
AC_USE_SYSTEM_EXTENSIONS
2013-03-05 13:40:53 -07:00
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
2006-11-25 13:07:29 -07:00
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
2006-11-25 13:07:29 -07:00
2015-01-03 08:52:33 -07:00
AC_CHECK_FUNCS([asprintf])
2008-06-12 22:55:03 -06:00
PKG_CHECK_MODULES(RGB, xproto)
2006-11-25 13:07:29 -07:00
AC_MSG_CHECKING([for rgb database location])
AC_ARG_WITH([rgb-db-dir],
2013-03-05 13:40:53 -07:00
AS_HELP_STRING([--with-rgb-db-dir=<path>],
2006-11-25 13:07:29 -07:00
[rgb database location (default is ${datadir}/X11/rgb)]),
[db_path=$withval], [db_path=${datadir}/X11/rgb])
AC_MSG_RESULT([$db_path])
dnl XXX not working - AC_DEFINE([RGB_DB], $db_path, [set to location of rgb database (without any file type suffix)])
db_file=`basename $db_path`
db_dir=`dirname $db_path`
AC_SUBST([db_file])
AC_SUBST([db_dir])
AC_MSG_CHECKING([for rgb database format])
AC_ARG_WITH([rgb-db-type],
2013-03-05 13:40:53 -07:00
AS_HELP_STRING([--with-rgb-db-type=(text|dbm|ndbm)],
2006-11-25 13:07:29 -07:00
[rgb database type (default is text)]),
[db_type=$withval], [db_type="text"])
AC_MSG_RESULT([$db_type])
2008-06-12 22:55:03 -06:00
RGB_DB_TYPE=$db_type
2006-11-25 13:07:29 -07:00
case $db_type in
text)
RGB_DB_FILES=""
AC_DEFINE([USE_RGB_TXT], [1],
[Define to 1 to use plain text files for rgb database])
;;
dbm)
2008-06-12 22:55:03 -06:00
AC_SEARCH_LIBS([dbminit], [db dbm nsl], [],
2006-11-25 13:07:29 -07:00
AC_MSG_ERROR([dbm requested but dbminit() not found in any libraries]))
2008-06-12 22:55:03 -06:00
AC_CHECK_HEADER([dbm.h], [DBM_HEADER='<dbm.h>'],
[AC_CHECK_HEADER([rpcsvc/dbm.h], [DBM_HEADER='<rpcsvc/dbm.h>'],
[AC_MSG_ERROR([dbm requested but dbm.h not found])])])
PKG_CHECK_MODULES(XORG, [xorg-server])
RGB_CFLAGS="$RGB_CFLAGS $XORG_CFLAGS"
RGB_DB_FILES='$(db_file).dir $(db_file).pag'
2006-11-25 13:07:29 -07:00
;;
ndbm)
# Find a dbm or ndbm implementation
2008-06-12 22:55:03 -06:00
AC_SEARCH_LIBS([dbm_open], [db ndbm dbm],
AC_DEFINE([NDBM], [1],
2006-11-25 13:07:29 -07:00
[Define to 1 if you have ndbm.h interfaces]),
AC_MSG_ERROR([ndbm requested but dbm_open() not found in any libraries]))
2008-06-12 22:55:03 -06:00
DBM_HEADER='<ndbm.h>'
PKG_CHECK_MODULES(XORG, [xorg-server])
RGB_CFLAGS="$RGB_CFLAGS $XORG_CFLAGS"
RGB_DB_FILES='$(db_file).dir $(db_file).pag'
2006-11-25 13:07:29 -07:00
;;
esac
2008-06-12 22:55:03 -06:00
if test x$DBM_HEADER != x ; then
AC_DEFINE_UNQUOTED([DBM_HEADER], [$DBM_HEADER],
2008-06-12 22:55:03 -06:00
[Header file to include for dbm functions])
fi
AC_SUBST([RGB_DB_TYPE])
2006-11-25 13:07:29 -07:00
AC_SUBST([RGB_DB_FILES])
2008-06-12 22:55:03 -06:00
AM_CONDITIONAL(RGB_DB, [test x$db_type != xtext])
2006-11-25 13:07:29 -07:00
AC_CONFIG_FILES([Makefile
man/Makefile])
2006-11-25 13:07:29 -07:00
AC_OUTPUT