-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathconfigure.in
2484 lines (2253 loc) · 64.9 KB
/
configure.in
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
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- mode:sh; sh-basic-offset:2; tab-width:2; indent-tabs-mode:t -*-
AC_INIT()
AC_CONFIG_HEADER(common/c_config.h)
AC_CONFIG_AUX_DIR(script)
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
# for CFLAGS="..." ./configure ...
AC_SUBST(CFLAGS)
if test -d ${top_srcdir-$srcdir}/encodefilter -a -d ${top_srcdir-$srcdir}/baselib ; then
CONFIG_SUBDIR_LIBS="internal"
if test "$CONFIG_SUBDIR_LIBS" = "external"; then
SUBDIRS="baselib encodefilter"
fi
MEF_CFLAGS='-I${top_builddir}/encodefilter/include'
POBL_CFLAGS='-I${top_builddir}/baselib/include'
LMEF='${top_builddir}/encodefilter/src/libmef.la'
LPOBL='${top_builddir}/baselib/src/libpobl.la'
elif test -d ${top_srcdir-$srcdir}/../../encodefilter -a -d ${top_srcdir-$srcdir}/../../baselib ; then
# --with-gui=xlib,fb => cd fb ; --with-gui=fb
MEF_CFLAGS='-I${top_builddir}/../../encodefilter/include'
POBL_CFLAGS='-I${top_builddir}/../../baselib/include'
LMEF='${top_builddir}/../../encodefilter/src/libmef.la'
LPOBL='${top_builddir}/../../baselib/src/libpobl.la'
else
LMEF="-lmef"
LPOBL="-lpobl"
fi
AC_SUBST(LMEF)
AC_SUBST(MEF_CFLAGS)
AC_SUBST(LPOBL)
AC_SUBST(POBL_CFLAGS)
AC_CHECK_TOOL(PKG_CONFIG, pkg-config)
AC_ARG_WITH(ios-sdk,
[ --with-ios-sdk@<:@=ARG@:>@ iOS SDK (e.g. iphoneos4.3 iphonesimulator4.3) ],
ios_sdk=$with_ios_sdk)
if test "$ios_sdk" != ""; then
AC_CHECK_PROG(XCRUN, xcrun, xcrun)
if test "$XCRUN" != ""; then
if test "$SDKROOT" = ""; then
SDKROOT=`$XCRUN --sdk $ios_sdk --show-sdk-path`
fi
if test "$CC" = ""; then
# Do 'export' for baselib/configure and encodefilter/configure.
export CC="`$XCRUN --sdk $ios_sdk -f cc` -isysroot $SDKROOT"
simver=`echo $ios_sdk|sed -n 's/^iphonesimulator\(@<:@0-9.@:>@*\)$/\1/p'`
if test "$simver" != ""; then
case "$simver" in
@<:@0-4@:>@.*)
# -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 or something like that
# should be defined as the value of CFLAGS environmental variable
# before ./configure.
;;
*)
CC="$CC -mios-simulator-version-min=$simver"
;;
esac
fi
fi
AC_ARG_WITH(ios-arch,
[ --with-ios-arch@<:@=ARG@:>@ iOS architectures (e.g. arm7v x86_64,i686) ],
ios_arch=$with_ios_arch)
if test "$ios_arch" != ""; then
ios_arch=`echo ${ios_arch} | sed 's/,/ /g'`
for arch in $ios_arch; do
CC="$CC -arch $arch"
done
fi
if test "$CPP" = ""; then
export CPP="$CC -E"
fi
if test "$RANLIB" = ""; then
export RANLIB=`$XCRUN --sdk $ios_sdk -f ranlib`
fi
if test "$LIBTOOL" = ""; then
export LIBTOOL=`$XCRUN --sdk $ios_sdk -f libtool`
fi
if test "$AR" = ""; then
export AR=`$XCRUN --sdk $ios_sdk -f ar`
fi
fi
XCRUN=
fi
AC_PROG_CC
# mlimgloader (gdiplus.cpp) and SCIM
AC_PROG_CXX
AC_PROG_INSTALL
AC_C_INLINE
AC_ARG_ENABLE(debug,
[ --enable-debug debug @<:@default=disabled@:>@],
debug=$enable_debug)
if test "$debug" = "yes" ; then
DEB_CFLAGS="-DDEBUG -DBL_DEBUG"
fi
AC_SUBST(DEB_CFLAGS)
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_ARG_WITH(libtool,
[ --with-libtool@<:@=ARG@:>@ libtool path @<:@default=without@:>@],
libtool=$with_libtool)
if test "${libtool}" != "" ; then
LIBTOOL=${libtool}
else
AM_PROG_LIBTOOL
LIBTOOL='${top_builddir}/libtool'
fi
AC_SUBST(LIBTOOL)
AC_CHECK_LIB(socket,connect,SOCK_LIBS=-lsocket)
AC_SUBST(SOCK_LIBS)
AC_PATH_XTRA
if test "$have_x" = "yes"; then
X_CFLAGS_AUX="-DHAVE_XLIB"
X_LIBS="$X_LIBS -lX11"
AC_SUBST(X_CFLAGS_AUX)
fi
MLTERM_FB="mlterm-fb"
AC_ARG_WITH(gui,
[ --with-gui@<:@=ARG@:>@ gui library (xlib|win32|fb|quartz|console|wayland|sdl2|beos)],
gui=$with_gui)
if test `echo $gui | grep ,`; then
gui_list=`echo $gui | sed 's/,/ /g'`
is_first=t
mkdir -p ${top_srcdir-$srcdir}/gui
for g in $gui_list; do
if test $is_first; then
gui=$g
is_first=
else
SUBDIRS="${SUBDIRS} gui/$g"
MAKE_DIRS2="${MAKE_DIRS2} gui/$g"
if test -d ${top_srcdir-$srcdir}/gui/$g ; then
echo ""
echo "** WARNING **"
echo "${top_srcdir-$srcdir}/gui/$g exists, so copy no files for $g."
echo "If there are files which should be copied, copy them manually."
echo ""
else
mkdir -p ${top_srcdir-$srcdir}/gui/$g
# clone source tree to build both mlterm, mlterm-wl, mlterm-fb, mlterm-con and mlterm-sdl2.
for file in ChangeLog Makefile.in common configure etc gtk inputmethod java \
main man vtemu script scrollbar uitoolkit doc libvterm; do
cp -R ${top_srcdir-$srcdir}/$file ${top_srcdir-$srcdir}/gui/$g/
done
mkdir -p ${top_srcdir-$srcdir}/gui/$g/contrib
cp -R ${top_srcdir-$srcdir}/contrib/scrollbar ${top_srcdir-$srcdir}/gui/$g/contrib/
fi
fi
done
elif test "$gui" = "subdir"; then
gui=`basename $PWD`
if test "$gui" = "wscons"; then
MLTERM_FB="mlterm-wscons"
elif test "$gui" = "x68kgrf"; then
MLTERM_FB="mlterm-x68kgrf"
elif test "$gui" = "scpc98"; then
MLTERM_FB="mlterm-scpc98"
fi
fi
AC_SUBST(MLTERM_FB)
if test "$gui" = "wscons"; then
gui="fb"
fbtype="wscons"
elif test "$gui" = "x68kgrf"; then
gui="fb"
fbtype="x68kgrf"
elif test "$gui" = "scpc98"; then
gui="fb"
fbtype="pc98"
fi
if test "$gui" = "fb" ; then
MAKE_DIRS2="doc/kbd ${MAKE_DIRS2}"
OUTPUT_FILES="doc/kbd/Makefile ${OUTPUT_FILES}"
fi
ml_cv_is_posix="yes"
case "${host_os}" in
mingw*)
CYGPATHW=echo
WIN32TAG=_win32
if test ! -f "/lib/libmsys-1.0.dll.a" ; then
case "${lt_cv_path_LD}" in
*-msys*)
;;
*)
ml_cv_is_posix="no"
;;
esac
fi
if test "$gui" != "sdl2" -a "$gui" != "win32" ; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
;;
msys*)
# msys2
AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo)
WIN32TAG=_win32
# $have_x is defined in AC_PATH_XTRA.
if test "$have_x" = "yes" ; then
if test "$gui" = "" ; then
gui="xlib"
elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
else
if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
fi
;;
cygwin*)
AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo)
WIN32TAG=_win32
case "${CC} ${CFLAGS}" in
*mno-cygwin* | *-mingw*)
ml_cv_is_posix="no"
;;
*)
;;
esac
# $have_x is defined in AC_PATH_XTRA.
if test "$have_x" = "yes" ; then
if test "$gui" = "" ; then
gui="xlib"
elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
else
if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then
echo "$gui is not supported in ${host_os}. Use win32."
gui="win32"
fi
fi
;;
*)
CYGPATHW=echo
if test "$gui" != "xlib" -a "$gui" != "fb" -a "$gui" != "console" -a "$gui" != "quartz" -a "$gui" != "wayland" -a "$gui" != "sdl2" -a "$gui" != "beos"; then
if test "$gui" != "" ; then
echo "$gui is not supported in ${host_os}. xlib is used instead."
fi
gui="xlib"
fi
# $have_x is defined in AC_PATH_XTRA.
if test "$gui" = "xlib" -a "$have_x" != "yes" ; then
echo ""
echo "** ERROR **"
echo "Could not find xlib."
echo ""
exit 1
fi
;;
esac
# for java/Makefile.in
AC_SUBST(WIN32TAG)
AC_SUBST(CYGPATHW)
if test "$ml_cv_is_posix" = "yes" -o "$debug" = "yes" ; then
SUBSYSTEM="-Wl,--subsystem,console"
fi
AC_SUBST(SUBSYSTEM)
if test "$with_gnu_ld" = "yes" ; then
DEXPORT="-Wl,--version-script=\$(VPATH)/dexport.map"
elif test "`$LD --version 2>&1 | $GREP Solaris`" != "" ; then
# This option is for SunOS 5.x (Solaris) or later.
DEXPORT="-Wl,-M -Wl,\$(VPATH)/dexport-sun.map -Wl,-z -Wl,nodefs"
fi
AC_SUBST(DEXPORT)
AC_ARG_WITH(gtk,
[ --with-gtk@<:@=ARG@:>@ gtk+ version (2.0|3.0|4.0) @<:@default=3.0@:>@],
gtk_version=$with_gtk)
if test "$gtk_version" = "no" ; then
have_gtk=no
else
if test "$gtk_version" = "4.0" ; then
PKG_CHECK_MODULES(GTK4, gtk4, have_gtk4=yes, have_gtk4=no)
# mlconfig supports gtk4, but mlterm-menu and libvte do not support it
gtk_version=3.0
elif test "$gtk_version" = "" ; then
gtk_version=3.0
fi
PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no)
if test "$have_gtk" != "yes"; then
if test "$gtk_version" = "3.0"; then
gtk_version=2.0
else
gtk_version=3.0
fi
PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no)
fi
fi
if test "$ml_cv_is_posix" = "no"; then
GTK_LIBS="$GTK_LIBS -limagehlp"
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0, have_gdk_pixbuf2=yes, have_gdk_pixbuf2=no)
# try to link libgio-2.0 explicitly. (SF topic #6234829)
PKG_CHECK_EXISTS(gdk-pixbuf-2.0 >= 2.14, [ PKG_CHECK_MODULES(GIO, gio-2.0) ])
GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS $GIO_CFLAGS"
GDK_PIXBUF_LIBS="$GDK_PIXBUF_LIBS $GIO_LIBS"
AC_CHECK_PROG(have_gdk_pixbuf1,gdk-pixbuf-config,yes)
if test "$gui" = "xlib" ; then
AC_ARG_WITH(imagelib,
[ --with-imagelib@<:@=ARG@:>@ image library (gdk-pixbuf) @<:@default=no@:>@],
imagelib=$with_imagelib)
else
# Don't link an external image library on win32gdi or framebuffer.
with_imagelib=""
fi
case ${imagelib} in
imlib)
AC_CHECK_PROG(imlib_config,imlib-config,yes,no)
if test "x$imlib_config" = "xno" ; then
echo ""
echo "** ERROR **"
echo "Could not find imlib-config."
echo ""
exit 1
fi
echo ""
echo "** WARNING **"
echo " imlib is no longer supported."
echo ""
IMAGELIB_CFLAGS="`imlib-config --cflags` -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="`imlib-config --libs`"
;;
imlib2)
AC_CHECK_PROG(imlib2_config,imlib2-config,yes,no)
if test "x$imlib2_config" = "xno" ; then
echo ""
echo "** ERROR **"
echo "Could not find imlib2-config."
echo ""
exit 1
fi
echo ""
echo "** WARNING **"
echo " imlib2 is no longer supported."
echo ""
IMAGELIB_CFLAGS="`imlib2-config --cflags` -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="`imlib2-config --libs`"
;;
gdk-pixbuf)
if test "$have_gdk_pixbuf2" = "yes" ; then
gdk_pixbuf_version=2
elif test "$have_gdk_pixbuf1" = "yes" ; then
gdk_pixbuf_version=1
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf"
echo ""
exit 1
fi
;;
gdk-pixbuf2)
if test "$have_gdk_pixbuf2" = "yes" ; then
gdk_pixbuf_version=2
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf2"
echo ""
exit 1
fi
;;
gdk-pixbuf1)
if test "$have_gdk_pixbuf1" = "yes" ; then
gdk_pixbuf_version=1
else
echo ""
echo "** ERROR **"
echo "Could not find gdk-pixbuf1"
echo ""
exit 1
fi
;;
*)
if test "${imagelib}" != "" ; then
echo ""
echo "** ERROR **"
echo "${imagelib} library is NOT supported."
echo ""
exit 1
fi
;;
esac
PKG_CHECK_MODULES(FT, freetype2, have_ft=yes, have_ft=no)
if test "$have_ft" = "no" ; then
PKG_CHECK_MODULES(FT, freetype, have_ft=yes, have_ft=no)
fi
# -DUSE_FREETYPE can be added to FT_CFLAGS later.
FT_CFLAGS_ORIGINAL=$FT_CFLAGS
if test "$gdk_pixbuf_version" != "" ; then
if test "$gdk_pixbuf_version" = "1" ; then
# Override GDK_PIXBUF_XXX variables.
GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`"
GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`"
echo ""
echo "** WARNING **"
echo " gdk-pixbuf1 is no longer supported."
echo ""
fi
IMAGELIB_CFLAGS="${GDK_PIXBUF_CFLAGS} -DBUILTIN_IMAGELIB"
IMAGELIB_LIBS="${GDK_PIXBUF_LIBS}"
if test "$have_ft" = "yes"; then
IMAGELIB_CFLAGS="$IMAGELIB_CFLAGS -DUSE_FREETYPE_EMOJI $FT_CFLAGS_ORIGINAL"
IMAGELIB_LIBS="$IMAGELIB_LIBS $FT_LIBS"
fi
elif test "$have_gdk_pixbuf2" != "yes" -a "$have_gdk_pixbuf1" = "yes" ; then
GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`"
GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`"
fi
# Used by mlimgloader.
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
AC_SUBST(IMAGELIB_CFLAGS)
AC_SUBST(IMAGELIB_LIBS)
# XXX For pow in libm.so which is used in ui_imagelib.c
# /lib/* ... e.g.) /lib/i386-linux-gnu in ubuntu.
for ml_cv_lib_path in /lib /usr/lib /lib/* `echo $LIBRARY_PATH | tr ":" " "` ; do
libm_files=`ls $ml_cv_lib_path/libm\\.so* $ml_cv_lib_path/libm\\.sl* 2> /dev/null`
for libm_file in $libm_files ; do
if test -n "`$NM -D $libm_file | $GREP pow`" ; then
ml_cv_libm_dir=`dirname $libm_file`
break
fi
done
if test "$ml_cv_libm_dir" != ""; then
break
fi
done
if test -z "$IMAGELIB_LIBS" ; then
if test -n "$ml_cv_libm_dir" ; then
MATH_CFLAGS="-DDLOPEN_LIBM -DLIBMDIR=\\\"$ml_cv_libm_dir\\\""
else
AC_CHECK_LIB(m, pow, MATH_LIBS=-lm)
fi
else
AC_CHECK_LIB(m, pow, MATH_LIBS=-lm)
fi
AC_SUBST(MATH_LIBS)
AC_SUBST(MATH_CFLAGS)
AC_ARG_ENABLE(image,
[ --disable-image show image @<:@default=enabled@:>@],
image=$enable_image, image="yes")
if test "$image" != "yes" ; then
# If sixel.h is not found on gui=console, set IMAGE_CFLAGS="-DNO_IMAGE" forcibly below.
IMAGE_CFLAGS="-DNO_IMAGE"
fi
AC_SUBST(IMAGE_CFLAGS)
if test "$gui" = "win32" ; then
GUI="win32"
GUI_CFLAGS="-DUSE_WIN32GUI"
X_CFLAGS=""
elif test "$gui" = "xlib" ; then
GUI="xlib"
# Li18nux Xlib-I18N defines X_HAVE_UTF8_STRING but has no Xutf8LookupString.
ldflags="$LDFLAGS" cflags="$CFLAGS"
LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" CFLAGS="$X_CFLAGS $CFLAGS"
AC_CHECK_LIB(X11,Xutf8LookupString,XUTF8_CFLAGS="-DHAVE_XUTF8_LOOKUP_STRING")
LDFLAGS="$ldflags" CFLAGS="$cflags"
AC_SUBST(XUTF8_CFLAGS)
elif test "$gui" = "quartz" ; then
GUI="quartz"
GUI_CFLAGS="-DUSE_QUARTZ"
if test "$ios_sdk" != ""; then
GUI_CFLAGS="$GUI_CFLAGS -DCOCOA_TOUCH"
COCOAOBJ=cocoatouch.o
COCOA_LIBS="-framework Foundation -framework UIKit -framework CoreGraphics"
else
COCOAOBJ=cocoa.o
COCOA_LIBS="-framework Foundation -framework Cocoa"
fi
AC_SUBST(COCOAOBJ)
AC_SUBST(COCOA_LIBS)
X_CFLAGS=""
VT_NORM_OBJ="vt_normalize.o"
VT_NORM_CFLAGS="-DUSE_NORMALIZE"
AC_SUBST(VT_NORM_OBJ)
AC_SUBST(VT_NORM_CFLAGS)
elif test "$gui" = "console" ; then
GUI="console"
GUI_CFLAGS="-DUSE_CONSOLE"
AC_CHECK_HEADER(sixel.h, SIXEL_CFLAGS="-DUSE_LIBSIXEL")
if test "$SIXEL_CFLAGS" = "-DUSE_LIBSIXEL" ; then
SIXEL_LIBS="-lsixel"
else
IMAGE_CFLAGS="-DNO_IMAGE"
IMAGELIB_CFLAGS=""
IMAGELIB_LIBS=""
fi
AC_SUBST(SIXEL_CFLAGS)
AC_SUBST(SIXEL_LIBS)
elif test "$gui" = "beos" ; then
GUI="beos"
GUI_CFLAGS="-DUSE_BEOS"
elif test "$gui" = "wayland" ; then
PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-cursor xkbcommon])
GUI="wayland"
GUI_CFLAGS="-DUSE_WAYLAND"
AC_SUBST(WAYLAND_CFLAGS)
AC_SUBST(WAYLAND_LIBS)
elif test "$gui" = "sdl2" ; then
PKG_CHECK_MODULES(SDL2, sdl2, have_sdl2=yes, have_sdl2=no)
if test "$have_sdl2" != "yes" ; then
AC_CHECK_PROG(sdl2_config, sdl2-config, yes)
if test "$sdl2_config" = "yes"; then
SDL2_CFLAGS="`sdl2-config --cflags`"
SDL2_LIBS="`sdl2-config --libs`"
else
echo "sdl2 is not available."
exit 1
fi
fi
if test "$ml_cv_is_posix" != "yes"; then
SDL2GUI="win32"
AC_SUBST(SDL2GUI)
fi
GUI="sdl2"
GUI_CFLAGS="-DUSE_SDL2"
AC_SUBST(SDL2_CFLAGS)
AC_SUBST(SDL2_LIBS)
else
GUI="fb"
if test "$fbtype" = ""; then
if test "`sysctl machdep.ispc98`" = "machdep.ispc98: 1"; then
fbtype="pc98"
else
# for NetBSD/x68k
# <machine/vuid_event.h> is also checked not to enable USE_GRF on NetBSD/macppc.
AC_CHECK_HEADER(machine/grfioctl.h,
AC_CHECK_HEADER(machine/vuid_event.h,
[
fbtype="x68kgrf"
GUI_CFLAGS="-DHAVE_GRFIOCTL_H"
]))
fi
fi
if test "$fbtype" = "x68kgrf"; then
GUI_CFLAGS="${GUI_CFLAGS} -DUSE_GRF"
elif test "$fbtype" = "pc98"; then
GUI_CFLAGS="${GUI_CFLAGS} -DPC98"
fi
GUI_CFLAGS="${GUI_CFLAGS} -DUSE_FRAMEBUFFER"
fi
AC_SUBST(GUI)
AC_SUBST(GUI_CFLAGS)
AC_CHECK_HEADER(regex.h,
[
REGEX_CFLAGS="-DHAVE_REGEX"
AC_CHECK_LIB(regex,regcomp,REGEX_LIBS=-lregex)
])
AC_SUBST(REGEX_CFLAGS)
AC_SUBST(REGEX_LIBS)
AC_ARG_ENABLE(compact-truecolor,
[ --disable-compact-truecolor true color support by reusing 240 palettes @<:@default=enabled@:>@],
compact_truecolor=$enable_compact_truecolor, compact_truecolor="yes")
if test "$compact_truecolor" = "yes" ; then
TRUECOLOR_CFLAGS="-DUSE_COMPACT_TRUECOLOR"
else
TRUECOLOR_TAG="x"
fi
AC_SUBST(TRUECOLOR_CFLAGS)
AC_SUBST(TRUECOLOR_TAG)
AC_ARG_ENABLE(dl-ctl,
[ --disable-dl-ctl dynamic loading ctl library @<:@default=enable@:>@],
dl_ctl=$enable_dl_ctl, dl_ctl="yes")
if test "$enable_shared" = "no" ; then
dl_ctl="no"
fi
if test "$dl_ctl" = "yes" ; then
LMLTERM_CORE=libmlterm${TRUECOLOR_TAG}_core.la
CTL_LOADER_OBJ=vt_ctl_loader.o
else
LMLTERM_CORE=libmlterm${TRUECOLOR_TAG}_core.a
CTL_CFLAGS="-DNO_DYNAMIC_LOAD_CTL"
CTL_LIBS_FOR_VTE="../vtemu/libctl/*.lo"
fi
AC_SUBST(LMLTERM_CORE)
AC_SUBST(CTL_LOADER_OBJ)
AC_ARG_ENABLE(fribidi,
[ --disable-fribidi bidi @<:@default=enabled@:>@],
fribidi=$enable_fribidi, fribidi="yes")
if test "$fribidi" = "yes" ; then
PKG_CHECK_MODULES(FRIBIDI, fribidi, have_fribidi=yes, have_fribidi=no)
if test "$have_fribidi" != "yes" ; then
AC_CHECK_PROG(fribidi_config,fribidi-config,yes,fribidi="no")
if test "$fribidi_config" = "yes" ; then
FRIBIDI_CFLAGS="`fribidi-config --cflags`"
FRIBIDI_LIBS="`fribidi-config --libs`"
have_fribidi="yes"
fi
fi
else
have_fribidi="no"
fi
if test "$have_fribidi" = "yes" ; then
if test "$dl_ctl" = "yes" ; then
CTL_LIBS="libctl${TRUECOLOR_TAG}_bidi.la ${CTL_LIBS}"
else
CTL_CFLAGS="-DUSE_FRIBIDI ${CTL_CFLAGS}"
CTL_LIBS="libctl${TRUECOLOR_TAG}_bidi.a ${CTL_LIBS}"
CTL_LIBS_FOR_PROG="../vtemu/libctl/libctl${TRUECOLOR_TAG}_bidi.a ${FRIBIDI_LIBS} ${CTL_LIBS_FOR_PROG}"
CTL_LIBS_FOR_VTE="${FRIBIDI_LIBS} ${CTL_LIBS_FOR_VTE}"
fi
fi
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)
AC_SUBST(CTL_CFLAGS)
AC_SUBST(CTL_LIBS_FOR_VTE)
AC_ARG_WITH(pthread,
[ --without-pthread do not use pthread @<:@default=with@:>@])
AC_ARG_ENABLE(dl-type,
[ --disable-dl-type dynamic loading type engine library @<:@default=enable@:>@],
dl_type=$enable_dl_type, dl_type="yes")
if test "$enable_shared" = "no" ; then
dl_type="no"
fi
if test "$dl_type" = "yes" ; then
TYPE_LOADER_OBJ=ui_type_loader.o
if test "$gui" != "xlib" ; then
TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE"
fi
else
TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE"
TYPE_LIBS_FOR_VTE="../uitoolkit/libtype/*.lo"
fi
AC_SUBST(TYPE_LOADER_OBJ)
if test "$gui" != "win32" -a "$gui" != "quartz"; then
PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fc=yes, have_fc=no)
if test "$have_fc" = "yes"; then
FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS -DUSE_FONTCONFIG"
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)
fi
fi
AC_ARG_ENABLE(anti_alias,
[ --disable-anti-alias same as --with-type-engines=xcore on xlib @<:@default=enabled@:>@
do not use truetype fonts on framebuffer @<:@default=enabled@:>@ ],
anti_alias=$enable_anti_alias, anti_alias="auto")
if test "$anti_alias" != "no"; then
if test "$gui" = "fb" -o "$gui" = "wayland" -o "$gui" = "sdl2"; then
if test "$have_ft" = "yes" ; then
FT_CFLAGS="$FT_CFLAGS -DUSE_FREETYPE "
AC_ARG_ENABLE(fontconfig,
[ --disable-fontconfig use fontconfig with freetype on framebuffer or wayland @<:@default=enabled@:>@ ],
fontconfig=$enable_fontconfig, fontconfig="yes")
if test "$fontconfig" != "no" -a "$have_fc" = "yes"; then
FT_CFLAGS="$FT_CFLAGS $FONTCONFIG_CFLAGS"
FT_LIBS="$FT_LIBS $FONTCONFIG_LIBS"
else
fontconfig="no"
fi
AC_SUBST(FT_CFLAGS)
AC_SUBST(FT_LIBS)
fi
fi
fi
AC_ARG_WITH(type_engines,
[ --with-type-engines@<:@=ARG@:>@ type engines (xcore, xft, cairo) @<:@default=xcore,xft,cairo@:>@],
type_engines=$with_type_engines)
if test "$gui" != "xlib" ; then
type_engines="xcore"
elif test "$type_engines" = "" ; then
if test "$anti_alias" = "no" ; then
type_engines="xcore"
else
type_engines="xcore,xft,cairo"
fi
fi
type_engines=`echo ${type_engines} | sed 's/,/ /g'`
for type_engine in ${type_engines} ; do
case ${type_engine} in
xft)
PKG_CHECK_MODULES(XFT, xft, have_xft=yes, have_xft=no)
if test "$have_xft" != "yes" ; then
AC_CHECK_PROG(xft_config,xft-config,yes)
if test "$xft_config" = "yes" ; then
XFT_CFLAGS="`xft-config --cflags`"
XFT_LIBS="`xft-config --libs`"
have_xft=yes
else
AC_CHECK_LIB(Xft,XftDrawCreate,
[
have_xft=yes
# -lfontconfig is necessary because ui_font.c refers FcXXX
# functions directly.
XFT_LIBS="-lXft -lfontconfig"
])
fi
elif test "$gui" = "xlib" -a "$enable_shared" = "no" ; then
# In case --disable-shared is specified on some platforms
# (e.g. ubuntu 14.04) where dependency_libs="" in libXft.la.
XFT_LIBS="$XFT_LIBS -lfontconfig -lfreetype"
fi
if test "$have_xft" = "yes" ; then
if test "$dl_type" = "yes" ; then
TYPE_LIBS="libtype_xft.la ${TYPE_LIBS}"
else
NODL_OBJ="ui_window_xft.o ${NODL_OBJ}"
TYPE_LIBS_FOR_VTE="${XFT_LIBS} ${TYPE_LIBS_FOR_VTE}"
fi
TYPE_CFLAGS="-DUSE_TYPE_XFT ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result xft"
fi
;;
cairo)
PKG_CHECK_MODULES(CAIRO, cairo, have_cairo=yes, have_cairo=no)
if test "$have_cairo" != "yes" ; then
AC_CHECK_LIB(cairo,cairo_create,
[
have_cairo=yes
# -lfontconfig is necessary because ui_font.c refers FcXXX
# functions directly.
CAIRO_LIBS="-lcairo -lfontconfig"
])
elif test "$gui" = "xlib" -a "$enable_shared" = "no" ; then
# In case --disable-shared is specified on some platforms
# (e.g. ubuntu 14.04) where dependency_libs="" in libcairo.la.
CAIRO_LIBS="$CAIRO_LIBS -lfontconfig -lfreetype"
fi
if test "$have_cairo" = "yes" ; then
if test "$dl_type" = "yes" ; then
TYPE_LIBS="libtype_cairo.la ${TYPE_LIBS}"
if test "$with_pthread" != "no" ; then
# NetBSD doesn't allow shared libraries to link
# libpthread without linking it to executables.
case "${host_os}" in
netbsd*)
PTHREAD_LIB="-lpthread"
;;
esac
fi
else
NODL_OBJ="ui_window_cairo.o ${NODL_OBJ}"
TYPE_LIBS_FOR_VTE="${CAIRO_LIBS} ${TYPE_LIBS_FOR_VTE}"
fi
TYPE_CFLAGS="-DUSE_TYPE_CAIRO ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result cairo"
fi
;;
xcore)
TYPE_CFLAGS="-DUSE_TYPE_XCORE ${TYPE_CFLAGS}"
type_engines_result="$type_engines_result xcore"
;;
*)
echo "${type_engine} is unknown type engine."
;;
esac
done
AC_ARG_ENABLE(otl,
[ --disable-otl Open Type layout with the use of harfbuzz or libotf @<:@default=enabled@:>@],
otl=$enable_otl,
otl="yes")
if test "$otl" != "yes" ; then
echo "Open Type layout is disabled"
elif test "$gui" = "xlib" -a "$dl_type" = "no" -a "$type_engines_result" = " xcore"; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "fb" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "wayland" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "sdl2" -a "$have_ft" != "yes" ; then
echo "libotf/libharfbuzz is not available."
elif test "$gui" = "console" ; then
echo "libotf/libharfbuzz is not available."
else
PKG_CHECK_MODULES(HB, harfbuzz, have_hb=yes, have_hb=no)
if test "$have_hb" = "yes" ; then
if test "$gui" = "quartz" ; then
CFLAGS_orig=$CFLAGS
CPPFLAGS_orig=$CPPFLAGS
CFLAGS="$CFLAGS $HB_CFLAGS"
CPPFLAGS="$CPPFLAGS $HB_CFLAGS"
AC_CHECK_HEADER(hb-coretext.h, have_hb_coretext_h=yes, have_hb_coretext_h=no)
CFLAGS=$CFLAGS_orig
CPPFLAGS=$CPPFLAGS_orig
if test "$have_hb_coretext_h" != "yes" ; then
echo ""
echo "** ERROR **"
echo "harfbuzz/hb-coretext.h is not found."
echo "Install harfbuzz with --with-coretext=yes in advance."
echo ""
have_hb=no
fi
elif test "$have_ft" = "yes" ; then
CFLAGS_orig=$CFLAGS
CPPFLAGS_orig=$CPPFLAGS
CFLAGS="$CFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL"
CPPFLAGS="$CPPFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL"
AC_CHECK_HEADER(hb-ft.h, have_hb_ft_h=yes, have_hb_ft_h=no)
CFLAGS=$CFLAGS_orig
CPPFLAGS=$CPPFLAGS_orig
if test "$have_hb_ft_h" != "yes" ; then
echo ""
echo "** ERROR **"
echo "harfbuzz/hb-ft.h is not found."
echo "Install harfbuzz with --with-freetype=yes in advance."
echo ""
have_hb=no
fi
fi
fi
if test "$have_hb" = "yes"; then
OT_LAYOUT_CFLAGS="$HB_CFLAGS -DUSE_HARFBUZZ -DUSE_OT_LAYOUT"
OT_LAYOUT_LIBS="$HB_LIBS"
OT_LAYOUT_OBJ=hb.o
if test "$gui" = "win32"; then
OT_LAYOUT_LIBS="$OT_LAYOUT_LIBS -lfreetype"
elif test "$gui" != "quartz" -a "$have_ft" = "yes"; then
OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS $FT_CFLAGS_ORIGINAL"
fi
elif test "$gui" = "win32" ; then
OT_LAYOUT_CFLAGS="-DUSE_OT_LAYOUT -DUSE_UNISCRIBE"
OT_LAYOUT_OBJ=uniscribe.o
OT_LAYOUT_LIBS="-lusp10"
else
AC_CHECK_PROG(libotf_config,libotf-config,yes)
if test "$libotf_config" = "yes" ; then
OT_LAYOUT_CFLAGS="`libotf-config --cflags` -DUSE_OT_LAYOUT"
OT_LAYOUT_LIBS="`libotf-config --libs`"
OT_LAYOUT_OBJ=otf.o
fi
fi
if test "$OT_LAYOUT_OBJ" != "" -a "$enable_shared" = "no" ; then
OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS -DNO_DYNAMIC_LOAD_OTL"
OT_LAYOUT_LIBS_FOR_PROG="$OT_LAYOUT_LIBS"
fi
if test "$OT_LAYOUT_OBJ" != "" -a "$LMLTERM_CORE" = "libmlterm${TRUECOLOR_TAG}_core.la" ; then
LMLTERM_CORE="libmlterm${TRUECOLOR_TAG}_coreotl.la"
fi
fi
AC_SUBST(OT_LAYOUT_LIBS)
AC_SUBST(OT_LAYOUT_LIBS_FOR_PROG)
AC_SUBST(OT_LAYOUT_CFLAGS)
AC_SUBST(OT_LAYOUT_OBJ)
if test "$OT_LAYOUT_OBJ" != "" ; then
MAKE_DIRS2="uitoolkit/libotl ${MAKE_DIRS2}"
OUTPUT_FILES="uitoolkit/libotl/Makefile ${OUTPUT_FILES}"
fi
if test "${NODL_OBJ}" != "" ; then
TYPE_LIBS=libtype.a
TYPE_LIBS_FOR_PROG="../uitoolkit/libtype/libtype.a ${CAIRO_LIBS} ${XFT_LIBS} ${OT_LAYOUT_LIBS}"
fi
if test "${TYPE_CFLAGS}" = "" ; then
echo "No type engine is specified."
exit 1
fi
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(TYPE_CFLAGS)
AC_SUBST(TYPE_LIBS)
AC_SUBST(TYPE_LIBS_FOR_PROG)
AC_SUBST(TYPE_LIBS_FOR_VTE)
AC_SUBST(NODL_OBJ)
AC_SUBST(PROG)
AC_ARG_ENABLE(ssh2,
[ --disable-ssh2 libssh2 @<:@default=enabled@:>@],
ssh2=$enable_ssh2, ssh2="yes")
if test "$ssh2" = "yes" ; then
PKG_CHECK_MODULES(SSH2, libssh2,
[
SSH2_CFLAGS="$SSH2_CFLAGS -DUSE_LIBSSH2"
if test "x$allow_undefined_flag" = "xunsupported" ; then
# vt_pty_ssh.c uses CRYPTO_xxx functions.
SSH2_LIBS="-lcrypto $SSH2_LIBS"
fi
], ssh2="no")
fi
if test "$enable_shared" != "no" ; then
AC_ARG_WITH(mosh,
[ --with-mosh@<:@=ARG@:>@ The directory where mosh is built])
if test -d "$with_mosh"; then
PKG_CHECK_MODULES(PROTOBUF, protobuf, MOSH_DIR=$with_mosh, with_mosh="")
if test "$MOSH_DIR" != ""; then
if test -f $MOSH_DIR/src/crypto/ocb.cc; then
# mosh-1.3.2 or before.
MOSH_OCB_OBJ="ocb.o"
# XXX (See terminaldisplayinit.cc)
PROTOBUF_CFLAGS="$PROTOBUF_CFLAGS -DMOSH_VERSION=10302"
else
# mosh-1.4.0 or later.
MOSH_OCB_OBJ="ocb_internal.o"
fi
fi
fi
fi
if test "$ml_cv_is_posix" = "no" ; then
if test "$ssh2" = "yes" ; then
VT_PTY_OBJ="vt_pty_ssh.o vt_pty_mosh.o"
if test -d "$with_mosh"; then
MAKE_DIRS2="${MAKE_DIRS2} vtemu/libptyssh vtemu/libptymosh"
OUTPUT_FILES="${OUTPUT_FILES} vtemu/libptyssh/Makefile vtemu/libptymosh/Makefile"
SSH2_LIBS_FOR_PROG="-lwsock32"
# XXX Hack for wcwidth()
PROTOBUF_LIBS="$PROTOBUF_LIBS \${top_builddir}/encodefilter/src/libmef.la"
else
# Not dlopen
SSH2_CFLAGS="$SSH2_CFLAGS -DNO_DYNAMIC_LOAD_SSH"
SSH2_LIBS_FOR_PROG="$SSH2_LIBS -lwsock32 -lws2_32"
SSH2_LIBS=
fi
SSH2_LIBS_FOR_VTE=$SSH2_LIBS_FOR_PROG
fi
AC_CHECK_FUNC(CreatePseudoConsole,