forked from scummvm/scummvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·7448 lines (6880 loc) · 203 KB
/
configure
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
#!/bin/sh
#
# configure -- custom configure script for ScummVM.
#
# ScummVM is the legal property of its developers, whose names
# are too numerous to list here. Please refer to the COPYRIGHT
# file distributed with this source distribution.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
set -a
# NLS nuisances.
LC_ALL=C
LANGUAGE=C
# Save the current environment variables for next runs
SAVED_CONFIGFLAGS=$@
SAVED_AR=$AR
SAVED_AS=$AS
SAVED_ASFLAGS=$ASFLAGS
SAVED_CPPFLAGS=$CPPFLAGS
SAVED_CXX=$CXX
SAVED_CXXFLAGS=$CXXFLAGS
SAVED_DWP=$DWP
SAVED_LD=$LD
SAVED_LDFLAGS=$LDFLAGS
SAVED_PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-unset}
SAVED_RANLIB=$RANLIB
SAVED_SDL_CONFIG=$SDL_CONFIG
SAVED_STRIP=$STRIP
SAVED_WINDRES=$WINDRES
SAVED_WINDRESFLAGS=$WINDRESFLAGS
# Use environment vars if set
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
PLUGIN_LDFLAGS=$LDFLAGS
# Backslashes into forward slashes:
# The following OS/2 specific code is performed to deal with handling of backslashes by ksh.
# Borrowed from the Sane configure script
if test "$ac_emxsupport" != "no" -a "$ac_emxsupport" != "NO"; then
ac_save_IFS="$IFS"
IFS="\\"
ac_TEMP_PATH=
for ac_dir in $PATH; do
IFS=$ac_save_IFS
if test -z "$ac_TEMP_PATH"; then
ac_TEMP_PATH="$ac_dir"
else
ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
fi
done
PATH="$ac_TEMP_PATH"
unset ac_TEMP_PATH
fi
set_var() {
eval ${1}='${2}'
}
get_var() {
eval echo \$${1}
}
append_var() {
VAR=${1}
shift
if eval test -z \"\$${VAR}\" ; then
eval ${VAR}='$@'
else
eval ${VAR}=\"\$${VAR} \"'$@'
fi
}
prepend_var() {
VAR=${1}
shift
if eval test -z \"\$${VAR}\" ; then
eval ${VAR}='$@'
else
eval ${VAR}='$@'\" \$${VAR}\"
fi
}
# Add an engine: id name build subengines base-games dependencies
add_engine() {
_engines="${_engines} ${1}"
if test "${3}" = "no" ; then
set_var _wip_engines "${_wip_engines} ${1}"
fi
set_var _engine_${1}_name "${2}"
set_var _engine_${1}_build "${3}"
set_var _engine_${1}_build_default "${3}"
set_var _engine_${1}_subengines "${4}"
set_var _engine_${1}_base "${5}"
set_var _engine_${1}_deps "${6}"
for sub in ${4}; do
set_var _engine_${sub}_sub "yes"
set_var _engine_${sub}_parent "${1}"
done
}
# Add a feature: id name settings-list
add_feature() {
set_var _feature_${1}_name "${2}"
# This is a list of settings, where one must be "yes" for the feature to
# be enabled
set_var _feature_${1}_settings "${3}"
}
_srcdir=`dirname $0`
# Read list of engines
for i in $_srcdir/engines/*/configure.engine; do
. "$i"
done
#
# Default settings
#
# Default lib behavior yes/no/auto
_sdl=no
_ogg=auto
_vorbis=auto
_sdlnet=auto
_libcurl=auto
_enet=yes
_tremor=auto
_tremolo=no
_flac=auto
_mad=auto
_opl2lpt=no
_retrowave=auto
_alsa=auto
_seq_midi=auto
_sndio=auto
_timidity=auto
_zlib=auto
_mpeg2=auto
_a52=auto
_sparkle=auto
_osxdockplugin=auto
_jpeg=auto
_png=auto
_gif=auto
_theoradec=auto
_vpx=auto
_faad=auto
_fluidsynth=auto
_fluidlite=auto
_sonivox=auto
_opengl_mode=auto
_opengl_game_classic=auto
_opengl_game_shaders=auto
_tinygl=yes
_readline=auto
_freetype2=auto
_libmikmod=auto
_libopenmpt=auto
_taskbar=auto
_updates=no
_libunity=auto
_dialogs=auto
_tts=auto
_gtk=auto
_fribidi=auto
_discord=auto
_test_cxx11=no
# Default option behavior yes/no
_debug_build=auto
_release_build=auto
_optimizations=auto
_verbose_build=no
_text_console=no
_mt32emu=yes
_lua=yes
_build_scalers=yes
_build_hq_scalers=yes
_build_edge_scalers=yes
_build_aspect=yes
_enable_prof=no
_enable_asan=no
_enable_tsan=no
_enable_ubsan=no
_bink=yes
_cloud=auto
_dlc=no
_scummvmdlc=no
_pandoc=no
_curl=yes
_lld=no
_mold=no
_gold=yes
# Default vkeybd/eventrec options
_vkeybd=no
_eventrec=no
# GUI translation options
_translation=yes
# Default platform settings
_backend=sdl
_16bit=auto
_highres=auto
_savegame_timestamp=auto
_dynamic_modules=no
_elf_loader=no
_plugins_default=static
_plugin_prefix=
_plugin_suffix=
_nasm=auto
_optimization_level=
_default_optimization_level=-O2
_nuked_opl=yes
_builtin_resources=yes
_windows_console=yes
_windows_unicode=yes
_cygwin_build=no
_ext_sse2=auto
_ext_avx2=auto
_ext_neon=auto
# Default commands
_ranlib=ranlib
_strip=strip
_ar="ar cr"
_as="as"
_dwp=dwp
_windres=windres
_ldd=ldd
_stagingpath="staging"
_amigaospath="install"
_morphospath="PROGDIR:"
_staticlibpath=
_xcodetoolspath=
_sparklepath=
_pkgconfig=pkg-config
_sdlconfig=sdl2-config
_libcurlconfig=curl-config
_libmikmodconfig=libmikmod-config
_freetypeconfig=freetype-config
_freetype_found="false"
_sdlpath="$PATH"
_freetypepath="$PATH"
_libcurlpath="$PATH"
_libmikmodpath="$PATH"
_libopenmptpath="$PATH"
_nasmpath="$PATH"
NASMFLAGS=""
NASM=""
_tainted_build=no
_pandocformat="default"
_pandocext="default"
_manualversion="latest"
# Detection features to be linked into executable or not
_detection_features_static=yes
_detection_features_full=yes
# The following variables are automatically detected, and should not
# be modified otherwise. Consider them read-only.
_posix=no
_has_posix_spawn=no
_has_fseeko_offt_64=no
_has_fseeko64=no
_has_fopen64=no
_endian=unknown
_need_memalign=yes
_have_x86=no
_have_amd64=no
_imgui=yes
# Add (virtual) features
add_feature 16bit "16bit color" "_16bit"
add_feature bink "Bink" "_bink"
add_feature cloud "cloud" "_cloud"
add_feature faad "libfaad" "_faad"
add_feature flac "FLAC" "_flac"
add_feature freetype2 "FreeType2" "_freetype2"
add_feature highres "high resolution" "_highres"
add_feature mad "MAD" "_mad"
add_feature jpeg "JPEG" "_jpeg"
add_feature mpeg2 "mpeg2" "_mpeg2"
add_feature opengl_game_classic "OpenGL (classic)" "_opengl_game_classic"
add_feature opengl_game_shaders "OpenGL with shaders" "_opengl_game_shaders"
add_feature png "PNG" "_png"
add_feature gif "GIF" "_gif"
add_feature theoradec "libtheoradec" "_theoradec"
add_feature tinygl "TinyGL" "_tinygl"
add_feature vpx "libvpx" "_vpx"
add_feature vorbis "Vorbis file support" "_vorbis _tremor"
add_feature zlib "zlib" "_zlib"
add_feature lua "lua" "_lua"
add_feature fribidi "FriBidi" "_fribidi"
add_feature test_cxx11 "Test C++11" "_test_cxx11"
add_feature imgui "imgui" "_imgui"
# Directories for installing ScummVM.
# This list is closely based on what GNU autoconf does,
# although the default value for datadir differs.
# Like GNU autoconf, we distinguish datadir and datarootdir
# to make it possible to change e.g. the location of the
# man pages independently of that of the engine data files,
# which are placed inside $datadir/scummvm
prefix=NONE
exec_prefix=NONE
bindir='${exec_prefix}/bin'
libdir='${exec_prefix}/lib'
datarootdir='${prefix}/share'
datadir='${datarootdir}/scummvm'
mandir='${datarootdir}/man'
docdir='${datarootdir}/doc/scummvm'
#localedir='${datarootdir}/locale'
# For cross compiling
_host=""
_host_cpu=""
_host_vendor=""
_host_os=""
_host_alias=""
_port_mk="ports.mk"
# Use temp files in the build directory
TMPO=./scummvm-conf
TMPC=${TMPO}.cpp
TMPLOG=config.log
cc_check_no_clean() {
echo >> "$TMPLOG"
cat "$TMPC" >> "$TMPLOG"
echo >> "$TMPLOG"
echo "$CXX $LDFLAGS $CXXFLAGS $TMPC -o $TMPO$HOSTEXEEXT $@" >> "$TMPLOG"
rm -f "$TMPO$HOSTEXEEXT"
if test "-c" = "$*" ; then
( $CXX $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
else
( $CXX $LDFLAGS $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
fi
TMPR="$?"
echo "return code: $TMPR" >> "$TMPLOG"
echo >> "$TMPLOG"
return "$TMPR"
}
cc_check_clean() {
rm -rf $TMPC $TMPO $TMPO.o $TMPO.dwo $TMPO.dSYM $TMPO$HOSTEXEEXT "$@"
}
cc_check() {
cc_check_no_clean "$@"
TMPR="$?"
cc_check_clean
return "$TMPR"
}
cc_check_define() {
cat > $TMPC << EOF
int main(void) {
#ifndef $1
syntax error
#endif
return 0;
}
EOF
cc_check -c
return $?
}
gcc_get_define() {
echo "" | $CXX -dM -E - | grep -F "$1" | head -n1 | cut -d ' ' -f 3-
}
#
# Function to provide echo -n for bourne shells that don't have it
#
echo_n() {
printf "$@"
}
echocheck() {
echo_n "Checking for $@... "
}
# Add a line of data to config.mk.
add_line_to_config_mk() {
_config_mk_data="$_config_mk_data"'
'"$1"
}
# Add a line of data to config.h.
add_line_to_config_h() {
_config_h_data="$_config_h_data"'
'"$1"
}
# Conditionally add a line of data to config.h. Takes two parameters:
# The first one can be set to 'no' to "comment out" the line, i.e.
# make it ineffective, use 'yes' otherwise.
# The second param is the line to insert.
add_to_config_h_if_yes() {
if test "$1" = yes ; then
add_line_to_config_h "$2"
else
add_line_to_config_h "/* $2 */"
fi
}
# Conditionally add a line of data to config.mk. Takes two parameters:
# The first one can be set to 'no' to "comment out" the line, i.e.
# make it ineffective, use 'yes' otherwise.
# The second param is the line to insert.
add_to_config_mk_if_yes() {
if test "$1" = yes ; then
add_line_to_config_mk "$2"
else
add_line_to_config_mk "# $2"
fi
}
# Conditionally add a '#define' line to config.h. Takes two parameters:
# The first one can be set to 'yes' or 'no'. If 'yes' is used, then
# the line "#define $2" is added to config.h, otherwise "#undef $2".
define_in_config_h_if_yes() {
if test "$1" = yes ; then
add_line_to_config_h "#define $2"
else
add_line_to_config_h "#undef $2"
fi
}
# Conditionally add definitions to config.h and config.mk. Takes two parameters:
# The first one can be set to 'yes' or 'no'. If 'yes' is used, then
# the line "#define $2" is added to config.h and "$2 = 1" to config.mk.
# Otherwise "#undef $2" is added to config.h and "# $2 = 1" to config.mk
define_in_config_if_yes() {
if test "$1" = yes ; then
add_line_to_config_h "#define $2"
add_line_to_config_mk "$2 = 1"
else
add_line_to_config_h "#undef $2"
add_line_to_config_mk "# $2 = 1"
fi
}
define_in_config_if_no() {
if test "$1" = no ; then
add_line_to_config_h "#define $2"
add_line_to_config_mk "$2 = 1"
else
add_line_to_config_h "#undef $2"
add_line_to_config_mk "# $2 = 1"
fi
}
#
# Determine sdl-config
#
# TODO: small bit of code to test sdl usability
find_sdlconfig() {
echo_n "Looking for sdl-config... "
sdlconfigs="$SDL_CONFIG:$_sdlconfig:sdl2-config:sdl12-config:sdl11-config:sdl-config"
_sdlconfig=
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
for path_dir in $_sdlpath; do
#reset separator to parse sdlconfigs
IFS=":"
for sdlconfig in $sdlconfigs; do
if test -f "$path_dir/$sdlconfig" ; then
_sdlconfig="$path_dir/$sdlconfig"
echo $_sdlconfig
# break at first sdl-config found in path
break 2
fi
done
done
IFS="$ac_save_ifs"
if test -z "$_sdlconfig"; then
echo "none found!"
exit 1
fi
}
#
# Determine freetype-config
#
find_freetypeconfig() {
echo_n "Looking for freetype-config... "
freetypeconfigs="$_freetypeconfig"
_freetypeconfig=
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
for path_dir in $_freetypepath; do
#reset separator to parse freetypeconfigs
IFS=":"
for freetypeconfig in $freetypeconfigs; do
if test -f "$path_dir/$freetypeconfig" ; then
_freetypeconfig="$path_dir/$freetypeconfig"
echo $_freetypeconfig
# Save the prefix
_freetypepath=$path_dir
if test `basename $path_dir` = bin ; then
_freetypepath=`dirname $path_dir`
fi
# break at first freetype-config found in path
break 2
fi
done
done
IFS="$ac_save_ifs"
if test -z "$_freetypeconfig"; then
echo "none found!"
fi
}
#
# Determine curl-config
#
find_libcurlconfig() {
echo_n "Looking for curl-config... "
libcurlconfigs="$_libcurlconfig"
_libcurlconfig=
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
for path_dir in $_libcurlpath; do
#reset separator to parse sdlconfigs
IFS=":"
for libcurlconfig in $libcurlconfigs; do
if test -f "$path_dir/$libcurlconfig" ; then
_libcurlconfig="$path_dir/$libcurlconfig"
echo $_libcurlconfig
# Save the prefix
_libcurlpath=$path_dir
if test `basename $path_dir` = bin ; then
_libcurlpath=`dirname $path_dir`
fi
# break at first curl-config found in path
break 2
fi
done
done
IFS="$ac_save_ifs"
if test -z "$_libcurlconfig"; then
echo "none found!"
fi
}
#
# Determine libmikmod-config
#
find_libmikmodconfig() {
echo_n "Looking for mikmod-config... "
libmikmodconfigs="$_libmikmodconfig"
_libmikmodconfig=
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
for path_dir in $_libmikmodpath; do
#reset separator to parse mikmodconfig
IFS=":"
for libmikmodconfig in $libmikmodconfigs; do
if test -f "$path_dir/$libmikmodconfig" ; then
_libmikmodconfig="$path_dir/$libmikmodconfig"
echo $_libmikmodconfig
# Save the prefix
_libmikmodpath=$path_dir
if test `basename $path_dir` = bin ; then
_libmikmodpath=`dirname $path_dir`
fi
# break at first mikmod-config found in path
break 2
fi
done
done
IFS="$ac_save_ifs"
if test -z "$_libmikmodconfig"; then
echo "none found!"
fi
}
#
# Determine extension used for executables
#
get_system_exe_extension() {
case $1 in
riscos)
_exeext=",e1f"
;;
3ds | dreamcast | ds | gamecube | n64 | psp | switch | wii)
_exeext=".elf"
;;
kolibrios | kos32)
_exeext=".dll"
;;
mingw* | *os2-emx)
_exeext=".exe"
;;
mint)
if test "$_backend" = "atari"; then
# ATARI backend
_exeext=".ttp"
else
# SDL backend
_exeext=".gtp"
fi
;;
emscripten)
_exeext=".html"
;;
*)
_exeext=""
;;
esac
}
#
# Generic options functions
#
# Show the configure help line for an option
option_help() {
option=$(echo "${3:---}${1} " | sed -e "s/\(.\{23\}\).*/\1/" -e "s/_/-/g")
echo " ${option} ${2}"
}
# Show an error about an unknown option
option_error() {
echo "error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
exit 1
}
# Show an error about an unknown engine
engine_option_error() {
echo "error: unrecognized engine: $1
Try \`$0 --help' for more information." >&2
exit 1
}
# Show an error about an invalid subengine option
subengine_option_error() {
echo "error: this option is invalid for the subengine $1: $ac_option
Try \`$0 --help' for more information." >&2
exit 1
}
#
# Engine handling functions
#
# Get the name of the engine
get_engine_name() {
get_var _engine_$1_name
}
# Will this engine be built?
get_engine_build() {
get_var _engine_$1_build
}
# Was this engine set to be built by default?
get_engine_build_default() {
get_var _engine_$1_build_default
}
# Get the subengines
get_engine_subengines() {
get_var _engine_$1_subengines
}
# Ask if this is a subengine
check_is_subengine() {
if test -z "$(get_var _engine_$1_sub)" ; then
return 1
fi
return 0
}
# Get a subengine's parent (undefined for non-subengines)
get_subengine_parent() {
get_var _engine_$1_parent
}
# Enable *all* engines
engine_enable_all() {
for engine in $_engines; do
set_var _engine_${engine}_build "yes"
done
}
# Disable *all* engines
engine_disable_all() {
for engine in $_engines; do
set_var _engine_${engine}_build "no"
done
}
# Enable all unstable engines
engine_enable_all_unstable() {
for engine in $_engines; do
engine_build_default=`get_engine_build_default $engine`
if test $engine_build_default = no ; then
set_var _engine_${engine}_build "yes"
fi
done
}
# Disable all unstable engines
engine_disable_all_unstable() {
for engine in $_engines; do
engine_build_default=`get_engine_build_default $engine`
if test $engine_build_default = no ; then
set_var _engine_${engine}_build "no"
fi
done
}
# Enable the given engine
engine_enable() {
# Get the parameter
if ( echo $1 | grep ':' ) 2> /dev/null > /dev/null ; then
eng=`echo $1 | cut -d ':' -f 1`
opt=`echo $1 | cut -d ':' -f 2`
else
eng=$1
opt=yes
fi
engine=`echo $eng | sed 's/-/_/g'`
# Filter the parameter for the subengines
if check_is_subengine ${engine} ; then
if test "$opt" != "yes" ; then
subengine_option_error ${engine}
return
fi
parent=`get_subengine_parent ${engine}`
if test `get_engine_build ${parent}` = "no" ; then
set_var _engine_${parent}_build "yes"
fi
fi
if test "$opt" != "static" -a "$opt" != "dynamic" -a "$opt" != "yes" ; then
option_error
return
fi
subengines=
if test "${engine%_all}" != "${engine}" ; then
engine="${engine%_all}"
subengines=$(get_engine_subengines ${engine})
if test "$subengines" = "" ; then
engine_option_error "${engine}*"
return
fi
fi
if test "`get_engine_name ${engine}`" = "" ; then
engine_option_error ${engine}
return
fi
set_var _engine_${engine}_build "$opt"
for subengine in $subengines ; do
set_var _engine_${subengine}_build "$opt"
done
}
# Disable the given engine
engine_disable() {
# Filter malformed options
if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
option_error
return
fi
engine=`echo $1 | sed 's/-/_/g'`
if test "`get_engine_name ${engine}`" != "" ; then
set_var _engine_${engine}_build "no"
else
engine_option_error ${engine}
fi
}
# Show the configure help line for a given engine
show_engine_help() {
name=`get_engine_name $1`
option_help "${1}" "${name} engine" " "
for sub in `get_engine_subengines $1`; do
show_subengine_help $sub $1
done
}
# Show the configure help line for a given subengine
show_subengine_help() {
name=`get_engine_name $1`
parent=`get_engine_name $2`
option_help "- ${1}" "${name} in ${parent} engine" " "
}
# Copy first argument to second one if they are different. Otherwise, delete the first one.
# Touch the optional third argument on change
copy_if_changed() {
if cmp -s $1 $2; then
rm -f $1
else
mv -f $1 $2
if test -n "$3" ; then
touch "$3"
fi
fi
}
#
# Check any parameters we received
#
# TODO:
# * Change --disable-mad / --enable-mad to the way it's done in autoconf:
# That is, --without-mad / --with-mad=/prefix/to/mad. Useful for people
# who have Mad/Vorbis/ALSA installed in a non-standard locations.
#
for parm in "$@" ; do
if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
for engine in $_engines; do
if ! check_is_subengine $engine ; then
engines_help="$engines_help`show_engine_help $engine`
"
fi
done
cat << EOF
Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
--backend=BACKEND backend to build (3ds, atari, android, dc, dingux, ds, gcw0,
ios7, maemo, n64, null, opendingux, openpandora,
psp, psp2, samsungtv, sdl, switch, wii) [sdl]
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
an installation prefix other than \`/usr/local' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--libdir=DIR object code libraries [EPREFIX/lib]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data
[DATAROOTDIR/scummvm]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/scummvm]
Special configuration feature:
--host=HOST cross-compile to target HOST (arm-linux, ...)
special targets: 3ds for Nintendo 3DS
android-arm-v7a for Android ARMv7-A (armeabi-v7a)
android-arm64-v8a for Android ARMv8-A (arm64-v8a)
android-x86 for Android x86
android-x86_64 for Android x86_64
dingux for Dingux
raspberrypi for Raspberry Pi
dreamcast for Sega Dreamcast
ds for Nintendo DS
gamecube for Nintendo GameCube
gcw0 for GCW Zero
ios7 for Apple iPhone / iPad (iOS >= 7)
ios7-arm64 for Apple iPhone / iPad (iOS >= 7, 64-bit)
kos32 for Kolibri OS
maemo for Nokia Maemo
miyoo for 1st generation Miyoo
miyoomini for Miyoo Mini
n64 for Nintendo 64
opendingux-gcw0 for GCW0 with Opendingux Beta
opendingux-lepus for Lepus with Opendingux Beta
opendingux-rs90 for RS90 and RG99 with Opendingux Beta
openpandora for OpenPandora
ouya for OUYA
ps3 for PlayStation 3
psp2 for PlayStation Vita
psp for PlayStation Portable
samsungtv for Samsung TV
switch for Nintendo Switch
tvos for Apple TV (tvOS 9.0+)
wasm32-unknown-emscripten for WebAssembly
wii for Nintendo Wii
Game engines:
--enable-all-engines enable all engines, including those which are
broken or unsupported
--disable-all-engines disable all engines
--enable-all-unstable-engines enable the engines which are
broken or unsupported
--disable-all-unstable-engines disable only the engines which are
broken or unsupported
--enable-engine=<engine name>[,<engine name>...] enable engine(s) listed
--disable-engine=<engine name>[,<engine name>...] disable engine(s) listed
--enable-engine-static=<engine name>[,<engine name>...]
enable engine(s) listed as static builtin (when plugins are enabled)
--enable-engine-dynamic=<engine name>[,<engine name>...]
enable engine(s) listed as dynamic plugin (when plugins are enabled)
The values of <engine name> for these options are as follows:
$engines_help
Optional Features:
--enable-static build a static binary instead of using shared objects
--enable-detection-static build detection features into executable (default)
--enable-detection-dynamic build detection features into a library
--disable-detection-full add detection only for the engines which were enabled
--disable-debug disable building with debugging symbols
--enable-Werror treat warnings as errors
--enable-release enable building in release mode (this activates
optimizations)
--enable-release-mode enable building in release mode (without optimizations)
--enable-optimizations enable optimizations
--enable-asan enable Address Sanitizer for memory-related debugging
--enable-tsan enable Thread Sanitizer for thread-related debugging
--enable-ubsan enable Undefined Behavior Sanitizer for undefined-behavior-related debugging
--enable-profiling enable profiling
--enable-plugins enable the support for dynamic plugins
--default-dynamic make plugins dynamic by default
--disable-mt32emu don't enable the integrated MT-32 emulator
--disable-lua don't enable Lua support
--disable-nuked-opl don't build Nuked OPL driver
--disable-16bit don't enable 16bit color support
--disable-highres don't enable support for high resolution engines >320x240
--disable-savegame-timestamp don't use timestamps for blank savegame descriptions
--disable-scalers exclude scalers
--disable-hq-scalers exclude HQ2x and HQ3x scalers (disables Edge scalers as well)
--disable-edge-scalers exclude Edge2x and Edge3x scalers
--disable-aspect exclude aspect ratio correction
--disable-translation don't build support for translated messages
--disable-taskbar don't build support for taskbar and launcher integration
--disable-cloud don't build cloud support
--disable-system-dialogs don't build support for system dialogs
--enable-vkeybd build virtual keyboard support
--enable-dlc build scummvm dlc downloading support
--enable-scummvmdlc build scummvm dlc downloading support using ScummVM Cloud
--enable-eventrecorder enable event recording functionality
--disable-eventrecorder disable event recording functionality
--enable-updates build support for updates
--enable-text-console use text console instead of graphical console
--enable-verbose-build enable regular echoing of commands during build
process
--enable-tts build support for text to speech
--disable-tts don't build support for text to speech
--disable-bink don't build with Bink video support
--opengl-mode=MODE OpenGL (ES) mode to use for OpenGL output [auto]
available modes: auto for autodetection
none for disabling any OpenGL usage
any for runtime detection
gl for forcing OpenGL
gles for forcing OpenGL ES
gles2 for forcing OpenGL ES 2
WARNING: only specify this manually if you know what
you are doing!
--no-builtin-resources do not include additional resources (e.g. engine data, fonts)
into the ScummVM binary
--enable-windows-console show console output on Windows (default)
--disable-windows-console do not show console output on Windows
--enable-windows-unicode use Windows Unicode APIs (default)
--disable-windows-unicode use Windows ANSI APIs
--enable-ext-sse2 allow code to use sse2 extensions on x86/amd64
--enable-ext-avx2 allow code to use avx2 extensions on x86/amd64
--enable-ext-neon allow code to use neon extensions on ARM
Optional Documentation Options:
--with-manual-version=VERSION version to use when generating the manual (optional)
--with-pandoc-format=FORMAT pandoc format to use during the conversion (optional)
Optional Libraries:
--with-alsa-prefix=DIR prefix where alsa is installed (optional)
--disable-alsa disable ALSA midi sound support [autodetect]
--with-ogg-prefix=DIR prefix where libogg is installed (optional)