-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure.ac
1591 lines (1446 loc) · 44.1 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
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
#
# 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 2, 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# configure.ac for VREng https://github.com/philippedax/vreng
#
# Written by Philippe Dax, report bugs to philippe.dax@gmail.com
# --------------------------------------------------------------------------
#
# Check name, version, config
#
AC_INIT([vreng],[9.4.7],[philippe.dax@gmail.com])
AC_CONFIG_SRCDIR([src/base/vreng.cpp])
# where to find macros m4
AC_CONFIG_MACRO_DIR(conf)
# canonicalizing cpu:vendor:os
AC_CANONICAL_HOST([])
AM_INIT_AUTOMAKE([subdir-objects])
# use config.h
AC_CONFIG_HEADERS([config.h])
# version
set x `echo $PACKAGE_VERSION | tr '.' ' '`
major=$2
minor=$3
micro=$4
AH_TEMPLATE(VRENG_MAJOR_VERSION, [VReng major version])
AC_DEFINE_UNQUOTED(VRENG_MAJOR_VERSION, [$major])
AH_TEMPLATE(VRENG_MINOR_VERSION, [VReng minor version])
AC_DEFINE_UNQUOTED(VRENG_MINOR_VERSION, [$minor])
AH_TEMPLATE(VRENG_MICRO_VERSION, [VReng micro version])
AC_DEFINE_UNQUOTED(VRENG_MICRO_VERSION, [$micro])
ubit_features=""
# --------------------------------------------------------------------------
#
# Check for compiler
#
if test "${CFLAGS}" = ""; then CFLAGS=-O2; fi
if test "${CXXFLAGS}" = ""; then CXXFLAGS=-O0; fi
AC_LANG([C++])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP
# --------------------------------------------------------------------------
#
# Programs needed by the build and install process
#
AC_PROG_YACC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_CHECK_PROG(AR, ar, ar)
AC_PROG_RANLIB
AC_SEARCH_LIBS([strerror],[cposix])
# --------------------------------------------------------------------------
#
# Where to install by default, handle the --prefix=... option
#
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=${prefix}
fi
# --------------------------------------------------------------------------
#
# Compile flags
#
CFLAGS="${CFLAGS}"
CXXFLAGS="${CXXFLAGS}"
CPPFLAGS="${CXXFLAGS}"
LDFLAGS="${LDFLAGS}"
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -Wall"
CXXFLAGS="${CXXFLAGS} -Wall"
LDFLAGS="${LDFLAGS} -g"
#CFLAGS=`echo ${CFLAGS} | sed -e 's/-O2//'`
CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-O2//'`
LDFLAGS=`echo ${LDFLAGS} | sed -e 's/-O2//'`
fi
# --------------------------------------------------------------------------
#
# Check for optimization
#
AC_ARG_ENABLE(optimize, AS_HELP_STRING([--enable-optimize], [allow to optimize [[default=no]]]))
if test "${enable_optimize:=no}" = "yes"; then
if test "${GCC}" = "yes"; then
optim_flags="-ffast-math -fomit-frame-pointer -funroll-loops -fpermissive"
CFLAGS="${CFLAGS} ${optim_flags}"
CXXFLAGS="${CXXFLAGS} ${optim_flags}"
CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-O0/-O2/'`
fi
fi
# --------------------------------------------------------------------------
#
# Check for debugging
#
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [allow to debug [[default=no]]]))
if test "${enable_debug:=no}" = "yes"; then
if test "${GCC}" = "yes"; then
CFLAGS=`echo ${CFLAGS} | sed -e 's/-O2/-DDEBUG/'`
CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-O0/-DDEBUG/'`
LDFLAGS="`echo ${LDFLAGS} | sed -e 's/-O0//'` -g"
fi
fi
# --------------------------------------------------------------------------
#
# Check for profiling compiler option
#
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [add -pg gcc option [[default=no]]]))
if test "${enable_profiling:=no}" = "yes"; then
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -pg"
CXXFLAGS="${CXXFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg"
fi
fi
# --------------------------------------------------------------------------
#
# Check for permissive compiler option
#
AC_ARG_ENABLE(permissive, AS_HELP_STRING([--enable-permissive], [add --permissive gcc option [[default=no]]]))
if test "${enable_permissive:=no}" = "yes"; then
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS}"
CXXFLAGS="${CXXFLAGS} --permissive"
fi
fi
# --------------------------------------------------------------------------
#
# Check for gcc
#
if test "${GCC}" = "yes"; then
case "$gcc_major_version" in
4)
case "$gcc_minor_version" in
0) ;;
*) CXXFLAGS="${CXXFLAGS} -ffriend-injection" ;;
esac
;;
esac
fi
# --------------------------------------------------------------------------
#
# Check if support for 64 bits (tested with gcc-2.96, gcc-3.*, gcc4.*)
#
AC_ARG_ENABLE(64bit, AS_HELP_STRING([--enable-64bit], [enable 64 bits compilation [[default=no]]]))
if test "${enable_64bit:=no}" = "yes"; then
AC_MSG_RESULT([--> Using 64 bits])
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -m64"
CXXFLAGS="${CXXFLAGS} -m64"
fi
fi
# --------------------------------------------------------------------------
#
# Check for OS types
#
AH_TEMPLATE(LINUX)
AH_TEMPLATE(MACOSX)
AH_TEMPLATE(WIN32)
AH_TEMPLATE(SOLARIS)
AH_TEMPLATE(SUNOS)
AH_TEMPLATE(LINUX_SPARC)
AH_TEMPLATE(LINUX_ALPHA)
AH_TEMPLATE(LINUX_IPAQ)
AH_TEMPLATE(FREEBSD)
AH_TEMPLATE(NETBSD)
AH_TEMPLATE(OPENBSD)
AH_TEMPLATE(HPUX)
AH_TEMPLATE(AIX)
AH_TEMPLATE(OSF1)
AH_TEMPLATE(IRIX)
AH_TEMPLATE(NEXTSTEP)
AH_TEMPLATE(CYGWIN32)
AH_TEMPLATE(FEDORA)
AH_TEMPLATE(UBUNTU)
AH_TEMPLATE(CENTOS)
AH_TEMPLATE(DEBIAN)
# OS dependent paths
OSDEP_LIBS=""
OSDEP_CFLAGS=""
# X11 paths
case "$build" in
*-*-darwin*)
;;
*)
X_CFLAGS="-I/usr/X11R6/include"
X_LIBS="-L/usr/X11R6/lib"
if test "$x_includes" != "NONE" ; then
X_CFLAGS="-I$x_includes"
fi
if test "$x_libraries" != "NONE" ; then
X_LIBS="-L$x_libraries"
fi
;;
esac
# defaults
libmpeg=mpeg
LDFLAGS_EXT=""
echo "canonical: $build"
case "$build" in
*-*-solaris*)
AC_DEFINE(SOLARIS)
X_CFLAGS="-I/usr/X11R6/include -I/usr/openwin/include"
X_LIBS="-L/usr/openwin/lib"
if test -d /usr/local/lib ; then
OSDEP_LIBS="-L/usr/local/lib"
fi
if test -d /usr/local/include ; then
OSDEP_CFLAGS="-I/usr/local/include"
fi
;;
sparc-sun-sunos*)
AC_DEFINE(SUNOS)
;;
sparc-*-linux*)
AC_DEFINE(LINUX_SPARC)
AC_DEFINE(LINUX)
;;
alpha-*-linux*)
AC_DEFINE(LINUX_ALPHA)
AC_DEFINE(LINUX)
;;
armv4l-*-linux*)
AC_DEFINE(LINUX_IPAQ)
AC_DEFINE(LINUX)
;;
*-*-linux*)
AC_DEFINE(LINUX)
X_CFLAGS="-I/usr/include"
if test -d /usr/lib64 ; then
X_LIBS="-L/usr/lib64"
OSDEP_LIBS="-L/usr/lib64"
else
X_LIBS="-L/usr/lib"
OSDEP_LIBS="-L/usr/lib"
fi
distrib=`lsb_release -is`
case $distrib in
Fedora)
AC_DEFINE(FEDORA)
;;
Ubuntu)
AC_DEFINE(UBUNTU)
;;
Debian)
AC_DEFINE(DEBIAN)
;;
CentOS)
AC_DEFINE(CENTOS)
;;
esac
;;
*-*-freebsd*)
AC_DEFINE(FREEBSD)
;;
*-*-netbsd*)
AC_DEFINE(NETBSD)
OSDEP_LIBS="-L/usr/pkg/lib"
if test -d /usr/pkg/include ; then
OSDEP_CFLAGS="-I/usr/pkg/include"
fi
CPPFLAGS="${OSDEP_CFLAGS} $CPPFLAGS"
# special patch for pkgsrc -lmpeg become -lmpeg_lib, because of kde conflict
libmpeg=mpeg_lib
;;
*-*-openbsd*)
AC_DEFINE(OPENBSD)
;;
*-*-hpux*)
AC_DEFINE(HPUX)
;;
*-*-aix*)
AC_DEFINE(AIX)
;;
*-*-osf*)
AC_DEFINE(OSF1)
;;
*-*-irix*)
AC_DEFINE(IRIX)
;;
*-*-darwin*|*-*-macosx*)
AC_DEFINE(MACOSX)
# needed by ocaml linking
LDFLAGS="-Wl,-no_compact_unwind"
# search in MacPorts and Fink installs
if test -d /usr/X11/include ; then
OSDEP_CFLAGS="-I/usr/X11/include"
X_CFLAGS="-I/usr/X11/include"
CPPFLAGS="${OSDEP_CFLAGS} $CPPFLAGS"
elif test -d /opt/X11/include ; then
OSDEP_CFLAGS="-I/opt/X11/include"
X_CFLAGS="-I/opt/X11/include"
CPPFLAGS="${OSDEP_CFLAGS} $CPPFLAGS"
elif test -d /opt/local/include ; then
OSDEP_CFLAGS="-I/opt/local/include"
CPPFLAGS="${OSDEP_CFLAGS} $CPPFLAGS"
fi
if test -d /usr/X11/lib ; then
OSDEP_LIBS="-L/usr/X11/lib"
X_LIBS="-L/usr/X11/lib"
elif test -d /opt/X11/lib ; then
OSDEP_LIBS="-L/opt/X11/lib"
X_LIBS="-L/opt/X11/lib"
elif test -d /opt/local/lib ; then
OSDEP_LIBS="-L/opt/local/lib"
fi
case "$build" in
*-*-darwin9*)
# BUG leopard
LDFLAGS_EXT="-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
;;
esac
;;
*-*-nextstep*)
AC_DEFINE(NEXTSTEP)
;;
i*-pc-cygwin*|i*-pc-mingw*)
AC_DEFINE(CYGWIN32)
AC_DEFINE(WIN32)
AC_DEFINE(HAVE_MULTICAST)
;;
esac
#
# Find TTF fonts (TrueType fonts)
#
AH_TEMPLATE(TTFPATH)
AH_TEMPLATE(HAVE_TTF_PFA)
TTFPATH=
if test -f /usr/share/X11/fonts/Type1/UTRG____.pfa; then
TTFPATH=/usr/share/X11/fonts/Type1/
AC_DEFINE(HAVE_TTF_PFA)
elif test -f /usr/share/fonts/X11/Type1/UTRG____.pfa; then
TTFPATH=/usr/share/fonts/X11/Type1/
AC_DEFINE(HAVE_TTF_PFA)
elif test -f /usr/X11/share/fonts/Type1/UTRG____.pfa; then
TTFPATH=/usr/X11/share/fonts/Type1/
AC_DEFINE(HAVE_TTF_PFA)
elif test -f /usr/X11/lib/fonts/Type1/UTRG____.pfa; then
TTFPATH=/usr/X11/lib/fonts/Type1/
AC_DEFINE(HAVE_TTF_PFA)
else
AC_MSG_WARN(Vreng requires TTF freetype fonts with the pfs format see src/ubit/fonts directory)
fi
if test x$TTFPATH != x; then
AC_DEFINE_UNQUOTED(TTFPATH, ["$TTFPATH"])
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
# --------------------------------------------------------------------------
# Check if we need to have -lnsl and -lsocket in LIBS. This may be needed
# to get the functions below right (socket, gethostbyname).
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB([socket], [connect])
AC_CHECK_LIB([m], [sqrt])
# --------------------------------------------------------------------------
#
# Check headers
#
AC_INCLUDES_DEFAULT([])
AC_HEADER_DIRENT
AC_HEADER_RESOLV
AC_HEADER_STAT
AC_HEADER_ASSERT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ unistd.h stddef.h float.h limits.h fcntl.h stdarg.h ctype.h utime.h malloc.h signal.h math.h errno.h setjmp.h getopt.h pwd.h pthread.h locale.h wchar.h libintl.h floatingpoint.h sys/param.h sys/time.h sys/timeb.h sys/socket.h sys/select.h sys/poll.h sys/resource.h sys/utsname.h netinet/tcp.h arpa/inet.h ])
# --------------------------------------------------------------------------
#
# Check for sizeofs and typedefs.
#
AC_C_BIGENDIAN
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_CHECK_TYPES(ptrdiff_t)
AC_MSG_CHECKING(for socklen_t)
AC_EGREP_HEADER([socklen_t], sys/socket.h, is_socklen=yes, is_socklen=no)
if test "$is_socklen" = "yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AH_TEMPLATE(HAVE_NO_SOCKLEN_T)
AC_DEFINE(HAVE_NO_SOCKLEN_T)
fi
# --------------------------------------------------------------------------
#
# Check for library functions.
#
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_FUNC_STRTOD
##AC_FUNC_MALLOC
##AC_FUNC_REALLOC
AC_CHECK_FUNCS([ getuid getpid getcwd getpwuid gethostname gethostid gethostbyaddr gethostbyname gethostbyname_r getservbyname getipnodebyname getipnodebyaddr getaddrinfo freehostent inet_pton inet_ntoa inet_ntop isascii gettimeofday memcpy memmove memset mkdir pow sqrt strcasecmp strchr strrchr strstr strcasecmp strerror strdup strtol strpbrk utime fcntl floor select poll socket setrlimit waitpid readdir getopt getopt_long uname rand random drand48 lrand48 usleep fpsetmask nice setlocale alarm ftime sysinfo ])
AH_TEMPLATE(_REENTRANT)
if test "$ac_cv_func_gethostbyname_r" = "yes" ; then
AC_DEFINE(_REENTRANT)
fi
if test "$ac_cv_func_strerror" = "no"; then
AC_CHECK_LIB([iberty], [strerror])
fi
# --------------------------------------------------------------------------
#
# Check for IP-Multicast support
#
AH_TEMPLATE(HAVE_MULTICAST)
AC_MSG_CHECKING(for IP Multicast support)
AC_EGREP_HEADER([struct ip_mreq], netinet/in.h, is_mc=yes, is_mc=no)
if test "${is_mc}" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MULTICAST)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# Check IPv6 support
#
am_ipv6="no"
AC_ARG_ENABLE(ipv6,
AS_HELP_STRING([--enable-ipv6],
[allow use of ipv6 if available [[default=no]]]))
AH_TEMPLATE(HAVE_IPV6)
if test "${enable_ipv6:=no}" = "yes"; then
am_ipv6="yes"
AC_MSG_CHECKING(IPv6 support)
AC_EGREP_HEADER(sockaddr_in6, netinet/in.h,
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IPV6)
])
fi
LIBS=""
AC_SUBST(LIBS)
# --------------------------------------------------------------------------
#
# Posix threads configuration
#
AH_TEMPLATE(WITH_PTHREAD)
AH_TEMPLATE(HAVE_LIBPTHREAD)
AC_ARG_ENABLE([pthread],
AS_HELP_STRING([--enable-pthread],
[allow use of pthreads [[default=yes]]]))
if test "${enable_pthread:=yes}" = "yes"; then
#
# check pthread
#
AC_CHECK_LIB([pthread], [pthread_create],
[LIBS="-lpthread -ldl $LIBS"],
[AC_MSG_WARN([pthreads library not found, check config.log!])])
if test "$ac_cv_lib_pthread_pthread_create" = "yes" ; then
CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
AC_DEFINE(WITH_PTHREAD)
AC_DEFINE(HAVE_LIBPTHREAD)
fi
fi
# --------------------------------------------------------------------------
#
# Check for dmalloc option
#
AC_ARG_ENABLE([dmalloc],
AS_HELP_STRING([--enable-dmalloc],
[enable dmalloc debugging [[default=no]]]))
if test "${GCC}" = "yes"; then
if test "${enable_dmalloc:=no}" = "yes"; then
CFLAGS="${CFLAGS} -DDMALLOC_FUNC_CHECK"
CXXFLAGS="${CXXFLAGS} -DDMALLOC_FUNC_CHECK"
AC_CHECK_LIB([dmallocthcxx], [dmalloc_verify])
AC_CHECK_HEADERS([dmalloc.h])
fi
fi
# --------------------------------------------------------------------------
#
# standalone
#
AC_MSG_CHECKING(if standalone is enabled)
AC_ARG_ENABLE(standalone,
AS_HELP_STRING([--enable-standalone],
[allow use without network connectivity [[default=no]]]))
if test "${enable_standalone:=no}" = "yes"; then
CFLAGS="${CFLAGS} -DSTANDALONE"
CXXFLAGS="${CXXFLAGS} -DSTANDALONE"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
if test "${enable_standalone}" = "yes"; then
AH_TEMPLATE(DEF_URL_PFX)
AC_MSG_CHECKING(if localhost httpd prefix is defined)
AC_ARG_WITH(httpd_prefix,
AS_HELP_STRING([--with-httpd-prefix=[DIR]],
[prefix relative to the localhost httpd root directory where are located vreng data]))
if test "${with_httpd_prefix}" != ""; then
AC_DEFINE_UNQUOTED(DEF_URL_PFX, ["${with_httpd_prefix}"])
AC_MSG_RESULT(yes -> "${with_httpd_prefix}")
else
AC_DEFINE_UNQUOTED(DEF_URL_PFX, ["/vreng"])
AC_MSG_RESULT(no -> "/vreng")
fi
fi
# --------------------------------------------------------------------------
#
# vrl configuration
#
am_vrl="no"
AC_MSG_CHECKING(if vrl is enabled)
AC_ARG_ENABLE(vrl,
AS_HELP_STRING([--enable-vrl],
[allow use of vrl [[default=no]]]))
if test "${enable_vrl:=no}" = "yes"; then
am_vrl="yes"
CXXFLAGS="${CXXFLAGS} -DVRL"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# vrel configuration
#
am_vrel="no"
AC_MSG_CHECKING(if vrel is enabled)
AC_ARG_ENABLE(vrel,
AS_HELP_STRING([--enable-vrel],
[allow use of vrel [[default=no]]]))
if test "${enable_vrel:=no}" = "yes"; then
am_vrel="yes"
CXXFLAGS="${CXXFLAGS} -DVREL"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# vred configuration
#
am_vred="no"
AC_MSG_CHECKING(if vred is enabled)
AC_ARG_ENABLE(vred,
AS_HELP_STRING([--enable-vred],
[allow use of vred [[default=no]]]))
if test "${enable_vred:=no}" = "yes"; then
am_vred="yes"
am_libglui="yes"
CXXFLAGS="${CXXFLAGS} -DVRED"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# vmm configuration
#
am_vmm="no"
AC_MSG_CHECKING(if vmm is enabled)
AC_ARG_ENABLE(vmm,
AS_HELP_STRING([--enable-vmm],
[allow use of vmm [[default=no]]]))
if test "${enable_vmm:=no}" = "yes"; then
am_vmm="yes"
CXXFLAGS="${CXXFLAGS} -DVMM"
#
# Java configuration
#
AC_JAVA_OPTIONS
AC_PROG_JAVAC
AC_PROG_JAVA
AC_PROG_JAR
AH_TEMPLATE(HAVE_JAVA)
if test "$ac_cv_prog_java_works" = "yes" ; then
AC_DEFINE(HAVE_JAVA)
else
am_java="no"
fi
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# vaps server configuration
#
am_vaps="no"
AC_MSG_CHECKING(if vaps is enabled)
AC_ARG_ENABLE(vaps,
AS_HELP_STRING([--enable-vaps],
[allow use of vaps server [[default=no]]]))
if test "${enable_vaps:=no}" = "yes"; then
am_vaps="yes"
CXXFLAGS="${CXXFLAGS} -DVAPS"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# vjs server configuration
#
am_vjs="no"
am_java="yes"
AC_MSG_CHECKING(if vjs is enabled)
AC_ARG_ENABLE(vjs,
AS_HELP_STRING([--enable-vjs],
[allow use of vjs server [[default=no]]]))
if test "${enable_vjs:=no}" = "yes"; then
am_vjs="yes"
CXXFLAGS="${CXXFLAGS} -DVJS"
AC_MSG_RESULT(yes)
#
# Java configuration
#
AC_JAVA_OPTIONS
AC_PROG_JAVAC
AC_PROG_JAVA
AC_PROG_JAR
AH_TEMPLATE(HAVE_JAVA)
if test "$ac_cv_prog_java_works" = "yes" ; then
AC_DEFINE(HAVE_JAVA)
else
am_java="no"
fi
else
AC_MSG_RESULT(no)
am_java="no"
fi
# --------------------------------------------------------------------------
#
# vacs server configuration
#
am_vacs="no"
AC_MSG_CHECKING(if vacs is enabled)
AC_ARG_ENABLE(vacs,
AS_HELP_STRING([--enable-vacs],
[allow use of vacs server [[default=no]]]))
if test "${enable_vacs:=no}" = "yes"; then
am_vacs="yes"
CXXFLAGS="{$CXXFLAGS} -DVACS"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# --------------------------------------------------------------------------
#
# check X11 first (see AC_X11_CHECK conf/acinclude.m4)
#
AC_X11_CHECK
saved_ldflags=$LDFLAGS
LDFLAGS="$X_LDFLAGS $X_LIBS"
# --------------------------------------------------------------------------
#
# check Xpm library
#
AC_CHECK_LIB([Xpm], [XpmReadFileToXpmImage],
[LIBS="-lXpm $LIBS"],
[AC_MSG_WARN([Xpm library not found, check config.log!,
Ubit needs Xpm, get http://koala.ilog.fr/ftp/pub/xpm or try apt|dnf|yum|brew install libXpm-devel | apt-get install libxpm-dev])],
[$X_LIBS $x_libs])
AH_TEMPLATE(HAVE_LIBXPM)
if test "$ac_cv_lib_Xpm_XpmReadFileToXpmImage" = "yes"; then
AC_DEFINE([HAVE_LIBXPM])
ubit_features="$ubit_features UBIT_WITH_XPM"
fi
LDFLAGS="$LDFLAGS $OSDEP_LIBS"
# --------------------------------------------------------------------------
#
# check gif library
#
AH_TEMPLATE(HAVE_LIBGIF)
AC_CHECK_LIB([ungif], [DGifOpenFileName],
[LIBS="-lungif $LIBS"],
[],
[-L/usr/local/lib])
if test "$ac_cv_lib_ungif_DGifOpenFileName" = "yes"; then
AC_DEFINE(HAVE_LIBGIF)
ubit_features="$ubit_features UBIT_WITH_GIF"
else
AC_CHECK_LIB([gif], [DGifOpenFileName],
[LIBS="-lgif $LIBS"],
[AC_MSG_WARN([gif library not found, check config.log!,
get ftp://prtr-13.ucsc.edu/pub/libungif/ or try apt|dnf|yum|brew install giflib-devel | apt-get install libgif-dev giflib-tools])],
[-L/usr/local/lib])
if test "$ac_cv_lib_gif_DGifOpenFileName" = "yes"; then
AC_DEFINE(HAVE_LIBGIF)
ubit_features="$ubit_features UBIT_WITH_GIF"
fi
fi
# --------------------------------------------------------------------------
#
# check jpeg library
#
AH_TEMPLATE(HAVE_LIBJPEG)
AC_CHECK_LIB([jpeg], [jpeg_read_scanlines],
[LIBS="-ljpeg $LIBS"],
[AC_MSG_WARN([jpeg library not found, check config.log!, or try apt|dnf|yum|brew install libjpeg-turbo-devel | apt-get install libjpeg8-dev])],
[-L/usr/local/lib])
if test "$ac_cv_lib_jpeg_jpeg_read_scanlines" = "yes"; then
AC_DEFINE([HAVE_LIBJPEG])
ubit_features="$ubit_features UBIT_WITH_JPEG"
fi
AH_TEMPLATE(HAVE_JPEGLIB_H)
AC_CHECK_HEADER([jpeglib.h], [AC_DEFINE([HAVE_JPEGLIB_H])],
AC_MSG_WARN([unable to find jpeg header]))
# --------------------------------------------------------------------------
#
# check tiff library
#
AH_TEMPLATE(HAVE_LIBTIFF)
AC_CHECK_LIB([tiff], [TIFFOpen],
[LIBS="-ltiff $LIBS"],
[AC_MSG_WARN([tiff library not found, check config.log!, try apt|dnf|yum|brew install libtiff-devel | apt-get install libtiff4-dev])],
[-L/usr/local/lib])
if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
AC_DEFINE([HAVE_LIBTIFF])
AH_TEMPLATE(HAVE_TIFFIO_H)
AC_CHECK_HEADER([tiffio.h], [AC_DEFINE([HAVE_TIFFIO_H])],
AC_MSG_WARN([unable to find tiff header]))
fi
# --------------------------------------------------------------------------
#
# check png library
#
AH_TEMPLATE(HAVE_LIBPNG)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_CHECK_LIB([png], [png_error],
[LIBS="-lpng $LIBS"],
[AC_MSG_WARN([png library not found, check config.log, or try apt|dnf|yum|brew install libpng-devel or apt-get install libpng-dev])],
[-L/usr/local/lib -lz])
if test "$ac_cv_lib_png_png_error" = "yes" ; then
AC_DEFINE(HAVE_LIBPNG)
fi
AH_TEMPLATE(HAVE_PNG_H)
AC_CHECK_HEADER([png.h], [AC_DEFINE([HAVE_PNG_H])],
AC_MSG_WARN([unable to find png header]))
# --------------------------------------------------------------------------
#
# Mpeg configuration
#
AC_ARG_WITH([mpeg],
AS_HELP_STRING([--with-mpeg],
[allow use of builtin libmpeg [[default=yes]]]))
am_libmpeg="no"
AH_TEMPLATE(HAVE_LIBMPEG)
if test "${with_mpeg:=yes}" = "yes"; then
#
# check mpeg
#
AC_CHECK_LIB([mpeg], [OpenMPEG],
[LIBS="-L/usr/local/lib -l${libmpeg} $LIBS"],
[AC_MSG_RESULT([ use embedded mpeg_lib ])],
[-L/usr/local/lib])
if test $ac_cv_lib_mpeg_OpenMPEG = "yes" ; then
AC_DEFINE(HAVE_LIBMPEG)
else
am_libmpeg="yes"
AC_DEFINE(HAVE_LIBMPEG)
fi
fi
# --------------------------------------------------------------------------
#
# check curl library
#
AH_TEMPLATE(HAVE_LIBCURL)
AC_CHECK_LIB([curl], [curl_easy_init],
[LIBS="-lcurl $LIBS"],
[AC_MSG_WARN([curl library not found, check config.log, or try apt|dnf|yum|brew install libcurl-devel or apt-get install libcurl4-openssl-dev])],
[-L/usr/local/lib])
if test "$ac_cv_lib_curl_curl_easy_init" = "yes"; then
AC_DEFINE([HAVE_LIBCURL])
AH_TEMPLATE(HAVE_CURL_CURL_H)
AC_CHECK_HEADER([curl/curl.h], [AC_DEFINE([HAVE_CURL_CURL_H])],
AC_MSG_WARN([unable to find curl header]))
fi
# --------------------------------------------------------------------------
#
# searches for freetype2 library
#
have_freetype="no"
have_freetype_and_gl="no"
AH_TEMPLATE(WITH_FREETYPE)
AC_CHECK_LIB([freetype],[FT_Library_Version],[have_freetype="yes"
[LIBS="-lfreetype $LIBS"]],
[AC_MSG_WARN([could not find FreeType2!, try apt|dnf|yum|brew install freetype-devel or apt-get install libfreetype6-dev])])
AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
freetype_cflags=`$FREETYPE_CONFIG --cflags`
FREETYPE_CFLAGS=$freetype_cflags
AC_SUBST(FREETYPE_CFLAGS)
freetype_libs=`$FREETYPE_CONFIG --libs`
CPPFLAGS="$freetype_cflags $CPPFLAGS"
LDFLAGS="$LDFLAGS $freetype_libs"
if test "$have_freetype" = "yes"; then
ubit_features="$ubit_features UBIT_WITH_FREETYPE"
if test "$have_gl" = "yes"; then
have_freetype_and_gl="yes";
fi
fi
AM_CONDITIONAL(WITH_FREETYPE, test "$have_freetype" = "yes")
AM_CONDITIONAL(WITH_FTGL, test "$have_freetype_and_gl" = "yes")
# --------------------------------------------------------------------------
#
# Ubit configuration
#
AC_ARG_WITH([ubit-builtin],
AS_HELP_STRING([--with-ubit-builtin],[use builtin UBIT toolkit [[default=yes]]]),
[ac_cv_use_ubit_builtin=$withval], [ac_cv_use_ubit_builtin=yes])
LDFLAGS="$X_LDFLAGS $X_LIBS -lpthread"
# Use builtin ubit
UBIT_L="-L../../src/ubit"
UBIT_I="-I../../src"
UBIT_CFLAGS=$UBIT_I
LIBS="-lXmu -lX11 $LIBS"
am_ubit="yes"
am_libftgl="yes"
min_ubit_version=7.0.0
toolkit=7.0.0
XLIBS=$x_libs
AC_SUBST(XLIBS)
AC_SUBST(UBIT_CFLAGS)
LDFLAGS=$saved_ldflags
# --------------------------------------------------------------------------
#
# TinyGL configuration
#
#AC_ARG_WITH([tinygl],
# AS_HELP_STRING([--with-tinygl],
# [allow use of libtinygl if available [[default=no]]]))
#
am_libtinygl="no"
#AH_TEMPLATE(HAVE_LIBTINYGL)
#if test "${with_tinygl:=yes}" = "yes"; then
# #
# # check tinygl
# #
# AC_CHECK_LIB([tinygl], [glBegin],
# [LIBS="-L/usr/local/lib -l${libtinygl} $LIBS"],
# [AC_MSG_RESULT([ use embedded tinygl ])],
# [-L/usr/local/lib])
# if test $ac_cv_lib_tinygl_glBegin = "yes" ; then
# AC_DEFINE(HAVE_LIBTINYGL)
# else
# am_libtinygl="yes"
# AC_DEFINE(HAVE_LIBTINYGL)
# fi
#fi
# --------------------------------------------------------------------------
#
# OpenGL configuration
#
have_gl="no"
AC_ARG_WITH([GL-prefix],
AS_HELP_STRING([--with-GL-prefix=DIR],
[prefix for OpenGL/Mesa3D lib & include]))
case "$build" in
*-*-darwin*)
GL_L="-L/usr/lib -L/usr/X11/lib -L/usr/local/lib"
GL_I="-I/usr/X11/include"
;;
*)
GL_L="-L/usr/lib"
GL_I="-I/usr/include"
;;
esac
if test -n "$with_GL_prefix"; then
GL_L="-L$with_GL_prefix/lib"
GL_I="-I$with_GL_prefix/include"
fi
saved_cppflags=$CPPFLAGS