configure.ac revision 2265a131
1dnl 
2dnl  Copyright © 2003 Keith Packard, Noah Levitt
3dnl 
4dnl  Permission to use, copy, modify, distribute, and sell this software and its
5dnl  documentation for any purpose is hereby granted without fee, provided that
6dnl  the above copyright notice appear in all copies and that both that
7dnl  copyright notice and this permission notice appear in supporting
8dnl  documentation, and that the name of Keith Packard not be used in
9dnl  advertising or publicity pertaining to distribution of the software without
10dnl  specific, written prior permission.  Keith Packard makes no
11dnl  representations about the suitability of this software for any purpose.  It
12dnl  is provided "as is" without express or implied warranty.
13dnl 
14dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20dnl  PERFORMANCE OF THIS SOFTWARE.
21dnl
22dnl Process this file with autoconf to create configure.
23
24AC_PREREQ([2.57])
25
26dnl
27dnl
28AC_INIT(libXt, 1.0.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXt)
29AM_INIT_AUTOMAKE([dist-bzip2])
30AM_MAINTAINER_MODE
31
32# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
33m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
34XORG_MACROS_VERSION(1.2)
35AM_CONFIG_HEADER(config.h)
36
37# Check for progs
38AC_PROG_CC
39AC_PROG_LIBTOOL
40AM_PROG_CC_C_O
41XORG_CWARNFLAGS
42
43if test x"$CC_FOR_BUILD" = x; then
44	if test x"$cross_compiling" = xyes; then
45		AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
46	else
47	        CC_FOR_BUILD="$CC"
48	fi
49fi
50AC_SUBST([CC_FOR_BUILD])
51
52PKG_CHECK_MODULES(XT, sm x11 xproto kbproto)
53
54# Needed for including Xalloca.h
55AC_CHECK_HEADER([alloca.h], AC_DEFINE(INCLUDE_ALLOCA_H, 1, [Define to 1 if Xalloca.h should include <alloca.h>]))
56
57# Map function checks to old Imake #defines
58case $host_os in
59	# darwin has poll() but can't be used to poll character devices
60	# darwin10 (SnowLeopard) should be tested as well once released
61	darwin7*) ;; darwin8*) ;; darwin9*) ;;
62	*)
63		AC_CHECK_FUNC(poll, AC_DEFINE(USE_POLL,1,
64	        	[Define to 1 if you have the "poll" function.]))
65	;;
66esac
67AC_CHECK_FUNC(snprintf, AC_DEFINE(USE_SNPRINTF,1,
68        [Define to 1 if you have the "snprintf" function.]))
69
70AC_HAVE_LIBRARY(ws2_32)
71
72# Options
73AC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]),
74	XKB="$enableval", XKB="yes")
75if test "x$XKB" = "xyes" ; then
76	AC_DEFINE(XKB, 1, [Define to 1 to use XKB for keysym resolution.])
77fi
78
79AC_ARG_ENABLE(install-makestrs,
80	AC_HELP_STRING([--disable-install-makestrs], [Disable installing makestrs]),
81	INSTALL_MAKESTRS="$enableval",
82	INSTALL_MAKESTRS="yes")
83AM_CONDITIONAL([INSTALL_MAKESTRS], [test "x$INSTALL_MAKESTRS" = xyes])
84
85# Replaces XFileSearchPathDefault from Imake configs
86XFILESEARCHPATHDEFAULT='$(sysconfdir)/X11/%L/%T/%N%C%S:$(sysconfdir)/X11/%l/%T/%N%C%S:$(sysconfdir)/X11/%T/%N%C%S:$(sysconfdir)/X11/%L/%T/%N%S:$(sysconfdir)/X11/%l/%T/%N%S:$(sysconfdir)/X11/%T/%N%S:$(datadir)/X11/%L/%T/%N%C%S:$(datadir)/X11/%l/%T/%N%C%S:$(datadir)/X11/%T/%N%C%S:$(datadir)/X11/%L/%T/%N%S:$(datadir)/X11/%l/%T/%N%S:$(datadir)/X11/%T/%N%S:$(libdir)/X11/%L/%T/%N%C%S:$(libdir)/X11/%l/%T/%N%C%S:$(libdir)/X11/%T/%N%C%S:$(libdir)/X11/%L/%T/%N%S:$(libdir)/X11/%l/%T/%N%S:$(libdir)/X11/%T/%N%S'
87
88AC_ARG_WITH(xfile-search-path,
89	AC_HELP_STRING([--with-xfile-search-path=<path>],
90		       [Set path to search for app-defaults and other files]),
91	[XFILESEARCHPATHDEFAULT="$withval"], [])
92AC_SUBST([XFILESEARCHPATHDEFAULT])
93
94AC_ARG_WITH(appdefaultdir,
95	AC_HELP_STRING([--with-appdefaultdir=<path>],
96		       [Set app-default directory (default: ${datadir}/X11/app-defaults)]),
97	[appdefaultdir="$withval"],
98	[appdefaultdir=${datadir}/X11/app-defaults])
99AC_DEFINE_DIR([appdefaultdir], [appdefaultdir], [app default data directory])
100
101# Replacement for Imake ToolkitStringsABIOptions, controls string tables
102# generated by util/string.list in StringDefs.h & Shell.h
103case $host_os in
104	solaris*)
105		# Solaris uses -intelabi even on SPARC
106  		STRINGSABIOPTIONS="-intelabi -solarisabinames"
107		;;
108	sco* | svr4*)
109		case $host_cpu in
110		    i*86) STRINGSABIOPTIONS="-intelabi" ;;
111		       *) STRINGSABIOPTIONS="" ;;
112		esac
113		;;
114esac
115AC_SUBST(STRINGSABIOPTIONS)
116
117case $host_os in
118    darwin*)
119        OS_CFLAGS="-Wl,-flat_namespace"
120	;;
121    *)
122        OS_CFLAGS=
123        ;;
124esac
125
126XT_CFLAGS="$CWARNFLAGS $XT_CFLAGS $OS_CFLAGS"
127
128# Man page processing requirements
129XORG_PROG_RAWCPP
130XORG_MANPAGE_SECTIONS
131
132# Check render configuration, strip extra digits from package version to
133# find the required protocol version
134
135XORG_CHECK_MALLOC_ZERO
136XORG_RELEASE_VERSION
137XORG_CHANGELOG
138
139AC_OUTPUT([Makefile
140	   src/Makefile
141	   util/Makefile
142	   include/Makefile
143	   man/Makefile
144           xt.pc])
145