-
Notifications
You must be signed in to change notification settings - Fork 28
/
configure.ac
1135 lines (971 loc) · 27.2 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
AC_PREREQ([2.69])
LT_PREREQ(2.4.6)
m4_define([unicon_version],[m4_esyscmd_s([config/scripts/version.sh "version"])])
AC_INIT([Unicon],[unicon_version],[[email protected]],[unicon],[http://www.unicon.org])
AC_CANONICAL_HOST
AH_TOP([#ifndef __AUTO_CONFIG_H
#define __AUTO_CONFIG_H])
AH_BOTTOM([#endif /* __AUTO_CONFIG_H */])
# not needed yet
#AC_CANONICAL_BUILD
#AC_CANONICAL_TARGET
case $host_cpu in
*armv7* | *armv6* | *aarch32*)
unicon_cpu="arm_32"
ARCHBITS="32"
AC_DEFINE([ARM], [1], [ARM platform])
;;
*armv8* | *aarch64*)
unicon_cpu="arm_64"
ARCHBITS="64"
AC_DEFINE([ARM], [1], [ARM platform])
;;
*riscv64*)
unicon_cpu="riscv_64"
ARCHBITS="64"
AC_DEFINE([RISCV], [1], [RISC-V platform])
;;
*i386* | *i686*)
unicon_cpu="x86_32"
ARCHBITS="32"
AC_DEFINE([X86], [1], [X86 platform])
;;
*)
unicon_cpu="$host_cpu"
ARCHBITS="64"
;;
esac
unicon_osdist=$OSDIST
unicon_osrel=$OSREL
case $host_os in
*linux*)
unicon_os="linux"
# if dist/version are not set, try to guess them
if test x$unicon_osdist = x ; then
if test -f /etc/os-release ; then
. /etc/os-release
unicon_osdist=$NAME
unicon_osrel=$VERSION_ID
elif type lsb_release >/dev/null 2>&1; then
unicon_osdist=$(lsb_release -si)
unicon_osrel=$(lsb_release -sr)
elif test -f /etc/lsb-release ; then
. /etc/lsb-release
unicon_osdist=$DISTRIB_ID
unicon_osrel=$DISTRIB_RELEASE
elif test -f /etc/debian_version ; then
unicon_osdist=Debian
unicon_osrel=$(cat /etc/debian_version)
fi
fi
AC_DEFINE([UNIX], [1], [Unix platform])
case $host_os in
*musl*)
AC_DEFINE([__MUSL__], [1], [MUSL C Library])
MUSLFLG="-D__MUSL__"
CFLAGS="-fno-pie $CFLAGS"
LDFLAGS=" -no-pie $LDFLAGS"
;;
esac
;;
*solaris*)
unicon_os="solaris"
AC_DEFINE([UNIX], [1], [Unix platform])
AC_DEFINE([SOLARIS], [1], [Solaris OS])
AC_DEFINE([SUN], [1], [Sun platform])
;;
*aix*)
unicon_os="aix"
AC_DEFINE([UNIX], [1], [Unix platform])
;;
*bsd*)
# freebsd for now
unicon_os="freebsd"
AC_DEFINE([UNIX], [1], [Unix platform])
AC_DEFINE([FreeBSD], [1], [FreeBSD OS])
;;
*darwin*)
unicon_os="macos"
AC_DEFINE([UNIX], [1], [Unix platform])
AC_DEFINE([MacOS], [1], [Mac OS])
;;
*cygwin* | *mingw* | *msys*)
unicon_os="windows"
AC_DEFINE([Windows], [1], [Windows platform])
;;
esac
unicon_host="$unicon_cpu"_"$unicon_os"
echo "##########################################"
echo "Configuring Unicon Host: $unicon_host"
echo "##########################################"
AC_ARG_ENABLE([graphics],
[AS_HELP_STRING([--disable-graphics], [No graphics subsystem])],
[graphics=$enableval], [graphics=on])
AC_ARG_ENABLE([graphics3d],
[AS_HELP_STRING([--disable-graphics3d], [No 3D graphics support])],
[graphics3d=$enableval], [graphics3d=on])
AC_ARG_ENABLE([multiprograms],
[AS_HELP_STRING([--disable-multiprograms], [No multi programs support])],
[multiprograms=$enableval], [multiprograms=on])
AC_ARG_ENABLE([concurrency],
[AS_HELP_STRING([--disable-concurrency], [No concurrent thread support])],
[concurrency=$enableval], [concurrency=on])
AC_ARG_ENABLE([pattern],
[AS_HELP_STRING([--disable-pattern], [No pattern type support])],
[pattern=$enableval], [pattern=on])
AC_ARG_ENABLE([database],
[AS_HELP_STRING([--disable-database], [No database support])],
[database=$enableval], [database=on])
AC_ARG_ENABLE([ssl],
[AS_HELP_STRING([--disable-ssl], [No SSL support])],
[ssl=$enableval], [ssl=on])
AC_ARG_ENABLE([audio],
[AS_HELP_STRING([--disable-audio], [No audio support])],
[audio=$enableval], [audio=on])
AC_ARG_ENABLE([voip],
[AS_HELP_STRING([--disable-voip], [No VOIP support])],
[voip=$enableval], [voip=on])
AC_ARG_ENABLE([plugins],
[AS_HELP_STRING([--disable-plugins], [No loadfunc or plugins support])],
[plugins=$enableval], [plugins=on])
AC_ARG_ENABLE([iconc],
[AS_HELP_STRING([--disable-iconc], [Don't build Unicon Compiler (Iconc/Uniconc)])],
[iconc=$enableval], [iconc=on])
AC_ARG_ENABLE([stdc],
[AS_HELP_STRING([--disable-stdc], [Disable the default std C compiler option])],
[stdc=$enableval], [stdc=on])
AC_ARG_ENABLE([iconcurrency],
[AS_HELP_STRING([--enable-iconcurrency], [Enable thread support in Unicon Compiler])],
[coniconc=yes], [coniconc=no])
AC_ARG_ENABLE([ovld],
[AS_HELP_STRING([--enable-ovld], [Enable operator overloading])],
[ovld=yes], [ovld=no])
AC_ARG_ENABLE([udbtools],
[AS_HELP_STRING([--enable-udbtools], [Enable Unicon debugger tools])],
[udbtools=yes], [udbtools=no])
AC_ARG_ENABLE([progs],
[AS_HELP_STRING([--enable-progs], [Enable Unicon programs])],
[progs=yes], [progs=no])
AC_ARG_ENABLE([verbosebuild],
[AS_HELP_STRING([--enable-verbosebuild], [Show full CC build lines with all compiler arguments])],
[verbosebuild=yes], [verbosebuild=no])
AC_ARG_ENABLE([doc],
[AS_HELP_STRING([--enable-doc], [Add makefile rule to build documentation])],
[doc=yes], [doc=no])
AC_ARG_ENABLE([htmldoc],
[AS_HELP_STRING([--enable-htmldoc], [Add makefile rule to html documentation])],
[htmldoc=yes], [htmldoc=no])
AC_ARG_ENABLE([thin],
[AS_HELP_STRING([--enable-thin], [Do a minimalist build disabling non critical features])],
[thin=yes], [thin=no])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Add debugging symbols])],
[debug=yes], [debug=no])
AC_ARG_ENABLE([debugheap],
[AS_HELP_STRING([--enable-debugheap], [Enable advanced heap debugging ])],
[debugheap=yes], [debugheap=no])
AC_ARG_ENABLE([verifyheap],
[AS_HELP_STRING([--enable-verifyheap], [Enable advanced heap verification])],
[verifyheap=yes], [verifyheap=no])
AC_ARG_ENABLE([devmode],
[AS_HELP_STRING([--enable-devmode], [Developer mode: turn on warnings and debugging options])],
[devmode=$enableval], [devmode=no])
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror], [Change compiler warnings to errors])],
[werror=yes], [werror=no])
AC_ARG_ENABLE([warnings],
[AS_HELP_STRING([--enable-warnings], [Turn on most types of compiler warnings])],
[warn=yes], [warn=no])
AC_ARG_ENABLE([uniconx],
[AS_HELP_STRING([--enable-uniconx], [Change executable names to co-exist with Icon])],
[uniconx=yes], [uniconx=no])
# Save flags
orig_cflags="${CFLAGS:-}"
CFLAGS=""
AC_LANG([C])
AC_USE_SYSTEM_EXTENSIONS
# Try CC 11
ac_cc="$CC"
if test "x$stdc" = "xon" ; then
AC_CFLAG([-std=c11])
else
if test "x$stdc" = "xyes" ; then
AC_CFLAG([-std=c11],[AC_MSG_ERROR("-std=c11 is required but not available")], [ CFLAGS="$CFLAGS -std=c11" ])
else
if ! test "x$stdc" = "xno" ; then
AC_CFLAG([-std=$stdc],[AC_MSG_ERROR("-std=$stdc is required but not available")], [ CFLAGS="$CFLAGS -std=$stdc" ])
fi
fi
fi
# try to add -m32 or -m64
ARCHFLAG="-m$ARCHBITS"
AC_CFLAG([$ARCHFLAG],[
ARCHFLAG=""
], [
CFLAGS="$CFLAGS $ARCHFLAG"
LDFLAGS="$LDFLAGS $ARCHFLAG"
ASFLAGS="$ASFLAGS $ARCHFLAG"
] )
if test x"$verbosebuild" = x"yes" ; then
CMNT="#"
SLNT=
DASHS=
else
CMNT=
SLNT="@"
DASHS="-s"
fi
if test x"$uniconx" = x"yes" ; then
AC_DEFINE([UniconX], [1], [Avoid naming conflicts with Icon])
UNICONX=uniconx
UNICONWX=wuniconx
UNICONC=uniconc
UNICONT=unicont
UNICONWT=wunicont
else
UNICONX=iconx
UNICONWX=wiconx
UNICONC=iconc
UNICONT=icont
UNICONWT=wicont
fi
if test x"$devmode" = x"yes" || test x"$devmode" = x"all"; then
debug=yes
warn=yes
AC_DEFINE([DEVELOPMODE], [1], [Developer Mode])
if test x"$devmode" = x"all"; then
debugheap=yes
verifyheap=yes
fi
fi
if test x"$debugheap" = x"yes" ; then
AC_DEFINE([DebugHeap], [1], [Debug Heap])
debugheapreport="DebugHeap"
fi
if test x"$verifyheap" = x"yes" ; then
AC_DEFINE([VerifyHeap], [1], [Verify Heap])
verifyheapreport="VerifyHeap"
fi
if test x"$udbtools" = x"yes" ; then
UDBTOOLS=udbtools
fi
if test x"$progs" = x"yes" ; then
UNIPROGS=progs
fi
# honor custom flags
if test "z$orig_cflags" = "z"; then
if test x"$debug" = x"yes" ; then
AC_CFLAG([-g])
AC_CFLAG([-O0])
else
AC_CFLAG([-O2], [
AC_CFLAG([-Os])
])
fi
fi
if test x"$warn" = x"yes" ; then
AC_CFLAG([-Wall])
AC_CFLAG([-Wno-missing-braces])
fi
#if test x"$devmode" = x"yes" ; then
# AC_CFLAG([-Wmissing-prototypes])
# AC_CFLAG([-Wmissing-declarations])
#fi
# We always want these CFLAGS if available, the second one is neseccary for a stable runtime
AC_CFLAG([-fno-omit-frame-pointer])
AC_CFLAG([-fno-strict-aliasing])
if test x"$CC" = x"clang" || test x"$unicon_os" = x"macos" ; then
AC_CFLAG([-Werror -Wno-parentheses-equality], [], [CFLAGS="$CFLAGS -Wno-parentheses-equality"])
fi
#if test x"${enable_werror}" = x"yes" ; then
# WERROR="-Werror"
#fi
#AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_SRCDIR([src/runtime/imain.r])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_RANLIB
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
#AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h netdb.h unistd.h strings.h arpa/inet.h net/errno.h \
stdlib.h string.h fcntl.h memory.h sys/file.h sys/resource.h \
netinet/in.h sys/errno.h sys/socket.h sys/types.h)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(long long int)
AC_CHECK_SIZEOF(int *)
AC_C_BIGENDIAN
AC_C_CONST
AC_TYPE_SIZE_T
AC_FUNC_ALLOCA
AC_TYPE_OFF_T
AC_ST_BLKSIZE
AC_CHECK_TYPE(ssize_t, signed)
case $ac_cv_sizeof_int_p in
*1)
BITS=8
;;
*2)
BITS=16
;;
*4)
BITS=32
# RCFLAGS used on Windows only at the moment
RCFLAGS="--target=pe-i386"
;;
*8)
BITS=64
# RCFLAGS used on Windows only at the moment
RCFLAGS="--target=pe-x86-64"
;;
esac
OBJ=o
CFUNCTARGET="cfun"
CFDYN="-fPIC $MUSLFLG "
LDDYN="-shared "
SO=so
DASHX=
# OS specific flags go here
case $unicon_host in
*linux*)
LDFLAGS="$LDFLAGS -rdynamic "
LDDYN="$LDDYN $ARCHFLAG "
CFDYN="$CFDYN $ARCHFLAG "
RLINK="-rdynamic -Wl,-E "
RLIBS="-ldl -lcrypt "
;;
*solaris*)
;;
*aix*)
;;
*bsd*)
;;
*macos*)
LDDYN="-Xlinker -undefined -Xlinker dynamic_lookup -shared "
RLIBS="-ldl "
DASHX="-x"
;;
*windows*)
EXE=".exe"
NT="NT"
DNT="-DNT"
SO=dll
DASHG="-G"
LDFLAGS="$LDFLAGS --static -mnop-fun-dllimport -mwin32 -DPTW32_STATIC_LIB "
CPPFLAGS="$CPPFLAGS --static -mnop-fun-dllimport -mwin32 -DPTW32_STATIC_LIB "
LIBS="$LIBS -lgdi32 -lws2_32"
WSTKLDFLAG="-Xlinker --stack -Xlinker 8192000"
WGLIBS="-lopengl32 -lglu32 -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinmm"
WSUBSYS="-Wl,--subsystem,console"
NTCONDEP="NTCON"
LIBWUCONSOLE="libwuconsole.a"
WICONXTARGET="$UNICONWX"
WICONTTARGET="$UNICONWT"
WUNICONTARGET="wunicon"
CFUNCTARGET="windows"
EXEICONTARGET=icon.$OBJ
ICONXEXE=$UNICONX.exe
WICONXEXE=$UNICONWX.exe
ICONTEXE=$UNICONT.exe
WICONTEXE=$UNICONWT.exe
UNICONEXE=unicon.exe
WUNICONEXE=wunicon.exe
ICONCEXE=$UNICONC.exe
;;
esac
if test "x$iconc" = "xyes" || test "x$iconc" = "xon" ; then
ICONCTARGET=Iconc
fi
if test "x$orig_cflags" != "x" ; then
CFLAGS="$CFLAGS $orig_cflags"
fi
if test x"$debug" = x"yes" ; then
STRIP="@\#strip"
else
STRIP="strip $DASHX"
fi
AC_SUBST(UNICONX)
AC_SUBST(UNICONT)
AC_SUBST(UNICONWX)
AC_SUBST(UNICONWT)
AC_SUBST(UNICONC)
AC_SUBST(EXE)
AC_SUBST(WSTKLDFLAG)
AC_SUBST(WGLIBS)
AC_SUBST(WSUBSYS)
AC_SUBST(NT)
AC_SUBST(DNT)
AC_SUBST(NTCONDEP)
AC_SUBST(LIBWUCONSOLE)
AC_SUBST(WICONXTARGET)
AC_SUBST(WICONTTARGET)
AC_SUBST(WUNICONTARGET)
AC_SUBST(CFUNCTARGET)
AC_SUBST(EXEICONTARGET)
AC_SUBST(RCFLAGS)
AC_SUBST(ICONXEXE)
AC_SUBST(WICONXEXE)
AC_SUBST(ICONTEXE)
AC_SUBST(WICONTEXE)
AC_SUBST(UNICONEXE)
AC_SUBST(WUNICONEXE)
AC_SUBST(ICONCEXE)
AC_SUBST(OBJ)
AC_SUBST(BITS)
AC_SUBST(unicon_os)
AC_SUBST(unicon_osdist)
AC_SUBST(unicon_osrel)
AC_SUBST(CC)
AC_SUBST(RLINK)
AC_SUBST(RLIBS)
AC_SUBST(CFDYN)
AC_SUBST(LDDYN)
AC_SUBST(SO)
AC_SUBST(ICONCTARGET)
AC_SUBST(UDBTOOLS)
AC_SUBST(UNIPROGS)
if test "x$doc" = "xyes"; then
UDOC=doc
fi
if test "x$htmldoc" = "xyes"; then
HTMLDOC=htmldoc
fi
AC_SUBST(UDOC)
AC_SUBST(HTMLDOC)
# Do we have rdynamic?
#AC_LANG_PUSH(C)
#ac_ld_flag_save="$LDFLAGS"
#LDFLAGS="$LDFLAGS -rdynamic"
#AC_MSG_CHECKING([[whether linker supports -rdynamic]])
#AC_LINK_IFELSE(
# [AC_LANG_PROGRAM([[]])],
# [AC_MSG_RESULT([yes])],
# [
# LDFLAGS="$ac_ld_flag_save"
# AC_MSG_RESULT([no])
# ])
#AC_LANG_POP(C)
if test "x$thin" = "xyes"; then
if test "x$graphics" = "xon"; then
graphics=no
fi
if test "x$graphics3d" = "xon"; then
graphics3d=no
fi
if test "x$concurrency" = "xon"; then
concurrency=no
fi
if test "x$pattern" = "xon"; then
pattern=no
fi
if test "x$audio" = "xon"; then
audio=no
fi
if test "x$database" = "xon"; then
database=no
fi
if test "x$voip" = "xon"; then
voip=no
fi
if test "x$plugins" = "xon"; then
plugins=no
fi
if test "x$database" = "xon"; then
database=no
fi
if test "x$databse" = "xon"; then
ssl=no
fi
if test "x$multiprograms" = "xon"; then
multiprograms=no
fi
# what else we need to disable?
fi
AC_CHECK_FUNCS([socket bcopy bzero memcpy memset inet_aton inet_pton \
snprintf vsprintf rename ftruncate flock fsync \
getrlimit setrlimit strerror vfork \
getrusage sysconf profil getenv_r clock_gettime \
ctime_r asctime_r gmtime_r localtime_r])
AC_FUNC_STRERROR_R()
AC_REPLACE_FUNCS(getopt)
AC_FUNC_FORK()
AC_CHECK_LIB(dbm,main)
AC_CHECK_LIB(ndbm,main)
# we don't need sqlite to be added to $LIBS, not yet at least
saved_libs="$LIBS"
AC_CHECK_HEADERS([sqlite3.h])
AC_CHECK_LIB(sqlite3, sqlite3_config)
LIBS="$saved_libs"
if test "x$ac_cv_header_sqlite3_h" = "xyes" -a "x$ac_cv_lib_sqlite3_sqlite3_config" = "xyes"; then
SQLITE="sqlite"
else
SQLITE=""
fi
AC_SUBST(SQLITE)
AC_SEARCH_LIBS([getaddrinfo],[socket],
[AC_DEFINE([HAVE_GETADDRINFO], [1], [getaddinfo])])
AC_SEARCH_LIBS([crypt],[crypt],
[AC_DEFINE([HAVE_CRYPT], [1], [crypt])])
if test "x$multiprograms" = "xno"; then
AC_DEFINE([NoMultiProgram], [1], [No MultiProgram])
fi
if test "x$concurrency" = "xno"; then
AC_DEFINE([NoConcurrent], [1], [No Concurrency])
fi
if test "x$coniconc" != "xyes"; then
AC_DEFINE([NoConcurrentCOMPILER], [1], [No ConcurrentCOMPILER])
fi
if test "x$pattern" = "xno"; then
AC_DEFINE([NoPattern], [1], [No PatternType])
fi
if test "x$ovld" = "xyes"; then
AC_DEFINE([OVLD], [1], [Enable Operator Overloading])
fi
#AM_CONDITIONAL([GRAPHICS], [test x$graphics = xyes])
CHECK_ZLIB()
if ! test "x$graphics" = "xno"; then
CHECK_XLIB()
# if we have X11 or if we are running on MS Windows check for graphics libs
if test "x$cv_libX11" = xyes -o "ms$unicon_os" = "mswindows" ; then
CHECK_FREETYPE()
CHECK_XFT()
CHECK_JPEG()
CHECK_PNG()
if ! test "x$graphics3d" = "xno"; then
# assume we have opengl on windows
if test "ms$unicon_os" = "mswindows" ; then
cv_libGL=yes
cv_libGLU=yes
cv_opengl=yes
AC_DEFINE([HAVE_LIBGL], [1])
AC_DEFINE([HAVE_LIBGLU], [1])
else
CHECK_OPENGL()
fi
# A C++ compiler must be present and usable
if test "x$CXX" = "xg++" -a "x$GXX" = "xyes"; then
CHECK_FTGL()
else
echo "FTGL: missing or untrusted C++; CXX is $CXX and GXX is $GXX"
fi
else
AC_DEFINE([NoGraphics3D], [1], [No Graphics3D])
fi
echo "Building with graphics..."
GRAPHICS=graphics
if test "ms$unicon_os" != "mswindows" ; then
XL="-lXpm \$(XLIBS)"
XPM=xpm
fi
if test "$cv_libftgl" = "yes"; then
DRAWSTRING=drawstring3d.o
COMMONDRAWSTRING=../common/drawstring3d.o
fi
# Any system specific graphics related config can go here
case $unicon_host in
*linux*)
;;
*solaris*)
XLIBS = -L/usr/X11R6/lib/64 -R/usr/X11R6/lib/64 -lXpm -lX11 ;;
*aix*)
;;
*bsd*)
;;
*macos*)
XLIBS="-L/opt/X11/lib -L/usr/X11R6/lib -L/usr/local/lib -lXpm -lX11"
;;
*windows*)
;;
esac
else
echo "Graphics library missing: building without graphics..."
fi
else
echo "Building without graphics..."
graphics3d=no
AC_DEFINE([NoGraphics], [1], [No Graphics])
AC_DEFINE([NoGraphics3D], [1], [No Graphics3D])
fi
AC_SUBST(XLIBS)
AC_SUBST(GRAPHICS)
AC_SUBST(XL)
AC_SUBST(XPM)
AC_SUBST(DRAWSTRING)
AC_SUBST(COMMONDRAWSTRING)
AC_SUBST(CMNT)
AC_SUBST(SLNT)
AC_SUBST(DASHS)
AC_SUBST(DASHG)
AC_SUBST(STRIP)
if test -f src/asm/$unicon_host-rswitch.s; then
echo "Native coswitch detected"
cp src/asm/$unicon_host-rswitch.s src/common/rswitch.s
else
if test -f src/asm/$unicon_host-rswitch.c; then
echo "Native coswitch detected"
cp src/asm/$unicon_host-rswitch.c src/common/rswitch.c
else
echo "No native coswitch for $unicon_host , switching to pthreadcoswitch..."
AC_DEFINE([NoNativeCoswitch], [1], [No Native coswitch])
cp src/common/pthreadcoswitch.c src/common/rswitch.c
fi
fi
if ! test "x$plugins" = "xno"; then
AC_SEARCH_LIBS([dlopen], [dl dld],
[AC_DEFINE([HAVE_LIBDL], [1], [define to 1 if you have dlopen])],
[])
if test "x$ac_cv_search_dlopen" != "xno" ; then
PLUGINS=upexample
AC_CHECK_LIB(lxc,lxc_get_version,[PLUGINS="$PLUGINS lxcunicon"])
AC_SUBST(PLUGINS)
fi
else
AC_DEFINE([NoLoadFunc], [1], [No LoadFunc])
CFUNCTARGET="disabled"
fi
#AC_CHECK_FUNC(dlopen,
# [AC_DEFINE([HAVE_DLOPEN], [1], [dlopen for shared object via c functions])])
if ! test "x$audio" = "xno"; then
CHECK_OGG()
CHECK_SDL()
CHECK_SMPEG()
CHECK_OPENAL()
else
AC_DEFINE([NoAudio], [1], [No Audio])
fi
if ! test "x$voip" = "xno"; then
# A C++ compiler must be present and usable
if test "$CXX" = "g++" -a "$GXX" = "yes"; then
CHECK_VOICE()
else
echo "VOIP: missing or untrusted C++; CXX is $CXX and GXX is $GXX"
fi
else
AC_DEFINE([NoVoip], [1], [No VOIP])
fi
if ! test "x$database" = "xno"; then
if test "ms$unicon_os" = "mswindows" ; then
CHECK_ODBC32()
else
CHECK_ODBC()
fi
else
AC_DEFINE([NoDatabase], [1], [No Database])
fi
CHECK_PTHREAD()
if ! test "x$ssl" = "xno" ; then
CHECK_OPENSSL()
else
AC_DEFINE([NoDatabase], [1], [No Database])
fi
# autoconf does this too late, so just do it now...
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
if test x"$werror" = x"yes" ; then
AC_CFLAG([-Werror])
fi
AC_SUBST(JV_LDFLAGS)
AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LDFLAGS)
AC_SUBST(prefix)
AC_SUBST(exec_prefix)
AC_SUBST(bindir)
AC_SUBST(libdir)
AC_SUBST(docdir)
AC_SUBST(mandir)
AC_SUBST(htmldir)
cprefix="$prefix"
cexec_prefix="$exec_prefix"
cbindir="$bindir"
clibdir="$libdir"
cdocdir="$docdir"
cmandir="$mandir"
for I in 1 2 3 4 5 6 7 8 9 10; do
eval cprefix="\"$cprefix\""
eval cexec_prefix="\"$cexec_prefix\""
eval cbindir="\"$cbindir\""
eval clibdir="\"$clibdir\""
eval cdocdir="\"$cdocdir\""
eval cmandir="\"$cmandir\""
done
AC_DEFINE_UNQUOTED([config_prefix], ["${cprefix}"], [prefix])
AC_DEFINE_UNQUOTED([config_exec_prefix], ["${cexec_prefix}"], [exec_prefix])
AC_DEFINE_UNQUOTED([config_bindir], ["${cbindir}"], [bindir])
AC_DEFINE_UNQUOTED([config_libdir], ["${clibdir}"], [libdir])
AC_DEFINE_UNQUOTED([config_docdir], ["${cdocdir}"], [docdir])
AC_DEFINE_UNQUOTED([config_man], ["${cmandir}"], [mandir])
AC_CHECK_GLOBAL(sys_nerr)
AC_CHECK_GLOBAL(sys_errlist)
AC_VAR_TIMEZONE_EXTERNALS()
AC_STRUCT_TIMEZONE()
AC_CONFIG_FILES([Makefile:Makefile.in],)
AC_CONFIG_FILES([Makedefs:Makedefs.in],)
AC_CONFIG_FILES([Makedefs.uni:Makedefs.uni.in],)
AC_CONFIG_HEADERS([src/h/auto.h:src/h/auto.in],)
AC_OUTPUT
if test "x$cv_libz" = "xyes" ; then
ctmp=" + Compression : +ZLIB"
else
ctmp=" - Compression : -ZLIB"
fi
# want graphics
if test "x$graphics" = "xyes" || test "x$graphics" = "xon" ; then
gtmp="Graphics :"
if test "x$cv_libX11" = "xyes" ; then
gtmp=" + $gtmp +X11 "
else
if test "x$graphics" = "xyes" ; then
AC_MSG_ERROR("Graphics requires libx11-dev or equivalent")
fi
gtmp=" - $gtmp -X11 "
fi
if test "x$cv_libjpeg" = "xyes" ; then gtmp="$gtmp +JPG " ; else gtmp="$gtmp -JPG " ; fi
if test "x$cv_libpng" = "xyes" ; then gtmp="$gtmp +PNG " ; else gtmp="$gtmp -PNG " ; fi
if test "x$cv_libXft" = "xyes" ; then gtmp="$gtmp +XFT " ; else gtmp="$gtmp -XFT " ; fi
if test "x$cv_libfreetype" = "xyes" ; then
gtmp="$gtmp+Freetype " ; else gtmp="$gtmp-FreeType " ; fi
else
#disbaled graphics
gtmp=" ! Graphics"
fi
# want graphics3d
if test "x$graphics3d" = "xyes" || test "x$graphics3d" = "xon" ; then
if test "x$cv_libGL" = "xyes" ; then
gdtmp="$gdtmp+OpenGL "
ong3d=1
else
if test "x$graphics3d" = "xyes" ; then
AC_MSG_ERROR("3D graphics requires libGL-dev")
fi
gdtmp="$gdtmp-OpenGL "
fi
if test "x$cv_libGLU" = "xyes" ; then
gdtmp="$gdtmp +GLU "
if test $ong3d = 1 ; then ong3d=2 ; fi
else
if test "x$graphics3d" = "xyes" ; then
AC_MSG_ERROR("3D graphics requires libGLU-dev")
fi
gdtmp="$gdtmp -GLU "
fi
if test "x$cv_libftgl" = "xyes" ; then gdtmp="$gdtmp +FTGL " ; else gdtmp="$gdtmp -FTGL " ; fi
if test "x$cv_opengl" = "xyes" ; then
gdtmp=" + Graphics3D : $gdtmp"
else
if test "x$graphics3d" = "xyes" ; then
AC_MSG_ERROR("3D graphics requires opengl librarry")
fi
gdtmp=" - Graphics3D : $gdtmp"
fi
else
#disbaled graphics3D
gdtmp=" ! Graphics3D"
fi
# want concurrency
if test "x$concurrency" = "xyes" || test "x$concurrency" = "xon" ; then
if test "x$cv_libpthread" = "xyes" ; then
contmp=" + Concurrency : +pthread"
else
contmp=" - Concurrency : -pthread"
fi
else
#disabled Concurrency
contmp=" ! Concurrency"
if test "x$concurrency" = "xyes" ; then
AC_MSG_ERROR("concurrency requires libpthread-dev")
fi
fi
# want audio
if test "x$audio" = "xyes" || test "x$audio" = "xon" ; then
atmp="Audio :"
onAudio=0
if test "x$cv_libopenal" = "xyes" ; then
atmp="$atmp +OpenAL "
onAudio="1"
else
if test "x$audio" = "xyes" ; then
AC_MSG_ERROR("audio requires libopenal-dev")
fi
atmp="$atmp -OpenAL "
fi
if test "x$cv_libalut" = "xyes" ; then
atmp="$atmp +alut "
if test "$onAudio" = 1 ; then onAudio=2 ; fi
else
if test "x$audio" = "xyes" ; then
AC_MSG_ERROR("audio requires libalut-dev")
fi
atmp="$atmp -alut "
fi
atmp="$atmp("
if test "x$cv_libogg" = "xyes" ; then
atmp="$atmp +ogg "
if test "$onAudio" = 2 ; then onAudio=3 ; fi
else
atmp="$atmp -ogg "
fi
if test "x$cv_libvorbis" = "xyes" ; then
atmp="$atmp +vorbis "
if test "$onAudio" = 3 ; then onAudio=4 ; fi
else
atmp="$atmp -vorbis "
fi
# if ogg was present but vorbis was missing, reset
if test "$onAudio" = 3 ; then onAudio=2 ; fi
atmp="$atmp) | ("
if test "x$cv_libsmpeg" = "xyes" ; then
atmp="$atmp +SDL +SMPEG "
if test "$onAudio" = 2 ; then onAudio=4 ; fi
else
atmp="$atmp -SDL -SMPEG "
fi
atmp="$atmp)"
if test "$onAudio" = 4 ; then
atmp=" + $atmp"
else
atmp=" - $atmp"
if test "x$audio" = "xyes" ; then
AC_MSG_ERROR("audio requires libsmpeg or libogg and libvorbis-dev")
fi
fi
else
#disbaled Audio
atmp=" ! Audio"
fi
# want voip
if test "x$voip" = "xyes" || test "x$voip" = "xon" ; then
if test "x$cv_libvoip" = "xyes" ; then
vtmp=" + VOIP : +voip"
else
if test "x$voip" = "xyes" ; then
AC_MSG_ERROR("voip requires libvoip-dev")
fi
vtmp=" - VOIP : -voip"
fi
if test "x$cv_libjvoip" = "xyes" ; then
vtmp="$vtmp +jvoip"
else
if test "x$voip" = "xyes" ; then
AC_MSG_ERROR("voip requires libjvoip-dev")