forked from brltty/brltty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2054 lines (1834 loc) · 56.3 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
###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
# text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2024 by The BRLTTY Developers.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU Lesser General Public License, as published by the Free Software
# Foundation; either version 2.1 of the License, or (at your option) any
# later version. Please see the file LICENSE-LGPL for details.
#
# Web Page: http://brltty.app/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################
AC_PREREQ([2.64])
AC_INIT([BRLTTY], [6.7], [BRLTTY@brltty.app], [brltty], [https://brltty.app/])
AC_CONFIG_SRCDIR([Programs/brltty.c])
AC_CONFIG_MACRO_DIR([m4])
m4_include([Bindings/Emacs/bindings.m4])
m4_include([Bindings/Java/bindings.m4])
m4_include([Bindings/Lisp/bindings.m4])
m4_include([Bindings/Lua/bindings.m4])
m4_include([Bindings/OCaml/bindings.m4])
m4_include([Bindings/Python/bindings.m4])
m4_include([Bindings/Tcl/bindings.m4])
copyright="© 1995-2024 by The BRLTTY Developers"
AC_SUBST([PACKAGE_COPYRIGHT], ["${copyright}"])
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT], ["${copyright}"],
[Define this to be a string containing the copyright notice.])
AC_SUBST([api_major], [0])
AC_SUBST([api_minor], [8])
AC_SUBST([api_revision], [6])
AC_SUBST([api_name], [BrlAPI])
AC_SUBST([api_version], [${api_major}.${api_minor}])
AC_SUBST([api_release], [${api_version}.${api_revision}])
AC_DEFINE_UNQUOTED([BRLAPI_RELEASE], ["${api_release}"],
[Define this to be a string containing the API library version.])
AC_DEFINE_UNQUOTED([BRLAPI_MAJOR], [${api_major}],
[Define this to be the API library major version number.])
AC_DEFINE_UNQUOTED([BRLAPI_MINOR], [${api_minor}],
[Define this to be the API library minor version number.])
AC_DEFINE_UNQUOTED([BRLAPI_REVISION], [${api_revision}],
[Define this to be the API library revision number.])
BRLTTY_SUMMARY_BEGIN
brltty_build_directories=". Programs Documents Messages"
brltty_source_directory="`dirname "${0}"`"
brltty_manual_directories=""
for brltty_directory in Autostart Authorization Initramfs Android
do
for brltty_subdirectory in `cd "${brltty_source_directory}/${brltty_directory}" && echo *`
do
brltty_path="${brltty_directory}/${brltty_subdirectory}"
test -f "${brltty_source_directory}/${brltty_path}/Makefile.in" && {
brltty_build_directories="${brltty_build_directories} ${brltty_path}"
}
done
done
for brltty_manual_directory in `(cd "${brltty_source_directory}" && echo Documents/Manual-*/*)`
do
test -f "${brltty_source_directory}/${brltty_manual_directory}/Makefile.in" && {
brltty_manual_directories="${brltty_manual_directories} ${brltty_manual_directory}"
}
done
AC_SUBST([brltty_manual_directories])
brltty_build_directories="${brltty_build_directories} ${brltty_manual_directories}"
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([Programs/brlapi.h])
AC_PREFIX_DEFAULT([])
AC_CONFIG_AUX_DIR([acdir])
AC_CANONICAL_TARGET
brltty_default_execute_root="/${PACKAGE_TARNAME}-${PACKAGE_VERSION}"
BRLTTY_ARG_WITH(
[execute-root], [DIRECTORY],
[where the package is to be anchored at run-time],
[execute_root], [""]
)
if test "${execute_root}" = "no"
then
execute_root=""
elif test "${execute_root}" = "yes"
then
execute_root="${brltty_default_execute_root}"
fi
AC_SUBST([execute_root])
BRLTTY_SUMMARY_ITEM([execute-root], [execute_root])
brltty_default_install_root="/tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION}"
BRLTTY_ARG_WITH(
[install-root], [DIRECTORY],
[where to install the package],
[install_root], ["${execute_root}"]
)
if test "${install_root}" = "no"
then
install_root="${execute_root}"
elif test "${install_root}" = "yes"
then
install_root="${brltty_default_install_root}"
fi
AC_SUBST([install_root])
BRLTTY_SUMMARY_ITEM([install-root], [install_root])
BRLTTY_ARG_WITH(
[configuration-file], [FILE],
[name of configuration file],
[CONFIGURATION_FILE], ["${PACKAGE_TARNAME}.conf"]
)
AC_SUBST([CONFIGURATION_FILE])
BRLTTY_DEFINE_EXPANDED([CONFIGURATION_FILE], ["${CONFIGURATION_FILE}"],
[Define this to be a string containing the name of the default configuration file.])
AC_SUBST([PREFERENCES_FILE], ["${PACKAGE_TARNAME}.prefs"])
BRLTTY_DEFINE_EXPANDED([PREFERENCES_FILE], ["${PREFERENCES_FILE}"],
[Define this to be a string containing the name of the default preferences file.])
BRLTTY_PORTABLE_DIRECTORY([includedir], [/usr])
BRLTTY_PORTABLE_DIRECTORY([datarootdir], [/usr])
BRLTTY_PORTABLE_DIRECTORY([localstatedir], [])
BRLTTY_SUMMARY_ITEM([libdir], [libdir])
BRLTTY_SUMMARY_ITEM([sysconfdir], [sysconfdir])
BRLTTY_ARG_REQUIRED(
[program-directory], [DIRECTORY],
[path to directory containing executables],
[program_directory], ["${bindir}"]
)
BRLTTY_ARG_REQUIRED(
[commands-directory], [DIRECTORY],
[path to directory containing helper commands],
[commands_directory], ["${libexecdir}/${PACKAGE_TARNAME}"]
)
BRLTTY_ARG_REQUIRED(
[drivers-directory], [DIRECTORY],
[path to directory containing drivers],
[drivers_directory], ["${libdir}/${PACKAGE_TARNAME}"]
)
BRLTTY_ARG_WITH(
[updatable-directory], [DIRECTORY],
[path to directory which contains files that can be updated],
[updatable_directory], ["yes"]
)
if test "${updatable_directory}" = "no"
then
updatable_directory=""
elif test "${updatable_directory}" = "yes"
then
updatable_directory="${localstatedir}/lib/${PACKAGE_TARNAME}"
fi
AC_SUBST([updatable_directory])
BRLTTY_SUMMARY_ITEM([updatable-directory], [updatable_directory])
BRLTTY_ARG_WITH(
[writable-directory], [DIRECTORY],
[path to directory which can be written to],
[writable_directory], ["yes"]
)
if test "${writable_directory}" = "no"
then
writable_directory=""
elif test "${writable_directory}" = "yes"
then
writable_directory="/run/${PACKAGE_TARNAME}"
fi
AC_SUBST([writable_directory])
BRLTTY_SUMMARY_ITEM([writable-directory], [writable_directory])
BRLTTY_ARG_REQUIRED(
[tables-directory], [DIRECTORY],
[path to directory containing data files],
[tables_directory], ["${sysconfdir}/${PACKAGE_TARNAME}"]
)
BRLTTY_DEFINE_STRING([TEXT_TABLES_SUBDIRECTORY], [Text], [the subdirectory for text tables])
BRLTTY_DEFINE_STRING([CONTRACTION_TABLES_SUBDIRECTORY], [Contraction], [the subdirectory for contraction tables])
BRLTTY_DEFINE_STRING([ATTRIBUTES_TABLES_SUBDIRECTORY], [Attributes], [the subdirectory for attributes tables])
BRLTTY_DEFINE_STRING([KEYBOARD_TABLES_SUBDIRECTORY], [Keyboard], [the subdirectory for keyboard key tables])
BRLTTY_DEFINE_STRING([INPUT_TABLES_SUBDIRECTORY], [Input], [the subdirectory for braille device key tables])
BRLTTY_DEFINE_STRING([TEXT_TABLE_EXTENSION], [.ttb], [the extension for text tables])
BRLTTY_DEFINE_STRING([TEXT_SUBTABLE_EXTENSION], [.tti], [the extension for text subtables])
BRLTTY_DEFINE_STRING([CONTRACTION_TABLE_EXTENSION], [.ctb], [the extension for contraction tables])
BRLTTY_DEFINE_STRING([CONTRACTION_SUBTABLE_EXTENSION], [.cti], [the extension for contraction subtables])
BRLTTY_DEFINE_STRING([ATTRIBUTES_TABLE_EXTENSION], [.atb], [the extension for attributes tables])
BRLTTY_DEFINE_STRING([ATTRIBUTES_SUBTABLE_EXTENSION], [.ati], [the extension for attributes subtables])
BRLTTY_DEFINE_STRING([KEY_TABLE_EXTENSION], [.ktb], [the extension for key tables])
BRLTTY_DEFINE_STRING([KEY_SUBTABLE_EXTENSION], [.kti], [the extension for key subtables])
BRLTTY_DEFINE_STRING([KEY_HELP_EXTENSION], [.txt], [the extension for key help files])
BRLTTY_DEFINE_STRING([PROFILES_SUBDIRECTORY], [Profiles], [the subdirectory for profiles])
BRLTTY_DEFINE_STRING([LANGUAGE_PROFILE_EXTENSION], [.lpf], [the extension for language profiles])
BRLTTY_ARG_REQUIRED(
[manpage-directory], [DIRECTORY],
[path to directory containing manual pages],
[manpage_directory], ["${mandir}"]
)
BRLTTY_ARG_REQUIRED(
[include-directory], [DIRECTORY],
[path to directory containing header files],
[include_directory], ["${includedir}/${PACKAGE_TARNAME}"]
)
brltty_default_init_path=/sbin/init_real
BRLTTY_ARG_WITH(
[init-path], [FILE],
[path to real init program],
[init_path], [""]
)
if test "${init_path}" = "no"
then
init_path=""
elif test "${init_path}" = "yes"
then
init_path="${brltty_default_init_path}"
fi
if test -n "${init_path}"
then
AC_DEFINE_UNQUOTED([INIT_PATH], ["${init_path}"],
[Define this if BRLTTY is to be run as init.])
fi
BRLTTY_SUMMARY_ITEM([init-path], [init_path])
AC_SUBST([init_path])
BRLTTY_ARG_PARAMETERS([privilege], [privilege establishment stage], [PLATFORM:], [])
brltty_default_stderr_path=/tmp/brltty.log
BRLTTY_ARG_WITH(
[stderr-path], [FILE],
[path to standard error log file],
[stderr_path], [""]
)
if test "${stderr_path}" = "no"
then
stderr_path=""
elif test "${stderr_path}" = "yes"
then
stderr_path="${brltty_default_stderr_path}"
fi
if test -n "${stderr_path}"
then
AC_DEFINE_UNQUOTED([STDERR_PATH], ["${stderr_path}"],
[Define this if standard error is to be redirected to a file.])
fi
BRLTTY_SUMMARY_ITEM([stderr-path], [stderr_path])
AC_SUBST([stderr_path])
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
brltty_gcc_cflags="-std=gnu99 -Wall"
brltty_gcc_cppflags=""
case "${host_os}"
in
darwin*)
brltty_gcc_cflags="${brltty_gcc_cflags} -Wno-initializer-overrides -Wno-unused-const-variable -Wno-pointer-bool-conversion"
;;
elf*)
brltty_gcc_cppflags="${brltty_gcc_cppflags} -ffreestanding -nostdinc -nostdlib"
CPPFLAGS="${CPPFLAGS} -DGRUB_RUNTIME -DGRUB_FILE=__FILE__ -DNESTED_FUNC_ATTR="
brltty_include_directory=`$CC -print-file-name=include`
CPPFLAGS="${CPPFLAGS} -isystem $brltty_include_directory"
brltty_grub_root="`pwd`/grub-root"
test -d $brltty_grub_root || {
AC_MSG_ERROR([symbolic link not found: $brltty_grub_root])
}
CPPFLAGS="${CPPFLAGS} -I$brltty_grub_root -I$brltty_grub_root/grub-core/lib/posix_wrap/include -I$brltty_grub_root/include"
;;
esac
test "${GCC}" = "yes" && {
CFLAGS="${CFLAGS} ${brltty_gcc_cflags}"
CPPFLAGS="${CPPFLAGS} ${brltty_gcc_cppflags}"
extraCFlags=""
for flag in unknown-warning-option
do
AX_CHECK_COMPILE_FLAG([-Werror=${flag}], [dnl
extraCFlags="${extraCFlags} -Werror=${flag}"
])
done
# warnings that should be errors
for flag in format-security
do
AX_CHECK_COMPILE_FLAG([-Werror=${flag}], [dnl
CFLAGS="${CFLAGS} -Werror=${flag}"
], [:], [${extraCFlags}])
done
# warnings that should be suppressed
for flag in address-of-packed-member stringop-truncation initializer-overrides
do
AX_CHECK_COMPILE_FLAG([-Werror=${flag}], [dnl
CFLAGS="${CFLAGS} -Wno-${flag}"
], [:], [${extraCFlags}])
done
AX_GCC_VAR_ATTRIBUTE([packed])
AX_GCC_VAR_ATTRIBUTE([unused])
AX_GCC_FUNC_ATTRIBUTE([format])
AX_GCC_FUNC_ATTRIBUTE([format_arg])
AX_GCC_FUNC_ATTRIBUTE([noreturn])
AX_GCC_FUNC_ATTRIBUTE([unused])
}
test "${GXX}" = "yes" && {
CXXFLAGS="${CXXFLAGS} ${brltty_gcc_cflags}"
}
case "${host_os}"
in
linux*|gnu*|kfreebsd*)
brltty_prog_cc_sysflags="-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE"
;;
solaris2.1?*) # Solaris 10 & 11 require _XOPEN_SOURCE=600 if using C99
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
;;
solaris*)
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
;;
hpux*)
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE_EXTENDED -D_HPUX_SOURCE"
;;
osf*)
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE -D_OSF_SOURCE"
;;
cygwin*)
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE"
;;
mingw*)
brltty_prog_cc_sysflags="-D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE"
;;
*)
brltty_prog_cc_sysflags=""
;;
esac
CPPFLAGS="${CPPFLAGS} ${brltty_prog_cc_sysflags}"
if test "${GCC}" = "yes"
then
case "${host_os}"
in
cygwin*|mingw*)
LIBCFLAGS=""
;;
msdos*)
LIBCFLAGS=""
;;
darwin*)
LIBCFLAGS=""
;;
*)
LIBCFLAGS="-fPIC"
;;
esac
else
case "${host_os}"
in
*)
LIBCFLAGS=""
AC_MSG_WARN([library flags not configured for ${host_os}])
;;
esac
fi
AC_SUBST([LIBCFLAGS])
if test "$GXX" = "yes"
then
LIBCXXFLAGS="-fPIC"
else
case "${host_os}"
in
*)
LIBCXXFLAGS=""
;;
esac
fi
AC_SUBST([LIBCXXFLAGS])
AC_CHECK_TOOL([LD], [ld])
AC_CHECK_TOOL([STRIP], [strip])
AC_CHECK_TOOL([RANLIB], [ranlib])
AC_PROG_AWK
AC_PROG_LN_S
m4_ifdef([PKG_PROG_PKG_CONFIG], [dnl
PKG_PROG_PKG_CONFIG
], [dnl
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
])
if test -z "${PKG_CONFIG}"
then
PKG_CONFIG=false
fi
AC_PATH_PROG([MSGMERGE], [msgmerge], [false])
AC_PATH_PROG([MSGFMT], [msgfmt], [false])
AC_PATH_PROG([LINUXDOC], [linuxdoc], [false])
AC_PATH_PROG([DOXYGEN], [doxygen], [false])
case "${host_os}"
in
cygwin* ) LDFLAGS_DYNAMIC="--export-all-symbols --enable-auto-import";;
darwin* ) LDFLAGS_DYNAMIC="";;
elf* ) LDFLAGS_DYNAMIC="";;
freebsd* ) LDFLAGS_DYNAMIC="-export-dynamic";;
gnu* ) LDFLAGS_DYNAMIC="-export-dynamic";;
haiku* ) LDFLAGS_DYNAMIC="-export-dynamic";;
hpux* ) LDFLAGS_DYNAMIC="-E +s";;
kfreebsd*) LDFLAGS_DYNAMIC="-export-dynamic";;
linux* ) LDFLAGS_DYNAMIC="-export-dynamic";;
mingw* ) LDFLAGS_DYNAMIC="--export-all-symbols --enable-auto-import";;
msdos* ) LDFLAGS_DYNAMIC="";;
netbsd* ) LDFLAGS_DYNAMIC="-export-dynamic";;
openbsd* ) LDFLAGS_DYNAMIC="-export-dynamic";;
osf* ) LDFLAGS_DYNAMIC="";;
*qnx* ) LDFLAGS_DYNAMIC="-export-dynamic";;
solaris* ) LDFLAGS_DYNAMIC="";;
*) AC_MSG_ERROR([dynamic linkage not supported for ${host_os}]);;
esac
LDFLAGS_DYNAMIC="BRLTTY_OPTIONS_LD2CC([${LDFLAGS_DYNAMIC}])"
if test "${GCC}" = "yes"
then
LDFLAGS_STATIC="-static"
else
case "${host_os}"
in
cygwin* ) LDFLAGS_STATIC="-static";;
elf* ) LDFLAGS_STATIC="-static";;
freebsd* ) LDFLAGS_STATIC="-static";;
gnu* ) LDFLAGS_STATIC="-static";;
hpux* ) LDFLAGS_STATIC="-Bstatic";;
kfreebsd*) LDFLAGS_STATIC="-static";;
linux* ) LDFLAGS_STATIC="-static";;
mingw* ) LDFLAGS_STATIC="-static";;
netbsd* ) LDFLAGS_STATIC="-Bstatic";;
openbsd* ) LDFLAGS_STATIC="-static";;
osf* ) LDFLAGS_STATIC="-non_shared";;
*qnx* ) LDFLAGS_STATIC="-static";;
solaris* ) LDFLAGS_STATIC="-dn";;
*) AC_MSG_ERROR([static linkage not supported for ${host_os}]);;
esac
LDFLAGS_STATIC="BRLTTY_OPTIONS_LD2CC([${LDFLAGS_STATIC}])"
fi
pkgconfig_flags_libs="--libs"
BRLTTY_ARG_ENABLE(
[standalone-programs],
[statically linked executables],
[],
[dnl
LDFLAGS="${LDFLAGS} ${LDFLAGS_STATIC}"
brltty_standalone_programs="yes"
pkgconfig_flags_libs="${pkgconfig_flags_libs} --static"
], [dnl
LDFLAGS="${LDFLAGS} ${LDFLAGS_DYNAMIC}"
AC_DEFINE([ENABLE_SHARED_OBJECTS], [1],
[Define this if shared object support is to be included.])
])
AC_PROG_INSTALL
BRLTTY_EXECUTABLE_PATH([INSTALL])
test "${LINUXDOC}" = "false" && can_make_manual=no || can_make_manual=yes
AC_SUBST([can_make_manual])
test "${DOXYGEN}" = "false" && can_make_BrlAPIref=no || can_make_BrlAPIref=yes
AC_SUBST([can_make_BrlAPIref])
AC_CACHE_CHECK([for shared object creation command], [brltty_cv_prog_make_object_shared], [dnl
case "${host_os}"
in
linux*|gnu*|openbsd*|freebsd*|kfreebsd*|netbsd*|*qnx*|cygwin*|mingw*|msdos*|elf*|haiku*)
brltty_mkshr_ld_make="-shared"
;;
solaris*)
brltty_mkshr_ld_make="-G"
;;
hpux*)
brltty_mkshr_ld_make="-b"
;;
osf*)
brltty_mkshr_ld_make="-shared"
;;
darwin*)
brltty_mkshr_ld_make="-bundle"
brltty_mkshr_ld_options="-flat_namespace -undefined suppress"
brltty_mkshr_gcc_make="-bundle"
;;
*)
AC_MSG_ERROR([loadable module creation command not configured for ${host_os}])
brltty_mkshr_ld_make="NOT_SUPPORTED"
brltty_mkshr_ld_options="NOT_SUPPORTED"
brltty_mkshr_gcc_make="NOT_SUPPORTED"
;;
esac
if test "${GCC}" = "yes"
then
brltty_cv_prog_make_object_shared="\$(CC) ${brltty_mkshr_gcc_make=-shared} BRLTTY_OPTIONS_LD2CC([${brltty_mkshr_ld_options}])"
else
brltty_cv_prog_make_object_shared="\$(LD) ${brltty_mkshr_ld_make} ${brltty_mkshr_ld_options}"
fi
brltty_cv_prog_make_object_shared="${brltty_cv_prog_make_object_shared} ${LDFLAGS} -o"
])
AC_SUBST([MKSHR], ["${brltty_cv_prog_make_object_shared}"])
AC_CACHE_CHECK([for make relocatable object command], [brltty_cv_prog_make_object_relocatable], [dnl
case "${host_os}"
in
*)
brltty_cv_prog_make_object_relocatable="\$(LD) -r -o"
;;
esac])
MKREL="${brltty_cv_prog_make_object_relocatable}"
AC_SUBST([MKREL])
AC_CACHE_CHECK([for dynamic library creation command], [brltty_cv_prog_mklib], [dnl
case "${host_os}"
in
linux*|gnu*|openbsd*|freebsd*|kfreebsd*|netbsd*|*qnx*|elf*|haiku*)
brltty_mklib_ld_make="-shared"
brltty_mklib_ld_options="-soname"
;;
solaris*)
brltty_mklib_ld_make="-G"
brltty_mklib_ld_options="-h"
;;
hpux*)
brltty_mklib_ld_make="-b"
brltty_mklib_ld_options="+h"
;;
osf*)
brltty_mklib_ld_make="-shared"
brltty_mklib_ld_options="-expect_unresolved '*' -soname"
;;
cygwin*|mingw*)
brltty_mklib_ld_make="-shared"
brltty_mklib_ld_options="--out-implib implib.a --output-def lib.def -soname"
;;
msdos*)
brltty_mklib_ld_make="not_supported_on_msdos"
brltty_mklib_ld_options="not_supported_on_msdos"
brltty_mklib_gcc_make="not_supported_on_msdos"
;;
darwin*)
dylibFound=false
dylibPath=/usr/lib/dylib1.o
set -- "${dylibPath}"
sdkRootPrefix="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX"
sdkRootSuffix=".sdk/${dylibPath}"
sdkVersion=`sw_vers -productVersion`
while true
do
set -- "${@}" "${sdkRootPrefix}${sdkVersion}${sdkRootSuffix}"
sdkNext="${sdkVersion%.*}"
test "${sdkNext}" != "${sdkVersion}" || break
sdkVersion="${sdkNext}"
done
set -- "${@}" "${sdkRootPrefix}"*"${sdkRootSuffix}"
for sdkPath
do
test ! -f "${sdkPath}" || {
dylibPath="${sdkPath}"
dylibFound=true
break
}
done
"${dylibFound}" || AC_MSG_WARN([cannot find ${dylibPath}])
brltty_mklib_ld_make="-dylib"
brltty_mklib_ld_options="${dylibPath} -single_module -install_name"
brltty_mklib_gcc_make="-dynamiclib"
;;
*)
AC_MSG_ERROR([dynamic library creation command not configured for ${host_os}])
;;
esac
if test "${GCC}" = "yes"
then
brltty_cv_prog_mklib="\$(CC) \$(LDFLAGS) ${brltty_mklib_gcc_make=-shared} BRLTTY_OPTIONS_LD2CC([${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>}]) -o"
else
brltty_cv_prog_mklib="\$(LD) \$(LDFLAGS) ${brltty_mklib_ld_make} ${brltty_mklib_ld_options+${brltty_mklib_ld_options} <name>} -o"
fi])
AC_SUBST([MKLIB], ["${brltty_cv_prog_mklib}"])
AC_CACHE_CHECK([for configure shared object directory command], [brltty_cv_prog_conflibdir], [dnl
case "${host_os}"
in
linux*|gnu*|kfreebsd*|elf*)
brltty_cv_prog_conflibdir="/sbin/ldconfig -n"
;;
*)
brltty_cv_prog_conflibdir=":"
;;
esac])
AC_SUBST([CONFLIBDIR], ["${brltty_cv_prog_conflibdir}"])
case "${host_os}"
in
mingw*)
BRLTTY_HAVE_WINDOWS_LIBRARY([ws2_32])
BRLTTY_HAVE_WINDOWS_LIBRARY([gdi32])
BRLTTY_HAVE_WINDOWS_LIBRARY([winmm])
;;
cygwin*)
BRLTTY_HAVE_WINDOWS_LIBRARY([gdi32])
;;
*)
AC_SEARCH_LIBS([socket], [socket network])
AC_SEARCH_LIBS([inet_ntoa], [nsl])
;;
esac
install_messages=
BRLTTY_ARG_DISABLE(
[i18n],
[support for internationalization],
[],
[dnl
test "${MSGMERGE}" = "false" || {
install_messages=install-messages
AC_CHECK_HEADER([libintl.h], [dnl
BRLTTY_HAVE_LIBRARY([intl])
AC_DEFINE([ENABLE_I18N_SUPPORT], [1],
[Define this if internationalization support is to be included.])
])
}
])
AC_SUBST([install_messages])
AC_CHECK_FUNC([wcslen], [AC_CHECK_HEADERS([wchar.h], [dnl
AC_CHECK_FUNCS([wcwidth])
])])
AC_CHECK_HEADERS([glob.h], [dnl
AC_CHECK_FUNCS([glob])
])
AC_CHECK_HEADERS([langinfo.h], [dnl
AC_CHECK_FUNCS([nl_langinfo])
])
icu_includes=""
icu_libs=""
BRLTTY_ARG_DISABLE(
[icu],
[support for Unicode-based internationalization],
[],
[dnl
BRLTTY_HAVE_PACKAGE([icu], [icu-uc], [dnl
AC_CHECK_HEADERS([unicode/unorm2.h])
AC_DEFINE_UNQUOTED([HAVE_ICU], [1],
[Define this if Unicode-based internationalization support is to be included.])
if test "${brltty_standalone_programs}" = "yes"
then
icu_libs="`echo ${icu_libs} | sed -e 's/\(-l\)\(icu\)/\1s\2/g'`"
fi
])
])
AC_SUBST([icu_includes])
AC_SUBST([icu_libs])
BRLTTY_ARG_DISABLE(
[iconv],
[support for character encoding conversion],
[],
[dnl
AC_CHECK_HEADERS([iconv.h], [
BRLTTY_HAVE_LIBRARY([iconv])
])
])
BRLTTY_ARG_DISABLE(
[polkit],
[support for the Polkit authorization manager],
[],
[dnl
BRLTTY_HAVE_PACKAGE([polkit], [polkit-gobject-1], [dnl
AC_DEFINE(HAVE_POLKIT, 1, [if the Polkit authorization manager should be used])
])
])
BRLTTY_ARG_DISABLE(
[api],
[the application programming interface],
[],
[dnl
BRLTTY_IF_PTHREADS([dnl
AC_DEFINE([ENABLE_API], [1],
[Define this if the application programming interface is to be included.])
BRLTTY_ARG_PARAMETERS([api], [application programming interface])
api_server_objects='brlapi_server.$O brlapi_keyranges.$O auth.$O'
api_libraries="${LIBS}"
all_api="all-api"
build_api="api"
install_api="install-api"
api_ref='$(API_LIBS)'
api_dynamic_library="api-dynamic-library"
install_api_libraries="install-api-libraries"
uninstall_api_libraries="uninstall-api-libraries"
default_api_socket_path="${localstatedir}/lib/BrlAPI"
case "${host_os}"
in
cygwin*|mingw*)
AC_DEFINE([BRLAPI_WIN32], [1],
[Define this if the Win32 programming interface is available.])
default_api_socket_path='\\\\.\\pipe\\BrlAPI'
api_dynamic_library="api-dynamic-library-windows"
install_api_libraries="install-api-libraries-windows"
uninstall_api_libraries="uninstall-api-libraries-windows"
;;
esac
BRLTTY_ARG_WITH(
[api-socket-path], [PATH],
[where local sockets for teh api are stored],
[api_socket_path], ["${default_api_socket_path}"]
)
BRLTTY_BINDINGS([Emacs])
BRLTTY_BINDINGS([Java])
BRLTTY_BINDINGS([Lisp])
BRLTTY_BINDINGS([Lua])
BRLTTY_BINDINGS([OCaml])
BRLTTY_BINDINGS([Python])
BRLTTY_BINDINGS([Tcl])
test -n "${api_bindings}" && {
for brltty_bindings_directory in ${api_bindings}
do
brltty_build_directories="${brltty_build_directories} Bindings/${brltty_bindings_directory}"
done
all_api_bindings="all-api-bindings"
install_api_bindings="install-api-bindings"
}
])
])
AC_SUBST([api_server_objects])
AC_SUBST([api_libraries])
AC_SUBST([api_bindings])
AC_SUBST([all_api_bindings])
AC_SUBST([install_api_bindings])
AC_SUBST([all_api])
AC_SUBST([build_api])
AC_SUBST([install_api])
AC_SUBST([api_ref])
AC_SUBST([api_dynamic_library])
AC_SUBST([install_api_libraries])
AC_SUBST([uninstall_api_libraries])
AC_SUBST([api_authkeyfile], [brlapi.key])
AC_SUBST([api_socket_path])
BRLTTY_SUMMARY_ITEM([api-socket-path], [api_socket_path])
BRLTTY_DEFINE_EXPANDED([BRLAPI_AUTHKEYFILE], ["${api_authkeyfile}"],
[Define this to be a string containing the name of BrlAPI's authorization key file.])
BRLTTY_ARG_ENABLE(
[api-fuzzing],
[fuzzing the application programming interface],
[],
[dnl
AC_CACHE_CHECK([for LLVM fuzzer], [brltty_cv_llvm_fuzzer], [dnl
HOST_CPU="`$CC -print-multiarch | sed -e 's/-.*//'`"
fuzzer_libs="`$CC -print-runtime-dir`/libclang_rt.fuzzer_no_main-$HOST_CPU.a -lstdc++ -lm"
CFLAGS="$CFLAGS -fsanitize=fuzzer-no-link -fsanitize=address,undefined -fstack-protector-strong"
LIBS="$LIBS -fsanitize=address,undefined -lubsan"
OLD_LIBS="$LIBS"
LIBS="$LIBS $fuzzer_libs"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[], [AC_MSG_ERROR([Compiler does not support fuzzing, did you set CC=clang?])])
LIBS="$OLD_LIBS"
])
AC_DEFINE([ENABLE_API_FUZZING], [1],
[Define this if the application programming interface is to be fuzzed.])
])
AC_SUBST(fuzzer_libs)
brltty_curses_libs_save="${LIBS}"
BRLTTY_PACKAGE_CHOOSE([curses],
[ncursesw ncursesw/ncurses.h],
[pdcursesw curses.h],
[ncurses ncurses.h],
[pdcursesu curses.h],
[curses curses.h],
[pdcurses curses.h])
if test -n "${curses_package}"
then
AC_CHECK_LIB([tinfo], [intrflush])
fi
curses_libs="${LIBS%${brltty_curses_libs_save}}"
LIBS="${brltty_curses_libs_save}"
AC_SUBST([curses_libs])
xkb_libs=""
xtk_libs=""
all_xbrlapi=""
install_xbrlapi=""
xsel_object=""
BRLTTY_ARG_DISABLE(
[x],
[support for X11],
[],
[dnl
BRLTTY_HAVE_PACKAGE([x11], [x11], [dnl
all_xbrlapi="all-xbrlapi"
install_xbrlapi="install-xbrlapi"
xsel_object='xsel.$O'
AC_CHECK_HEADERS([X11/keysym.h])
BRLTTY_HAVE_PACKAGE([xext], [xext], [dnl
xkb_libs="${xext_libs} ${xkb_libs}"
BRLTTY_HAVE_PACKAGE([xtst], [xtst], [dnl
xkb_libs="${xtst_libs} ${xkb_libs}"
AC_CHECK_HEADERS([X11/extensions/XTest.h])
AC_CHECK_HEADERS([X11/extensions/XKB.h])
])
BRLTTY_HAVE_PACKAGE([xfixes], [xfixes], [dnl
AC_CHECK_HEADERS([X11/extensions/Xfixes.h])
])
])
brltty_cppflags_save="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${x11_includes}"
brltty_libs_save="${LIBS}"
LIBS="${x11_libs} ${LIBS}"
AC_CHECK_FUNCS([XSetIOErrorExitHandler])
CPPFLAGS="${brltty_cppflags_save}"
LIBS="${brltty_libs_save}"
BRLTTY_HAVE_PACKAGE([xt], [xt], [dnl
xtk_libs="${xt_libs} ${xtk_libs}"
brltty_cppflags_save="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${x11_includes}"
brltty_libs_save="${LIBS}"
LIBS="${xtk_libs} ${x11_libs} ${LIBS}"
BRLTTY_PACKAGE_CHOOSE([gui_toolkit],
[Xaw X11/Xaw/Form.h X11/Xaw/Paned.h X11/Xaw/Label.h X11/Xaw/Command.h X11/Xaw/Repeater.h],
[Xaw3d X11/Xaw3d/Form.h X11/Xaw3d/Paned.h X11/Xaw3d/Label.h X11/Xaw3d/Command.h X11/Xaw3d/Repeater.h],
[neXtaw X11/neXtaw/Form.h X11/neXtaw/Paned.h X11/neXtaw/Label.h X11/neXtaw/Command.h X11/neXtaw/Repeater.h],
[XawPlus X11/XawPlus/Form.h X11/XawPlus/Paned.h X11/XawPlus/Label.h X11/XawPlus/Command.h X11/XawPlus/Repeater.h],
[Xm Xm/Xm.h Xm/Form.h Xm/PanedW.h Xm/Label.h Xm/PushB.h])
xtk_libs="${LIBS%${x11_libs} ${brltty_libs_save}}"
CPPFLAGS="${brltty_cppflags_save}"
LIBS="${brltty_libs_save}"
])
])
])
AC_SUBST([xkb_libs])
AC_SUBST([xtk_libs])
AC_SUBST([all_xbrlapi])
AC_SUBST([install_xbrlapi])
AC_SUBST([xsel_object])
test -z "$gui_toolkit_package" && {
case "${host_os}"
in
cygwin*|mingw*)
gui_toolkit_package="windows"
;;
esac
}
AC_CHECK_FUNCS([time stime gettimeofday settimeofday nanosleep])
BRLTTY_CHECK_FUNCTION([clock_gettime], [time.h], [rt])
BRLTTY_CHECK_FUNCTION([clock_settime], [time.h], [rt])
BRLTTY_CHECK_FUNCTION([pthread_getname_np], [pthread.h], [pthread])
BRLTTY_CHECK_FUNCTION([pthread_atfork], [pthread.h], [pthread])
AC_CHECK_DECLS([localtime_r], [], [], [dnl
#include <time.h>
])
AC_CHECK_HEADERS([sys/poll.h sys/select.h sys/wait.h])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([poll])
AC_CHECK_HEADERS([sys/capability.h sys/prctl.h sched.h])
AC_CHECK_HEADERS([linux/seccomp.h linux/filter.h linux/audit.h])
AC_CHECK_HEADERS([signal.h sys/signalfd.h])
AC_CHECK_FUNCS([sigaction])
AC_CHECK_HEADERS([alloca.h getopt.h regex.h termios.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([sys/file.h sys/socket.h])
AC_CHECK_HEADERS([pwd.h grp.h])
AC_CHECK_HEADERS([sys/io.h sys/modem.h machine/speaker.h dev/speaker/speaker.h linux/vt.h])
AC_CHECK_HEADERS([sdkddkver.h])
AC_CHECK_HEADERS([execinfo.h], [BRLTTY_HAVE_LIBRARY([execinfo])])
AC_CHECK_HEADERS([linux/input.h], [
AC_CHECK_HEADERS([linux/uinput.h], [], [], [
#include <linux/input.h>
])])
AC_CHECK_FUNCS([getopt_long hstrerror vsyslog])
AC_CHECK_FUNCS([realpath readlink])
AC_CHECK_FUNCS([pause])
AC_CHECK_FUNCS([fchdir fchmod])
AC_CHECK_FUNCS([shmget shm_open])
AC_CHECK_FUNCS([getpeereid getpeerucred getzoneid])
AC_CHECK_FUNCS([mempcpy wmempcpy])
case "${host_os}"
in
cygwin*|mingw*)
if test "${brltty_cv_dll_ws2_32}" = "yes"
then
BRLTTY_HAVE_WINDOWS_FUNCTION([getaddrinfo], [ws2_32])
BRLTTY_HAVE_WINDOWS_FUNCTION([getnameinfo], [ws2_32])
AC_CHECK_FUNCS([gai_strerror])
fi
AC_CHECK_TYPES([PROCESS_INFORMATION_CLASS], [], [], [
#include <windows.h>
])
AC_CHECK_DECLS([ProcessUserModeIOPL], [], [], [
#include <windows.h>
])
;;
*)
AC_CHECK_FUNCS([gai_strerror getaddrinfo getnameinfo])
;;
esac
AC_CHECK_SIZEOF([wchar_t], [], [
#include <wchar.h>
])
AC_DEFINE_UNQUOTED([SIZEOF_WCHAR_T_STR], ["${ac_cv_sizeof_wchar_t}"],
[Define this to be a string containing the size of the wchar_t type.])
BRLTTY_IF_PTHREADS([dnl
AC_DEFINE([HAVE_POSIX_THREADS], [1],
[Define this if posix threads are supported.])
])
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_OBJEXT
AC_EXEEXT