configure.ac revision 9e1184fe
1dnl Copyright 2005 Red Hat, Inc. 2dnl 3dnl Permission to use, copy, modify, distribute, and sell this software and its 4dnl documentation for any purpose is hereby granted without fee, provided that 5dnl the above copyright notice appear in all copies and that both that 6dnl copyright notice and this permission notice appear in supporting 7dnl documentation, and that the name of Red Hat not be used in 8dnl advertising or publicity pertaining to distribution of the software without 9dnl specific, written prior permission. Red Hat makes no 10dnl representations about the suitability of this software for any purpose. It 11dnl is provided "as is" without express or implied warranty. 12dnl 13dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 14dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 15dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR 16dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 17dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 18dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19dnl PERFORMANCE OF THIS SOFTWARE. 20dnl 21dnl Process this file with autoconf to create configure. 22 23# Initialize Autoconf 24AC_PREREQ([2.60]) 25AC_INIT([xrdb], [1.2.1], 26 [https://gitlab.freedesktop.org/xorg/app/xrdb/issues], [xrdb]) 27AC_CONFIG_SRCDIR([Makefile.am]) 28AC_CONFIG_HEADERS([config.h]) 29AC_USE_SYSTEM_EXTENSIONS 30 31# Initialize Automake 32AM_INIT_AUTOMAKE([foreign dist-bzip2]) 33 34# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 35m4_ifndef([XORG_MACROS_VERSION], 36 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 37XORG_MACROS_VERSION(1.8) 38XORG_DEFAULT_OPTIONS 39 40AC_CHECK_FUNCS([mkstemp asprintf reallocarray]) 41 42# Find MAXHOSTNAMELEN definition 43# Common hidey holes: 44# BSD & Linux - <sys/param.h> 45# Solaris - <netdb.h> 46 47AC_CHECK_DECL([MAXHOSTNAMELEN],[FOUND_MAXHOSTNAMELEN=yes]) 48 49if test x$FOUND_MAXHOSTNAMELEN != xyes ; then 50 AC_MSG_CHECKING([for header that defines MAXHOSTNAMELEN]) 51 52 FOUND_MAXHOSTNAMELEN='not found' 53 54 AC_COMPILE_IFELSE( 55 [AC_LANG_PROGRAM([#include <sys/param.h>], 56 [int h = MAXHOSTNAMELEN;])], 57 [FOUND_MAXHOSTNAMELEN='sys/param.h' 58 AC_DEFINE(NEED_SYS_PARAM_H,1, 59 [Define to 1 if you need <sys/param.h> to define MAXHOSTNAMELEN])]) 60 61 AC_COMPILE_IFELSE( 62 [AC_LANG_PROGRAM([#include <netdb.h>], 63 [int h = MAXHOSTNAMELEN;])], 64 [FOUND_MAXHOSTNAMELEN='netdb.h' 65 AC_DEFINE(NEED_NETDB_H,1, 66 [Define to 1 if you need <netdb.h> to define MAXHOSTNAMELEN])]) 67 68 AC_MSG_RESULT([$FOUND_MAXHOSTNAMELEN]) 69fi 70 71# xrdb needs to know where to find cpp at runtime - previously set as CppCmd 72# in Imake config files for each OS 73AC_ARG_WITH([cpp], 74 AS_HELP_STRING([--with-cpp=path], 75 [comma-separated list of paths to cpp command for xrdb to use at runtime]), 76 [AC_MSG_CHECKING(for cpp) 77 CPP_PATH=$withval 78 AC_MSG_RESULT(--with-cpp specified $CPP_PATH)], 79 [AC_PATH_PROG([CPP_PATH],[cpp], [cpp], 80 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])]) 81CPP_PATH=`echo ${CPP_PATH} | sed 's/,/\\",\\"/g'` 82AC_DEFINE_UNQUOTED([CPP], "$CPP_PATH", [Path to CPP program]) 83 84# Checks for pkg-config packages 85PKG_CHECK_MODULES(XRDB, [xmuu x11 xproto >= 7.0.25]) 86 87AC_CONFIG_FILES([ 88 Makefile 89 man/Makefile]) 90AC_OUTPUT 91