2 ## Process this file with autoconf to produce a configure script.
3 ## Use autoupdate to update this file for newer versions of autoconf.
4 ## Use autoscan to check if you need to add something to this file.
5 ##############################################################################
6 ## $Id: configure.ac,v 1.29 2011-01-21 22:49:59 behdad Exp $
8 ## $Date: 2011-01-21 22:49:59 $
10 ## $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/configure.ac,v $
11 ##############################################################################
15 dnl Define different version variables.
18 dnl FRIBIDI_MICRO_VERSION++;
19 dnl FRIBIDI_INTERFACE_AGE++;
21 dnl If any functions have been added:
22 dnl FRIBIDI_INTERFACE_AGE = 0;
23 dnl FRIBIDI_INTERFACE_VERSION++;
24 dnl FRIBIDI_BINARY_AGE++;
26 dnl If binary backwards compatibility has been broken:
27 dnl FRIBIDI_BINARY_AGE = FRIBIDI_INTERFACE_AGE = 0;
29 m4_define(fribidi_major_version, 0)dnl
30 m4_define(fribidi_minor_version, 19)dnl
31 m4_define(fribidi_micro_version, 4)dnl
32 m4_define(fribidi_interface_version, 3)dnl
33 m4_define(fribidi_interface_age, 3)dnl
34 m4_define(fribidi_binary_age, 3)dnl
36 m4_define(fribidi_version,
37 m4_if(m4_eval(fribidi_micro_version()),0,
38 fribidi_major_version.fribidi_minor_version,
39 fribidi_major_version.fribidi_minor_version.fribidi_micro_version))dnl
41 AC_INIT([GNU FriBidi],
43 [http://bugs.freedesktop.org/enter_bug.cgi?product=fribidi],
45 [http://fribidi.org/])
47 AC_CONFIG_SRCDIR([fribidi.pc.in])
48 AC_CONFIG_HEADERS([config.h])
50 AM_INIT_AUTOMAKE([1.11.1 gnits dist-bzip2 no-dist-gzip -Wall no-define])
51 AM_SILENT_RULES([yes])
55 LT_INIT([disable-static])
57 FRIBIDI_MAJOR_VERSION=fribidi_major_version()
58 FRIBIDI_MINOR_VERSION=fribidi_minor_version()
59 FRIBIDI_MICRO_VERSION=fribidi_micro_version()
60 FRIBIDI_VERSION=fribidi_version()
61 FRIBIDI_INTERFACE_VERSION=fribidi_interface_version()
62 FRIBIDI_INTERFACE_AGE=fribidi_interface_age()
63 FRIBIDI_BINARY_AGE=fribidi_binary_age()
65 AC_SUBST(FRIBIDI_MAJOR_VERSION)
66 AC_SUBST(FRIBIDI_MINOR_VERSION)
67 AC_SUBST(FRIBIDI_MICRO_VERSION)
68 AC_SUBST(FRIBIDI_VERSION)
69 AC_SUBST(FRIBIDI_INTERFACE_VERSION)
70 AC_SUBST(FRIBIDI_INTERFACE_AGE)
71 AC_SUBST(FRIBIDI_BINARY_AGE)
73 dnl libtool versioning.
74 m4_define(lt_current, fribidi_interface_version())dnl
75 m4_define(lt_revision, fribidi_interface_age())dnl
76 m4_define(lt_age, fribidi_binary_age())dnl
77 LT_VERSION_INFO=lt_current():lt_revision():lt_age()
78 LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
80 AC_SUBST(LT_VERSION_INFO)
81 AC_SUBST(LT_CURRENT_MINUS_AGE)
83 dnl ==========================================================================
85 # Checks for programs.
88 AC_MSG_CHECKING([for native Win32])
90 mingw*) os_win32=yes ;;
93 AC_MSG_RESULT([$os_win32])
94 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
95 AC_MSG_CHECKING([for some Win32 platform])
97 mingw*|cygwin*) platform_win32=yes ;;
98 *) platform_win32=no ;;
100 AC_MSG_RESULT([$platform_win32])
101 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
104 # Checks for header files.
106 AC_CHECK_HEADERS([stdlib.h string.h strings.h inttypes.h wchar.h asm/page.h sys/times.h])
108 # Checks for typedefs and structures.
112 SIZEOF_INT=$ac_cv_sizeof_int
114 AC_CHECK_SIZEOF(short)
115 AC_CHECK_SIZEOF(void *)
116 AC_CHECK_SIZEOF(wchar_t)
118 # Checks for compiler characteristics.
120 if test "x$GCC" = "xyes"; then
121 CFLAGS="$CFLAGS -Wall -ansi "
125 # Checks for library functions.
126 AC_CHECK_FUNCS([memmove memset strdup])
129 # Checks for configure options
132 m4_define(debug_default,
133 m4_if(m4_eval(fribidi_minor_version() % 2),1,yes,no))
135 AC_HELP_STRING([--enable-debug],
136 [turn on debugging @<:@default=debug_default()@:>@]),,
137 enable_debug=debug_default())
138 if test x$enable_debug = xyes; then
140 [Define to 1 if you want to include debug code in the library])
143 # --disable-deprecated
144 AC_ARG_ENABLE(deprecated,
145 AC_HELP_STRING([--disable-deprecated],
146 [do not build deprecated functionality]))
147 if test x$enable_deprecated = xno; then
148 FRIBIDI_NO_DEPRECATED=1
150 FRIBIDI_NO_DEPRECATED=0
152 AC_SUBST(FRIBIDI_NO_DEPRECATED)
155 AC_ARG_ENABLE(malloc,
156 AC_HELP_STRING([--enable-malloc],
157 [use simple malloc instead of memory chunks]))
158 if test x$enable_malloc = xyes; then
159 AC_DEFINE(USE_SIMPLE_MALLOC,1,
160 [Define to 1 if you want to use simple mallocs instead of memory chunks])
164 AC_ARG_ENABLE(charsets,
165 AC_HELP_STRING([--disable-charsets],
166 [exclude charset conversion routines from library]))
167 if test x$enable_charsets = xno; then
172 AC_SUBST(FRIBIDI_CHARSETS)
173 AM_CONDITIONAL(FRIBIDI_CHARSETS, test x$FRIBIDI_CHARSETS = x1)
177 AC_HELP_STRING([--with-glib=@<:@no/auto/yes@:>@],
178 [use Glib @<:@default=auto@:>@]))
179 GLIB_PACKAGE=glib-2.0
183 if test x$with_glib = xyes; then
184 PKG_CHECK_MODULES(GLIB,$GLIB_PACKAGE >= $GLIB_MINVERSION)
187 if test x$with_glib = xno; then
190 PKG_CHECK_MODULES(GLIB,$GLIB_PACKAGE >= $GLIB_MINVERSION,
195 if test x$FRIBIDI_USE_GLIB = x0; then
198 AC_SUBST(FRIBIDI_USE_GLIB)
199 AM_CONDITIONAL(FRIBIDI_USE_GLIB, test x$FRIBIDI_USE_GLIB = x1)
202 MISC_CFLAGS="$GLIB_CFLAGS"
203 MISC_LIBS="$GLIB_LIBS"
204 MISC_PACKAGES="$GLIB_PACKAGE"
205 AC_SUBST(MISC_CFLAGS)
207 AC_SUBST(MISC_PACKAGES)
210 AC_CONFIG_FILES([fribidi.pc