-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
3981 lines (3453 loc) · 138 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 This file is part of VICE, the Versatile Commodore Emulator.
dnl See README for copyright notice.
dnl
dnl Process this file with GNU autoconf to produce a configure script.
dnl
dnl Set VICE version number.
dnl ONLY bump this on release, any revision in the version string indicates
dnl a development version. Don't add any strings to the version number (such
dnl as '-dev' or 'beta'), the '-r$SVNREV' revision string is the only thing we
dnl alllow after the version number.
m4_define(vice_version_major, 3)
m4_define(vice_version_minor, 7)
m4_define(vice_version_build, 1)
dnl Some people lose their shit if a version ends in .0
dnl also turns out some people lose it if it doesn't :)
m4_define(vice_version,
ifelse(vice_version_build, 0,
ifelse(vice_version_label, ,
[vice_version_major.vice_version_minor],
[vice_version_major.vice_version_minor]),
ifelse(vice_version_label, ,
[vice_version_major.vice_version_minor.vice_version_build],
[vice_version_major.vice_version_minor.vice_version_build])))
dnl The major/minor stuff gets replaced in autogen.sh
AC_INIT([vice], [vice_version])
dnl We save the command line options here since AM_INIT_AUTOMAKE and other
dnl macros clobber $@:
cmdline_options="$@"
AC_CONFIG_SRCDIR([src/maincpu.c])
AM_INIT_AUTOMAKE([-Wno-portability foreign])
dnl Make sure autotools doesn't add '-g -O2' by default when the user's CFLAGS
dnl or CXXFLAGS are empty
dnl This has to happen before any other AC_* calls, so leave it here please.
: ${CFLAGS=""}
: ${CXXFLAGS=""}
: ${OBJCFLAGS=""}
dnl Set VICE's compiler flags (can be overridden by the user)
VICE_CPPFLAGS="-I\$(top_srcdir)/src/arch/systemheaderoverride"
VICE_CFLAGS="-g -O3"
VICE_CXXFLAGS="-g -O3"
VICE_OBJCFLAGS="-g -O3"
VICE_LDFLAGS=""
dnl Avoid "ar: `u' modifier ignored since `D' is the default (see `U')" warning
dnl caused by a longstanding bug in libtool.
dnl See https://github.com/rsyslog/rsyslog/issues/1179 for some details.
: ${ARFLAGS="cr"}
: ${AR_FLAGS="cr"}
AC_SUBST(ARFLAGS)
AC_SUBST(AR_FLAGS)
AC_CONFIG_MACRO_DIR([m4])
dnl Make version number visible to generated files and source
VICE_VERSION_MAJOR=vice_version_major
VICE_VERSION_MINOR=vice_version_minor
VICE_VERSION_BUILD=vice_version_build
VICE_VERSION=vice_version
VERSION_RC="$VICE_VERSION_MAJOR,$VICE_VERSION_MINOR,$VICE_VERSION_BUILD,0"
VERSION_COMBINED=`expr $VICE_VERSION_MAJOR \* 65536 + $VICE_VERSION_MINOR \* 256 + $VICE_VERSION_BUILD`
AC_SUBST(VICE_VERSION_MAJOR)
AC_SUBST(VICE_VERSION_MINOR)
AC_SUBST(VICE_VERSION_BUILD)
AC_SUBST(VICE_VERSION)
AC_SUBST(VERSION_RC)
AC_SUBST(VERSION_COMBINED)
dnl Command-line options
dnl
dnl The whitespace (2 spaces) before --with[out]-option is significant, as is
dnl the whitespace before the option description, in order to align these
dnl properly with the auto-generated options of configure.ac
VICE_ARG_INIT()
dnl
dnl Sound options
dnl
VICE_ARG_WITH_LIST(alsa, [ --without-alsa do not use the ALSA sound system])
VICE_ARG_WITH_LIST(fastsid, [ --with-fastsid use the FastSID engine])
VICE_ARG_WITH_LIST(flac, [ --with-flac use FLAC support])
VICE_ARG_WITH_LIST(mpg123, [ --with-mpg123 use MPG123 support])
VICE_ARG_WITH_LIST(oss, [ --with-oss use the OSS sound system])
VICE_ARG_WITH_LIST(pulse, [ --without-pulse do not use PulseAudio sound system])
VICE_ARG_WITH_LIST(resid, [ --without-resid do not use the reSID engine])
VICE_ARG_WITH_LIST(sdlsound, [ --with-sdlsound use SDL sound system])
VICE_ARG_WITH_LIST(sun, [ --without-sun do not use the sun/netbsd sound system])
VICE_ARG_WITH_LIST(vorbis, [ --with-vorbis use Ogg/Vorbis support])
VICE_ARG_ENABLE_LIST(catweasel, [ --enable-catweasel enables CatWeasel (PCI/Zorro/Clockport SID card) support])
VICE_ARG_ENABLE_LIST(hardsid, [ --disable-hardsid disables HardSID support])
VICE_ARG_ENABLE_LIST(lame, [ --enable-lame Enable MP3 export with LAME])
VICE_ARG_ENABLE_LIST(midi, [ --enable-midi enable MIDI support])
VICE_ARG_ENABLE_LIST(new8580filter, [ --disable-new8580filter disable new 8580 filters])
VICE_ARG_ENABLE_LIST(parsid, [ --enable-parsid enables ParSID support])
VICE_ARG_ENABLE_LIST(portaudio, [ --disable-portaudio disables PortAudio support])
VICE_ARG_ENABLE_LIST(ssi2001, [ --enable-ssi2001 enables SSI2001 (ISA SID card) support])
VICE_ARG_ENABLE_LIST(static-lame, [ --enable-static-lame enable static LAME linking])
dnl
dnl Graphics options
dnl
VICE_ARG_WITH_LIST(gif, [ --with-gif use GIF screenshot system])
VICE_ARG_WITH_LIST(png, [ --without-png do not use the PNG screenshot system])
VICE_ARG_ENABLE_LIST(ffmpeg, [ --enable-ffmpeg enable FFmpeg support])
dnl Only supported for SDL1
VICE_ARG_ENABLE_LIST(hwscale, [ --disable-hwscale disables GPU scaling of emulated screen (SDL1 UI only)])
dnl
dnl Misc build options
dnl
VICE_ARG_WITH_LIST(readline, [ --without-readline do not try to use the system readline library])
VICE_ARG_WITH_LIST(zlib, [ --without-zlib do not use the zlib support])
VICE_ARG_ENABLE_LIST(arch, [ --enable-arch[[=arch]] enable architecture specific compilation [[default=yes]]], [], [enable_arch=yes])
VICE_ARG_ENABLE_LIST(cpuhistory, [ --disable-cpuhistory disable the 65xx cpu history feature])
VICE_ARG_ENABLE_LIST(ethernet, [ --enable-ethernet enables The Final Ethernet emulation])
VICE_ARG_ENABLE_LIST(ipv6, [ --disable-ipv6 disables the checking for IPv6 compatibility])
VICE_ARG_ENABLE_LIST(libieee1284, [ --enable-libieee1284 enables libieee1284 support])
VICE_ARG_ENABLE_LIST(no-pic, [ --enable-no-pic enable the use of the no-pic switch [[default=yes]]])
VICE_ARG_ENABLE_LIST(realdevice, [ --disable-realdevice disables access to real peripheral devices (CBM4Linux/OpenCBM)])
VICE_ARG_ENABLE_LIST(rs232, [ --disable-rs232 disable RS232 support])
VICE_ARG_ENABLE_LIST(openmp, [ --disable-openmp disable OpenMP acceleration])
dnl
dnl Developer options
dnl
VICE_ARG_ENABLE_LIST(cmake, [ --enable-cmake enable generation of CMakeLists.txt files [[default=no]]])
VICE_ARG_ENABLE_LIST(debug, [ --enable-debug enable debug source options])
VICE_ARG_ENABLE_LIST(debug-gtk3ui, [ --enable-debug-gtk3ui enables debugging for the GTK3 UI])
VICE_ARG_ENABLE_LIST(debug-threads, [ --enable-debug-threads enable debug messages about the threading code [[default=no]]])
VICE_ARG_ENABLE_LIST(x64, [ --enable-x64 enable building of the old x64 emulator [[default=no]]])
VICE_ARG_ENABLE_LIST(x64-image, [ --enable-x64-image enable X64 image support [[default=no]]])
VICE_ARG_ENABLE_LIST(optimization, [ --disable-optimization disable code optimization by passing -O0 [[default=no]]])
VICE_ARG_ENABLE_LIST(extra-warnings, [ --enable-extra-warnings enable anal warnings [[default=no]]])
VICE_ARG_ENABLE_LIST(io-simulation, [ --enable-io-simulation enable i/o simulation devices [[default=no]]])
dnl Temporary for something mysterious
VICE_ARG_WITH_LIST(libcurl, [ --with-libcurl enable libcurl support [[default=no]]])
dnl
dnl UI options
dnl
VICE_ARG_ENABLE_LIST(headlessui, [ --enable-headlessui enables building without a UI])
VICE_ARG_ENABLE_LIST(sdl1ui, [ --enable-sdl1ui enables SDL 1.2 UI support])
VICE_ARG_ENABLE_LIST(sdl2ui, [ --enable-sdl2ui enables SDL 2.x UI support])
VICE_ARG_ENABLE_LIST(gtk3ui, [ --enable-gtk3ui enables GTK3 UI support])
dnl If enabled, tries to install XDG .desktop files for running the binaries
dnl from a desktop menu. Only supported for Unix with the exception of MacOS.
dnl Gtk3 only.
VICE_ARG_ENABLE_LIST(desktop-files, [ --enable-desktop-files enable installation of XDG desktop files (GTK3 UI only)])
VICE_ARG_ENABLE_LIST(hidmgr, [ --disable-hidmgr disable IOHIDManager joystick support on Mac])
dnl
dnl Documentation options
dnl
VICE_ARG_ENABLE_LIST(html-docs, [ --disable-html-docs do not generate the HTML documentation [[default=no]]])
VICE_ARG_ENABLE_LIST(pdf-docs, [ --enable-pdf-docs generate the PDF documentation [[default=if possible]]])
VICE_ARG_ENABLE_LIST(platformdox, [ --enable-platformdox enable generating of documentation specific to the current host])
dnl
dnl Check for disabling compiler optimization with --disable-optimization
dnl
if test x"$enable_optimization" = "xno"; then
VICE_CFLAGS="-g -O0"
VICE_CXXFLAGS="-g -O0"
VICE_OBJCFLAGS="-g -O0"
fi
AC_ARG_VAR(FW_DIR, [Location of support frameworks (macOS only)])
dnl check for conflicting options
VICE_ARG_LIST_AT_MOST_ONE([--enable-sdlui --enable-sdlui2 --enable-gtk3ui --enable-headlessui], [UI])
AS_IF([test x"$enable_gtk3ui" = "xno" -a x"$enable_sdl1ui" = "xno" -a x"$enable_sdl2ui" = "xno" -a x"$enable_headlessui" = "xno"],
[AC_MSG_ERROR([You cannot disable all GUIs])])
dnl Try to find out which system we are on...
AC_CANONICAL_HOST
dnl Check for the existence of various programs that VICE and its component systems use
dnl Find compiler
AC_PROG_CC([cc gcc clang])
dnl Make sure the compiler supports C99 at a minimum
AC_PROG_CC_C99
AS_IF([test x"$ac_cv_prog_cc_c99" = "xno"],
[AC_MSG_ERROR([A C99-compliant compiler is required.])])
dnl Force C99-compliance
dnl Currently breaks some code depending on POSIX/BSD functions, for that
dnl we'll have to pass -D_BSD_SOURCE or a similar define to the compiler,
dnl before #including any header. So for now this is disabled.
dnl VICE_CFLAGS="$VICE_CFLAGS -std=c99"
AC_PROG_CPP
dnl C++ check, at least C++11
AC_PROG_CXX([c++ g++ clang++])
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
AC_PROG_CXXCPP
AC_PROG_OBJC([cc gcc clang])
dnl Try global compiler warnings
dnl
dnl Temporarily removed:
dnl -Wextra (enables -Wsign-compare)
dnl -Wswitch-default
dnl -Wswitch-enum
dnl -Wconversion
dnl -Wredundant-decls
dnl -Wnested-externs
dnl -Wcast-qual
dnl -Wcast-align
dnl -Wsign-compare
dnl
dnl (Commenting these out in the following list makes configure barf)
dnl
dnl NOTE - before you optimise away the weird SUCCESS_CFLAGS thing, understand the following:
dnl clang doesn't exit with an error for an unsupported warning flag by default.
dnl clang has -Werror=x to promote a warning to an error, but gcc treats that as an error
dnl clang and gcc both support -Werror to promote all warnings to errors
dnl initialising and returning the value of arse removes the gcc warning that arse isn't used.
dnl So, until a better solution is found, -Werror is added while testing -W flag support.
dnl
dnl Warnings added to C should also be added to C++ compiler list. Except these ones because novte:
dnl -Wstrict-prototypes (g++ warning: "cc1plus: -Wstrict-prototypes is only valid of C/ObjC not C++" - but zero exit code)
dnl -Wformat-signedness (novte warnings - these could be addressed with source changes)
dnl
dnl C++ warnings implied by other settings but explicitly disabled:
dnl -Waddress-of-packed-member (novte warnings)
dnl -Wchar-subscripts (novte warnings)
dnl
dnl -Wunused-but-set-variable is enabled by -Wall in GCC >= 4.6 but doesn't
dnl exist in clang < 13.0. clang-tidy implements this check though, so our
dnl Github code analysis runner should find these issues pre-clang 13.
dnl
m4_foreach([flag],
[[-W],
[-Wall],
[-Wextra],
[-Wformat],
[-Wformat-signedness],
[-Wformat-pedantic],
[-Wformat-security],
[-Wshadow],
[-Wpointer-arith],
[-Wmissing-prototypes],
[-Wstrict-prototypes],
[-Wuninitialized],
[-Wunreachable-code],
[-Wmacro-redefined],
[-Werror=implicit-function-declaration],
[-Wfatal-errors],
[-fdiagnostics-absolute-paths],
[-Wshorten-64-to-32],
[-Wdiscarded-qualifiers],
[-Wno-unknown-pragmas],
[-Wunused-but-set-variable]],
[TEST_FLAG=flag
VICE_CFLAG_REQUEST([$TEST_FLAG])
])
dnl Disable extra warnings if requested
dnl
dnl Enabled by default, disable with `--disable-extra-warnings`
if test x"$enable_extra_warnings" != "xyes"; then
m4_foreach([flag],
[[-Wno-sign-compare],
[-Wno-missing-field-initializers],
[-Wno-ignored-qualifiers],
[-Wno-unused-parameter]],
[TEST_FLAG=flag
VICE_CFLAG_REQUEST([$TEST_FLAG])
])
fi
dnl Check C++ flags
m4_foreach([flag],
[[-Wall],
[-Wformat],
[-Wformat-pedantic],
[-Wshadow],
[-Wpointer-arith],
[-Wuninitialized],
[-Wunreachable-code],
[-Wno-unused-parameter],
[-Wmissing-prototypes],
[-Werror=implicit-function-declaration],
[-Wfatal-errors],
[-fdiagnostics-absolute-paths],
[-Wshorten-64-to-32]],
[TEST_FLAG=flag
VICE_CXXFLAG_REQUEST([$TEST_FLAG])
])
dnl VTE specific C++ flags
VTE_CXXFLAGS=""
m4_foreach([flag],
[[-Wno-address-of-packed-member],
[-Wno-char-subscripts],
[-Wno-format-signedness],
[-Wno-missing-prototypes],
[-Wno-c99-designator],
[-Wno-shorten-64-to-32],
[-Wno-nonnull-compare]],
[TEST_FLAG=flag
VICE_CXXFLAG_REQUEST([$TEST_FLAG], [VTE_CXXFLAGS])
])
AC_SUBST(VTE_CXXFLAGS)
dnl Monitor specific flags (due to the code generated by yacc/lex)
MONITOR_CFLAGS=""
m4_foreach([flag],
[[-Wno-unused-label],
[-Wno-unreachable-code],
[-Wno-misleading-indentation]],
[TEST_FLAG=flag
VICE_CFLAG_REQUEST([$TEST_FLAG], [MONITOR_CFLAGS])
])
AC_SUBST(MONITOR_CFLAGS)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LEX
AS_IF([test x"$LEX" = "x:"], [AC_MSG_ERROR([Could not find either flex or lex!])])
AC_LIB_PROG_LD
AC_CHECK_PROG(AR, ar, ar, ar)
AC_CHECK_PROG(SVN, svn, svn, :)
AC_CHECK_PROG(TAR, tar, tar, :)
AC_CHECK_PROG(SVNVERSION, svnversion, svnversion, :)
AC_CHECK_PROGS(YACC, byacc yacc 'bison -y', [no])
AS_IF([test x"$YACC" = "xno"], [AC_MSG_ERROR([Could not find byacc, yacc or bison!])])
dnl Check for makeinfo, might only be required for AmigaOS since we don't
dnl generate info pages anymore ?
AC_CHECK_PROGS(MAKEINFO, makeinfo, no)
AS_IF([test x"$MAKEINFO" = "xno"],
[AC_MSG_ERROR([makeinfo is missing, please install texinfo])])
dnl Check for dos2unix
AC_CHECK_PROGS(DOS2UNIX, dos2unix, no)
AS_IF([test x"$DOS2UNIX" = "xno"],
[AC_MSG_ERROR([The dos2unix tool is missing, please install dos2unix])])
dnl Check for xa[65]
AC_CHECK_PROGS(XA, [xa xa65], no)
AS_IF([test x"$XA" = "xno"],
[AC_MSG_ERROR([The xa assembler is missing, either install it via your
distribution or build and install it using the latest source
from https://www.floodgap.com/retrotech/xa/])])
if test x"$enable_pdf_docs" != xno; then
AC_CHECK_PROGS(TEXI2DVI, texi2dvi, no)
if test x"$TEXI2DVI" = "xno"; then
AC_MSG_ERROR([PDF docs were requested (--enable-pdf-docs), but texi2dvi is missing])
fi
AC_CHECK_PROGS(PDFTEX, pdftex, no)
if test x"$PDFTEX" = "xno"; then
AC_MSG_ERROR([PDF docs were requested (--enable-pdf-docs), but pdftex is missing])
fi
fi
AC_CHECK_PROGS(PERL, perl)
if test x"${enable_html_docs:-yes}" != xno -a x"$PERL" = x; then
AC_MSG_ERROR([Perl is required to generate the HTML documentation])]
fi
AM_CONDITIONAL([ENABLE_PDF_DOCS], [test x"${enable_pdf_docs}" != xno])
if test x"${enable_pdf_docs}" != "xno"; then
VICE_PDF_FILE_NAME="vice.pdf"
else
VICE_PDF_FILE_NAME=""
fi
AC_SUBST(VICE_PDF_FILE_NAME)
AM_CONDITIONAL([ENABLE_HTML_DOCS], [test x"${enable_html_docs:-yes}" != xno])
AM_CONDITIONAL([HAVE_PERL], [test x"$PERL" != x])
AC_CHECK_PROGS(ICONV, iconv, no)
AS_IF([test x"$ICONV" = x"no"], [AC_MSG_ERROR([iconv is missing])])
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_TOOL(objdump, objdump, no)
AC_CHECK_TOOL(sdl_config, sdl-config, no)
dnl echo "Checking host_os for Windows: host_os = $host_os"
dnl Check for windres, required to link icons into windows binaries
if test x"$host_os" = "xmingw32"; then
AC_CHECK_TOOL([WINDRES], [windres], [no])
AS_IF([test x"$WINDRES" = "xno"],
[AC_MSG_ERROR([Could not find required windres binary!])])
fi
AM_PROG_AS
dnl Other build environment checks
AC_SYS_LARGEFILE
AC_CONFIG_HEADERS([src/config.h])
is_unix=no
is_unix_x11=no
is_unix_macosx=no
is_win32=no
is_win32_gtk3=no
is_beos=no
BSD_JOYSTICK_SUPPORT="no "
DEBUG_SUPPORT="no "
DEBUG_THREADS_SUPPORT="no "
FEATURE_CPUMEMHISTORY_SUPPORT="no "
HAS_HIDMGR_SUPPORT="no "
HAS_USB_JOYSTICK_SUPPORT="no "
HAVE_AUDIO_UNIT_SUPPORT="no "
HAVE_CATWEASELMKIII_SUPPORT="no "
HAVE_DINPUT_SUPPORT="no "
HAVE_DYNLIB_SUPPORT_TOO="no "
HAVE_FASTSID_SUPPORT="no "
HAVE_FFMPEG_AVRESAMPLE_SUPPORT="no "
HAVE_FFMPEG_SUPPORT="no "
HAVE_FFMPEG_SWRESAMPLE_SUPPORT="no "
HAVE_FFMPEG_SWSCALE_SUPPORT="no "
HAVE_FONTCONFIG_SUPPORT="no "
HAVE_GIF_SUPPORT="no "
HAVE_HARDSID_SUPPORT="no "
HAVE_HWSCALE_SUPPORT="no "
HAVE_IOSID_SUPPORT="no "
HAVE_IPV6_SUPPORT="no "
HAVE_LIBIEEE1284_SUPPORT="no "
HAVE_LIGHTPEN_SUPPORT="no "
HAVE_MIDI_SUPPORT="no "
HAVE_MOUSE_SUPPORT="no "
HAVE_NETWORK_SUPPORT="no "
HAVE_PARSID_SUPPORT="no "
HAVE_PCIUTILS_SUPPORT="no "
HAVE_PNG_SUPPORT="no "
HAVE_PORTSID_SUPPORT="no "
HAVE_RAWNET_SUPPORT="no "
HAVE_REALDEVICE_SUPPORT="no "
HAVE_RESID_SUPPORT="no "
HAVE_RS232DEV_SUPPORT="no "
HAVE_RS232NET_SUPPORT="no "
HAVE_OPENMP_SUPPORT="no "
HAVE_SDL_NUMJOYSTICKS_SUPPORT="no "
HAVE_SSI2001_SUPPORT="no "
HAVE_SYS_AUDIOIO_H_SUPPORT="no "
HAVE_SYS_AUDIO_H_SUPPORT="no "
HAVE_ZLIB_SUPPORT="no "
LINUX_JOYSTICK_SUPPORT="no "
MAC_JOYSTICK_SUPPORT="no "
USE_ALSA_SUPPORT="no "
USE_COREAUDIO_SUPPORT="no "
USE_DMEDIA_SUPPORT="no "
USE_DXSOUND_SUPPORT="no "
USE_FLAC_SUPPORT="no "
USE_LAMEMP3_SUPPORT="no "
USE_MPG123_SUPPORT="no "
USE_OSS_SUPPORT="no "
USE_PORTAUDIO_SUPPORT="no "
USE_PULSE_SUPPORT="no "
USE_SANDBOX_MODE="no "
USE_SDL_AUDIO_SUPPORT="no "
USE_VORBIS_SUPPORT="no "
USE_NEW_8580_FILTER="no "
USE_DESKTOP_FILES="no "
HAVE_X64_IMAGE_SUPPORT="no "
HAVE_CAPABILITIES_SUPPORT="no "
HAVE_LIBCURL_SUPPORT="no "
dnl Why do we have this?
AM_CONDITIONAL(DUMMY_COMPILE, false)
dnl Set all FOO_COMPILE conditionals to false to simplify the code below
dnl BEOS_COMPILE means both 'classic' BeOS and Haiku
AM_CONDITIONAL(BEOS_COMPILE, false)
dnl HAIKU_COMPILE means specifically Haiku
AM_CONDITIONAL(HAIKU_COMPILE, false)
AM_CONDITIONAL(LINUX_COMPILE, false)
dnl BSD_COMPILE means Free, Net, Open and DragonFly BSD
AM_CONDITIONAL(BSD_COMPILE, false)
AM_CONDITIONAL(FREEBSD_COMPILE, false)
AM_CONDITIONAL(NETBSD_COMPILE, false)
AM_CONDITIONAL(OPENBSD_COMPILE, false)
AM_CONDITIONAL(DRAGONFLYBSD_COMPILE, false)
AS_IF([test x"$enable_cpuhistory" != "xno"],
[
AC_DEFINE(FEATURE_CPUMEMHISTORY,,[Use the 65xx cpu history feature.])
FEATURE_CPUMEMHISTORY_SUPPORT="yes"
])
dnl New 8580 filters: Changed on 2020-08-23 from default 'no' to default 'yes'.
dnl If we don't get any (valid) complaints, we should make this non-configurable.
AS_IF([test x"$enable_new8580filter" != "xno"],
[
AC_DEFINE(HAVE_NEW_8580_FILTER,,[Use the new 8580 filter])
USE_NEW_8580_FILTER="yes"
])
AM_CONDITIONAL(VICE_QUIET, test x"$verbose" != "xyes" -a x"$enable_silent_rules" = "x")
user_cflags=$CFLAGS
PKG_PROG_PKG_CONFIG
SOUND_DRIVERS=""
dnl Check if a GUI order check needs to be done
AS_IF([test x"$enable_gtk3ui" != "xyes" -a x"$enable_sdl1ui" != "xyes" -a x"$enable_sdl2ui" != "xyes" -a x"$enable_headlessui" != "xyes"],
[check_guis=yes])
dnl Check if gtk3 ui should be checked
if test x"$check_guis" = "xyes"; then
if test x"$enable_gtk3ui" != "xno"; then
check_gtk3=yes
fi
else
if test x"$enable_gtk3ui" = "xyes"; then
check_gtk3=yes
fi
fi
old_CFLAGS="$CFLAGS"
CFLAGS="$VICE_CFLAGS"
dnl Do these checks before any Gtk3 flags are added
AC_MSG_CHECKING(for time_t in time.h)
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
if test $bu_cv_decl_time_t_time_h = yes; then
AC_DEFINE([HAVE_TIME_T_IN_TIME_H],,
[Is the type time_t defined in <time.h>?])
fi
AC_MSG_CHECKING(for time_t in sys/types.h)
AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
if test $bu_cv_decl_time_t_types_h = yes; then
AC_DEFINE([HAVE_TIME_T_IN_TYPES_H],,
[Is the type time_t defined in <sys/types.h>?])
fi
if test $bu_cv_decl_time_t_time_h = yes; then
AC_CHECK_SIZEOF([time_t],[],[#include <time.h>])
else
AC_CHECK_SIZEOF([time_t],[],[#include <sys/types.h>])
fi
if test "x$ac_cv_sizeof_time_t" = "x4"; then
AC_DEFINE([TIME_T_IS_32BIT],,[time_t is 32 bit])
elif test "x$ac_cv_sizeof_time_t" = "x8"; then
AC_DEFINE([TIME_T_IS_64BIT],,[time_t is 64 bit])
else
AC_MSG_ERROR([can not figure type of time_t])
fi
dnl Add runtime/linker paths for *BSD
CFLAGS="$old_CFLAGS"
case "$host_os" in
freebsd*)
AC_DEFINE(BSD_COMPILE,,[Are we compiling for *BSD?])
AC_DEFINE(FREEBSD_COMPILE,,[Are we compiling for FreeBSD?])
AM_CONDITIONAL(BSD_COMPILE, true)
AM_CONDITIONAL(FREEBSD_COMPILE, true)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fbsdrtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/local/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $fbsdrtp -L/usr/local/lib"
;;
netbsd*)
AC_DEFINE(BSD_COMPILE,,[Are we compiling for *BSD?])
AC_DEFINE(NETBSD_COMPILE,,[Are we compiling for NetBSD?])
AM_CONDITIONAL(BSD_COMPILE, true)
AM_CONDITIONAL(NETBSD_COMPILE, true)
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include -I/usr/include"
nbsdrtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/pkg/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $nbsdrtp -L/usr/pkg/lib"
if test -d "/usr/X11R7/lib"; then
CPPFLAGS="$CPPFLAGS -I/usr/X11R7/include"
rtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/X11R7/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $rtp"
LDFLAGS="$LDFLAGS -L/usr/X11R7/lib"
else
if test -d "/usr/X11R6/lib"; then
CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
rtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/X11R6/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $rtp -L/usr/X11R6/lib"
LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
fi
fi
;;
openbsd*)
AC_DEFINE(BSD_COMPILE,,[Are we compiling for *BSD?])
AC_DEFINE(OPENBSD_COMPILE,,[Are we compiling for OpenBSD?])
AM_CONDITIONAL(BSD_COMPILE, true)
AM_CONDITIONAL(OPENBSD_COMPILE, true)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
obsdrtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/local/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $obsdrtp -L/usr/local/lib"
;;
dragonfly*)
AC_DEFINE(BSD_COMPILE,,[Are we compiling for *BSD?])
AC_DEFINE(DRAGONFLYBSD_COMPILE,,[Are we compiling for DragonFly BSD?])
AM_CONDITIONAL(BSD_COMPILE, true)
AM_CONDITIONAL(DRAGONFLYBSD_COMPILE, true)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
dfbsdrtp=`${CONFIG_SHELL-/bin/sh} "$srcdir/config.rpath" "$CC" "$GCC" "$VICE_LDFLAGS" "$LD" "$with_gnu_ld" "$host" "/usr/local/lib"`
VICE_LDFLAGS="$VICE_LDFLAGS $dfbsdrtp -L/usr/local/lib"
;;
dnl Why is this in BSD section?
cygwin*)
VICE_CPPFLAGS="$VICE_CPPFLAGS -D_GNU_SOURCE=1"
;;
dnl Again: why?
mingw32*)
is_win32=yes
;;
*)
;;
esac
if test "x$CC" = "xgcc"; then
GCC=yes
fi
if test x"$enable_arch" = "xno"; then
march=""
ENABLE_ARCH=no
else
if test x"$enable_arch" = "xyes"; then
AC_MSG_CHECKING([if the compiler supports -march=native])
ORIG_CFLAGS="$VICE_CFLAGS"
VICE_CFLAGS="$VICE_CFLAGS -march=native"
AC_TRY_COMPILE([],
[int test;],
[ AC_MSG_RESULT(yes)
ENABLE_ARCH=yes
march="-march=native" ],
[ AC_MSG_RESULT(no)
ENABLE_ARCH=no
march="" ])
VICE_CFLAGS="$ORIG_CFLAGS"
else
AC_MSG_CHECKING([if the compiler supports -march=$enable_arch])
ORIG_CFLAGS="$VICE_CFLAGS"
VICE_CFLAGS="$VICE_CFLAGS -march=$enable_arch"
AC_TRY_COMPILE([],
[int test;],
[ AC_MSG_RESULT(yes)
ENABLE_ARCH=yes
march="-march=$enable_arch" ],
[ AC_MSG_RESULT(no)
ENABLE_ARCH=no
march="" ])
VICE_CFLAGS="$ORIG_CFLAGS"
fi
fi
AC_SUBST(ENABLE_ARCH)
dnl check if the compiler supports -posix
if test x"$posix_check" = "xyes"; then
AC_MSG_CHECKING([if the compiler supports -posix])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -posix"
AC_TRY_COMPILE([],
[int test;],
[ AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS ])
fi
dnl check if ar truncates object names
if test x"$ar_check" != "xno"; then
AC_MSG_CHECKING(if ar truncates object names)
rm -f vicetest.c
touch vicetest.c
$CC -c vicetest.c -o some_long_object_name.o
rm -f vicetest.c
rm -f libvicetest.a
$AR cru libvicetest.a some_long_object_name.o
rm -f some_long_object_name.o
$AR x libvicetest.a
if test -f some_long_object_name.o; then
AC_MSG_RESULT(no)
rm -f some_long_object_name.o libvicetest.a
else
AC_MSG_RESULT(yes)
rm -f some*.o libvicetest.a
AC_MSG_ERROR([ar is too old, upgrade your ar])
fi
fi
AM_CONDITIONAL(USE_SVN_REVISION,false)
AM_CONDITIONAL(USE_SVN_REVISION_OVERRIDE,false)
AC_ARG_VAR(SVN_REVISION_OVERRIDE,,[Subversion revision number to embed in build (without the 'r')])
if test x"$SVN_REVISION_OVERRIDE" != "x"; then
AM_CONDITIONAL(USE_SVN_REVISION,true)
AM_CONDITIONAL(USE_SVN_REVISION_OVERRIDE,true)
AC_DEFINE(USE_SVN_REVISION,,[define when using the svn revision in addition to the version])
AC_DEFINE(USE_SVN_REVISION_OVERRIDE,,[define when using an svn revision passed to configure via SVN_REVISION_OVERRIDE env var])
else
if test x"$SVN" != "x"; then
svnrevision=`$SVN 2>dummy.tmp info $srcdir | grep Revision | cut -d " " -f 2`
rm dummy.tmp
if test x"$svnrevision" != "x"; then
AC_DEFINE(USE_SVN_REVISION,,[define when using the svn revision in addition to the version])
AM_CONDITIONAL(USE_SVN_REVISION,true)
fi
fi
fi
JOYSTICK_DRIVERS=""
dnl Hardware SID drivers (obsolete so disabled by default)
AM_CONDITIONAL(HAVE_CATWEASELMKIII, false)
AM_CONDITIONAL(HAVE_PARSID, false)
AM_CONDITIONAL(HAVE_SSI2001, false)
if test x"$is_win32" = "xyes" -o x"$is_win32_gtk3" = "xyes"; then
dnl This is used by subsequent tests.
ac_cv_prog_gcc=yes
GCC=yes
AC_CHECK_HEADERS([commctrl.h shlobj.h winioctl.h], [], [], [#include <windows.h>])
AC_DEFINE(HAVE_HTONL,,[Define to 1 if you have the htonl function.])
AC_DEFINE(HAVE_HTONS,,[Define to 1 if you have the htons function.])
AC_DEFINE(HAVE_NETWORK,,[Enable netplay support])
HAVE_NETWORK_SUPPORT="yes"
AC_DEFINE(HAVE_RS232NET,,[Enable RS232 network support])
HAVE_RS232NET_SUPPORT="yes"
if test x"$host_cpu" = "xx86_64" -o x"$host_cpu" = "xamd64"; then
LIBS="$LIBS -lwinmm -lntdll -ld2d1 -ld3d11 -lavrt -lws2_32"
else
LIBS="$LIBS -lwinmm -lntdll -ld2d1 -ld3d11 -lavrt -lwsock32 -lmingwex -lmsvcrt"
fi
if test x"$enable_catweasel" = "xyes"; then
AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
AM_CONDITIONAL(HAVE_CATWEASELMKIII, true)
HAVE_CATWEASELMKIII_SUPPORT="yes"
fi
if test x"$enable_hardsid" != "xno"; then
AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
HAVE_HARDSID_SUPPORT="yes"
fi
if test x"$enable_parsid" = "xyes"; then
AC_DEFINE(HAVE_PARSID,,[Support for ParSID.])
AM_CONDITIONAL(HAVE_PARSID, true)
HAVE_PARSID_SUPPORT="yes"
if test x"$enable_libieee1284" = "xyes"; then
LIBIEEE1284_HEADERS_PRESENT=yes
dnl Check for needed io headers
AC_CHECK_HEADERS(ieee1284.h,,[LIBIEEE1284_HEADERS_PRESENT=no],)
if test x"$LIBIEEE1284_HEADERS_PRESENT" = "xyes"; then
AC_CHECK_LIB(ieee1284, ieee1284_find_ports,[LIBS="-lieee1284 $LIBS"; PARSID_SUPPORT=yes],,)
if test x"$PARSID_SUPPORT" = "xyes"; then
AC_DEFINE(HAVE_LIBIEEE1284,,[Define to 1 if you have the 'ieee1284' library (-lieee1284).])
else
AC_MSG_ERROR([libieee1284 is missing])
fi
else
AC_MSG_ERROR([libieee1284 header is missing])
fi
fi
fi
if test x"$enable_ssi2001" = "xyes"; then
AC_DEFINE(HAVE_SSI2001,,[Support for SSI2001 (ISA SID card).])
AM_CONDITIONAL(HAVE_SSI2001, true)
HAVE_SSI2001_SUPPORT="yes"
fi
if test x"$enable_midi" = "xyes"; then
AC_DEFINE(HAVE_MIDI,,[Enable support for MIDI.])
HAVE_MIDI_SUPPORT="yes"
fi
if test x"$enable_rs232" != "xno"; then
AC_DEFINE(HAVE_RS232DEV,,[Enable RS232 device emulation.])
HAVE_RS232DEV_SUPPORT="yes"
fi
dnl warnings_cxx="-Wall -W -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare"
dnl (Didn't we already check this?
if test x"$nowarnings" != "xyes"; then
warnings_cxx="-Wall -Wno-unused-parameter -Wno-sign-compare"
VICE_CFLAGS="$VICE_CFLAGS $warnings_cxx"
VICE_CXXFLAGS="$VICE_CXXFLAGS $warnings_cxx"
fi
elif test x"$host_os" = "xbeos" -o x"$host_os" = "xhaiku"; then
dnl Again: ingnored for now
dnl This is used by subsequent tests.
ac_cv_prog_gcc=yes
GCC=yes
is_beos=yes
AC_DEFINE(BEOS_COMPILE,,[Are we compiling for either BeOS or Haiku?])
AM_CONDITIONAL(BEOS_COMPILE, true)
if test x"$host_os" = "xhaiku"; then
AC_DEFINE(HAIKU_COMPILE,,[Are we compiling for Haiku?])
AM_CONDITIONAL(HAIKU_COMPILE, true)
fi
if test x"$enable_catweasel" = "xyes"; then
AC_DEFINE(HAVE_CATWEASELMKIII,,[Support for Catweasel MKIII.])
AM_CONDITIONAL(HAVE_CATWEASELMKIII, true)
HAVE_CATWEASELMKIII_SUPPORT="yes"
fi
if test x"$enable_hardsid" != "xno"; then
AC_DEFINE(HAVE_HARDSID,,[Support for HardSID.])
HAVE_HARDSID_SUPPORT="yes"
fi
if test x"$enable_parsid" = "xyes"; then
AC_DEFINE(HAVE_PARSID,,[Support for ParSID.])
AM_CONDITIONAL(HAVE_PARSID, true)
HAVE_PARSID_SUPPORT="yes"
if test x"$enable_libieee1284" = "xyes"; then
LIBIEEE1284_HEADERS_PRESENT=yes
dnl Check for needed io headers
AC_CHECK_HEADERS(ieee1284.h,,[LIBIEEE1284_HEADERS_PRESENT=no],)
if test x"$LIBIEEE1284_HEADERS_PRESENT" = "xyes"; then
AC_CHECK_LIB(ieee1284, ieee1284_find_ports,[LIBS="-lieee1284 $LIBS"; PARSID_SUPPORT=yes],,)
if test x"$PARSID_SUPPORT" = "xyes"; then
AC_DEFINE(HAVE_LIBIEEE1284,,[Define to 1 if you have the 'ieee1284' library (-lieee1284).])
else
AC_MSG_ERROR([libieee1284 is missing])
fi
else
AC_MSG_ERROR([libieee1284 header is missing])
fi
fi
fi
if test x"$enable_ssi2001" = "xyes"; then
AC_DEFINE(HAVE_SSI2001,,[Support for SSI2001 (ISA SID card).])
AM_CONDITIONAL(HAVE_SSI2001, true)
HAVE_SSI2001_SUPPORT="yes"
fi
dnl Haiku needs a few compiler flags to compile:
dnl Probably can get rid off libstdc++, but who will ever notice?
VICE_CFLAGS="$VICE_CFLAGS -static -static-libgcc -static-libstdc++"
else
dnl check for darwin first.
case "$host_os" in
darwin*)
dnl check for needed CoreVideo header
AC_CHECK_HEADERS(CoreVideo/CVHostTime.h)
dnl check for needed CoreServices header
AC_CHECK_HEADERS(CoreServices/CoreServices.h)
dnl change the host_os to puredarwin to make the configure think it is
dnl just another unix.
if test x"$ac_cv_header_CoreServices_CoreServices_h" != "xyes"; then
host_os=puredarwin;
AC_DEFINE(DARWIN_COMPILE,,[Enable plain darwin compilation])
fi
;;
*)
;;
esac
dnl Check for host os with version attached. Typically on UN*X like systems.
case "$host_os" in
dnl Mac OS X Host
darwin*)
AC_PROG_OBJCPP
is_unix=yes
is_unix_macosx=yes
is_unix_x11=yes
dnl disable toolchain checking for macosx
toolchain_check=no
dnl The vice build system builds empty libs for things that are configured out,
dnl then links all of them together. This causes ranlib to complain like:
dnl
dnl file: libarch.a(joy-win32-dinput-handle.o) has no symbols
dnl
dnl This warning can be disabled by passing -no_warning_for_no_symbols to ranlib.
dnl ar also calls ranlib, and there is no way to pass the argument.
dnl
dnl You can split an 'ar cru' call into separate ar and ranlib calls, but,
dnl sometimes ranlib will invoke libtool which has its own warning we can't
dnl change without major build system changes.
dnl
dnl Given all that it's simpler to just grep -v out the warnings we don't want,
dnl which these scripts do.
RANLIB="\$(top_srcdir)/src/arch/shared/macOS-wrap-ranlib.sh"
AR="\$(top_srcdir)/src/arch/shared/macOS-wrap-ar.sh"
dnl
dnl Support targeting a specific macOS version
dnl
VICE_ARG_ENABLE_LIST(
macos-minimum-version,
AS_HELP_STRING(
[--enable-macos-minimum-version=version],
[compile for a specific macOS version such as 10.10 or 11.0])
)
if test x"$enable_macos_minimum_version" = "x"; then
AC_MSG_CHECKING([default macOS minimum version (use --enable-macos-minimum-version to override)])
enable_macos_minimum_version=`echo "int main(int argc, char** argv) { return 0; }" | cc -x c - ;
otool -l a.out | awk '/LC_VERSION_MIN_MACOSX/ { f_old=1 }
/LC_BUILD_VERSION/ { f_new=1 }
f_old && /version/ { print $2; exit; }
f_new && /minos/ { print $2; exit; }' ;
rm a.out`
AC_MSG_RESULT($enable_macos_minimum_version)
else
AC_MSG_CHECKING([if the compiler supports -mmacosx-version-min=$enable_macos_minimum_version])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="$VICE_CFLAGS -mmacosx-version-min=$enable_macos_minimum_version"
AC_TRY_COMPILE([],
[int test;],
[ AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS"],
[ AC_MSG_RESULT(no)
AC_MSG_ERROR([Requested macOS minimum version $enable_macos_minimum_version not supported])
])
fi
VICE_CFLAGS="$VICE_CFLAGS -mmacosx-version-min=$enable_macos_minimum_version"
VICE_CXXFLAGS="$VICE_CXXFLAGS -mmacosx-version-min=$enable_macos_minimum_version"
VICE_LDFLAGS="$VICE_LDFLAGS -mmacosx-version-min=$enable_macos_minimum_version"
dnl
dnl Yeah, OpenGL and other stuff is deprecated, we don't need to be warned about it.
dnl Please don't remove this again whoever did last time :)
dnl
VICE_CFLAGS="$VICE_CFLAGS -Wno-deprecated-declarations"
VICE_CXXFLAGS="$VICE_CXXFLAGS -Wno-deprecated-declarations"
if test x"$enable_rs232" != "xno"; then
AC_DEFINE(HAVE_RS232DEV,,[Enable RS232 device emulation.])
HAVE_RS232DEV_SUPPORT="yes"
fi
AC_DEFINE(HAVE_MOUSE,,[Enable 1351 mouse support])
HAVE_MOUSE_SUPPORT="yes"
AC_DEFINE(HAVE_LIGHTPEN,,[Enable lightpen support])
HAVE_LIGHTPEN_SUPPORT="yes"
AC_DEFINE(MACOS_COMPILE,,[Enable MacOS-specific code.])
dnl Set CPPFLAGS as well as VICE_CPPFLAGS for the macports / homebrew dep search paths.
dnl If we don't, then various header / compile checks won't succeed.
MAC_CCPFLAGS=""
MAC_LDFLAGS="-headerpad_max_install_names"