4 AC_INIT([libX11], [1.5.0],
5 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11])
6 AC_CONFIG_SRCDIR([Makefile.am])
7 AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h])
8 AC_CONFIG_MACRO_DIR([m4])
11 # Set common system defines for POSIX extensions, such as _GNU_SOURCE
12 # Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
13 # to avoid autoconf errors.
14 AC_USE_SYSTEM_EXTENSIONS
17 AM_INIT_AUTOMAKE([foreign dist-bzip2])
23 # Require xorg-macros minimum of 1.15 for fop minimum version
24 m4_ifndef([XORG_MACROS_VERSION],
25 [m4_fatal([must install xorg-macros 1.15 or later before running autoconf/autogen])])
26 XORG_MACROS_VERSION(1.15)
29 XORG_WITH_XMLTO(0.0.22)
30 XORG_WITH_FOP([],[no])
32 XORG_CHECK_SGML_DOCTOOLS(1.10)
36 # Required when PKG_CHECK_MODULES called within an if statement
39 if test x"$CC_FOR_BUILD" = x; then
40 if test x"$cross_compiling" = xyes; then
41 AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
46 AC_SUBST([CC_FOR_BUILD])
48 if test x"$CPPFLAGS_FOR_BUILD" = x; then
49 if test ! x"$cross_compiling" = xyes; then
50 CPPFLAGS_FOR_BUILD=${CPPFLAGS}
53 AC_SUBST(CPPFLAGS_FOR_BUILD)
55 if test x"$CFLAGS_FOR_BUILD" = x; then
56 if test ! x"$cross_compiling" = xyes; then
57 CFLAGS_FOR_BUILD=${CFLAGS}
60 AC_SUBST(CFLAGS_FOR_BUILD)
62 if test x"$LDFLAGS_FOR_BUILD" = x; then
63 if test ! x"$cross_compiling" = xyes; then
64 LDFLAGS_FOR_BUILD=${LDFLAGS}
67 AC_SUBST(LDFLAGS_FOR_BUILD)
69 # Checks for pkg-config packages
72 X11_REQUIRES='xproto >= 7.0.17 xextproto xtrans xcb >= 1.1.92'
73 X11_EXTRA_DEPS="xcb >= 1.1.92"
77 AC_SUBST(X11_EXTRA_DEPS)
79 # Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
80 # was not expanded, since libX11 with no transport types is rather useless.
82 # If you're seeing an error here, be sure you installed the lib/xtrans module
83 # first and if it's not in the default location, that you set the ACLOCAL
84 # environment variable to find it, such as:
85 # ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
86 m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
88 # Transport selection macro from xtrans.m4
89 XTRANS_CONNECTION_FLAGS
91 # Secure RPC detection macro from xtrans.m4
92 XTRANS_SECURE_RPC_FLAGS
94 # Preferred order to try transports for local connections
95 AC_MSG_CHECKING([what order to try transports in for local connections])
96 DEFAULT_LOCAL_TRANS=""
99 # On Solaris 2.6 through 9, named pipes (LOCAL_TRANS) were
100 # faster than Unix domain sockets, but on Solaris 10 & later,
101 # Unix domain sockets are faster now.
102 if test "$UNIXCONN" = "yes" ; then
103 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
104 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
106 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}UNIX_TRANS"
108 if test "$LOCALCONN" = "yes" ; then
109 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
110 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
112 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}LOCAL_TRANS"
114 if test "$TCPCONN" = "yes" ; then
115 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
116 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
118 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}TCP_TRANS"
122 # LOCAL_TRANS is used for abstract sockets.
123 if test "$UNIXCONN" = "yes" ; then
124 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
125 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
127 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}LOCAL_TRANS,UNIX_TRANS"
129 if test "$TCPCONN" = "yes" ; then
130 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
131 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
133 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}TCP_TRANS"
137 if test "$LOCALCONN" = "yes" ; then
138 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
139 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
141 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}LOCAL_TRANS"
143 if test "$UNIXCONN" = "yes" ; then
144 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
145 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
147 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}UNIX_TRANS"
149 if test "$TCPCONN" = "yes" ; then
150 if test ! "x$DEFAULT_LOCAL_TRANS" = "x" ; then
151 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS},"
153 DEFAULT_LOCAL_TRANS="${DEFAULT_LOCAL_TRANS}TCP_TRANS"
158 AC_ARG_WITH(local-transport-order,
159 AS_HELP_STRING([--with-local-transport-order=LIST], [preference sorted list of transport types to try for local connections]),
160 [LOCAL_TRANSPORT_LIST=$withval],
161 [LOCAL_TRANSPORT_LIST=$DEFAULT_LOCAL_TRANS])
162 AC_DEFINE_UNQUOTED([LOCAL_TRANSPORT_LIST], [$LOCAL_TRANSPORT_LIST],
163 [preference sorted list of transport types to try for local connections])
164 AC_MSG_RESULT([$LOCAL_TRANSPORT_LIST])
167 AC_MSG_CHECKING([if run-time linking is supported])
168 AC_SEARCH_LIBS(dlopen,[dl svld])
169 if test "x$ac_cv_search_dlopen" = xno; then
170 AC_SEARCH_LIBS(shl_load,[dld])
171 if test "x$ac_cv_search_shl_load" != xno; then
172 AC_DEFINE(HAVE_SHL_LOAD,1,
173 [Use shl_load to load shared libraries])
174 AC_CHECK_HEADERS([dl.h])
177 AC_DEFINE(HAVE_DLOPEN,1,[Use dlopen to load shared libraries])
178 AC_CHECK_HEADERS([dlfcn.h])
180 if test x$ac_cv_header_dlcfn_h -o x$ac_cv_header_dl_h; then
181 HAVE_LOADABLE_MODULES=yes
183 HAVE_LOADABLE_MODULES=no
185 AC_MSG_RESULT($HAVE_LOADABLE_MODULES)
187 AC_MSG_CHECKING([if loadable i18n module support should be enabled])
188 AC_ARG_ENABLE(loadable-i18n,
189 AS_HELP_STRING([--enable-loadable-i18n],
190 [Controls loadable i18n module support]),
191 [XLIB_LOADABLE_I18N=$enableval],
192 [XLIB_LOADABLE_I18N="no"])
193 if test x$XLIB_LOADABLE_I18N = xyes; then
194 if test x$HAVE_LOADABLE_MODULES = xno; then
195 AC_MSG_ERROR([Loadable module support is required to enable loadable i18n module support])
197 AC_DEFINE(USE_DYNAMIC_LC,1,
198 [Split some i18n functions into loadable modules])
199 AC_SUBST(I18N_MODULE_LIBS,'${top_builddir}/src/libX11.la')
201 AC_MSG_RESULT($XLIB_LOADABLE_I18N)
203 AM_CONDITIONAL(XLIB_LOADABLE_I18N, test x$XLIB_LOADABLE_I18N = xyes)
205 AC_MSG_CHECKING([if loadable Xcursor library support should be enabled])
206 AC_ARG_ENABLE(loadable-xcursor,
207 AS_HELP_STRING([--disable-loadable-xcursor],
208 [Controls loadable xcursor library support]),
209 [XLIB_LOADABLE_XCURSOR=$enableval],
210 [XLIB_LOADABLE_XCURSOR=$HAVE_LOADABLE_MODULES])
211 if test x$XLIB_LOADABLE_XCURSOR = xyes; then
212 AC_DEFINE(USE_DYNAMIC_XCURSOR,1,
213 [Use the X cursor library to load cursors])
215 AC_MSG_RESULT($XLIB_LOADABLE_XCURSOR)
217 # Checks for header files.
218 AC_CHECK_HEADERS([sys/select.h])
220 # Checks for typedefs, structures, and compiler characteristics.
222 # Checks for library functions.
223 AC_CHECK_FUNCS([strtol seteuid])
224 # Used in lcFile.c (see also --enable-xlocaledir settings below)
225 XLOCALEDIR_IS_SAFE="no"
226 AC_CHECK_DECL([issetugid])
227 AC_CHECK_FUNC([issetugid])
228 if test "$ac_cv_have_decl_issetugid" = yes && test "$ac_cv_func_issetugid" = yes; then
229 XLOCALEDIR_IS_SAFE="yes"
230 AC_DEFINE(HASSETUGID,1,[Has issetugid() function])
232 AC_CHECK_FUNC([getresuid], [XLOCALEDIR_IS_SAFE="yes"]
233 AC_DEFINE(HASGETRESUID,1,[Has getresuid() & getresgid() functions]))
235 AC_CHECK_FUNC([shmat], AC_DEFINE(HAS_SHM,1,[Has shm*() functions]))
237 # Checks for system services
240 # arch specific things
243 os2*) os2="true" ; WCHAR32="0" ;;
248 AM_CONDITIONAL(OS2, test x$os2 = xtrue)
250 AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
251 if test "x$LAUNCHD" = xauto; then
253 AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
256 if test "x$LAUNCHD" = xyes ; then
257 AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
258 AC_DEFINE(TRANS_REOPEN, 1, [launchd support available])
261 AC_ARG_ENABLE(xthreads,
262 AS_HELP_STRING([--disable-xthreads],
263 [Disable Xlib support for Multithreading]),
264 [xthreads=$enableval],[xthreads=yes])
266 AC_CHECK_LIB(c, getpwuid_r, [mtsafeapi="yes"], [mtsafeapi="no"])
270 AC_DEFINE(XTHREADS,1,[Whether libX11 is compiled with thread support])
271 if test x$mtsafeapi = xyes
273 AC_DEFINE(XUSE_MTSAFE_API,1,[Whether libX11 needs to use MT safe API's])
280 AC_CHECK_LIB(c, pthread_self, [thrstubs="no"], [thrstubs="yes"])
281 AM_CONDITIONAL(THRSTUBS, test x$thrstubs = xyes)
283 # XXX incomplete, please fill this in
284 if test x$xthreads = xyes ; then
286 linux*|gnu*|k*bsd*-gnu)
287 XTHREADLIB=-lpthread ;;
289 XTHREAD_CFLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS"
290 XTHREADLIB="-lpthread" ;;
292 XTHREAD_CFLAGS="-D_THREAD_SAFE"
293 XTHREADLIB="-pthread" ;;
295 XTHREADLIB="-pthread" ;;
297 XTHREAD_CFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" ;;
301 AC_SUBST(XTHREAD_CFLAGS)
303 AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
308 AC_MSG_CHECKING([keysym definitions])
309 KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
310 FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
312 if test -f "$KEYSYMDEFDIR/$i"; then
313 KEYSYMDEFS="$KEYSYMDEFS $KEYSYMDEFDIR/$i"
314 elif test "x$i" = "xkeysymdef.h"; then
315 AC_MSG_ERROR([Cannot find keysymdef.h])
318 AC_MSG_RESULT([$KEYSYMDEFS])
321 AM_CONDITIONAL(UDC, test xfalse = xtrue)
324 AS_HELP_STRING([--disable-xcms],
325 [Disable Xlib support for CMS *EXPERIMENTAL*]),
326 [XCMS=$enableval],[XCMS=yes])
327 AM_CONDITIONAL(XCMS, [test x$XCMS = xyes ])
328 if test x"$XCMS" = "xyes"; then
329 AC_DEFINE(XCMS,1,[Include support for XCMS])
332 AC_ARG_ENABLE(xlocale,
333 AS_HELP_STRING([--disable-xlocale],
334 [Disable Xlib locale implementation *EXPERIMENTAL*]),
335 [XLOCALE=$enableval],[XLOCALE=yes])
337 AM_CONDITIONAL(XLOCALE, [ test x$XLOCALE = xyes ])
338 if test x"$XLOCALE" = "xyes"; then
339 AC_DEFINE(XLOCALE,1,[support for X Locales])
342 # This disables XLOCALEDIR. Set it if you're using BuildLoadableXlibI18n,
343 # don't have either issetugid() or getresuid(), and you need to protect
344 # clients that are setgid or setuid to an id other than 0.
345 AC_MSG_CHECKING([if XLOCALEDIR support should be enabled])
346 AC_ARG_ENABLE(xlocaledir,
347 AS_HELP_STRING([--enable-xlocaledir],
348 [Enable XLOCALEDIR environment variable support]),
349 [ENABLE_XLOCALEDIR=$enableval],[ENABLE_XLOCALEDIR=$XLOCALEDIR_IS_SAFE])
350 if test "x$ENABLE_XLOCALEDIR" = "xno"; then
351 AC_DEFINE(NO_XLOCALEDIR,1,[Disable XLOCALEDIR environment variable])
353 AC_MSG_RESULT($ENABLE_XLOCALEDIR)
355 AC_ARG_ENABLE(xf86bigfont,
356 AS_HELP_STRING([--disable-xf86bigfont],
357 [Disable XF86BigFont extension support]),
358 [XF86BIGFONT=$enableval],[XF86BIGFONT="yes"])
359 if test "x$XF86BIGFONT" = "xyes"; then
360 PKG_CHECK_MODULES(BIGFONT, [xf86bigfontproto >= 1.2.0],
361 AC_DEFINE(XF86BIGFONT,1,[Enable XF86BIGFONT extension]),XF86BIGFONT="no")
365 AS_HELP_STRING([--disable-xkb],
366 [Disable XKB support *EXPERIMENTAL*]),
367 [XKB=$enableval],[XKB=yes])
369 AM_CONDITIONAL(XKB, [ test x$XKB = xyes ])
370 if test x"$XKB" = "xyes"; then
371 XKBPROTO_REQUIRES="kbproto"
372 X11_REQUIRES="${X11_REQUIRES} kbproto inputproto"
373 AC_DEFINE(XKB,1,[Use XKB])
377 AC_SUBST(XKBPROTO_REQUIRES)
380 composecache_default=$ac_cv_func_mmap_fixed_mapped
381 AC_CHECK_FUNC(nl_langinfo, , [composecache_default=no])
382 AC_ARG_ENABLE(composecache,
383 AS_HELP_STRING([--disable-composecache],
384 [Disable compose table cache support]),
385 [COMPOSECACHE=$enableval],[COMPOSECACHE=$composecache_default])
386 if test x"$COMPOSECACHE" = "xyes"; then
387 AC_DEFINE(COMPOSECACHE,1,[Include compose table cache support])
390 # Allow checking code with lint, sparse, etc.
392 XORG_LINT_LIBRARY([X11])
394 X11_DATADIR="${datadir}/X11"
395 AX_DEFINE_DIR(X11_DATADIR, X11_DATADIR, [Location of libX11 data])
396 AC_SUBST(X11_DATADIR)
398 X11_LIBDIR="${libdir}/X11"
399 AX_DEFINE_DIR(X11_LIBDIR, X11_LIBDIR, [Location of libX11 library data])
402 PKG_CHECK_MODULES(X11, [$X11_REQUIRES])
403 X11_CFLAGS="$X11_CFLAGS $XTHREAD_CFLAGS"
406 # Yes, it would be nice to put the locale data in
407 # /usr/share, but the locale stuff includes loadable
408 # libraries which must be located in the same directory
409 # as the other locale data, so for now, everything lives
413 X11_LOCALEDATADIR="${X11_DATADIR}/locale"
414 AX_DEFINE_DIR(XLOCALEDATADIR, X11_LOCALEDATADIR, [Location of libX11 locale data])
415 AC_SUBST(X11_LOCALEDATADIR)
417 AC_ARG_WITH(locale-lib-dir, AS_HELP_STRING([--with-locale-lib-dir=DIR],
418 [Directory where locale libraries files are installed (default: $libdir/X11/locale)]),
419 [ X11_LOCALELIBDIR="$withval" ],
420 [ X11_LOCALELIBDIR="${X11_LIBDIR}/locale" ])
421 AX_DEFINE_DIR(XLOCALELIBDIR, X11_LOCALELIBDIR, [Location of libX11 locale libraries])
422 AC_SUBST(X11_LOCALELIBDIR)
424 X11_LOCALEDIR="${X11_LOCALEDATADIR}"
425 AX_DEFINE_DIR(XLOCALEDIR, X11_LOCALEDIR, [Location of libX11 locale data])
426 AC_SUBST(X11_LOCALEDIR)
429 am_ET.UTF-8 armscii-8 C el_GR.UTF-8 en_US.UTF-8 fi_FI.UTF-8 \
430 georgian-academy georgian-ps ibm-cp1133 iscii-dev isiri-3342 \
431 iso8859-1 iso8859-10 iso8859-11 iso8859-13 iso8859-14 iso8859-15 \
432 iso8859-2 iso8859-3 iso8859-4 iso8859-5 iso8859-6 iso8859-7 \
433 iso8859-8 iso8859-9 iso8859-9e ja ja.JIS ja_JP.UTF-8\
434 ja.S90 ja.SJIS ja.U90 ko koi8-c koi8-r \
435 koi8-u ko_KR.UTF-8 microsoft-cp1251 microsoft-cp1255 \
436 microsoft-cp1256 mulelao-1 nokhchi-1 pt_BR.UTF-8 ru_RU.UTF-8 \
437 tatar-cyr th_TH th_TH.UTF-8 tscii-0 vi_VN.tcvn vi_VN.viscii \
438 zh_CN zh_CN.gb18030 zh_CN.gbk zh_CN.UTF-8 zh_HK.big5 \
439 zh_HK.big5hkscs zh_HK.UTF-8 zh_TW zh_TW.big5 zh_TW.UTF-8"
442 XKEYSYMDB="${X11_DATADIR}/XKeysymDB"
443 AX_DEFINE_DIR(XKEYSYMDB, XKEYSYMDB, [Location of keysym database])
445 XERRORDB="${X11_DATADIR}/XErrorDB"
446 AX_DEFINE_DIR(XERRORDB, XERRORDB, [Location of error message database])
448 XORG_CHECK_MALLOC_ZERO
450 AC_CONFIG_FILES([Makefile
457 src/xlibi18n/Makefile
460 modules/im/ximcp/Makefile
462 modules/lc/def/Makefile
463 modules/lc/gen/Makefile
464 modules/lc/Utf8/Makefile
465 modules/lc/xlocale/Makefile
467 modules/om/generic/Makefile
472 specs/i18n/compose/Makefile
473 specs/i18n/framework/Makefile
474 specs/i18n/localedb/Makefile
475 specs/i18n/trans/Makefile
476 specs/libX11/Makefile
484 echo "X11 will be built with the following settings:"
485 echo " Loadable i18n module support: "$XLIB_LOADABLE_I18N
486 echo " Loadable xcursor library support: "$XLIB_LOADABLE_XCURSOR
487 echo " Threading support: "$xthreads
488 echo " Use Threads safe API: "$mtsafeapi
489 echo " Threads stubs in libX11: "$thrstubs
491 echo " Internationalization support: "$XLOCALE
492 echo " XF86BigFont support: "$XF86BIGFONT
493 echo " XKB support: "$XKB
494 echo " XLOCALEDIR environment variable support: "$ENABLE_XLOCALEDIR
495 echo " Compose table cache enabled: "$COMPOSECACHE
496 echo " Functional specs building enabled: "$build_specs