-
Notifications
You must be signed in to change notification settings - Fork 3
/
aclocal.m4
3464 lines (2965 loc) · 103 KB
/
aclocal.m4
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
dnl Autoconf support for Bundle Protocol Query Extension
dnl
AC_DEFUN(AC_CONFIG_BPQ, [
ac_bpq='no'
AC_ARG_WITH(bpq,
AC_HELP_STRING([--with-bpq],
[enable Bundle Protocol Query Extension support]),
ac_bpq=$withval)
dnl
dnl First make sure we even want it
dnl
if test "$ac_bpq" = no; then
BPQ_ENABLED=0
else
BPQ_ENABLED=1
AC_DEFINE_UNQUOTED(BPQ_ENABLED, 1, [whether Bundle Protocol Query Extension support is enabled])
fi # BPQ_ENABLED
])dnl
dnl Autoconf support for Bundle Security Protocol
dnl
AC_DEFUN(AC_CONFIG_BSP, [
ac_bsp='no'
AC_ARG_WITH(bsp,
AC_HELP_STRING([--with-bsp],
[enable Bundle Security Protocol support (EXPERIMENTAL)]),
ac_bsp=$withval)
dnl
dnl First make sure we even want it
dnl
if test "$ac_bsp" = no; then
BSP_ENABLED=0
else
BSP_ENABLED=1
AC_DEFINE_UNQUOTED(BSP_ENABLED, 1, [whether Bundle Security Protocol support is enabled])
fi # BSP_ENABLED
])
dnl
dnl Autoconf support for external convergence layer
dnl
AC_DEFUN(AC_CONFIG_EXTERNAL_CL, [
ac_ecl='yes'
AC_ARG_ENABLE(ecl,
AC_HELP_STRING([--disable-ecl],
[disable external convergence layer support]),
ac_ecl=$enableval)
dnl
dnl First make sure we even want it
dnl
AC_MSG_CHECKING(whether to enable external convergence layer support)
if test "$ac_ecl" = no; then
AC_MSG_RESULT(no)
EXTERNAL_CL_ENABLED=0
else
AC_MSG_RESULT(yes)
AC_OASYS_SUPPORTS(XERCES_C_ENABLED)
if test $ac_oasys_supports_result != yes ; then
AC_MSG_ERROR([external convergence layer support requires xerces... install it or configure --disable-ecl])
fi
EXTERNAL_CL_ENABLED=1
AC_DEFINE_UNQUOTED(EXTERNAL_CL_ENABLED, 1, [whether external convergence layer support is enabled])
fi # EXTERNAL_CL_ENABLED
])
dnl
dnl Autoconf support for external decision plane
dnl
AC_DEFUN(AC_CONFIG_EXTERNAL_DP, [
ac_edp='yes'
AC_ARG_ENABLE(edp,
AC_HELP_STRING([--disable-edp],
[disable external decision plane support]),
ac_edp=$enableval)
dnl
dnl First make sure we even want it
dnl
AC_MSG_CHECKING(whether to enable external decision plane support)
if test "$ac_edp" = no; then
AC_MSG_RESULT(no)
EXTERNAL_DP_ENABLED=0
else
AC_MSG_RESULT(yes)
AC_OASYS_SUPPORTS(XERCES_C_ENABLED)
if test $ac_oasys_supports_result != yes ; then
AC_MSG_ERROR([external decision plane support requires xerces... install it or configure --disable-edp])
fi
AC_DEFINE_UNQUOTED(EXTERNAL_DP_ENABLED, 1, [whether external decision plane support is enabled])
fi # EXTERNAL_DP_ENABLED
])
dnl
dnl Copyright 2005-2006 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
#
# Macro based on AC_CHECK_LIB but which takes a particular
# LFLAGS setting as another argument to go into the cache.
#
# AC_CHECK_LIB_FLAGS(LIBRARY, FUNCTION, LDFLAGS,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [OTHER-LIBRARIES])
# ------------------------------------------------------
#
# Use a cache variable name containing both the library and function name,
# because the test really is for library $1 defining function $2, not
# just for library $1. Separate tests with the same $1 and different $2s
# may have different results.
#
# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])
# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
# ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence
# the AS_LITERAL_IF indirection.
#
# FIXME: This macro is extremely suspicious. It DEFINEs unconditionally,
# whatever the FUNCTION, in addition to not being a *S macro. Note
# that the cache does depend upon the function we are looking for.
#
# It is on purpose we used `ac_check_lib_save_LIBS' and not just
# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
# changed but still want to use AC_CHECK_LIB, so they save `LIBS'.
# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
# freedom.
AC_DEFUN([AC_CHECK_LIB_FLAGS],
[m4_ifval([$4], , [AH_CHECK_LIB([$1])])dnl
AS_LITERAL_IF([$1],
[AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2_$3])],
[AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2_$3])])dnl
AC_CACHE_CHECK([for $2 in -l$1 with $3], ac_Lib,
[ac_check_lib_save_LIBS=$LIBS
ac_check_lib_save_LDFLAGS=$LDFLAGS
LIBS="-l$1 $6 $LIBS"
LDFLAGS="$3 $LDFLAGS"
AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
[AS_VAR_SET(ac_Lib, yes)],
[AS_VAR_SET(ac_Lib, no)])
LIBS=$ac_check_lib_save_LIBS
LDFLAGS=$ac_check_lib_save_LDFLAGS])
AS_IF([test AS_VAR_GET(ac_Lib) = yes],
[m4_default([$4], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
])],
[$5])dnl
AS_VAR_POPDEF([ac_Lib])dnl
])# AC_CHECK_LIB
dnl
dnl Autoconf support for LTP convergence layer based on TCD's LTPLib
dnl
AC_DEFUN(AC_CONFIG_LTP, [
AC_ARG_WITH(ltp,
[AC_HELP_STRING([--with-ltp],
[enable LTP convergence layer support using TCD's LTPlib (EXPERIMENTAL)])],
[ac_use_ltp=$withval],
[ac_use_ltp="no"])
AC_MSG_CHECKING([whether to enable LTP convergence layer support])
dnl
dnl Disable LTP if requested
dnl
if test "$ac_use_ltp" = "no"; then
AC_MSG_RESULT(no)
LTP_ENABLED=0
else
dnl
dnl Find the LTPlib installation
dnl
if test "$ac_use_ltp" = try \
-o "$ac_use_ltp" = yes \
-o "$ac_use_ltp" = "" ; then
AC_MSG_RESULT([try])
ac_ltp_inst_dirs="$ac_pwd/../LTPlib /usr /usr/local"
else
AC_MSG_RESULT([yes (dir $ac_use_ltp)])
ac_ltp_inst_dirs="$ac_use_ltp"
fi
ac_save_EXTLIB_CFLAGS="$EXTLIB_CFLAGS"
ac_save_EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS"
AC_MSG_CHECKING([whether ltp libraries are available])
AC_CACHE_VAL(dtn_cv_path_ltp,
[
for ac_ltp_inst_dir in $ac_ltp_inst_dirs; do
if test -d "$ac_ltp_inst_dir"; then
AC_LANG([C++])
EXTLIB_CFLAGS="-DFILE_OFFSET_BITS=64"
EXTLIB_LDFLAGS="-L$ac_pwd/../LTPlib/lib \
-lltp -lpthread -lcrypto -lm"
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[
#include "$ac_ltp_inst_dir/include/ltp.h"
],
[
ltpaddr la;
]),
[
dtn_cv_path_ltp=`cd $ac_ltp_inst_dir && pwd`
break
],
[
dtn_cv_path_ltp=
]
)
fi
done
])
EXTLIB_CFLAGS="$ac_save_EXTLIB_CFLAGS"
EXTLIB_LDFLAGS="$ac_save_EXTLIB_LDFLAGS"
if test -z "$dtn_cv_path_ltp"; then
AC_MSG_RESULT([no])
LTP_ENABLED=0
else
AC_MSG_RESULT([yes])
LTP_ENABLED=1
AC_DEFINE(LTP_ENABLED, 1, [whether LTP support is enabled])
if test ! "$dtn_cv_path_ltp" = /usr && test ! "$dtn_cv_path_ltp" = /usr/local; then
EXTLIB_CFLAGS="$EXTLIB_CFLAGS -I$dtn_cv_path_ltp/include"
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -L$dtn_cv_path_ltp/lib"
fi
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -lltp -lpthread -lcrypto -lm"
fi
fi
])
dnl
dnl Copyright 2008 The MITRE Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl The US Government will not be charged any license fee and/or royalties
dnl related to this software. Neither name of The MITRE Corporation; nor the
dnl names of its contributors may be used to endorse or promote products
dnl derived from this software without specific prior written permission.
dnl
dnl
dnl Autoconf support for NORM convergence layer
dnl
AC_DEFUN(AC_CONFIG_NORM, [
AC_ARG_WITH(norm,
[AC_HELP_STRING([--with-norm],
[enable NORM convergence layer support (EXPERIMENTAL)])],
[ac_use_norm=$withval],
[ac_use_norm="no"])
AC_MSG_CHECKING([whether to enable NORM convergence layer support])
dnl
dnl Disable norm if requested
dnl
if test "$ac_use_norm" = "no"; then
AC_MSG_RESULT(no)
NORM_ENABLED=0
else
dnl
dnl Find the norm installation
dnl
if test "$ac_use_norm" = try \
-o "$ac_use_norm" = yes \
-o "$ac_use_norm" = "" ; then
AC_MSG_RESULT([try])
ac_norm_inst_dirs="$ac_pwd/../norm /usr /usr/local"
else
AC_MSG_RESULT([yes (dir $ac_use_norm)])
ac_norm_inst_dirs="$ac_use_norm"
fi
ac_save_EXTLIB_CFLAGS="$EXTLIB_CFLAGS"
ac_save_EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS"
AC_MSG_CHECKING([whether norm libraries are available])
AC_CACHE_VAL(dtn_cv_path_norm,
[
for ac_norm_inst_dir in $ac_norm_inst_dirs; do
if test -d "$ac_norm_inst_dir"; then
AC_LANG([C++])
EXTLIB_CFLAGS="-DFILE_OFFSET_BITS=64"
EXTLIB_LDFLAGS="-L$ac_pwd/../norm/build/default \
-L$ac_pwd/../norm/build/default/protolib \
-lnorm -lprotokit -lpthread"
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[
#include "$ac_norm_inst_dir/include/normApi.h"
],
[
NormInstanceHandle handle = NormCreateInstance();
NormDestroyInstance(handle);
]),
[
dtn_cv_path_norm="$ac_norm_inst_dir"
break
],
[
dtn_cv_path_norm=
]
)
fi
done
])
EXTLIB_CFLAGS="$ac_save_EXTLIB_CFLAGS"
EXTLIB_LDFLAGS="$ac_save_EXTLIB_LDFLAGS"
if test -z "$dtn_cv_path_norm"; then
AC_MSG_RESULT([no])
NORM_ENABLED=0
else
AC_MSG_RESULT([yes])
NORM_ENABLED=1
AC_DEFINE(NORM_ENABLED, 1, [whether norm support is enabled])
if test ! "$dtn_cv_path_norm" = /usr && test ! "$dtn_cv_path_norm" = /usr/local; then
EXTLIB_CFLAGS="$EXTLIB_CFLAGS -I$dtn_cv_path_norm/include"
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -L$dtn_cv_path_norm/build/default -L$dtn_cv_path_norm/build/default/protolib"
fi
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -lnorm -lprotokit"
fi
fi
])
dnl
dnl Autoconf support for finding OpenSSL
dnl
dnl
AC_DEFUN(AC_CONFIG_OPENSSL, [
if test "$ac_bsp" = yes; then
ac_openssldir='yes'
AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl=DIR],
[location of an OpenSSL installation (default system)]),
ac_openssldir=$withval)
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
ac_save_LIBS="$LIBS"
dnl
dnl Now check if we have a cached value, unless the user specified
dnl something explicit with the --with-openssl= argument, in
dnl which case we force it to redo the checks (i.e. ignore the
dnl cached values)
dnl
if test "$ac_openssldir" = yes -a ! x$openssl_cv_include = x ; then
echo "checking for OpenSSL installation... (cached) $openssl_cv_include/openssl/evp.h, $openssl_cv_lib -lcrypto"
else
if test "$ac_openssldir" = system -o \
"$ac_openssldir" = yes -o \
"$ac_openssldir" = "" ;
then
ac_openssldir="/usr/include"
openssl_include=$ac_openssldir
openssl_lib="/usr/lib"
else
openssl_include=$ac_openssldir/include
CPPFLAGS="-I$openssl_include"
openssl_lib=$ac_openssldir/lib
LDFLAGS="-L$openssl_lib"
fi
fi
AC_CHECK_HEADERS([$openssl_include/openssl/evp.h], [], [AC_MSG_FAILURE([Cannot find OpenSSL.
On Debian-based Linux systems, you need the 'libssl-dev' package.])])
AC_CHECK_LIB([crypto], [EVP_DigestInit], [], [AC_MSG_FAILURE([Cannot find OpenSSL.
On Debian-based Linux systems, you need the 'libssl-dev' package.])])
AC_CHECK_LIB([crypto], [EVP_sha256], [], [AC_MSG_FAILURE([Cannot find EVP_sha256.
On Mac OS X systems, you probably need an updated OpenSSL package, version 0.9.8.
Specify --with-openssl=/path/to/openssl LDFLAGS="-Wl,-search_paths_first"])])
if test "$openssl_include" != /usr/include ; then
EXTLIB_CFLAGS="$EXTLIB_CFLAGS -I$openssl_include"
fi
if test "$openssl_lib" != /usr/lib ; then
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -L$openssl_lib"
fi
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -lcrypto"
CPPFLAGS=$ac_save_CPPFLAGS
LDFLAGS=$ac_save_LDFLAGS
LIBS=$ac_save_LIBS
fi
])
dnl
dnl Autoconf support for building scripting apis
dnl
dnl
AC_DEFUN(AC_CONFIG_SCRIPT_APIS, [
AC_MSG_CHECKING(for --enable-scriptapis)
AC_ARG_ENABLE(scriptapis,
AC_HELP_STRING([--enable-scriptapis],
[Enable PYTHON, PERL and TCL APIs]),
[ENABLE_SCRIPT_APIS=yes
AC_SUBST(ENABLE_SCRIPT_APIS)
AC_MSG_RESULT(yes)
],
[ENABLE_SCRIPT_APIS=
AC_SUBST(ENABLE_SCRIPT_APIS)
AC_MSG_RESULT(no)
])
])
dnl
dnl Copyright 2006 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl -------------------------------------------------------------------------
dnl Configure the options for oasys atomic functions
dnl -------------------------------------------------------------------------
AC_DEFUN(AC_OASYS_CONFIG_ATOMIC, [
dnl
dnl Handle --enable-atomic-nonatomic[=yes|no]
dnl
dnl
AC_ARG_ENABLE(atomic_nonatomic,
AC_HELP_STRING([--enable-atomic-nonatomic],
[compile with non-atomic "atomic" routines (testing only)]),
[atomic_nonatomic=$enableval],
[atomic_nonatomic=no])
AC_MSG_CHECKING([whether to compile with non-atomic "atomic" routines])
AC_MSG_RESULT($atomic_nonatomic)
if test $atomic_nonatomic = yes ; then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** WARNING: non-atomic "atomic" routines are for testing only ***])
AC_MSG_NOTICE([***])
AC_DEFINE_UNQUOTED(OASYS_ATOMIC_NONATOMIC, 1,
[whether non-atomic "atomic" routines are enabled])
else
dnl
dnl Handle --enable-atomic-asm[=yes|no]
dnl --disable-atomic-asm
dnl
AC_ARG_ENABLE(atomic_asm,
AC_HELP_STRING([--disable-atomic-asm],
[compile without assembly-based atomic functions]),
[atomic_asm=$enableval],
[atomic_asm=yes])
AC_MSG_CHECKING([whether to compile with assembly-based atomic functions])
AC_MSG_RESULT($atomic_asm)
if test $atomic_asm = no ; then
AC_DEFINE_UNQUOTED(OASYS_ATOMIC_MUTEX, 1,
[whether atomic routines are implemented with a mutex])
fi
fi
])
dnl
dnl Copyright 2008 Darren Long, [email protected]
dnl Copyright 2007 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl
dnl Autoconf support for configuring whether ax25 stack is
dnl available on the system
dnl
AC_DEFUN(AC_CONFIG_AX25, [
AC_ARG_WITH(ax25,
[AC_HELP_STRING([--with-ax25],
[compile in ax25 support (default try)])],
[ac_use_ax25=$withval],
[ac_use_ax25=try])
ac_has_ax25_lib="no"
ac_has_axconfig_h="no"
ac_has_ax25_h="no"
ac_has_axlib_h="no"
AC_MSG_CHECKING([whether ax25 support should be enabled])
if test "$ac_use_ax25" = "no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT($ac_use_ax25)
dnl look for the library and the headers
AC_EXTLIB_PREPARE
AC_CHECK_HEADERS([netax25/ax25.h], ac_has_ax25_h=yes)
AC_CHECK_HEADERS([netax25/axlib.h], ac_has_axlib_h=yes)
AC_CHECK_HEADERS([netax25/axconfig.h], ac_has_axconfig_h=yes, [],
[#if HAVE_NETAX25_AX25_H
# include <netax25/ax25.h>
#endif
#if HAVE_NETAX25_AXLIB_H
# include <netax25/axlib.h>
#endif
])
AC_SEARCH_LIBS(ax25_config_load_ports, ax25, ac_has_ax25_lib=yes)
AC_EXTLIB_SAVE
dnl print the result
AC_MSG_CHECKING([whether ax25 support was found])
if test "$ac_has_ax25_lib" = yes -a "$ac_has_axconfig_h" = yes -a "$ac_has_ax25_h" = yes -a "$ac_has_axlib_h" = yes ; then
AC_DEFINE(OASYS_AX25_ENABLED, 1,
[whether ax25 support is enabled])
AC_MSG_RESULT(yes)
elif test "$ac_use_ax25" = "try" ; then
AC_MSG_RESULT(no)
else
AC_MSG_ERROR([can't find ax25 headers or library])
fi
fi
])
dnl
dnl Copyright 2006 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl
dnl Autoconf support for configuring whether BlueZ bluetooth is available
dnl on the system
dnl
AC_DEFUN(AC_CONFIG_BLUEZ, [
AC_ARG_WITH(bluez,
[AC_HELP_STRING([--with-bluez],
[compile in bluetooth support (default try)])],
[ac_use_bluez=$withval],
[ac_use_bluez=try])
ac_has_libbluetooth="no"
ac_has_bluetooth_h="no"
AC_MSG_CHECKING([whether bluetooth support should be enabled])
if test "$ac_use_bluez" = "no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT($ac_use_bluez)
dnl
dnl Look for the baswap() function in libbluetooth
dnl
AC_EXTLIB_PREPARE
AC_SEARCH_LIBS(baswap, bluetooth, ac_has_libbluetooth="yes")
AC_EXTLIB_SAVE
dnl
dnl Locate standard Bluetooth header file
dnl
AC_CHECK_HEADERS([bluetooth/bluetooth.h],
ac_has_bluetooth_h="yes")
dnl
dnl Print out whether or not we found the libraries
dnl
AC_MSG_CHECKING([whether bluetooth support was found])
dnl
dnl Check which defines, if any, are set
dnl
if test "$ac_has_libbluetooth" = yes -a "$ac_has_bluetooth_h" = yes; then
dnl
dnl Enable Bluetooth-dependent code
dnl
AC_DEFINE(OASYS_BLUETOOTH_ENABLED, 1,
[whether bluetooth support is enabled])
AC_MSG_RESULT(yes)
elif test "$ac_use_bluez" = "try" ; then
AC_MSG_RESULT(no)
else
AC_MSG_ERROR([can't find bluez headers or library])
fi
fi
])
dnl
dnl Copyright 2007 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl
dnl Autoconf support for configuring whether Apple's Bonjour stack is
dnl available on the system
dnl
AC_DEFUN(AC_BONJOUR_HELP, [
cat <<EOF
Configure error with bonjour...
The default is to try to compile in bonjour support and
if development headers and libraries are not present
proceed. You appear to have stated '[$ac_use_bonjour]'
when asked whether bonjour support should be enabled
Can't find the required development headers (dns_sd.h) or
function (DNSServiceRegister) in dns_sd of the Avahi
Apple Bonjour library.
If you do not want bonjour support at all, you can specify
--without-bonjour.
EOF
])
AC_DEFUN(AC_CONFIG_BONJOUR, [
AC_ARG_WITH(bonjour,
[AC_HELP_STRING([--with-bonjour],
[compile in bonjour support (default try)])],
[ac_use_bonjour=$withval],
[ac_use_bonjour=try])
ac_has_bonjour_lib="no"
ac_has_bonjour_h="no"
AC_MSG_CHECKING([whether bonjour support should be enabled])
if test "$ac_use_bonjour" = "no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT($ac_use_bonjour)
dnl look for the library and the header
AC_EXTLIB_PREPARE
AC_MSG_CHECKING([searching for the bonjour library development headers])
AC_CHECK_HEADERS([dns_sd.h], ac_has_bonjour_h=yes, AC_MSG_RESULT(bonjour header not found))
AC_SEARCH_LIBS(DNSServiceRegister, dns_sd, ac_has_bonjour_lib=yes, AC_MSG_RESULT(function not found in bonjour library))
AC_EXTLIB_SAVE
dnl print the result
AC_MSG_CHECKING([whether bonjour support was found])
if test "$ac_has_bonjour_lib" = yes -a "$ac_has_bonjour_h" = yes ; then
AC_DEFINE(OASYS_BONJOUR_ENABLED, 1,
[whether bonjour support is enabled])
AC_MSG_RESULT(yes)
elif test "$ac_use_bonjour" = "try" ; then
AC_MSG_RESULT(no)
else
AC_BONJOUR_HELP
AC_MSG_ERROR([can't find the required development headers for the Avahi Apple Bonjour library])
fi
fi
])
dnl
dnl Copyright 2005-2006 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl
dnl Autoconf support for finding Berkeley DB
dnl
AC_DEFUN(AC_DB_HELP, [
cat <<EOF
Configure error with Berkeley DB...
If you do not want Berkeley DB support at all, you can specify
--without-db.
If your installed version is not one of the following versions:
'[$ac_dbvers]', you may have to specify the version explicitly
with --with-dbver=<version>.
If your installation is in a non-standard path, you can specify
the path with --with-db=DIR.
To download the latest version, go to http://www.sleepycat.com
To build and install to /usr/local/BerkeleyDB-<version>:
# cd <db_download_dir>/build_unix
# ../dist/configure
# make
# make install
EOF
])
dnl
dnl Main macro for finding a usable db installation
dnl
AC_DEFUN(AC_CONFIG_DB, [
ac_dbvers='5.3 5.2 5.1 4.8 4.7 4.6 4.5 4.4 4.3 4.2 4.1'
ac_dbdir='yes'
AC_ARG_WITH(db,
AC_HELP_STRING([--with-db=DIR],
[location of a Berkeley DB installation (default system)]),
ac_dbdir=$withval)
AC_ARG_WITH(dbver,
AC_HELP_STRING([--with-dbver=VERSION],
Berkeley DB versions to try (default 5.1-4.2)),
ac_dbvers=$withval)
dnl
dnl First make sure we even want it
dnl
if test "$ac_dbdir" = no ; then
LIBDB_ENABLED=0
else
LIBDB_ENABLED=1
AC_DEFINE_UNQUOTED(LIBDB_ENABLED, 1,
[whether berkeley db storage support is enabled])
dnl
dnl Now check if we have a cached value, unless the user specified
dnl something explicit with the --with-db= argument, in
dnl which case we force it to redo the checks (i.e. ignore the
dnl cached values)
dnl
if test "$ac_dbdir" = yes -a ! x$oasys_cv_db_incpath = x ; then
echo "checking for Berkeley DB installation... (cached) -I$oasys_cv_db_incpath -L$oasys_cv_db_libpath -l$oasys_cv_db_lib"
else
AC_FIND_DB
fi # no cache
if test ! $oasys_cv_db_incpath = /usr/include ; then
EXTLIB_CFLAGS="$EXTLIB_CFLAGS -I$oasys_cv_db_incpath"
fi
if test ! $oasys_cv_db_libpath = /usr/lib ; then
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -L$oasys_cv_db_libpath"
fi
EXTLIB_LDFLAGS="$EXTLIB_LDFLAGS -l$oasys_cv_db_lib"
fi # LIBDB_ENABLED
])
dnl
dnl Find db
dnl
AC_DEFUN(AC_FIND_DB, [
oasys_cv_db_incpath=
oasys_cv_db_libpath=
oasys_cv_db_lib=
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
ac_save_LIBS="$LIBS"
for ac_dbver in $ac_dbvers ; do
ac_dbver_major=`echo $ac_dbver | cut -d . -f1`
ac_dbver_minor=`echo $ac_dbver | cut -d . -f2`
dnl
dnl For each version, we look in /usr, /usr/local, and /usr/local/BerkeleyDB.XX
dnl making sure that the resulting include and lib paths must match.
dnl
if test "$ac_dbdir" = system -o \
"$ac_dbdir" = yes -o \
"$ac_dbdir" = "" ;
then
ac_dbdirs="/usr /usr/local /usr/local/BerkeleyDB.$ac_dbver"
else
ac_dbdirs="$ac_dbdir"
fi
for dir in $ac_dbdirs; do
ac_dbincdirs="$dir/include"
ac_dblibdirs="$dir/lib"
dnl
dnl Need to also check variations in /usr/local/include/dbXXX
dnl
if test $dir = /usr/local ; then
ac_dbincdirs="$ac_dbincdirs /usr/local/include/db$ac_dbver"
ac_dbincdirs="$ac_dbincdirs /usr/local/include/db$ac_dbver_major"
ac_dbincdirs="$ac_dbincdirs /usr/local/include/db$ac_dbver_major$ac_dbver_minor"
ac_dblibdirs="$ac_dblibdirs /usr/local/lib/db$ac_dbver"
ac_dblibdirs="$ac_dblibdirs /usr/local/lib/db$ac_dbver_major"
ac_dblibdirs="$ac_dblibdirs /usr/local/lib/db$ac_dbver_major$ac_dbver_minor"
fi
for ac_dbincdir in $ac_dbincdirs ; do
CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dbincdir"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
dnl
dnl First check the version in the header file. If there's a match,
dnl fall through to the other check to make sure it links.
dnl If not, then we can break out of the two inner loops.
dnl
AC_MSG_CHECKING([for Berkeley DB header (version $ac_dbver) in $ac_dbincdir])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[
#include <db.h>
#if (DB_VERSION_MAJOR != ${ac_dbver_major}) || \
(DB_VERSION_MINOR != ${ac_dbver_minor})
#error "incorrect version"
#endif
],
[
]),
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
continue
])
for ac_dblibdir in $ac_dblibdirs; do
for ac_dblib in db-$ac_dbver; do
LDFLAGS="$ac_save_LDFLAGS -L$ac_dblibdir"
if test x"$STATIC" = x"extlibs" ; then
LIBS="-Wl,-Bstatic -l$ac_dblib -Wl,-Bdynamic $ac_save_LIBS"
else
LIBS="-l$ac_dblib $ac_save_LIBS"
fi
AC_MSG_CHECKING([for Berkeley DB library in $ac_dblibdir, -l$ac_dblib])
AC_LINK_IFELSE(
AC_LANG_PROGRAM(
[
#include <db.h>
],
[
DB *db;
db_create(&db, NULL, 0);
]),
[
AC_MSG_RESULT([yes])
oasys_cv_db_incpath=$ac_dbincdir
oasys_cv_db_libpath=$ac_dblibdir
oasys_cv_db_lib=$ac_dblib
break 5
],
[
AC_MSG_RESULT([no])
])
done # foreach ac_dblib
done # foreach ac_dblibdir
done # foreach ac_dbincdir
done # foreach ac_dbdir
done # foreach ac_dbver
AC_DEFINE_UNQUOTED(BERKELEY_DB_VERSION, $ac_dbver,
[configured version of berkeley db])
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
if test x$oasys_cv_db_incpath = x ; then
AC_DB_HELP
AC_MSG_ERROR([can't find usable Berkeley DB installation])
fi
])
dnl
dnl Copyright 2006 Intel Corporation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl
dnl Autoconf support for finding expat
dnl