-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
4729 lines (4346 loc) · 156 KB
/
configure.ac
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
dnl configure.ac: autoconf script for Vim
dnl Process this file with autoconf 2.71 to produce "configure".
AC_INIT
AC_CONFIG_SRCDIR([vim.h])
AC_CONFIG_HEADERS(auto/config.h:config.h.in)
dnl Being able to run configure means the system is Unix (compatible).
AC_DEFINE(UNIX)
AC_PROG_MAKE_SET
dnl Checks for programs.
AC_PROG_CC dnl required by almost everything
AC_PROG_CPP dnl required by header file checks
AC_PROG_EGREP dnl required by AC_EGREP_CPP
AC_PROG_FGREP dnl finds working grep -F
AC_PROG_AWK dnl required for "make html" in ../doc
dnl Don't strip if we don't have it
AC_CHECK_PROG(STRIP, strip, strip, :)
dnl Check for extension of executables
AC_EXEEXT
AC_HEADER_SYS_WAIT
dnl Check that the C99 features that Vim uses are supported:
if test x"$ac_cv_prog_cc_c99" != xno; then
dnl If the compiler doesn't explicitly support C99, then check
dnl for the specific features Vim uses
AC_TYPE_LONG_LONG_INT
if test "$ac_cv_type_long_long_int" = no; then
AC_MSG_FAILURE([Compiler does not support long long int])
fi
AC_MSG_CHECKING([if the compiler supports trailing commas])
trailing_commas=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
enum {
one,
};])],
[AC_MSG_RESULT(yes); trailing_commas=yes],
[AC_MSG_RESULT(no)])
if test "$trailing_commas" = no; then
AC_MSG_FAILURE([Compiler does not support trailing comma in enum])
fi
AC_MSG_CHECKING([if the compiler supports C++ comments])
slash_comments=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[// C++ comments?])],
[AC_MSG_RESULT(yes); slash_comments=yes],
[AC_MSG_RESULT(no)])
if test "$slash_comments" = no; then
AC_MSG_FAILURE([Compiler does not support C++ comments])
fi
fi
dnl If $SOURCE_DATE_EPOCH is present in the environment, use that as the
dnl "compiled" timestamp in :version's output. Attempt to get the formatted
dnl date using GNU date syntax, BSD date syntax, and finally falling back to
dnl just using the current time.
if test -n "$SOURCE_DATE_EPOCH"; then
DATE_FMT="%b %d %Y %H:%M:%S"
BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT")
AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
BUILD_DATE_MSG=-"echo -e '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nNOTE: build date/time is fixed: $BUILD_DATE\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='"
AC_SUBST(BUILD_DATE_MSG)
fi
dnl Check for the flag that fails if stuff are missing.
AC_MSG_CHECKING(--enable-fail-if-missing argument)
AC_ARG_ENABLE(fail_if_missing,
[ --enable-fail-if-missing Fail if dependencies on additional features
specified on the command line are missing.],
[fail_if_missing="yes"],
[fail_if_missing="no"])
AC_MSG_RESULT($fail_if_missing)
dnl Keep original value to check later.
with_x_arg="$with_x"
dnl Set default value for CFLAGS if none is defined or it's empty
if test -z "$CFLAGS"; then
CFLAGS="-O"
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations"
fi
if test "$GCC" = yes; then
dnl Method that should work for nearly all gcc versions.
gccversion=`$CC -dumpversion`
if test "x$gccversion" = "x"; then
dnl old method; fall-back for when -dumpversion doesn't work
gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
fi
dnl Gcc version 4.0.1 was reported to cause trouble on Macintosh by Marcin
dnl Dalecki. For Mac with Intel the symptom reported is: malloc() reports
dnl double free. This happens in expand_filename(), because the optimizer
dnl swaps two blocks of code, both using "repl", that can't be swapped.
if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
else
if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
fi
fi
dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
dnl the version number of the clang in use.
dnl Note that this does not work to get the version of clang 3.1 or 3.2.
AC_MSG_CHECKING(for clang version)
CLANG_VERSION_STRING=`$CC --version 2>/dev/null | sed -n -e 's/^.*clang[[^0-9]]*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
if test x"$CLANG_VERSION_STRING" != x"" ; then
CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
AC_MSG_RESULT($CLANG_VERSION)
dnl If you find the same issue with versions earlier than 500.2.75,
dnl change the constant 500002075 below appropriately. To get the
dnl integer corresponding to a version number, refer to the
dnl definition of CLANG_VERSION above.
dnl Clang 11 reports "11", assume Clang 10 and later work like this.
AC_MSG_CHECKING(if clang supports -fno-strength-reduce)
if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then
AC_MSG_RESULT(no)
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(N/A)
fi
dnl If configure thinks we are cross compiling, there might be something
dnl wrong with the CC or CFLAGS settings, give a useful warning message
CROSS_COMPILING=
if test "$cross_compiling" = yes; then
AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS])
CROSS_COMPILING=1
fi
AC_SUBST(CROSS_COMPILING)
dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
dnl But gcc 3.1 changed the meaning! See near the end.
test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
if test -f ./toolcheck; then
AC_MSG_CHECKING(for buggy tools)
sh ./toolcheck 1>&AS_MESSAGE_FD
fi
OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
dnl When cross-compiling set $vim_cv_uname_output, $vim_cv_uname_r_output and
dnl $vim_cv_uname_m_output to the desired value for the target system
AC_MSG_CHECKING(uname)
if test "x$vim_cv_uname_output" = "x" ; then
vim_cv_uname_output=`(uname) 2>/dev/null`
AC_MSG_RESULT($vim_cv_uname_output)
else
AC_MSG_RESULT([$vim_cv_uname_output (cached)])
fi
AC_MSG_CHECKING(uname -r)
if test "x$vim_cv_uname_r_output" = "x" ; then
vim_cv_uname_r_output=`(uname -r) 2>/dev/null`
AC_MSG_RESULT($vim_cv_uname_r_output)
else
AC_MSG_RESULT([$vim_cv_uname_r_output (cached)])
fi
AC_MSG_CHECKING(uname -m)
if test "x$vim_cv_uname_m_output" = "x" ; then
vim_cv_uname_m_output=`(uname -m) 2>/dev/null`
AC_MSG_RESULT($vim_cv_uname_m_output)
else
AC_MSG_RESULT([$vim_cv_uname_m_output (cached)])
fi
AC_MSG_CHECKING(for Haiku)
case $vim_cv_uname_output in
Haiku) HAIKU=yes; AC_MSG_RESULT(yes);;
*) HAIKU=no; AC_MSG_RESULT(no);;
esac
dnl If QNX is found, assume we don't want to use Xphoton
dnl unless it was specifically asked for (--with-x)
AC_MSG_CHECKING(for QNX)
case $vim_cv_uname_output in
QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
test -z "$with_x" && with_x=no
QNX=yes; AC_MSG_RESULT(yes);;
*) QNX=no; AC_MSG_RESULT(no);;
esac
dnl Check for Darwin and MacOS X
dnl We do a check for MacOS X in the very beginning because there
dnl are a lot of other things we need to change besides GUI stuff
AC_MSG_CHECKING([for Darwin (Mac OS X)])
if test "$vim_cv_uname_output" = Darwin; then
AC_MSG_RESULT(yes)
MACOS_X=yes
CPPFLAGS="$CPPFLAGS -DMACOS_X"
AC_MSG_CHECKING(--disable-darwin argument)
AC_ARG_ENABLE(darwin,
[ --disable-darwin Disable Darwin (Mac OS X) support.],
, [enable_darwin="yes"])
if test "$enable_darwin" = "yes"; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if Darwin files are there)
if test -f os_macosx.m; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT([no, Darwin support disabled])
enable_darwin=no
fi
else
AC_MSG_RESULT([yes, Darwin support excluded])
fi
AC_MSG_CHECKING(--with-mac-arch argument)
AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
AC_MSG_CHECKING(--with-developer-dir argument)
AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools],
DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
AC_MSG_RESULT(not present))
if test "x$DEVELOPER_DIR" = "x"; then
AC_PATH_PROG(XCODE_SELECT, xcode-select)
if test "x$XCODE_SELECT" != "x"; then
AC_MSG_CHECKING(for developer dir using xcode-select)
DEVELOPER_DIR=`$XCODE_SELECT -print-path`
AC_MSG_RESULT([$DEVELOPER_DIR])
else
DEVELOPER_DIR=/Developer
fi
fi
if test "x$MACARCH" = "xboth"; then
AC_MSG_CHECKING(for 10.4 universal SDK)
dnl There is a terrible inconsistency (but we appear to get away with it):
dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
dnl tests using the preprocessor are actually done with the wrong header
dnl files. $LDFLAGS is set at the end, because configure uses it together
dnl with $CFLAGS and we can only have one -sysroot argument.
save_cppflags="$CPPFLAGS"
save_cflags="$CFLAGS"
save_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
AC_LINK_IFELSE([AC_LANG_PROGRAM([ ], [ ])],
AC_MSG_RESULT(found, will make universal binary),
AC_MSG_RESULT(not found)
CFLAGS="$save_cflags"
AC_MSG_CHECKING(if Intel architecture is supported)
CPPFLAGS="$CPPFLAGS -arch i386"
LDFLAGS="$save_ldflags -arch i386"
AC_LINK_IFELSE([AC_LANG_PROGRAM([ ], [ ])],
AC_MSG_RESULT(yes); MACARCH="intel",
AC_MSG_RESULT(no, using PowerPC)
MACARCH="ppc"
CPPFLAGS="$save_cppflags -arch ppc"
LDFLAGS="$save_ldflags -arch ppc"))
elif test "x$MACARCH" = "xintel"; then
CPPFLAGS="$CPPFLAGS -arch intel"
LDFLAGS="$LDFLAGS -arch intel"
elif test "x$MACARCH" = "xppc"; then
CPPFLAGS="$CPPFLAGS -arch ppc"
LDFLAGS="$LDFLAGS -arch ppc"
fi
if test "$enable_darwin" = "yes"; then
MACOS_X_DARWIN=yes
OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
dnl os_macosx.m implements timer_create() and friends
AC_DEFINE(HAVE_TIMER_CREATE)
dnl TODO: use -arch i386 on Intel machines
dnl Removed -no-cpp-precomp, only for very old compilers.
CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN"
dnl Assume we don't want X11 unless it was specifically asked for
dnl (--with-x) or Motif or GTK GUI is used.
if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xgtk2 -a "X$enable_gui" != Xgtk3; then
with_x=no
fi
fi
else
AC_MSG_RESULT(no)
fi
dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon
dnl so we need to include it to have access to version macros.
AC_CHECK_HEADERS(AvailabilityMacros.h)
# 10.5 and earlier lack dispatch
AC_CHECK_HEADERS(dispatch/dispatch.h)
AC_SUBST(OS_EXTRA_SRC)
AC_SUBST(OS_EXTRA_OBJ)
dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
dnl Only when the directory exists and it wasn't there yet.
dnl For gcc don't do this when it is already in the default search path.
dnl Skip all of this when cross-compiling.
if test "$cross_compiling" = no; then
AC_MSG_CHECKING(--with-local-dir argument)
have_local_include=''
have_local_lib=''
AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries.
--without-local-dir do not search /usr/local for local libraries.], [
local_dir="$withval"
case "$withval" in
*/*) ;;
no)
# avoid adding local dir to LDFLAGS and CPPFLAGS
have_local_include=yes
have_local_lib=yes
;;
*) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;;
esac
AC_MSG_RESULT($local_dir)
], [
local_dir=/usr/local
AC_MSG_RESULT(Defaulting to $local_dir)
])
if test "$GCC" = yes -a "$local_dir" != no; then
echo 'void f(){}' > conftest.c
dnl Removed -no-cpp-precomp, only needed for OS X 10.2 (Ben Fowler)
have_local_include=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
rm -f conftest.c conftest.o
fi
if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then
tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"`
if test "$tt" = "$LDFLAGS"; then
LDFLAGS="$LDFLAGS -L${local_dir}/lib"
fi
fi
if test -z "$have_local_include" -a -d "${local_dir}/include"; then
tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
if test "$tt" = "$CPPFLAGS"; then
CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
fi
fi
fi
AC_MSG_CHECKING(--with-vim-name argument)
AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
AC_SUBST(VIMNAME)
AC_MSG_CHECKING(--with-ex-name argument)
AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
AC_SUBST(EXNAME)
AC_MSG_CHECKING(--with-view-name argument)
AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
AC_SUBST(VIEWNAME)
AC_MSG_CHECKING(--with-global-runtime argument)
AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories],
RUNTIME_GLOBAL="$withval"; AC_MSG_RESULT($withval),
AC_MSG_RESULT(no))
if test "X$RUNTIME_GLOBAL" != "X"; then
RUNTIME_GLOBAL_AFTER=$(printf -- "$RUNTIME_GLOBAL\\n" | $AWK -F, 'BEGIN { comma=0 } { for (i = NF; i > 0; i--) { if (comma) { printf ",%s/after", $i } else { printf "%s/after", $i; comma=1 } } } END { printf "\n" }')
AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$RUNTIME_GLOBAL")
AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL_AFTER, "$RUNTIME_GLOBAL_AFTER")
fi
AC_MSG_CHECKING(--with-modified-by argument)
AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
AC_MSG_RESULT(no))
dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix
AC_MSG_CHECKING(if character set is EBCDIC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ],
[ /* TryCompile function for CharSet.
Treat any failure as ASCII for compatibility with existing art.
Use compile-time rather than run-time tests for cross-compiler
tolerance. */
#if '0'!=240
make an error "Character set is not EBCDIC"
#endif ])],
[ # TryCompile action if true
cf_cv_ebcdic=yes ],
[ # TryCompile action if false
cf_cv_ebcdic=no])
# end of TryCompile ])
# end of CacheVal CvEbcdic
AC_MSG_RESULT($cf_cv_ebcdic)
case "$cf_cv_ebcdic" in #(vi
yes) AC_DEFINE(EBCDIC)
line_break='"\\n"'
;;
*) line_break='"\\012"';;
esac
AC_SUBST(line_break)
if test "$cf_cv_ebcdic" = "yes"; then
dnl If we have EBCDIC we most likely have z/OS Unix, let's test it!
AC_MSG_CHECKING(for z/OS Unix)
case $vim_cv_uname_output in
OS/390) zOSUnix="yes";
dnl If using cc the environment variable _CC_CCMODE must be
dnl set to "1", so that some compiler extensions are enabled.
dnl If using c89 the environment variable is named _CC_C89MODE.
dnl Note: compile with c89 never tested.
if test "$CC" = "cc"; then
ccm="$_CC_CCMODE"
ccn="CC"
else
if test "$CC" = "c89"; then
ccm="$_CC_C89MODE"
ccn="C89"
else
ccm=1
fi
fi
if test "$ccm" != "1"; then
echo ""
echo "------------------------------------------"
echo " On z/OS Unix, the environment variable"
echo " _CC_${ccn}MODE must be set to \"1\"!"
echo " Do:"
echo " export _CC_${ccn}MODE=1"
echo " and then call configure again."
echo "------------------------------------------"
exit 1
fi
# Set CFLAGS for configure process.
# This will be reset later for config.mk.
# Use haltonmsg to force error for missing H files.
CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)";
LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
AC_MSG_RESULT(yes)
;;
*) zOSUnix="no";
AC_MSG_RESULT(no)
;;
esac
fi
dnl Set QUOTESED. Needs additional backslashes on zOS
if test "$zOSUnix" = "yes"; then
QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/' -e 's/ */ /g'"
else
QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/' -e 's/ */ /g'"
fi
AC_SUBST(QUOTESED)
dnl Link with -lsmack for Smack stuff; if not found
AC_MSG_CHECKING(--disable-smack argument)
AC_ARG_ENABLE(smack,
[ --disable-smack Do not check for Smack support.],
, enable_smack="yes")
if test "$enable_smack" = "yes"; then
AC_MSG_RESULT(no)
AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
else
AC_MSG_RESULT(yes)
fi
if test "$enable_smack" = "yes"; then
AC_CHECK_HEADER([sys/xattr.h], true, enable_smack="no")
fi
if test "$enable_smack" = "yes"; then
AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h)
AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no); enable_smack="no")
fi
if test "$enable_smack" = "yes"; then
AC_CHECK_LIB(attr, setxattr,
[LIBS="$LIBS -lattr"
found_smack="yes"
AC_DEFINE(HAVE_SMACK)])
fi
dnl When smack was found don't search for SELinux
if test "x$found_smack" = "x"; then
dnl Link with -lselinux for SELinux stuff; if not found
AC_MSG_CHECKING(--disable-selinux argument)
AC_ARG_ENABLE(selinux,
[ --disable-selinux Do not check for SELinux support.],
, enable_selinux="yes")
if test "$enable_selinux" = "yes"; then
AC_MSG_RESULT(no)
AC_CHECK_LIB(selinux, is_selinux_enabled,
[AC_CHECK_HEADER(selinux/selinux.h,
[LIBS="$LIBS -lselinux"
AC_DEFINE(HAVE_SELINUX)])])
else
AC_MSG_RESULT(yes)
fi
fi
dnl enable xattr support
AC_MSG_CHECKING(--enable-xattr argument)
AC_ARG_ENABLE(xattr,
[ --disable-xattr Do not check for XATTR support.],
, enable_xattr="yes")
if test "$enable_xattr" = "yes"; then
AC_MSG_RESULT(yes)
AC_CHECK_HEADER([sys/xattr.h], [AC_DEFINE(HAVE_XATTR)])
else
AC_MSG_RESULT(no)
fi
dnl Check user requested features.
AC_MSG_CHECKING(--with-features argument)
AC_ARG_WITH(features, [ --with-features=TYPE tiny, normal or huge (default: huge)],
features="$withval"; AC_MSG_RESULT($features),
features="huge"; AC_MSG_RESULT(Defaulting to huge))
dnl "small" is supported for backwards compatibility, now an alias for "tiny"
dnl "big" is supported for backwards compatibility, now an alias for "normal"
case "$features" in
small) features="tiny" ;;
big) features="normal" ;;
esac
dovimdiff=""
dogvimdiff=""
case "$features" in
tiny) AC_DEFINE(FEAT_TINY) ;;
normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
dogvimdiff="installgvimdiff" ;;
huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
dogvimdiff="installgvimdiff" ;;
*) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
esac
AC_SUBST(dovimdiff)
AC_SUBST(dogvimdiff)
if test "x$features" = "xtiny"; then
has_eval=no
else
has_eval=yes
fi
AC_MSG_CHECKING(--with-compiledby argument)
AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
compiledby="$withval"; AC_MSG_RESULT($withval),
compiledby=""; AC_MSG_RESULT(no))
AC_SUBST(compiledby)
AC_MSG_CHECKING(--disable-xsmp argument)
AC_ARG_ENABLE(xsmp,
[ --disable-xsmp Disable XSMP session management],
, enable_xsmp="yes")
if test "$enable_xsmp" = "yes"; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING(--disable-xsmp-interact argument)
AC_ARG_ENABLE(xsmp-interact,
[ --disable-xsmp-interact Disable XSMP interaction],
, enable_xsmp_interact="yes")
if test "$enable_xsmp_interact" = "yes"; then
AC_MSG_RESULT(no)
AC_DEFINE(USE_XSMP_INTERACT)
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(yes)
fi
AC_MSG_CHECKING([diff feature])
if test "x$features" = "xtiny"; then
AC_MSG_RESULT([disabled in $features version])
else
AC_MSG_RESULT(enabled)
AC_DEFINE(FEAT_DIFF)
XDIFF_OBJS_USED="\$(XDIFF_OBJS)"
AC_SUBST(XDIFF_OBJS_USED)
fi
dnl Check for Lua feature.
AC_MSG_CHECKING(--enable-luainterp argument)
AC_ARG_ENABLE(luainterp,
[ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
[enable_luainterp="no"])
AC_MSG_RESULT($enable_luainterp)
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Lua with tiny features])
fi
dnl -- find the lua executable
AC_SUBST(vi_cv_path_lua)
AC_MSG_CHECKING(--with-lua-prefix argument)
AC_ARG_WITH(lua_prefix,
[ --with-lua-prefix=PFX Prefix where Lua is installed.],
with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
with_lua_prefix="";AC_MSG_RESULT(no))
if test "X$with_lua_prefix" != "X"; then
vi_cv_path_lua_pfx="$with_lua_prefix"
else
AC_MSG_CHECKING(LUA_PREFIX environment var)
if test "X$LUA_PREFIX" != "X"; then
AC_MSG_RESULT("$LUA_PREFIX")
vi_cv_path_lua_pfx="$LUA_PREFIX"
else
AC_MSG_RESULT([not set, default to /usr])
vi_cv_path_lua_pfx="/usr"
fi
fi
AC_MSG_CHECKING(--with-luajit)
AC_ARG_WITH(luajit,
[ --with-luajit Link with LuaJIT instead of Lua.],
[vi_cv_with_luajit="$withval"],
[vi_cv_with_luajit="no"])
AC_MSG_RESULT($vi_cv_with_luajit)
LUA_INC=
if test "X$vi_cv_path_lua_pfx" != "X"; then
if test "x$vi_cv_with_luajit" != "xno"; then
dnl -- try to find LuaJIT executable
AC_PATH_PROG(vi_cv_path_luajit, luajit)
if test "X$vi_cv_path_luajit" != "X"; then
dnl -- find LuaJIT version
AC_CACHE_CHECK(LuaJIT version, vi_cv_version_luajit,
[ vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([[0-9.]]*\)\.[[0-9]]\(-*[[a-z0-9]]*\)* .*/\1/'` ])
AC_CACHE_CHECK(Lua version of LuaJIT, vi_cv_version_lua_luajit,
[ vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ])
vi_cv_path_lua="$vi_cv_path_luajit"
vi_cv_version_lua="$vi_cv_version_lua_luajit"
fi
else
dnl -- try to find Lua executable
AC_PATH_PROG(vi_cv_path_plain_lua, lua)
if test "X$vi_cv_path_plain_lua" != "X"; then
dnl -- find Lua version
AC_CACHE_CHECK(Lua version, vi_cv_version_plain_lua,
[ vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
fi
vi_cv_path_lua="$vi_cv_path_plain_lua"
vi_cv_version_lua="$vi_cv_version_plain_lua"
fi
if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit)
if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then
AC_MSG_RESULT(yes)
LUA_INC=/luajit-$vi_cv_version_luajit
fi
fi
if test "X$LUA_INC" = "X"; then
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
AC_MSG_RESULT(yes)
LUA_INC=/lua$vi_cv_version_lua
else
AC_MSG_RESULT(no)
# Detect moonjit:
# https://groups.google.com/forum/#!topic/vim_use/O0vek60WuTk
lua_suf=/moonjit-2.3
inc_path="$vi_cv_path_lua_pfx/include"
for dir in "$inc_path"/moonjit-[[0-9]]* ; do
if test -d "$dir" ; then
lua_suf=`basename "$dir"`
lua_suf="/$lua_suf"
break
fi
done
AC_MSG_CHECKING(if lua.h can be found in $inc_path$lua_suf)
if test -f "$inc_path$lua_suf/lua.h"; then
AC_MSG_RESULT(yes)
LUA_INC=$lua_suf
else
AC_MSG_RESULT(no)
vi_cv_path_lua_pfx=
fi
fi
fi
fi
fi
if test "X$vi_cv_path_lua_pfx" != "X"; then
if test "x$vi_cv_with_luajit" != "xno"; then
multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
if test "X$multiarch" != "X"; then
lib_multiarch="lib/${multiarch}"
else
lib_multiarch="lib"
fi
if test "X$vi_cv_version_lua" = "X"; then
LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit"
else
LUA_LIBS="-L${vi_cv_path_lua_pfx}/${lib_multiarch} -lluajit-$vi_cv_version_lua"
fi
else
dnl Test alternate lib location including version
if test -d "${vi_cv_path_lua_pfx}/lib/lua$vi_cv_version_lua"; then
LUALIBDIR="lib/lua$vi_cv_version_lua"
else
LUALIBDIR=lib
fi
if test "X$LUA_INC" != "X"; then
dnl Test alternate name including version
LUA_LIBS="-L${vi_cv_path_lua_pfx}/${LUALIBDIR} -llua$vi_cv_version_lua"
else
LUA_LIBS="-L${vi_cv_path_lua_pfx}/${LUALIBDIR} -llua"
fi
fi
if test "$enable_luainterp" = "dynamic"; then
lua_ok="yes"
else
AC_MSG_CHECKING([if link with ${LUA_LIBS} is sane])
libs_save=$LIBS
LIBS="$LIBS $LUA_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ ])],
AC_MSG_RESULT(yes); lua_ok="yes",
AC_MSG_RESULT(no); lua_ok="no"; LUA_LIBS="")
LIBS=$libs_save
fi
if test "x$lua_ok" = "xyes"; then
LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}"
LUA_SRC="if_lua.c"
LUA_OBJ="objects/if_lua.o"
LUA_PRO="if_lua.pro"
AC_DEFINE(FEAT_LUA)
fi
if test "$enable_luainterp" = "dynamic"; then
if test "x$vi_cv_with_luajit" != "xno"; then
luajit="jit"
fi
if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
else
if test "x$MACOS_X" = "xyes"; then
ext="dylib"
indexes=""
else
ext="so"
indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9"
multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
if test "X$multiarch" != "X"; then
lib_multiarch="lib/${multiarch}"
fi
fi
dnl Determine the sover for the current version, but fallback to
dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found.
AC_MSG_CHECKING(if liblua${luajit}*.${ext}* can be found in $vi_cv_path_lua_pfx)
for subdir in "${lib_multiarch}" lib64 lib; do
if test -z "$subdir"; then
continue
fi
for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \
".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do
for i in $indexes ""; do
if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${luajit}${sover}$i"; then
sover2="$i"
break 3
fi
done
done
sover=""
done
if test "X$sover" = "X"; then
AC_MSG_RESULT(no)
lua_ok="no"
vi_cv_dll_name_lua="liblua${luajit}.${ext}"
else
AC_MSG_RESULT(yes)
lua_ok="yes"
vi_cv_dll_name_lua="liblua${luajit}${sover}$sover2"
fi
fi
AC_DEFINE(DYNAMIC_LUA)
LUA_LIBS=""
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
fi
if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
test "$vim_cv_uname_m_output" = "x86_64"; then
dnl OSX/x64 requires these flags. See http://luajit.org/install.html
LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
fi
fi
if test "$fail_if_missing" = "yes" -a "$lua_ok" != "yes"; then
AC_MSG_ERROR([could not configure lua])
fi
AC_SUBST(LUA_SRC)
AC_SUBST(LUA_OBJ)
AC_SUBST(LUA_PRO)
AC_SUBST(LUA_LIBS)
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_CFLAGS_EXTRA)
fi
dnl Check for MzScheme feature.
AC_MSG_CHECKING(--enable-mzschemeinterp argument)
AC_ARG_ENABLE(mzschemeinterp,
[ --enable-mzschemeinterp Include MzScheme interpreter.], ,
[enable_mzschemeinterp="no"])
AC_MSG_RESULT($enable_mzschemeinterp)
if test "$enable_mzschemeinterp" = "yes"; then
dnl -- find the mzscheme executable
AC_SUBST(vi_cv_path_mzscheme)
AC_MSG_CHECKING(--with-plthome argument)
AC_ARG_WITH(plthome,
[ --with-plthome=PLTHOME Use PLTHOME.],
with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
with_plthome="";AC_MSG_RESULT("no"))
if test "X$with_plthome" != "X"; then
vi_cv_path_mzscheme_pfx="$with_plthome"
vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
AC_MSG_CHECKING(PLTHOME environment var)
if test "X$PLTHOME" != "X"; then
AC_MSG_RESULT("$PLTHOME")
vi_cv_path_mzscheme_pfx="$PLTHOME"
vi_cv_path_mzscheme="${vi_cv_path_mzscheme_pfx}/bin/mzscheme"
else
AC_MSG_RESULT(not set)
dnl -- try to find MzScheme executable
AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
dnl resolve symbolic link, the executable is often elsewhere and there
dnl are no links for the include files.
if test "X$vi_cv_path_mzscheme" != "X"; then
lsout=`ls -l $vi_cv_path_mzscheme`
if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
fi
fi
if test "X$vi_cv_path_mzscheme" != "X"; then
dnl -- find where MzScheme thinks it was installed
AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
dnl different versions of MzScheme differ in command line processing
dnl use universal approach
echo "(display (simplify-path \
(build-path (call-with-values \
(lambda () (split-path (find-system-path (quote exec-file)))) \
(lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
dnl Remove a trailing slash
[ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
sed -e 's+/$++'` ])
rm -f mzdirs.scm
fi
fi
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
AC_MSG_CHECKING(for racket include directory)
SCHEME_INC=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-include-dir))) (when (path? p) (display p)))'`
if test "X$SCHEME_INC" != "X"; then
AC_MSG_RESULT(${SCHEME_INC})
else
AC_MSG_RESULT(not found)
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
AC_MSG_RESULT(yes)
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
AC_MSG_RESULT(yes)
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
if test -f /usr/include/plt/scheme.h; then
AC_MSG_RESULT(yes)
SCHEME_INC=/usr/include/plt
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
if test -f /usr/include/racket/scheme.h; then
AC_MSG_RESULT(yes)
SCHEME_INC=/usr/include/racket
else
AC_MSG_RESULT(no)
vi_cv_path_mzscheme_pfx=
fi
fi
fi
fi
fi
fi
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
AC_MSG_CHECKING(for racket lib directory)
SCHEME_LIB=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-lib-dir))) (when (path? p) (display p)))'`
if test "X$SCHEME_LIB" != "X"; then
AC_MSG_RESULT(${SCHEME_LIB})
else
AC_MSG_RESULT(not found)
fi
for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
if test "X$path" != "X"; then
if test "x$MACOS_X" = "xyes"; then
MZSCHEME_LIBS="-framework Racket"
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libmzscheme3m.a"; then
MZSCHEME_LIBS="${path}/libmzscheme3m.a"
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libracket3m.a"; then
MZSCHEME_LIBS="${path}/libracket3m.a"
if test -f "${path}/librktio.a"; then
MZSCHEME_LIBS="${MZSCHEME_LIBS} ${path}/librktio.a"
fi
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libracket.a"; then
MZSCHEME_LIBS="${path}/libracket.a ${path}/libmzgc.a"
elif test -f "${path}/libmzscheme.a"; then
MZSCHEME_LIBS="${path}/libmzscheme.a ${path}/libmzgc.a"
else
dnl Using shared objects
if test -f "${path}/libmzscheme3m.so"; then
MZSCHEME_LIBS="-L${path} -lmzscheme3m"
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libracket3m.so"; then
MZSCHEME_LIBS="-L${path} -lracket3m"
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libracket.so"; then
MZSCHEME_LIBS="-L${path} -lracket -lmzgc"
else
dnl try next until last
if test "$path" != "$SCHEME_LIB"; then
continue
fi
MZSCHEME_LIBS="-L${path} -lmzscheme -lmzgc"
fi
if test "$GCC" = yes; then
dnl Make Vim remember the path to the library. For when it's not in
dnl $LD_LIBRARY_PATH.
MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${path}"
elif test "$vim_cv_uname_output" = SunOS &&
echo $vim_cv_uname_r_output | grep '^5' >/dev/null; then
MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${path}"
fi
fi
fi
if test "X$MZSCHEME_LIBS" != "X"; then
break
fi
done
AC_MSG_CHECKING([if racket requires -pthread])
if test "X$SCHEME_LIB" != "X" && $FGREP -e -pthread "$SCHEME_LIB/buildinfo" >/dev/null ; then
AC_MSG_RESULT(yes)
MZSCHEME_LIBS="${MZSCHEME_LIBS} -pthread"
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -pthread"
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for racket config directory)
SCHEME_CONFIGDIR=`${vi_cv_path_mzscheme} -e '(require setup/dirs)(let ((p (find-config-dir))) (when (path? p) (display p)))'`
if test "X$SCHEME_CONFIGDIR" != "X"; then
MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DMZSCHEME_CONFIGDIR='\"${SCHEME_CONFIGDIR}\"'"
AC_MSG_RESULT(${SCHEME_CONFIGDIR})
else