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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(fontforge/fontforge.h)
AC_PROG_CC
AC_PROG_INSTALL
dnl AC_DISABLE_SHARED
dnl AC_ENABLE_STATIC
AC_PROG_RANLIB
AC_CANONICAL_HOST
AC_SUBST(HOST)
AC_SUBST(MACAPP)
HOST="$host"
AC_C_CONST
AC_PATH_XTRA
AC_SUBST(X_11LIB)
AC_SUBST(GDRAW_LIB)
AC_SUBST(exeOBJECTS)
AC_SUBST(LINK_WITH_GDRAW)
X_11LIB=-lX11
GDRAW_LIB=libgdraw
exeOBJECTS=fontforge_UIOBJECTS
LINK_WITH_GDRAW=../libs/libgdraw.a
if test "$no_x" = "yes"; then
X_11LIB=
GDRAW_LIB=
exeOBJECTS=fontforge_SCRIPTOBJ
LINK_WITH_GDRAW=
MACAPP=
else
dnl AC_CHECK_HEADER("X11/extensions/XInput.h", : ,AC_DEFINE(_NO_XINPUT),)
dnl AC_CHECK_HEADER("X11/extensions/XI.h", : ,AC_DEFINE(_NO_XINPUT),)
dnl /usr/share/doc/XFree86-doc-4.2.0/Xi/lib.PS
AC_CHECK_LIB(Xi, XOpenDevice, X_11LIB="-lXi -lX11" ,AC_DEFINE(_NO_XINPUT), $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 )
AC_CHECK_LIB(xkbui, XkbQueryExtension, X_11LIB="$X_11LIB -lxkbui" ,AC_DEFINE(_NO_XKB), $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 -lm )
fi
gww_define_caps_for_alt="dontknow"
gww_nodynamic="no"
gww_needsstatic="no"
case "$host" in
*-apple-darwin*)
AC_DEFINE(_CursorsMustBe16x16)
AC_DEFINE(_Keyboard,1)
AC_DEFINE(__Mac,1)
MACAPP=FontForge.app/Contents/Info.plist
gww_define_caps_for_alt="1"
dnl fink puts stuff under /sw
dnl macports puts stuff under /opt/local
if test "$CPPFLAGS" \!= "" >/dev/null ; then
TrustUser="yes"
elif test -d /sw/include >/dev/null ; then
CPPFLAGS="$CPPFLAGS -I/sw/include"
elif test -d /opt/local/include >/dev/null ; then
CPPFLAGS="$CPPFLAGS -I/opt/local/include"
fi
if test "$LDFLAGS" \!= "" >/dev/null ; then
TrustUser="yes"
elif test -d /sw/lib >/dev/null ; then
LDFLAGS="$LDFLAGS -L/sw/lib"
gww_rpath="-rpath /sw/lib"
elif test -d /opt/local/lib >/dev/null ; then
LDFLAGS="$LDFLAGS -L/opt/local/lib"
gww_rpath="-rpath /opt/local/lib"
fi
LIBS="-Wl,/System/Library/Frameworks/Carbon.framework/Carbon $LIBS"
LIBS="/System/Library/Frameworks/CoreServices.framework/CoreServices $LIBS"
;;
powerpc-*-*linux*)
AC_DEFINE(_Keyboard,3)
;;
*sparc*)
AC_DEFINE(_Keyboard,2)
;;
*-pc-cygwin*)
AC_DEFINE(_BrokenBitmapImages)
AC_DEFINE(_ModKeysAutoRepeat)
AC_DEFINE(__CygWin,1)
dnl on cygwin about half the libraries have no .la files so I can't figure out
dnl how to load them at run time.
gww_nodynamic="yes"
;;
esac
AC_C_BIGENDIAN()
AC_ARG_WITH(capslock-for-alt,
[ --with-capslock-for-alt Control whether to use capslock rather than alt/meta to alter behavior of tools in outline/bitmap windows],
[
if test "$withval" \!= "2" ; then
gww_define_caps_for_alt="2"
elif test "$withval" \!= "no" ; then
gww_define_caps_for_alt="1"
else
gww_define_caps_for_alt="0"
fi
])
if test "$gww_define_caps_for_alt" \!= "dontknow" ; then
AC_DEFINE_UNQUOTED(FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT,$gww_define_caps_for_alt)
fi
AC_ARG_ENABLE(debug-raw-points,
[ --enable-debug-raw-points Add a raw mode to the points window of the debugger],
[
if test "$enableval" \!= "no" ; then
AC_DEFINE(FONTFORGE_CONFIG_SHOW_RAW_POINTS)
fi
])
dnl One user seems to have messed up iconv on his system and can't get it
dnl to work.
gww_uselessiconv="no"
AC_ARG_WITH(iconv,
[ --without-iconv Don't use the system's iconv(3) routines, use fontforge's instead],
[
if test "$withval" = "no" ; then
gww_uselessiconv="yes"
fi
])
AC_SUBST(FF_EXTRA_FILES)
AC_SEARCH_LIBS(dlopen, dl) dnl some systems have this in libc
AC_SEARCH_LIBS(inet_aton, resolv) dnl some systems have this in libc
if test "$gww_uselessiconv" = "no" ; then
# on some systems "iconv()" lives in libc. On others it lives in libiconv
# on older systems "libiconv()" lives in libiconv
AC_SEARCH_LIBS(iconv, iconv,,
AC_SEARCH_LIBS(libiconv, iconv,,gww_uselessiconv="yes"))
fi
python="yes"
AC_ARG_WITH(python,
[ --without-python Don't include a python interpreter],
[
if test "$withval" = "no" >/dev/null 2>&1 ; then
python="no"
fi
], : )
if test "$python" = "yes" ; then
echo -n "Checking for python..."
if python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')" >/dev/null 2>&1 ; then
if python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" >/dev/null 2>&1 ; then
PyVersion=`python -c "import distutils.sysconfig ; print '%s' % distutils.sysconfig.get_config_var('VERSION')"`
PySubVersion=`echo $PyVersion |sed -e 's/2.//'`
PyInc=`python -c "import distutils.sysconfig ; print '%s' % distutils.sysconfig.get_config_var('INCLUDEPY')"`
PyLib=`python -c "import distutils.sysconfig ; print '%s/%s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'))"`
if test "$PySubVersion" \!= "" -a "$PySubVersion" -le 2 ; then
python="no"
elif test "$PySubVersion" \!= "" -a "$PySubVersion" -ge 3 -a -e $PyLib -a -e $PyInc; then
PyIncs=`python -c "import distutils.sysconfig ; print '-I%s' % distutils.sysconfig.get_config_var('INCLUDEPY')"`
PyLibs=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))"`
LIBS="$LIBS $PyLibs"
CPPFLAGS="$CPPFLAGS $PyIncs"
else
# python gets it wrong on all my build systems, this seems to work instead
PyName="python$PyVersion"
AC_SEARCH_LIBS(Py_Main, $PyName python, : , python="no")
if test -d /usr/include/$PyName ; then
CPPFLAGS="$CPPFLAGS -I/usr/include/$PyName"
else
python="no"
fi
fi
else
python="no"
fi
else
python="no"
fi
echo $python
fi
if test "$python" = "no" ; then
AC_DEFINE(_NO_PYTHON)
else
AC_DEFINE_UNQUOTED(PYTHON_LIB_NAME,"python$PyVersion")
fi
ffscript="yes"
AC_ARG_WITH(native-script,
[ --without-native-script Don't include a legacy fontforge scripting interpreter],
[
if test "$withval" = "no" >/dev/null 2>&1 ; then
ffscript="no"
fi
], : )
if test "$ffscript" = "no" ; then
AC_DEFINE(_NO_FFSCRIPT)
fi
AC_CHECK_FUNC(tzset,:,AC_DEFINE(_NO_TZSET))
dnl linux has isnan in math.h, solaris puts it in ieeeefp.h
AC_CHECK_HEADERS([ieeefp.h])
dnl linux has integer types in stdint.h, solaris, vms in inttypes.h
AC_CHECK_HEADERS([stdint.h])
dnl Is there a better way to add a directory to the include path?
FreeType2_IncRoot=
if sh -c "freetype-config --prefix" >/dev/null 2>&1 ; then
FreeType2_IncRoot=`freetype-config --prefix`
AC_CHECK_FILE($FreeType2_IncRoot/include/freetype2,CFLAGS="$CFLAGS -I$FreeType2_IncRoot/include/freetype2/",FreeType2_IncRoot=)
ft_flags=`freetype-config --cflags`
CFLAGS="$CFLAGS $ft_flags"
fi
if test "FreeType2_IncRoot" = "" >/dev/null 2>&1 ; then
AC_CHECK_FILE(/usr/include/freetype2,[CFLAGS="$CFLAGS -I/usr/include/freetype2/"
FreeType2_IncRoot="/usr"
],[
AC_CHECK_FILE(/usr/local/include/freetype2,[CFLAGS="$CFLAGS -I/usr/local/include -I/usr/local/include/freetype2/"
FreeType2_IncRoot="/usr/local/"
],[
AC_CHECK_FILE(/usr/X11R6/include/freetype2,[CFLAGS="$CFLAGS -I/usr/X11R6/include -I/usr/X11R6/include/freetype2/"
FreeType2_IncRoot="/usr/X11R6/"
],AC_DEFINE(_NO_FREETYPE))])])
fi
AC_CHECK_FILE(/usr/include/libxml2/libxml,[CFLAGS="$CFLAGS -I/usr/include/libxml2/"],[
AC_CHECK_FILE(/usr/local/include/libxml2/libxml,[CFLAGS="$CFLAGS -I/usr/local/include -I/usr/local/include/libxml2/"],
AC_DEFINE(_NO_LIBXML))])
dnl Some old versions of lib(un)gif don't work for us, they've got the
dnl Function argument in the wrong place. So check the header files.
dnl check for both libgif and libungif, I think they use the same args.
AC_CHECK_LIB(gif, DGifOpenFileName, [
echo -n checking for ExtensionBlock.Function in gif_lib.h...
AC_TRY_COMPILE([#include <gif_lib.h>], [ ExtensionBlock foo; foo.Function=3; ], echo " " yes , [echo " " no
ac_cv_lib_ungif_DGifOpenFileName=no
AC_DEFINE(_NO_LIBUNGIF)])
] , [
AC_CHECK_LIB(ungif, DGifOpenFileName, [
echo -n checking for ExtensionBlock.Function in gif_lib.h...
AC_TRY_COMPILE([#include <gif_lib.h>], [ ExtensionBlock foo; foo.Function=3; ], echo " " yes , [echo " " no
ac_cv_lib_ungif_DGifOpenFileName=no
AC_DEFINE(_NO_LIBUNGIF)])
] , AC_DEFINE(_NO_LIBUNGIF))])
AC_CHECK_LIB(z, deflateEnd, : ,AC_DEFINE(_NO_LIBPNG), -lm)
AC_CHECK_LIB(png16, png_create_read_struct, AC_DEFINE(_LIBPNG16),[
AC_CHECK_LIB(png15, png_create_read_struct, AC_DEFINE(_LIBPNG15),[
AC_CHECK_LIB(png14, png_create_read_struct, AC_DEFINE(_LIBPNG14),[
AC_CHECK_LIB(png12, png_create_read_struct, AC_DEFINE(_LIBPNG12),[
AC_CHECK_LIB(png, png_create_read_struct, : ,
AC_DEFINE(_NO_LIBPNG), -lz -lm)], -lz -lm)], -lz -lm)], -lz -lm)], -lz -lm)
AC_CHECK_HEADER(png.h, : , AC_DEFINE(_NO_LIBPNG))
AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, : ,AC_DEFINE(_NO_LIBJPEG))
AC_CHECK_HEADER(jpeglib.h, : , AC_DEFINE(_NO_LIBJPEG))
AC_CHECK_LIB(tiff, TIFFOpen, : , AC_DEFINE(_NO_LIBTIFF), -lm )
AC_CHECK_HEADER(tiffio.h, : , AC_DEFINE(_NO_LIBTIFF))
AC_CHECK_LIB(xml2, xmlParseFile, : , AC_DEFINE(_NO_LIBXML), -lz -lm)
AC_CHECK_LIB(spiro, TaggedSpiroCPsToBezier, : ,AC_DEFINE(_NO_LIBSPIRO))
AC_CHECK_HEADER(spiroentrypoints.h, : , AC_DEFINE(_NO_LIBSPIRO))
if test "$gww_uselessiconv" = "no" ; then
AC_CHECK_HEADERS([iconv.h])
fi
AC_CHECK_HEADERS([langinfo.h])
dnl Do we have libcairo
gww_hascairo="no"
gww_checkcairo="yes"
AC_ARG_WITH(cairo,
[ --without-cairo Don't use libcairo],
[
if test "$withval" = "no" ; then
gww_checkcairo="no"
fi
], : )
if test "$gww_checkcairo" = "yes" ; then
gww_CFLAGS=$CFLAGS
gww_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
AC_CHECK_HEADER(fontconfig/fontconfig.h, [
AC_CHECK_LIB(fontconfig, FcConfigCreate, [
AC_CHECK_LIB(cairo, cairo_set_scaled_font, gww_hascairo="yes" )])])
CFLAGS=$gww_CFLAGS
LDFLAGS=$gww_LDFLAGS
fi
if test "$gww_hascairo" = "yes" ; then
gww_hascairo="no"
for gww_prefix in /usr /usr/local /sw /opt/local /usr/X11R6/
do
if test -e $gww_prefix/include/cairo/cairo.h ; then
CFLAGS="$CFLAGS -I$gww_prefix/include/cairo"
gww_hascairo="yes"
break
fi
done
fi
if test "$gww_hascairo" = "no" ; then
AC_DEFINE(_NO_LIBCAIRO)
fi
dnl Do we have libpango
gww_haspango="no"
gww_haspangocairo="no"
gww_checkpango="yes"
gww_has_pkg_config="yes"
AC_ARG_WITH(pango,
[ --without-pango Don't use libpango],
[
if test "$withval" = "no" ; then
gww_checkpango="no"
fi
], : )
if test "$gww_checkpango" = "yes" ; then
pan_headers=""
pan_lib=""
AC_ARG_WITH(pango-headers,
[ --with-pango-headers=dirs Specify the CPPFLAGS needed to compile pango],
[
if test "$withval" != "no" -a "$withval" != "yes" >/dev/null 2>&1 ; then
pan_headers="$withval"
CFLAGS="$CFLAGS $pan_headers"
fi
], : )
AC_ARG_WITH(pango-lib,
[ --with-pango-lib Specify LDFLAGS needed to link with pango],
[
if test "$withval" != "no" -a "$withval" != "yes" >/dev/null 2>&1 ; then
pan_lib="$withval"
LDFLAGS="$LDFLAGS $pan_libs"
fi
], : )
if test "$pan_headers" != "" > /dev/null 2>&1 ; then
gww_haspango="done"
elif pkg-config --libs pangoxft > /dev/null 2>&1 ; then
AC_CHECK_HEADER(X11/Xft/Xft.h, gww_haspango="yes",,[#include <ft2build.h>])
else
for gww_prefix in /usr /usr/local /sw /opt/local /usr/X11R6/
do
if test -d $gww_prefix/include/pango-1.0/pango -a -d $gww_prefix/include/glib-2.0 -a -d $gww_prefix/lib/glib-2.0/include ; then
CFLAGS="$CFLAGS -I$gww_prefix/include/pango-1.0 -I$gww_prefix/include/glib-2.0 -I$gww_prefix/lib/glib-2.0/include"
gww_haspango="done"
break
fi
done
fi
fi
if test "$gww_haspango" = "yes" ; then
CFLAGS="$CFLAGS `pkg-config --cflags pangoxft`"
fi
if test "$gww_haspango" = "yes" -a "$gww_hascairo" = "yes" ; then
if pkg-config --libs pangocairo > /dev/null 2>&1 ; then
gww_haspangocairo="yes"
CFLAGS="$CFLAGS `pkg-config --cflags pangocairo`"
fi
fi
if test "$gww_haspango" = "no" ; then
gww_haspangocairo="no"
AC_DEFINE(_NO_LIBPANGO)
elif test "$gww_haspango" = "done" ; then
gww_haspango="yes"
fi
AC_ARG_ENABLE(macapp,
[ --disable-macapp Do not build a mac Application (only for macs)],
[
if test "$enableval" = "no" >/dev/null 2>&1 ; then
MACAPP=
fi
])
dnl many systems have freetype on /usr/X11R6/lib which isn't in the standard search path
AC_CHECK_LIB(freetype, FT_New_Memory_Face, : , [
gww_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
dnl Avoid configure's cache.
unset ac_cv_lib_freetype_FT_New_Memory_Face
echo "${ac_cv_lib_freetype_FT_New_Memory_Face+set}" set
AC_CHECK_LIB(freetype, FT_New_Memory_Face,[
gww_rpath="$gww_rpath -rpath /usr/X11R6/lib"
] , [
LDFLAGS=$gww_save_LDFLAGS
AC_DEFINE(_NO_FREETYPE)
])
])
gww_hasbytecode="no"
if test "$ac_cv_lib_freetype_FT_New_Memory_Face" = "yes" ; then
AC_ARG_WITH(freetype-bytecode,
[ --with-freetype-bytecode Control whether we build with the bytecode interpreter],
[
gww_hasbytecode="$withval"
],
[
echo checking for bytecode interpreter in freetype...
AC_CHECK_LIB(freetype, TT_RunIns, gww_hasbytecode="yes", : )
])
fi
if test "$gww_hasbytecode" = "yes" ; then
AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread", gww_hasbytecode="no")
AC_CHECK_HEADERS([pthread.h], : , gww_hasbytecode="no")
fi
if test \( "$gww_hasbytecode" = "yes" \) -a \( "$FreeType2_IncRoot" != "" \); then
gww_hasbytecode="no"
AC_ARG_WITH(freetype-src,
[ --with-freetype-src=dir Specify freetype source directory],
[
if test "$withval" != "no" >/dev/null 2>&1 ; then
FreeType2_TT_BUILD_INC="$withval/src/truetype"
# if test "${FreeType2_TT_BUILD_INC:0:1}" != "/" ; then
if test `echo ${FreeType2_TT_BUILD_INC} | sed 's/\(.\).*/\1/'` != "/" ; then
FreeType2_TT_BUILD_INC=`pwd`/$FreeType2_TT_BUILD_INC
fi
AC_MSG_CHECKING(for valid freetype tree)
if test -f "$FreeType2_TT_BUILD_INC/ttobjs.h"; then
AC_MSG_RESULT(ok)
else
AC_MSG_RESULT(missing ttobjs.h)
echo "Unable to find $FreeType2_TT_BUILD_INC/ttobjs.h"
fi
fi
],
[
dnl guess directory
AC_MSG_CHECKING(trying to find the freetype source directory -- be patient)
FreeType2_TT_SRC_DIRs=`find / -name ttobjs.h -print 2>/dev/null |grep '[freetype[^/\]*2[^/\]*/src/truetype/ttobjs.h]' | sort -r | sed -e 's/ttobjs.h//'`
for dir in $FreeType2_TT_SRC_DIRs; do
if cmp -s ${dir}../../include/freetype/freetype.h ${FreeType2_IncRoot}/freetype/freetype.h >/dev/null 2>&1 ; then
FreeType2_TT_BUILD_INC=$dir
break
fi
done
if test "$FreeType2_TT_BUILD_INC" = "" >/dev/null 2>&1 ; then
for dir in $FreeType2_TT_SRC_DIRs; do
has_goodft2sources="no"
FreeType2_TT_BUILD_INC=$dir
break
done
fi
if test "$FreeType2_TT_BUILD_INC" = "" >/dev/null 2>&1 ; then
echo " " no
else
echo " " probably
fi
])
if test "$FreeType2_TT_BUILD_INC" \!= "" >/dev/null 2>&1 ; then
if test -f $FreeType2_TT_BUILD_INC/ttdriver.h >/dev/null 2>&1 ; then
CFLAGS="$CFLAGS -I$FreeType2_TT_BUILD_INC -I$FreeType2_TT_BUILD_INC/../../include -I$FreeType2_TT_BUILD_INC/../../include/freetype"
gww_hasbytecode="yes"
AC_DEFINE(FREETYPE_HAS_DEBUGGER)
fi
fi
fi
dnl older libc's don't have snprintf
AC_CHECK_FUNC(snprintf, : , AC_DEFINE(_NO_SNPRINTF))
AC_C_LONG_DOUBLE
echo -n checking for long long ...
AC_TRY_COMPILE(,[long long foo=0x400000000000;],[ AC_DEFINE(_HAS_LONGLONG)
echo " " yes] , echo " " no )
dnl mac's don't have gettext, people have to use fink to install it
gww_has_gettext="yes"
AC_CHECK_HEADERS([libintl.h], : , gww_has_gettext="no")
AC_LINK_IFELSE([AC_LANG_CALL([],[bind_textdomain_codeset])], AC_DEFINE(_STATIC_LIBINTL) , [
AC_CHECK_LIB(intl, bind_textdomain_codeset,: ,HAVE_LIBINTL_H=0 )])
dnl If we can't/don't want to use dynamic libraries then we must link with
dnl the static libraries we've found
AC_SUBST(STATIC_LIBS)
STATIC_LIBS=
if test "$gww_nodynamic" = "yes"; then
if test "$gww_needsstatic" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -static"
fi
if test "$ac_cv_lib_ungif_DGifOpenFileName" = "yes" -a ! -e /usr/lib/libungif.la ; then
STATIC_LIBS="$STATIC_LIBS -lungif"
AC_DEFINE(_STATIC_LIBUNGIF)
fi
if test "$ac_cv_lib_png_png_create_read_struct" = "yes" -a "$ac_cv_lib_z_deflateEnd" = "yes" -a \( ! -e /usr/lib/libpng.la -o ! -e /usr/lib/libz.la \); then
STATIC_LIBS="$STATIC_LIBS -lpng -lz"
AC_DEFINE(_STATIC_LIBPNG)
fi
if test "$ac_cv_lib_png12_png_create_read_struct" = "yes" -a "$ac_cv_lib_z_deflateEnd" = "yes" -a \( ! -e /usr/lib/libpng12.la -o ! -e /usr/lib/libz.la \); then
STATIC_LIBS="$STATIC_LIBS -lpng12 -lz"
AC_DEFINE(_STATIC_LIBPNG)
fi
if test "$ac_cv_lib_tiff_TIFFOpen" = "yes" -a ! -e /usr/lib/libtiff.la; then
STATIC_LIBS="$STATIC_LIBS -ltiff"
AC_DEFINE(_STATIC_LIBTIFF)
fi
if test "$ac_cv_lib_spiro_TaggedSpiroCPsToBezier" = "yes" -a ! -e /usr/lib/libspiro.la; then
STATIC_LIBS="$STATIC_LIBS -lspiro"
AC_DEFINE(_STATIC_LIBSPIRO)
fi
if test "$ac_cv_lib_jpeg_jpeg_CreateDecompress" = "yes" -a ! -e /usr/lib/libjpeg.la; then
STATIC_LIBS="$STATIC_LIBS -ljpeg"
AC_DEFINE(_STATIC_LIBJPEG)
fi
if test "$ac_cv_lib_freetype_FT_New_Memory_Face" = "yes" -a ! -e /usr/lib/libfreetype.la; then
STATIC_LIBS="$STATIC_LIBS -lfreetype"
AC_DEFINE(_STATIC_LIBFREETYPE)
fi
if test "$ac_cv_lib_xml2_xmlParseFile" = "yes" -a "$ac_cv_lib_z_deflateEnd" = "yes" -a \( ! -e /usr/lib/libxml2.la -o ! -e /usr/lib/libz.la \); then
STATIC_LIBS="$STATIC_LIBS -lxml2"
AC_DEFINE(_STATIC_LIBXML)
fi
if test "$ac_cv_lib_intl_bind_textdomain_codeset" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -lintl"
fi
if test "$ac_cv_lib_spiro_TaggedSpiroCPsToBezier" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -lspiro"
fi
AC_CHECK_LIB(uninameslist, UnicodeNameAnnot, [
STATIC_LIBS="$STATIC_LIBS -luninameslist"
AC_DEFINE(_STATIC_LIBUNINAMESLIST) ] , AC_DEFINE(_NO_LIBUNINAMESLIST))
if test "$gww_hascairo" = "yes"; then
STATIC_LIBS="$STATIC_LIBS -lcairo -lfontconfig"
fi
if test "$gww_haspango" = "yes"; then
STATIC_LIBS="$STATIC_LIBS `pkg-config --libs pangoxft` -lXft"
fi
if test "$gww_haspangocairo" = "yes"; then
STATIC_LIBS="$STATIC_LIBS `pkg-config --libs pangocairo`"
fi
fi
AC_ARG_ENABLE(type3,
AS_HELP_STRING([--enable-type3], [Control whether we build with support for type3/svg fonts containing multilayered drawing with strokes, fills, images, etc.]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_TYPE3)
fi
], : )
AC_ARG_ENABLE(multilayer,
AS_HELP_STRING([--enable-multilayer], [Control whether we build with support for type3/svg fonts containing multilayered drawing with strokes, fills, images, etc. (Deprecated. Use --enable-type3 instead)]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_TYPE3)
fi
], : )
AC_ARG_ENABLE(devicetables,
AS_HELP_STRING([--enable-devicetables], [Control whether we build with support for device tables which allow fine control of kerning (etc.) at small point sizes]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_DEVICETABLES)
fi
], AC_DEFINE(FONTFORGE_CONFIG_DEVICETABLES) )
AC_ARG_ENABLE(double,
AS_HELP_STRING([--enable-double], [Control whether fontforge uses doubles internally (normally it uses floats)]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_USE_DOUBLE)
fi
], : )
AC_ARG_ENABLE(longdouble,
AS_HELP_STRING([--enable-longdouble], [Control whether fontforge uses long doubles internally (normally it uses floats)]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_USE_LONGDOUBLE)
fi
], : )
AC_ARG_ENABLE(pasteafter,
AS_HELP_STRING([--enable-pasteafter], [Control whether fontforge has a paste after command (Useful for making words?)]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_PASTEAFTER)
fi
], : )
AC_ARG_ENABLE(gb12345,
AS_HELP_STRING([--enable-gb12345], [Control whether fontforge understands the gb12345 encoding]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_GB12345)
fi
], : )
AC_ARG_ENABLE(tilepath,
AS_HELP_STRING([--enable-tilepath], [Control whether fontforge has a tile path command (a variant of expand stroke)]),
[
if test "$enableval" != "no" >/dev/null 2>&1 ; then
AC_DEFINE(FONTFORGE_CONFIG_TILEPATH)
fi
], : )
test -d libs || mkdir libs
dnl Build a $ac_confdir/po/Makefile.in with appropriate instructions for installing all locales
MACKEYS=
if test "$gww_has_gettext" = "yes" >/dev/null 2>&1 ; then
if test "$gww_ismac" = "yes" >/dev/null 2>&1 ; then
mofiles="$(cd $ac_confdir/po/mackeys && ls *.po | sed -e 's#\.po#\.mo#g')"
cat </dev/null >$ac_confdir/po/mackeys/Makefile.in
echo 'prefix = @prefix@' >> $ac_confdir/po/mackeys/Makefile.in
echo 'localedir = $(prefix)/share/locale' >> $ac_confdir/po/mackeys/Makefile.in
echo 'INSTALL = @INSTALL@' >> $ac_confdir/po/mackeys/Makefile.in
echo 'INSTALL_DATA = @INSTALL_DATA@' >> $ac_confdir/po/mackeys/Makefile.in
echo '' >> $ac_confdir/po/mackeys/Makefile.in
echo "MOFILES =" $mofiles >> $ac_confdir/po/mackeys/Makefile.in
echo '' >> $ac_confdir/po/mackeys/Makefile.in
echo '.SUFFIXES:' >> $ac_confdir/po/mackeys/Makefile.in
echo '.SUFFIXES: .po .mo' >> $ac_confdir/po/mackeys/Makefile.in
echo '' >> $ac_confdir/po/mackeys/Makefile.in
echo 'all: $(MOFILES)' >> $ac_confdir/po/mackeys/Makefile.in
echo '' >> $ac_confdir/po/mackeys/Makefile.in
echo '.po.mo:' >> $ac_confdir/po/mackeys/Makefile.in
echo ' msgfmt -o $@ $<' >> $ac_confdir/po/mackeys/Makefile.in
echo '' >> $ac_confdir/po/mackeys/Makefile.in
echo 'install:' >> $ac_confdir/po/mackeys/Makefile.in
for localefile in $mofiles; do
locale="${localefile%%.mo}"
echo ' mkdir -p $(DESTDIR)$(localedir)/'$locale'/LC_MESSAGES' >> $ac_confdir/po/mackeys/Makefile.in
echo ' $(INSTALL_DATA)' $localefile '$(DESTDIR)$(localedir)/'$locale'/LC_MESSAGES/Mac-FontForge-MenuShortCuts.mo' >> $ac_confdir/po/mackeys/Makefile.in
done
MACKEYS=po/mackeys/Makefile
fi
mofiles="$(cd $ac_confdir/po && ls *.po | sed -e 's#\.po#\.mo#g')"
cat </dev/null >$ac_confdir/po/Makefile.in
echo 'prefix = @prefix@' >> $ac_confdir/po/Makefile.in
echo 'localedir = $(prefix)/share/locale' >> $ac_confdir/po/Makefile.in
echo 'INSTALL = @INSTALL@' >> $ac_confdir/po/Makefile.in
echo 'INSTALL_DATA = @INSTALL_DATA@' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo "MOFILES =" $mofiles >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo '.SUFFIXES:' >> $ac_confdir/po/Makefile.in
echo '.SUFFIXES: .po .mo' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo 'all: $(MOFILES)' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo '.po.mo:' >> $ac_confdir/po/Makefile.in
echo ' msgfmt -o $@ $<' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo 'install:' >> $ac_confdir/po/Makefile.in
for localefile in $mofiles; do
locale="${localefile%%.mo}"
echo ' mkdir -p $(DESTDIR)$(localedir)/'$locale'/LC_MESSAGES' >> $ac_confdir/po/Makefile.in
echo ' $(INSTALL_DATA)' $localefile '$(DESTDIR)$(localedir)/'$locale'/LC_MESSAGES/FontForge.mo' >> $ac_confdir/po/Makefile.in
done
else
cat </dev/null >$ac_confdir/po/Makefile.in
echo 'all:' >> $ac_confdir/po/Makefile.in
echo ' ' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
echo 'install:' >> $ac_confdir/po/Makefile.in
echo ' ' >> $ac_confdir/po/Makefile.in
echo '' >> $ac_confdir/po/Makefile.in
fi
dnl end code for locale files.
AC_SUBST(VERSION)
VERSION=`cat $ac_confdir/VERSION`
AC_SUBST(WFLAGS)
if test "$GCC" = yes; then
WFLAGS="-Wmissing-prototypes -Wunused -Wimplicit -Wreturn-type -Wparentheses -Wformat -Wchar-subscripts"
else
WFLAGS=""
fi
cp $ac_confdir/Makefile.static.in $ac_confdir/Makefile.in
cp $ac_confdir/Unicode/Makefile.static.in $ac_confdir/Unicode/Makefile.in
cp $ac_confdir/gdraw/Makefile.static.in $ac_confdir/gdraw/Makefile.in
cp $ac_confdir/gutils/Makefile.static.in $ac_confdir/gutils/Makefile.in
cp $ac_confdir/fontforge/Makefile.static.in $ac_confdir/fontforge/Makefile.in
UMAP=
if test -e umap >/dev/null 2>&1 ; then
cp $ac_confdir/umap/Makefile.static.in $ac_confdir/umap/Makefile.in
UMAP=umap/Makefile
fi
AC_OUTPUT(Makefile Unicode/Makefile gutils/Makefile gdraw/Makefile fontforge/Makefile po/Makefile systemspecific fontforge.pc $MACKEYS $UMAP )
echo Configuration defines: $DEFS
echo CFLAGS: $CFLAGS
if test "$STATIC_LIBS" != ""; then
echo Static Libraries: $STATIC_LIBS
fi
if ! echo $PATH | tr : \\n | grep -x $prefix/bin >/dev/null ; then
echo " *******************************************************************"
echo " * You do not have $prefix/bin in your PATH environment variable *"
echo " *******************************************************************"
echo
fi
if test "$no_x" = "yes"; then
echo " *******************************************************************"
echo " * This version of fontforge will only run scripts. No X libraries *"
echo " * (or X include files or some such) were found so there is NO user*"
echo " * interface!!!!! If you want a UI try installing X11 on your *"
echo " * system. *"
echo " * Caveat: You will probably need to install two packages, the *"
echo " * base X11 package and the developer SDK package *"
echo " *******************************************************************"
case "$host" in
*-apple-darwin*)
echo ""
echo "X11 is optional software on the mac, it does not install automatically"
echo " but X11User it is on CD 3 of the OS/X install disks, and X11SDK is on"
echo " the Xcode CD. You must install both packages for fontforge to build"
echo " with a user interface"
;;
esac
fi
if test "$gww_has_gettext" = "no"; then
echo " *******************************************************************"
echo " * Your system does not have the gettext package installed. This *"
echo " * means that fontforge cannot localize its user interface and all *"
echo " * messages will be in English. You might want to install libintl. *"
case "$host" in
*-apple-darwin*)
echo " * Unfortunately Mac OS/X does not ship with gettext. You can find *"
echo " * it as part of the standard fink download at: *"
echo " * http://fink.sourceforge.net/ *"
;;
esac
echo " *******************************************************************"
fi
dnl EOF
|