1
dnl Top-level configure for VFlib verison 3 package
2
dnl by H.Kakugawa (h.kakugawa@computer.org)
5
AC_REQUIRE([AC_STARTUP])
12
vflib_version='3.6.12'
13
AC_SUBST(vflib_version)
15
dnl Libtool versioning scheme
19
AC_SUBST(version_info)
20
version_info=$CUR:$REV:$AGE
22
dnl From GNU Libtoool 1.2 manual:
23
dnl 1. Start with version information of `0:0:0' for each libtool library.
25
dnl 2. Update the version information only immediately before a public
26
dnl release of your software. More frequent updates are unnecessary,
27
dnl and only guarantee that the current interface number gets larger
30
dnl 3. If the library source code has changed at all since the last
31
dnl update, then increment REVISION (`C:R:A' becomes `C:R+1:A').
33
dnl 4. If any interfaces have been added, removed, or changed since the
34
dnl last update, increment CURRENT, and set REVISION to 0.
36
dnl 5. If any interfaces have been added since the last public release,
37
dnl then increment AGE.
39
dnl 6. If any interfaces have been removed since the last public release,
40
dnl then set AGE to 0.
48
if test "x$CC" = xgcc; then
49
XX_CFLAGS="-Wall -pedantic -ansi"
56
AC_CHECK_HEADERS(unistd.h)
57
AC_CHECK_HEADERS(malloc.h)
58
AC_CHECK_HEADERS(fcntl.h)
59
AC_CHECK_HEADERS(strings.h)
60
AC_CHECK_HEADERS(string.h)
61
AC_CHECK_HEADERS(dirent.h)
62
AC_CHECK_HEADERS(sys/stat.h)
65
AC_CHECK_FUNCS(opendir)
66
AC_CHECK_FUNCS(access)
68
AC_CHECK_LIB(nsl, main, LIBS="$LIBS -lnsl")
69
AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket")
70
AC_CHECK_LIB(m, main, LIBS="$LIBS -lm")
72
AC_SUBST(default_vflibcap)
73
AC_SUBST(runtimesitedir)
76
AC_SUBST(subdir_t1enc)
77
AC_SUBST(subdir_ascii_jtex)
80
default_vflibcap=${datadir}/VFlib/${vflib_version}/vflibcap
81
runtimesitedir=${datadir}/VFlib/site
82
runtimedir=${datadir}/VFlib/${vflib_version}
85
subdir_ascii_jtex=ascii-jtex
92
[ --disable-bdf Build VFlib without BDF font driver],
95
if test -n "$bdf_objs" ; then
96
echo "Enabled the BDF font driver";
97
else echo "Disabled the BDF font driver"; fi
100
pcf_objs="drv_pcf.lo"
103
[ --disable-pcf Build VFlib without PCF font driver],
106
if test -n "$pcf_objs" ; then
107
echo "Enabled the PCF font driver";
108
else echo "Disabled the PCF font driver"; fi
111
hbf_objs="drv_hbf.lo"
114
[ --disable-hbf Build VFlib without HBF font driver],
117
if test -n "$hbf_objs" ; then
118
echo "Enabled the HBF font driver";
119
else echo "Disabled the HBF font driver"; fi
121
AC_SUBST(freetype_includedir)
122
AC_SUBST(freetype_libdir)
123
AC_SUBST(freetype_lib)
127
[ --with-freetype[=LIB] Link FreeType library LIB [LIB=ttf]],
128
if test "${withval}" = yes; then withval="ttf"; fi;
129
if test "${withval}" = no; then withval=""; fi;
130
if test "${withval}" = ""; then withval="ttf"; fi;
131
if test "${withval}" != ""; then
132
freetype_lib=-l$withval; ttf_objs="drv_ttf.lo";
133
AC_DEFINE(WITH_TRUETYPE)
137
[ --with-freetype-includedir=DIR FreeType include files are in DIR],
138
if test "${withval}" = yes; then withval=""; fi;
139
if test "${withval}" = "";
140
then freetype_includedir=""
141
else freetype_includedir=-I${withval}; fi)
144
[ --with-freetype-libdir=DIR FreeType library files are in DIR],
145
if test "${withval}" = yes; then withval=""; fi;
146
if test "${withval}" = "";
147
then freetype_libdir=""
148
else freetype_libdir=-L${withval}; fi)
149
if test -n "$freetype_lib" ; then
150
echo "Enabled the TrueType font driver";
151
OLD_CPPFLAGS=${CPPFLAGS}; OLD_LIBS=${LIBS}
152
CPPFLAGS="${freetype_includedir} ${CPPFLAGS}"
153
LIBS="${freetype_libdir} ${freetype_lib} ${LIBS}";
154
AC_TRY_CPP([#include <freetype.h>], ,
155
AC_MSG_ERROR(Header file is not found: ${freetype_includedir}))
156
dnl AC_TRY_LINK([#include <freetype.h>],
157
dnl [TT_Engine fte; TT_Init_FreeType(&fte)], ,
158
dnl AC_MSG_ERROR(Library file is not found: ${freetype_lib}))
159
CPPFLAGS=${OLD_CPPFLAGS}; LIBS=${OLD_LIBS}
160
else echo "Disabled the TrueType font driver";
161
freetype_includedir=""; freetype_libdir="";
164
AC_SUBST(t1lib_includedir)
165
AC_SUBST(t1lib_libdir)
170
[ --with-t1lib[=LIB] Link T1Lib library LIB [LIB=t1]],
171
if test "${withval}" = yes; then withval="t1"; fi;
172
if test "${withval}" = no; then withval=""; fi;
173
if test "${withval}" = ""; then withval="t1"; fi;
174
if test "${withval}" != ""; then
175
t1lib_lib=-l$withval; type1_objs="drv_t1.lo"; AC_DEFINE(WITH_TYPE1)
179
[ --with-t1lib-includedir=DIR T1Lib include files are in DIR],
180
if test "${withval}" = yes; then withval=""; fi;
181
if test "${withval}" = "";
182
then t1lib_includedir=""
183
else t1lib_includedir=-I${withval}; fi)
186
[ --with-t1lib-libdir=DIR T1Lib library files are in DIR],
187
if test "${withval}" = yes; then withval=""; fi;
188
if test "${withval}" = "";
190
else t1lib_libdir=-L${withval}; fi)
191
if test -n "$t1lib_lib" ; then
192
echo "Enabled the Type1 font driver";
193
OLD_CPPFLAGS=${CPPFLAGS}; OLD_LIBS=${LIBS}
194
CPPFLAGS="${t1lib_includedir} ${CPPFLAGS}"
195
LIBS="${t1lib_libdir} ${t1lib_lib} ${LIBS}";
196
AC_TRY_CPP([#include <t1lib.h>], ,
197
AC_MSG_ERROR(Header file is not found: ${t1lib_includedir}))
198
AC_TRY_LINK([#include <t1lib.h>],
199
[T1_SetBitmapPad(8); T1_SetLogLevel(0)], ,
200
AC_MSG_ERROR(Library file is not found: ${t1lib_lib}))
201
CPPFLAGS=${OLD_CPPFLAGS}; LIBS=${OLD_LIBS}
202
else echo "Disabled the Type1 font driver";
203
t1lib_includedir=""; t1lib_libdir="";
207
zeit_objs="drv_zeit.lo"
210
[ --disable-zeit Build VFlib without ZEIT font driver],
212
AC_DEFINE(WITH_ZEIT))
213
if test -n "$zeit_objs" ; then
214
echo "Enabled the Syotai Kurabu (ZEIT) font driver";
215
else echo "Disabled the Syotai Kurabu (ZEIT) font driver"; fi
221
[ --disable-jg Build VFlib without JG font driver],
224
if test -n "$jg_objs" ; then
225
echo "Enabled the JG font driver";
226
else echo "Disabled the JG font driver"; fi
229
ekan_objs="drv_ekan.lo"
232
[ --disable-ekanji Build VFlib without EKanji font driver],
234
AC_DEFINE(WITH_EKANJI))
235
if test -n "$ekan_objs" ; then
236
echo "Enabled the EKanji font driver";
237
else echo "Disabled the EKanji font driver"; fi
243
[ --disable-gf Build VFlib without TeX GF font driver],
246
if test -n "$gf_objs" ; then
247
echo "Enabled the GF font driver";
248
else echo "Disabled the GF font driver"; fi
254
[ --disable-pk Build VFlib without TeX PK font driver],
257
if test -n "$pk_objs" ; then
258
echo "Enabled the PK font driver";
259
else echo "Disabled the PK font driver"; fi
262
tfm_objs="drv_tfm.lo"
265
[ --disable-tfm Build VFlib without TeX TFM font driver],
268
if test -n "$tfm_objs" ; then
269
echo "Enabled the TFM font driver";
270
else echo "Disabled the TFM font driver"; fi
276
[ --disable-vf Build VFlib without TeX VF font driver],
279
if test -n "$vf_objs" ; then
280
echo "Enabled the VF font driver";
281
else echo "Disabled the VF font driver"; fi
284
jtex_objs="drv_jtex.lo"
287
[ --disable-jtex Build VFlib without Japanese TeX Kanji font driver],
289
AC_DEFINE(WITH_JTEX))
290
if test -n "$jtex_objs" ; then
291
echo "Enabled the ASCII Japanese TeX Kanji font driver";
292
else echo "Disabled the ASCII Japanese TeX Kanji font driver"; fi
294
AC_SUBST(texfonts_objs)
295
texfonts_objs="texfonts.lo tfm.lo jfmbi.lo"
298
[ --disable-tex-fonts Build VFlib without any TeX fonts font drivers],
299
gf_objs="";pk_objs="";tfm_objs="";vf_objs="";jtex_objs="";texfonts_objs="",
300
AC_DEFINE(WITH_TEXFONTS))
301
if test ! -n "$texfonts_objs" ; then
302
echo "Disabled all TeX-related font drivers"; fi
305
comic_objs="drv_comic.lo"
308
[ --disable-comic Build VFlib without Japanese Comic font driver],
310
AC_DEFINE(WITH_COMIC))
311
if test -n "$comic_objs" ; then
312
echo "Enabled the Japanese Comic font driver";
313
else echo "Disabled the Japanese Comic font driver"; fi
316
try_objs="drv_try.lo"
319
[ --disable-try Build VFlib without Try font driver],
322
if test -n "$try_objs" ; then
323
echo "Enabled the Try font driver";
324
else echo "Disabled the Try font driver"; fi
326
AC_SUBST(mojikmap_objs)
327
mojikmap_objs="drv_mojikmap.lo"
330
[ --disable-mojikmap Build VFlib without Mojikyo mapping font driver],
332
AC_DEFINE(WITH_MOJIKMAP))
333
if test -n "$mojikmap_objs" ; then
334
echo "Enabled the Mojikyo mapping font driver";
335
else echo "Disabled the Mojikyo mapping font driver"; fi
337
AC_SUBST(kpathsea_includedir)
338
AC_SUBST(kpathsea_libdir)
339
AC_SUBST(kpathsea_lib)
342
[ --with-kpathsea[=LIB] Build VFlib with kpathsea library],
343
if test "${withval}" = yes; then withval="kpathsea"; fi;
344
if test "${withval}" = no; then withval=""; fi;
345
if test "${withval}" = ""; then withval="kpathsea"; fi;
346
if test "${withval}" != ""; then
347
kpathsea_lib=-l$withval; AC_DEFINE(WITH_KPATHSEA)
351
[ --with-kpathsea-includedir=DIR Kpathsea include files are in DIR],
352
if test "${withval}" = yes; then withval=""; fi;
353
if test "${withval}" = "";
354
then kpathsea_includedir=""
355
else kpathsea_includedir="-I${withval} -I${withval}/kpathsea"; fi)
358
[ --with-kpathsea-libdir=DIR Kpathsea library files are in DIR],
359
if test "${withval}" = yes; then withval=""; fi;
360
if test "${withval}" = "";
361
then kpathsea_libdir=""
362
else kpathsea_libdir=-L${withval}; fi)
363
if test -n "$kpathsea_lib" ; then
364
echo "Enabled the kpathsea library for font search";
365
OLD_CPPFLAGS=${CPPFLAGS}; OLD_LIBS=${LIBS};
366
CPPFLAGS="${kpathsea_includedir} ${CPPFLAGS}"
367
LIBS="${kpathsea_libdir} ${kpathsea_lib} ${LIBS}";
368
AC_TRY_CPP([#include <kpathsea/kpathsea.h>], ,
369
AC_MSG_ERROR(Header file is not found: ${kpathsea_includedir}))
370
AC_TRY_LINK([#include <kpathsea/kpathsea.h>],
371
[kpse_init_prog("/usr/local/bin/xldvi", 300, "cx", NULL)], ,
372
AC_MSG_ERROR(Library file is not found: ${kpathsea_lib}))
373
CPPFLAGS=${OLD_CPPFLAGS}; LIBS=${OLD_LIBS}
374
else echo "Disabled the kpathsea library for font search";
375
kpathsea_includedir=""; kpathsea_libdir="";
379
KPSEWHICH="kpsewhich"
380
TEXMF_CHECK="tex.fmt:fmt plain.fmt:fmt latex.fmt:fmt \
381
tex.pool:texpool plain.pool:texpool latex.fmt:texpool"
384
if test ! -z "$KPSEWHICH" ; then
385
for f in $TEXMF_CHECK
387
c=`echo $f | sed 's/:/ /' | awk '{ print $1 }'`
388
s=`echo $f | sed 's/:/ /' | awk '{ print $2 }'`
390
$KPSEWHICH $c > /dev/null 2> /dev/null
391
if test $? = 0 ; then
394
$KPSEWHICH $s $c > /dev/null 2> /dev/null
395
if test $? = 0 ; then
399
if test X-$g != X- ; then
400
TEXMF_ROOT=`echo $g | sed "s|/web2c/$c||"`
406
#if test "X-${TEXMF_ROOT}" = "X-" ; then
407
# TEXMF_ROOT="${datadir}/texmf"
408
# echo "Failed to detect TeX directory. Assume ${TEXMF_ROOT} as default."
410
# echo "Detected TeX directory is ${TEXMF_ROOT}"
412
#texmf_root=$TEXMF_ROOT
417
[ --with-texmf-root=DIR Top directory of TeX is DIR],
418
if test "${withval}" = yes; then withval=""; fi;
419
if test "${withval}" = "";
421
else texmf_root=${withval}; fi,
422
texmf_root=${datadir}/texmf; )
423
echo "texmf directory: $texmf_root"
426
AC_CHECK_HEADERS(libintl.h)
427
if test "X-${ac_cv_header_libintl_h}" = "X-yes"; then
432
[ --with-gettext Compile xgdvi with GNU gettext library],
435
AC_SUBST(gettext_lib)
436
AC_SUBST(gettext_include)
437
if test "X-${gettext}" = "X-no"; then
441
AC_DEFINE(WITH_GETTEXT)
444
[ --with-gettext-prefix=DIR GNU gettext preffix direcotry is DIR],
445
gettext_lib="-L${withval}/lib"; gettext_include="-I${withval}/include",
446
gettext_lib='-L${prefix}/lib'; gettext_include='-I${prefix}/include')
448
AC_TRY_LINK([#include <libintl.h>],
449
[ bindtextdomain("xxx", "/usr/share/locale"); ],
450
AC_MSG_RESULT(Use libc built-in gettext functions.); ,
451
AC_MSG_RESULT(Use external gettext library.); gettext_lib="${gettext_lib} -lintl")
454
AC_CHECK_SIZEOF(int,0)
455
AC_CHECK_SIZEOF(long,0)
457
if test ${ac_cv_sizeof_long} -eq 4; then
459
elif test ${ac_cv_sizeof_long} -ge 4; then
460
if test ${ac_cv_sizeof_long} -eq ${ac_cv_sizeof_int}; then
466
AC_MSG_ERROR([Long is too small to contain outline data element.])
468
AC_SUBST(ol_elem_type)
469
AC_MSG_RESULT([Outline element type: ${ol_elem_type}.])
472
AC_CONFIG_HEADER(src/config.h src/with.h)
473
AC_OUTPUT(Makefile make-sub VFlib3-config \
474
src/VFlib-3_6.h src/Makefile \
478
ascii-jtex/Makefile \
481
utils/ctext2pgm/Makefile utils/vfl2bdf/Makefile\
482
utils/vflx11/Makefile utils/hyaku/Makefile )
484
chmod a+x VFlib3-config
485
chmod a+x src/vflmkcaptex
487
if test X-`./whereisit xmkmf` != "X-" ; then
488
echo xmkmf: `./whereisit xmkmf`
489
( cd X11; ./runxmkmf; make make-x11 )
491
echo xmkmf: not found
493
rm -f Makefile make-x11
494
touch Makefile make-x11
495
echo "all: " >> Makefile
496
echo " @echo X11 NOT FOUND" >> Makefile )
501
echo "** Configureation Finished!"
503
if test "x-${freetype_lib}" = "x-"; then
504
echo "** Configured NOT to use TrueType."
506
echo "** Configured to use TrueType."
508
if test "x-${t1lib_lib}" = "x-"; then
509
echo "** Configured NOT to use Type 1."
511
echo "** Configured to use Type 1."
513
if test "x-${kpathsea_lib}" = "x-"; then
514
echo "** Configured NOT to use Kpathsea."
516
echo "** Configured to use Kpathsea."
519
echo "** (If it is not what you want, invoke configure with --help option,"
520
echo "** or see 'configure-site' file."
522
echo "** Now run 'make' to compile."