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([imake], [1.0.10],
26        [https://gitlab.freedesktop.org/xorg/util/imake/-/issues], [imake])
27AC_CONFIG_SRCDIR([Makefile.am])
28AC_CONFIG_HEADERS([config.h])
29
30# Initialize Automake
31AM_INIT_AUTOMAKE([foreign dist-xz])
32
33# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
34m4_ifndef([XORG_MACROS_VERSION],
35	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
36XORG_MACROS_VERSION(1.8)
37XORG_DEFAULT_OPTIONS
38
39AC_PROG_CPP
40XORG_PROG_RAWCPP
41CPP_PROGRAM=${RAWCPP}
42AC_SUBST(CPP_PROGRAM)
43
44# Checks for library functions.
45AC_CHECK_FUNCS([mkstemp])
46
47# Checks for typedefs, structures, and compiler characteristics.
48AC_SYS_LARGEFILE
49
50AC_CHECK_PROG(HAS_PERL, perl, yes)
51AM_CONDITIONAL([HAS_PERL], [test "x$HAS_PERL" = xyes])
52
53m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
54
55DEFAULT_XCONFDIR="${libdir}/X11/config"
56AC_ARG_WITH(config-dir,
57	AS_HELP_STRING([--with-config-dir=<path>], [Path to config dir (default: ${libdir}/X11/config)]),
58	[XCONFDIR="$withval"],
59	[XCONFDIR="$DEFAULT_XCONFDIR"])
60AC_SUBST(XCONFDIR)
61
62DEFAULT_PREPROCESSCMD_MKDEPEND="gcc -E"
63AC_ARG_WITH(script-preproc-cmd,
64	AS_HELP_STRING([--with-script-preproc-cmd=CMD], [Preprocessor command to run on scripts (default: "gcc -E")]),
65	[PREPROCESSCMD_MKDEPEND="$withval"],
66	[PREPROCESSCMD_MKDEPEND="$DEFAULT_PREPROCESSCMD_MKDEPEND"])
67AC_SUBST(PREPROCESSCMD_MKDEPEND)
68
69DEFAULT_ARCMD="ar clq"
70AC_ARG_WITH(create-lib-cmd,
71	AS_HELP_STRING([--with-create-lib-cmd=CMD], [Command to create libraries (default: "ar clq")]),
72	[ARCMD="$withval"],
73	[ARCMD="$DEFAULT_ARCMD"])
74AC_SUBST(ARCMD)
75
76DEFAULT_RANLIB="ranlib"
77AC_ARG_WITH(clean-lib-cmd,
78	AS_HELP_STRING([--with-clean-lib-cmd=CMD], [Command to clean up libraries (default: "ranlib")]),
79	[RANLIB="$withval"],
80	[RANLIB="$DEFAULT_RANLIB"])
81AC_SUBST(RANLIB)
82
83AC_ARG_ENABLE(revpath,
84	AS_HELP_STRING([--disable-revpath], [Build revpath (default: enabled)]),
85	[BUILD_REVPATH="$enableval"],
86	[BUILD_REVPATH=yes])
87AM_CONDITIONAL([BUILD_REVPATH], [test "x$BUILD_REVPATH" = xyes])
88
89AC_ARG_ENABLE(makeg,
90	AS_HELP_STRING([--disable-makeg], [Build makeg (default: enabled)]),
91	[BUILD_MAKEG="$enableval"],
92	[BUILD_MAKEG=yes])
93AM_CONDITIONAL([BUILD_MAKEG], [test "x$BUILD_MAKEG" = xyes])
94
95AC_ARG_ENABLE(xmkmf,
96	AS_HELP_STRING([--disable-xmkmf], [Build xmkmf (default: enabled)]),
97	[BUILD_XMKMF="$enableval"],
98	[BUILD_XMKMF=yes])
99AM_CONDITIONAL([BUILD_XMKMF], [test "x$BUILD_XMKMF" = xyes])
100
101AC_ARG_ENABLE(ccmakedep,
102	AS_HELP_STRING([--disable-ccmakedep], [Build ccmakedep (default: enabled)]),
103	[BUILD_CCMAKEDEP="$enableval"],
104	[BUILD_CCMAKEDEP=yes])
105AM_CONDITIONAL([BUILD_CCMAKEDEP], [test "x$BUILD_CCMAKEDEP" = xyes])
106
107AC_ARG_ENABLE(mergelib,
108	AS_HELP_STRING([--disable-mergelib], [Build mergelib (default: enabled)]),
109	[BUILD_MERGELIB="$enableval"],
110	[BUILD_MERGELIB=yes])
111AM_CONDITIONAL([BUILD_MERGELIB], [test "x$BUILD_MERGELIB" = xyes])
112
113AC_ARG_ENABLE(mkdirhier,
114	AS_HELP_STRING([--disable-mkdirhier], [Build mkdirhier (default: enabled)]),
115	[BUILD_MKDIRHIER="$enableval"],
116	[BUILD_MKDIRHIER=yes])
117AM_CONDITIONAL([BUILD_MKDIRHIER], [test "x$BUILD_MKDIRHIER" = xyes])
118
119AC_ARG_ENABLE(cleanlinks,
120	AS_HELP_STRING([--disable-cleanlinks], [Build cleanlinks (default: enabled)]),
121	[BUILD_CLEANLINKS="$enableval"],
122	[BUILD_CLEANLINKS=yes])
123AM_CONDITIONAL([BUILD_CLEANLINKS], [test "x$BUILD_CLEANLINKS" = xyes])
124
125AC_ARG_ENABLE(mkhtmlindex,
126	AS_HELP_STRING([--disable-mkhtmlindex], [Build mkhtmlindex (default: enabled)]),
127	[BUILD_MKHTMLINDEX="$enableval"],
128	[BUILD_MKHTMLINDEX=yes])
129AM_CONDITIONAL([BUILD_MKHTMLINDEX], [test "x$BUILD_MKHTMLINDEX" = xyes])
130
131# Checks for pkg-config packages
132PKG_CHECK_MODULES(XPROTO, xproto)
133
134AC_CONFIG_FILES([Makefile])
135AC_OUTPUT
136