1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(gdk/gdktypes.h)
4 # Save this value here, since automake will set cflags later
5 cflags_set=${CFLAGS+set}
8 # GTK_MICRO_VERSION += 1;
9 # GTK_INTERFACE_AGE += 1;
10 # GTK_BINARY_AGE += 1;
11 # if any functions have been added, set GTK_INTERFACE_AGE to 0.
12 # if backwards compatibility has been broken,
13 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
20 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
21 AC_SUBST(GTK_MAJOR_VERSION)
22 AC_SUBST(GTK_MINOR_VERSION)
23 AC_SUBST(GTK_MICRO_VERSION)
27 LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
28 LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
29 LT_REVISION=$GTK_INTERFACE_AGE
30 LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
42 AC_CONFIG_SUBDIRS(glib)
44 # Save this value here, since automake will set cflags later
45 cflags_set=${CFLAGS+set}
47 dnl Initialize automake stuff
48 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
50 # Specify a configuration file
51 AM_CONFIG_HEADER(config.h)
53 dnl Initialize libtool
56 dnl Initialize maintainer mode
61 AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available [default=yes]],
62 echo $enable_shm, enable_shm="yes")
63 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
64 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
66 AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
67 echo $enable_xim, enable_xim="yes")
68 AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
70 AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
72 if test "x$enable_debug" = "xyes"; then
73 test "$cflags_set" = set || CFLAGS="-g"
74 CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
76 if test "x$enable_debug" = "xno"; then
77 CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DGTK_NO_CHECK_CASTS"
79 CFLAGS="$CFLAGS -DGTK_NO_CHECK_CASTS"
83 # Build time sanity check...
86 # Checks for programs.
92 if test "x$GCC" = "xyes"; then
93 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
94 CFLAGS="$CFLAGS -Wall"
97 if test "x$enable_ansi" = "xyes"; then
98 if test -z "`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`" ; then
99 CFLAGS="$CFLAGS -ansi"
102 if test -z "`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`" ; then
103 CFLAGS="$CFLAGS -pedantic"
108 if test "x$enable_xim" = "xyes"; then
109 CFLAGS="$CFLAGS -DUSE_XIM"
112 # Find the X11 include and library directories
116 if test "x$x_includes" = "x"; then
117 x_includes="/usr/include"
120 saved_cflags="$CFLAGS"
121 saved_ldflags="$LDFLAGS"
124 LDFLAGS="$X_LDFLAGS $X_LIBS"
126 # Checks for libraries.
127 # Check for the X11 library
128 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", no_x11_lib=yes, $X_EXTRA_LIBS)
130 if test "x$enable_shm" = "xyes"; then
131 # Check for the Xext library (needed for XShm extention)
132 AC_CHECK_LIB(Xext, XShmAttach,
133 x_libs="-lXext $x_libs",
134 # On AIX, it is in XextSam instead, but we still need -lXext
135 AC_CHECK_LIB(XextSam, XShmAttach,
136 x_libs="-lXextSam -lXext $x_libs",
137 no_xext_lib=yes, $x_libs),
141 # Check for shaped window extension
143 AC_CHECK_LIB(Xext, XShapeCombineMask,
144 if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
145 $x_libs="-lXext $x_libs"
147 AC_DEFINE(HAVE_SHAPE_EXT),
152 x_ldflags="$X_LDFLAGS $X_LIBS"
154 # set up things for XInput
156 if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
157 AC_DEFINE(XINPUT_GXI)
159 x_libs="-lXi $x_libs"
160 elif test "x$with_xinput" = "xxfree"; then
161 AC_DEFINE(XINPUT_XFREE)
162 x_libs="-lXi $x_libs"
164 AC_DEFINE(XINPUT_NONE)
171 AC_SUBST(xinput_progs)
173 CFLAGS="$saved_cflags"
174 LDFLAGS="$saved_ldflags"
176 if test "x$enable_shm" = "xyes"; then
177 # Check for shared memory
178 AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
179 AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(HAVE_SHM_H), no_sys_shm=yes)
181 # Check whether shmctl IPC_RMID allowes subsequent attaches
182 if test "$ac_cv_header_sys_shm_h" = "yes"; then
183 AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches)
185 #include <sys/types.h>
192 id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0777);
195 shmaddr = shmat (id, 0, 0);
196 shmctl (id, IPC_RMID, 0);
197 if ((char*) shmat (id, 0, 0) == (char*) -1)
207 AC_DEFINE(IPC_RMID_DEFERRED_RELEASE)
210 AC_MSG_RESULT(assuming no))
213 # Check for the X shared memory extension header file
214 AC_MSG_CHECKING(X11/extensions/XShm.h)
215 if test "x$no_xext_lib" = "xyes"; then
219 if test -f "$x_includes/X11/extensions/XShm.h"; then
221 AC_DEFINE(HAVE_XSHM_H)
229 # Check for private display resource base variable
230 AC_MSG_CHECKING(resource base field in XDisplay)
231 AC_CACHE_VAL(gtk_cv_display_resource_base,
233 #define XLIB_ILLEGAL_ACCESS
234 #include <X11/Xlib.h>
243 display->resource_base;
245 gtk_cv_display_resource_base="resource_base",
246 gtk_cv_display_resource_base="private3")])
247 AC_MSG_RESULT($gtk_cv_display_resource_base)
248 AC_DEFINE_UNQUOTED(RESOURCE_BASE, gdk_display->$gtk_cv_display_resource_base)
250 # Check if X_LOCALE definition is necessary
252 AC_MSG_CHECKING(need -DX_LOCALE)
261 return setlocale (LC_ALL, "${with_locale}") == NULL;
265 AC_MSG_RESULT($need_x_locale)
267 if test $need_x_locale = yes; then
268 CFLAGS="$CFLAGS -DX_LOCALE"
271 # Checks for header files.
274 # Checks for typedefs, structures, and compiler characteristics.
277 # Checks for library functions.
281 # Check for sys/select.h
283 AC_MSG_CHECKING([fd_set and sys/select])
284 AC_TRY_COMPILE([#include <sys/types.h>],
285 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
286 if test $gtk_ok = no; then
287 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
288 if test $gtk_ok = yes; then
289 AC_DEFINE(HAVE_SYS_SELECT_H)
292 AC_MSG_RESULT($gtk_ok)
293 if test $gtk_ok = no; then
304 ], [chmod +x gtk-config])