*** empty log message ***
[m17n/libotf.git] / configure.ac
1 dnl Autoconf script for libotf.
2
3 dnl Process this file with autoconf to produce a configure script.
4
5 dnl Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
6 dnl   National Institute of Advanced Industrial Science and Technology (AIST)
7 dnl   Registration Number H15PRO167
8
9 dnl This file is part of libotf.
10
11 dnl Libotf is free software; you can redistribute it and/or modify it
12 dnl under the terms of the GNU Lesser General Public License as published
13 dnl by the Free Software Foundation; either version 2.1 of the License, or
14 dnl (at your option) any later version.
15
16 dnl Libotf is distributed in the hope that it will be useful, but WITHOUT
17 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
19 dnl License for more details.
20
21 dnl You should have received a copy of the GNU Lesser General Public
22 dnl License along with this library, in a file named COPYING; if not,
23 dnl write to the Free Software Foundation, Inc., 59 Temple Place, Suite
24 dnl 330, Boston, MA 02111-1307, USA.
25
26 AC_INIT(libotf, 0.9.13, handa@m17n.org)
27 AM_INIT_AUTOMAKE(libotf, 0.9.13)
28 AM_CONFIG_HEADER(src/config.h)
29
30 # Checks for programs.
31 AC_PROG_CC
32 AM_PROG_LIBTOOL
33
34 # Checks for libraries.
35 AC_PATH_XTRA
36
37 # Checks for header files.
38 AC_HEADER_STDC
39 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
40
41 AC_CHECK_HEADERS([X11/Xaw/Command.h], , no_x=yes)
42
43 AM_CONDITIONAL([X11_UNAVAILABLE], [test x$no_x = xyes])
44
45 # Checks for typedefs, structures, and compiler characteristics.
46
47 # Checks for library functions.
48 AC_FUNC_ALLOCA
49 AC_FUNC_MALLOC
50
51 # Check for Freetype2 usability.
52 AC_CHECK_PROG(HAVE_FREETYPE_CONFIG, freetype-config, yes)
53 if test "x$HAVE_FREETYPE_CONFIG" = "xyes"; then
54   FREETYPE_INC=`freetype-config --cflags`
55   CPPFLAGS="$CPPFLAGS $FREETYPE_INC"
56   AC_CHECK_HEADER(ft2build.h, HAVE_FREETYPE=yes,
57                               HAVE_FREETYPE=no CPPFLAGS=$save_CPPFLAGS)
58   if test "x$HAVE_FREETYPE" = "xyes" ; then
59     FREETYPE_LD_FLAGS=`freetype-config --libs`;
60     LIBS="$LIBS $FREETYPE_LD_FLAGS"
61     AC_CHECK_LIB(freetype, FT_Init_FreeType, HAVE_FREETYPE=yes,
62                                              HAVE_FREETYPE=no)
63   fi
64 fi
65
66 if test "x$HAVE_FREETYPE" != "xyes" ; then
67   echo "Freetype library wan't found in your system!"
68   exit 1
69 fi
70 AC_SUBST(FREETYPE_INC)
71 AC_SUBST(FREETYPE_LD_FLAGS)
72
73 if test "x$no_x" != "xyes"; then
74   X11_XT_XAW_XMU="-lX11 -lXt -lXaw -lXmu"
75 fi
76 AC_SUBST(X11_XT_XAW_XMU)
77
78 AC_CHECK_FUNC(scandir, HAVE_SCANDIR=yes, HAVE_SCANDIR=no)
79 if test "x$HAVE_SCANDIR" = "xyes"; then
80   AC_DEFINE(HAVE_SCANDIR, 1,
81            [Define to 1 if you have scandir function.])
82 fi
83
84 AC_CHECK_FUNC(alphasort, HAVE_ALPHASORT=yes, HAVE_ALPHASORT=no)
85 if test "x$HAVE_ALPHASORT" = "xyes"; then
86   AC_DEFINE(HAVE_ALPHASORT, 1,
87            [Define to 1 if you have alphasort function.])
88 fi
89
90 AC_CONFIG_FILES([Makefile src/Makefile example/Makefile
91                  libotf-config libotf.pc])
92 AC_OUTPUT