configure.ac revision 30f8ce46
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([xfs],
26        [1.1.1],
27        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
28        [xfs])
29# Set common system defines for POSIX extensions, such as _GNU_SOURCE
30# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
31AC_USE_SYSTEM_EXTENSIONS
32# xfs already have a header called config.h
33AC_CONFIG_HEADERS([xfs-config.h])
34AC_CONFIG_MACRO_DIR([m4])
35
36# Initialize Automake
37AM_INIT_AUTOMAKE([foreign dist-bzip2])
38AM_MAINTAINER_MODE
39
40# Require xorg-macros minimum of 1.10 for HAVE_STYLESHEETS in XORG_CHECK_SGML_DOCTOOLS
41m4_ifndef([XORG_MACROS_VERSION],
42	  [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
43XORG_MACROS_VERSION(1.10)
44XORG_DEFAULT_OPTIONS
45XORG_ENABLE_DEVEL_DOCS
46XORG_WITH_XMLTO(0.0.20)
47XORG_WITH_FOP
48XORG_CHECK_SGML_DOCTOOLS(1.5)
49XORG_WITH_LINT
50
51AC_CHECK_HEADERS([stdint.h])
52
53AC_ARG_WITH(default-config-file,
54	AS_HELP_STRING([--with-default-config-file=PATH],
55   [comma-separated list of paths to look for config file when not specified (default: ${sysconfdir}/X11/fs/config)]),
56	[CONFIG_FILE="$withval"], [CONFIG_FILE="${sysconfdir}/X11/fs/config"])
57
58DEFAULT_CONFIG_FILE=`echo ${CONFIG_FILE} | sed 's/,/\\\\\\\\\\\",\\\\\\\\\\\"/'g`
59AX_DEFINE_DIR([DEFAULT_CONFIG_FILE], DEFAULT_CONFIG_FILE,
60    [comma-separated list of strings for config file paths when not specified])
61
62# generate text for the man page
63case $CONFIG_FILE in
64    *,*)
65	CONFIG_FILE_DESC="the first file found from the list:"
66	CONFIG_FILE_PATH=`echo ${CONFIG_FILE} | sed 's/,/\\\\\\\\fR, \\\\\\\\fI/g'`
67	;;
68    *)
69	CONFIG_FILE_DESC="the default file,"
70	CONFIG_FILE_PATH="${CONFIG_FILE}"
71	;;
72esac
73AC_SUBST([CONFIG_FILE_DESC])
74AC_SUBST([CONFIG_FILE_PATH])
75
76# Require X.Org's font util macros 1.1 or later for XORG_FONTROOTDIR
77m4_ifndef([XORG_FONT_MACROS_VERSION],
78	  [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
79XORG_FONT_MACROS_VERSION(1.1)
80
81XORG_FONTROOTDIR
82
83# Determine font path to put in config file
84# Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
85# otherwise uses default path copied from xserver configure.ac
86AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
87	[DEFAULT_FONT_PATH='catalogue:$(sysconfdir)/X11/fontpath.d'],
88	[
89	DEFAULT_FONT_PATH='$(FONTROOTDIR)/misc/,$(FONTROOTDIR)/TTF/,$(FONTROOTDIR)/OTF/,$(FONTROOTDIR)/Type1/,$(FONTROOTDIR)/100dpi/,$(FONTROOTDIR)/75dpi/'
90	case $host_os in
91        	darwin*)    DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
92	esac
93])
94
95AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font path entries]),
96                                [ FONTPATH="$withval" ],
97                                [ FONTPATH="${DEFAULT_FONT_PATH}" ])
98AC_SUBST([FONTPATH])
99
100# Option to enable support for starting from inetd
101AC_ARG_ENABLE(inetd,
102	AS_HELP_STRING([--enable-inetd],
103	    [Support -inetd flag for starting from inetd (default: enabled)]),
104	    [INETD=$enableval], [INETD=yes])
105if test "x$INETD" = xyes; then
106        AC_DEFINE(XFS_INETD, 1, [Build support for starting from inetd])
107fi
108
109# Option to enable support for logging to syslog
110AC_ARG_ENABLE(syslog,
111	AS_HELP_STRING([--enable-syslog],
112	    [Support option for logging via syslog (default: enabled)]),
113	    [SYSLOG=$enableval], [SYSLOG=yes])
114if test "x$SYSLOG" = xyes; then
115        AC_DEFINE(USE_SYSLOG, 1, [Build support for logging via syslog])
116fi
117
118
119# Checks for system functions / libraries
120AC_CHECK_FUNCS([daemon])
121
122# Checks for pkg-config packages
123PKG_CHECK_MODULES(XFS, libfs xfont xtrans)
124
125# Transport selection macro from xtrans.m4
126XTRANS_CONNECTION_FLAGS
127
128AC_CONFIG_FILES([Makefile
129                 config/Makefile
130                 doc/Makefile
131                 man/Makefile])
132AC_OUTPUT
133