summaryrefslogtreecommitdiff
path: root/configure.in
blob: e915e2501f84b941edd4db3cc5044d726da5deb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
dnl Process this file with autoconf to create configure.

AC_INIT(ChangeLog)
AM_INIT_AUTOMAKE(pango, 0.10)

AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AM_PROG_LIBTOOL

changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl

AC_PATH_X
if test x$no_x = xyes ; then
  AC_MSG_ERROR([X development libraries not found])
fi 
X_LIBS="-L$x_libraries -lX11"
AC_SUBST(X_LIBS)

gtk_works=no
AM_PATH_GTK(1.2.0,
            [CFLAGS="$GTK_CFLAGS $CFLAGS"; gtk_works=yes],
            AC_MSG_WARN("Disabling GTK+-based tests"))

AM_CONDITIONAL(BUILD_TESTS, test x$gtk_works = xyes)

AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no)
if test x$FRIBIDI_CONFIG = xno ; then
  AC_MSG_ERROR([*** fribidi-config not found])
fi
FRIBIDI_CFLAGS="`$FRIBIDI_CONFIG --cflags`"
CFLAGS="$CFLAGS $UNICODE_CFLAGS"
FRIBIDI_LIBS="`$FRIBIDI_CONFIG --libs`"
AC_SUBST(FRIBIDI_LIBS)
AC_SUBST(FRIBIDI_CFLAGS)

AC_CHECK_LIB(fribidi, fribidi_map_range, :,
	     AC_MSG_ERROR([*** libfribidi not found.]), $FRIBIDI_LIBS)


# We run glib-config separately to get the gmodule cflags so we
# can add them to pango-config

AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
if test x$GLIB_CONFIG = xno ; then
  AC_MSG_ERROR([*** glib-config not found])
fi
GLIB_CFLAGS="`$GLIB_CONFIG --cflags gmodule`"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
GLIB_LIBS="`$GLIB_CONFIG --libs gmodule`"
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS)


AC_PATH_PROG(UNICODE_CONFIG, unicode-config, no)
if test x$UNICODE_CONFIG = xno ; then
  AC_MSG_ERROR([*** unicode-config not found])
fi
UNICODE_CFLAGS="`$UNICODE_CONFIG --cflags`"
CFLAGS="$CFLAGS $UNICODE_CFLAGS"
UNICODE_LIBS="`$UNICODE_CONFIG --libs`"
AC_SUBST(UNICODE_LIBS)
AC_SUBST(UNICODE_CFLAGS)

AC_CHECK_LIB(unicode, unicode_type, :,
	     AC_MSG_ERROR([*** libunicode not found.]), $UNICODE_LIBS)


#
# Checks for iconv
#
AC_ARG_WITH(libiconv, [ --with-libiconv     Use the libiconv library ],,with_libiconv=maybe)

found_iconv=no

if ! test "x$with_libiconv" = "xyes" ; then
   # 
   # Check in the C library 
   #
   AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes)
fi

if test "x$with_libiconv" != "xno" ; then
   #
   # Check for libiconv
   #
   AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=yes; found_iconv=yes)
fi

if test "x$found_iconv" = "xno" ; then
   AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
fi

if test "x$with_libiconv" = "xyes" ; then
  UNICODE_LIBS="$UNICODE_LIBS -liconv"
fi
  
#
# Allow building some or all modules included
#
AC_ARG_WITH(included_modules, [ --with-included-modules=MODULE1,MODULE2,...     Build the given modules into Pango])

included_modules=""
if ! test "x$with_included_modules" = xno || test "x$with_included_modules" = x ; then

   # If no modules specified, include all modules
   if test "x$with_included_modules" = xyes ; then  
     included_modules="arabic,devanagari,basic,hangul,tamil,thai"
   else
     included_modules="$with_included_modules"
   fi
fi

INCLUDED_MODULES=
IFS="${IFS= 	}"; pango_save_ifs="$IFS"; IFS=","
for module in $included_modules; do
  INCLUDED_MODULES="$INCLUDED_MODULES \$(top_builddir)/modules/$module/libpango-$module.la"
done
IFS="$pango_save_ifs"

AC_SUBST(INCLUDED_MODULES)

AM_CONDITIONAL(INCLUDE_ARABIC,echo $included_modules | grep '\(^\|,\)arabic\($\|,\)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC,echo $included_modules | grep '\(^\|,\)basic\($\|,\)' > /dev/null)
AM_CONDITIONAL(INCLUDE_DEVANAGARI,echo $included_modules | grep '\(^\|,\)devanagari\($\|,\)' > /dev/null)
AM_CONDITIONAL(INCLUDE_HANGUL,echo $included_modules | grep '\(^\|,\)hangul\($\|,\)' > /dev/null)
AM_CONDITIONAL(INCLUDE_TAMIL,echo $included_modules | grep '\(^\|,\)tamil\($\|,\)' > /dev/null)
AM_CONDITIONAL(INCLUDE_THAI,echo $included_modules | grep '\(^\|,\)thai\($\|,\)' > /dev/null)

#
# We use flockfile to implement pango_getline() - should be moved to GLib
#
AC_CHECK_FUNCS(flockfile)

AC_CHECK_PROG(gtkdoc, gtkdoc-scan, yes, no)
AM_CONDITIONAL(HAVE_GTK_DOC, test x$gtkdoc = xyes)

AC_OUTPUT_COMMANDS([
cat > pango/module-defs.c <<EOTEXT
/* Autogenerated by configure. Do not edit */

#include "modules.h"

EOTEXT

IFS="${IFS= 	}"; pango_save_ifs="$IFS"; IFS=","
for module in $included_modules; do
  cat >> pango/module-defs.c <<EOTEXT
extern void         _pango_${module}_script_engine_list (PangoEngineInfo **engines, int *n_engines);
extern PangoEngine *_pango_${module}_script_engine_load (const char *id);
extern void         _pango_${module}_script_engine_unload (PangoEngine *engine);

EOTEXT
done
IFS="$pango_save_ifs"

cat >> pango/module-defs.c <<EOTEXT

PangoIncludedModule _pango_included_modules[] = {
EOTEXT

IFS="${IFS= 	}"; pango_save_ifs="$IFS"; IFS=","
for module in $included_modules; do
  cat >> pango/module-defs.c <<EOTEXT
 { _pango_${module}_script_engine_list, _pango_${module}_script_engine_load,_pango_${module}_script_engine_unload },
EOTEXT
done
IFS="$pango_save_ifs"

cat >> pango/module-defs.c <<EOTEXT
 { NULL, NULL, NULL },
};
EOTEXT

],[
included_modules=$included_modules
])

AC_OUTPUT([
Makefile 
pango/Makefile
modules/Makefile
modules/arabic/Makefile
modules/basic/Makefile
modules/devanagari/Makefile
modules/hangul/Makefile
modules/tamil/Makefile
modules/thai/Makefile
examples/Makefile
docs/Makefile
tools/Makefile
fonts/Makefile
pango.spec
pango-config
],[case "$CONFIG_FILES" in
*pango-config*)chmod +x pango-config;;
esac])