This repository has been archived by the owner on Jan 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
configure.ac
2084 lines (1766 loc) · 63.8 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])
AC_INIT([lightwave], [1.3.0])
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
LT_INIT
AC_PROG_CC
AC_PROG_CXX(g++)
AC_PROG_LIBTOOL
AC_PREFIX_DEFAULT(/opt/vmware)
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
dnl Check supported operating systems
dnl
case "${host_os}:${host_cpu}" in
linux*:x86_64)
PLATFORM_LIB_PREFIX=lib64
;;
linux*:aarch64)
PLATFORM_LIB_PREFIX=lib
;;
darwin*:x86_64)
PLATFORM_LIB_PREFIX=lib
;;
*)
AC_ERROR("Unsupported operating system - ${host_os}:${host_cpu}")
;;
esac
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_GNU_SOURCE -fPIC"
CXXFLAGS="$CXXFLAGS -frtti"
AM_CPPFLAGS="$AM_CPPFLAGS -I${top_srcdir}/include"
AM_CFLAGS="$AM_CFLAGS -Wall -Werror -fno-strict-aliasing"
#flag overrides to allow per module compile flags.
#warning ignore flags are here (temporarily) so that modules
#can start fixing code by overriding in respective Makefile.am
#to check a module, do AM_CFLAGS=$(CFLAGS_DESIRED) in Makefile.am
CFLAGS_ORIGINAL="$AM_CFLAGS"
CFLAGS_COMPAT="-Wno-unused-but-set-variable -Wno-pointer-sign -Wno-implicit-function-declaration -Wno-address -Wno-enum-compare"
CFLAGS_DESIRED="$CFLAGS_ORIGINAL -fno-strict-aliasing -Wformat -Wformat-security -Werror=format-security -fstack-protector-all"
#reset cflags to not break existing
#AM_CFLAGS="$AM_CFLAGS $CFLAGS_COMPAT"
AM_CFLAGS="$AM_CFLAGS $CFLAGS_DESIRED"
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(CFLAGS_ORIGINAL)
AC_SUBST(CFLAGS_COMPAT)
AC_SUBST(CFLAGS_DESIRED)
AC_HEADER_STDC
AC_CHECK_HEADERS(pthread.h errno.h sys/types.h sys/stat.h stdio.h string.h strings.h)
AC_CHECK_HEADERS(unistd.h time.h inttypes.h sys/socket.h netdb.h syslog.h)
AC_CHECK_HEADERS(stdlib.h locale.h stddef.h stdarg.h assert.h signal.h)
AC_CHECK_HEADERS(ctype.h netinet/in.h arpa/inet.h fcntl.h sys/un.h dirent.h termios.h term.h)
AC_CHECK_HEADERS(pwd.h grp.h nss.h nss_common.h nsswitch.h shadow.h crypt.h)
AC_CHECK_HEADERS(limits.h)
AC_C_CONST
AC_TYPE_SIZE_T
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror)
#--------------------------------------------------------------------
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug],
[enable debugging (default: disabled)])],
[
if test x"$enableval" = x"yes"
then
AM_CFLAGS="$AM_CFLAGS -g -O0"
AM_CPPFLAGS="$AM_CPPFLAGS -DDEBUG -DLDAP_DEBUG -DVMCA_DEBUG -DMUTENTCA_DEBUG"
fi
])
#--------------------------------------------------------------------
ADDACL_CHECK_ENABLED="yes"
AC_ARG_ENABLE([addacl],
[AC_HELP_STRING([--enable-addacl],
[enable acl check on add (default: enabled)])],
[
if test x"$enableval" = x"no"
then
ADDACL_CHECK_ENABLED="no"
fi
])
if test x"$ADDACL_CHECK_ENABLED" = x"no"
then
AC_DEFINE_UNQUOTED(ADDACL_CHECK_DISABLED, "1", [ Disable ACL checks on add ])
fi
#--------------------------------------------------------------------
MODACL_CHECK_ENABLED="yes"
AC_ARG_ENABLE([modacl],
[AC_HELP_STRING([--enable-modacl],
[enable acl check on modify (default: enabled)])],
[
if test x"$enableval" = x"no"
then
MODACL_CHECK_ENABLED="no"
fi
])
if test x"$MODACL_CHECK_ENABLED" = x"no"
then
AC_DEFINE_UNQUOTED(MODACL_CHECK_DISABLED, "1", [ Disable ACL checks on modify ])
fi
#--------------------------------------------------------------------
DELACL_CHECK_ENABLED="yes"
AC_ARG_ENABLE([delacl],
[AC_HELP_STRING([--enable-delacl],
[enable acl check on delete (default: enabled)])],
[
if test x"$enableval" = x"no"
then
DELACL_CHECK_ENABLED="no"
fi
])
if test x"$DELACL_CHECK_ENABLED" = x"no"
then
AC_DEFINE_UNQUOTED(DELACL_CHECK_DISABLED, "1", [ Disable ACL checks on delete ])
fi
#--------------------------------------------------------------------
SEAACL_CHECK_ENABLED="yes"
AC_ARG_ENABLE([seaacl],
[AC_HELP_STRING([--enable-seaacl],
[enable acl check on search (default: enabled)])],
[
if test x"$enableval" = x"no"
then
SEAACL_CHECK_ENABLED="no"
fi
])
if test x"$SEAACL_CHECK_ENABLED" = x"no"
then
AC_DEFINE_UNQUOTED(SEAACL_CHECK_DISABLED, "1", [ Disable ACL checks on search ])
fi
#--------------------------------------------------------------------
# rest head flag
REST_ENABLED=true
AC_ARG_ENABLE([rest],
[AC_HELP_STRING([--enable-rest],
[enable rest heads (default: enabled)])],
[
if test x"$enableval" = x"no"
then
REST_ENABLED=false
fi
])
if $REST_ENABLED
then
AC_DEFINE_UNQUOTED(REST_ENABLED, 1, [ Enable rest heads ])
fi
AM_CONDITIONAL(REST_ENABLED, [$REST_ENABLED])
#--------------------------------------------------------------------
# v2 rest head flag
REST_V2_ENABLED=false
AC_ARG_ENABLE([restv2],
[AC_HELP_STRING([--enable-rest-v2],
[enable v2 rest heads (default: disabled)])],
[
if test x"$enableval" = x"yes"
then
REST_V2_ENABLED=true
fi
])
if $REST_V2_ENABLED
then
AC_DEFINE_UNQUOTED(REST_V2_ENABLED, 1, [ Enable v2 rest heads ])
fi
AM_CONDITIONAL(REST_V2_ENABLED, [$REST_V2_ENABLED])
#--------------------------------------------------------------------
# datastore flag
AC_ARG_WITH([datastore],
[AC_HELP_STRING([--with-datastore=<datastore>],
[use backend datastore <datastore>])],
[
DATASTORE="$withval"
],
[
DATASTORE="mdb"
])
#--------------------------------------------------------------------
# lightwave build flag
ENABLE_LIGHTWAVE_BUILD=true
AC_ARG_ENABLE([lightwave-build],
[AC_HELP_STRING([--enable-lightwave-build],
[enable lightwave build (default: enabled)])],
[
if test x"$enableval" = x"no"
then
ENABLE_LIGHTWAVE_BUILD=false
fi
])
if $ENABLE_LIGHTWAVE_BUILD
then
AC_DEFINE_UNQUOTED(LIGHTWAVE_BUILD, 1, [ enable lightwave specific build ])
fi
AM_CONDITIONAL(LIGHTWAVE_BUILD, [$LIGHTWAVE_BUILD])
#--------------------------------------------------------------------
# client only build
ENABLE_SERVER=true
AC_ARG_ENABLE([server],
[AC_HELP_STRING([--enable-server],
[enable full build (default: yes)])],
[
if test x"$enableval" = x"yes"
then
ENABLE_SERVER=true
else
ENABLE_SERVER=false
fi
])
AM_CONDITIONAL(ENABLE_SERVER, [$ENABLE_SERVER])
#--------------------------------------------------------------------
# go dependency flag
GO_ENABLED=false
AC_ARG_ENABLE([go],
[AC_HELP_STRING([--enable-go],
[enable go dependencies (default: disabled)])],
[
if test x"$enableval" = x"yes"
then
GO_ENABLED=true
fi
])
if $GO_ENABLED
then
AC_DEFINE_UNQUOTED(GO_ENABLED, 1, [ Enable go dependencies ])
fi
AM_CONDITIONAL(GO_ENABLED, [$GO_ENABLED])
#--------------------------------------------------------------------
# plugins
ENABLE_PLUGINS=false
AC_ARG_ENABLE([plugins],
[AC_HELP_STRING([--enable-plugins],
[enable all plugin builds (default: disabled)])],
[
if test x"$enableval" = x"yes"
then
ENABLE_PLUGINS=true
AC_DEFINE(ENABLE_PLUGINS, 1, [Build plugins?])
fi
]
)
AM_CONDITIONAL(ENABLE_PLUGINS, [$ENABLE_PLUGINS])
#--------------------------------------------------------------------
# aws kms sdk
ENABLE_SECURITY_AWS_KMS=false
AC_ARG_ENABLE([security_aws_kms],
[AC_HELP_STRING([--enable-security_aws_kms],
[enable security plugin aws kms (default: disabled)])
],
[
if test x"$enableval" = x"yes"
then
ENABLE_SECURITY_AWS_KMS=true
AC_DEFINE(ENABLE_SECURITY_AWS_KMS, 1, [Build security plugin for aws kms?])
security_aws_kms_libdir=$prefix/lib64
AC_SUBST(security_aws_kms_libdir)
AS_AC_EXPAND(SECURITY_AWS_KMS_LIB_DIR, $security_aws_kms_libdir)
AC_DEFINE_UNQUOTED(SECURITY_AWS_KMS_LIB_DIR, "$SECURITY_AWS_KMS_LIB_DIR", [Lib directory])
security_aws_kms_confdir="$datadir/config"
AC_SUBST(security_aws_kms_confdir)
AS_AC_EXPAND(SECURITY_AWS_KMS_CONFIG_DIR, $security_aws_kms_confidr)
AC_DEFINE_UNQUOTED(SECURITY_AWS_KMS_CONFIG_DIR, "$SECURITY_AWS_KMS_CONFIG_DIR", [Config directory])
fi
]
)
AM_CONDITIONAL(ENABLE_SECURITY_AWS_KMS, [$ENABLE_SECURITY_AWS_KMS])
#--------------------------------------------------------------------
# openssl component
case "${host_os}:${host_cpu}" in
linux*:x86_64)
OPEN_SSL_DEFAULT_PATH=/opt/vmware/lib64
;;
darwin*:x86_64)
OPEN_SSL_DEFAULT_PATH=/opt/vmware/lib
;;
linux*:aarch64)
OPEN_SSL_DEFAULT_PATH=/opt/vmware/lib
;;
*)
AC_ERROR("Unsupported operating system - ${host_os}:${host_cpu}")
;;
esac
AC_ARG_WITH([ssl],
[AC_HELP_STRING([--with-ssl=<dir>],
[use SSL binaries rooted at prefix <dir>])],
[
OPENSSL_BASE_PATH="$withval"
],
[
OPENSSL_BASE_PATH="/usr"
])
AC_ARG_WITH([ssl-includes],
[AC_HELP_STRING([--with-ssl-includes=<dir>],
[use SSL headers located in prefix <dir>])],
[
OPENSSL_INCLUDES="-DOPENSSL_NO_KRB5 -I$withval"
],
[
OPENSSL_INCLUDES="-DOPENSSL_NO_KRB5 -I$OPENSSL_BASE_PATH/include"
])
AC_ARG_WITH([ssl-libs],
[AC_HELP_STRING([--with-ssl-libs=<dir>],
[use SSL libraries located in prefix <dir>])],
[
OPENSSL_LDFLAGS="-L$withval"
],
[
OPENSSL_LDFLAGS="-L$OPENSSL_BASE_PATH/$PLATFORM_LIB_PREFIX -Wl,-rpath,$OPEN_SSL_DEFAULT_PATH"
])
AC_SUBST(OPENSSL_BASE_PATH)
AC_SUBST(OPENSSL_INCLUDES)
AC_SUBST(OPENSSL_LDFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LW_INCLUDES"
AC_CHECK_HEADERS(openssl/crypto.h openssl/ssl.h openssl/err.h)
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# zlib component
AC_ARG_WITH([zlib],
[AC_HELP_STRING([--with-zlib=<dir>],
[use zlib binaries rooted at prefix <dir>])],
[
ZLIB_BASE_PATH="$withval"
],
[
ZLIB_BASE_PATH="/usr"
])
ZLIB_INCLUDES="-I$ZLIB_BASE_PATH/include"
ZLIB_LDFLAGS="-L$ZLIB_BASE_PATH/lib -Wl,-rpath,/opt/vmware/lib64 -Wl,-rpath-link,/opt/vmware/lib64"
AC_SUBST(ZLIB_BASE_PATH)
AC_SUBST(ZLIB_INCLUDES)
AC_SUBST(ZLIB_LDFLAGS)
#--------------------------------------------------------------------
# bzip component
AC_ARG_WITH([bzip],
[AC_HELP_STRING([--with-bzip=<dir>],
[use BZIP binaries rooted at prefix <dir>])],
[
BZIP_BASE_PATH="$withval"
],
[
BZIP_BASE_PATH="/usr"
])
BZIP_INCLUDES="-I$BZIP_BASE_PATH/include"
BZIP_LDFLAGS="-L$BZIP_BASE_PATH/lib -Wl,-rpath,/opt/vmware/lib64 -Wl,-rpath-link,/opt/vmware/lib64"
AC_SUBST(BZIP_BASE_PATH)
AC_SUBST(BZIP_INCLUDES)
AC_SUBST(BZIP_LDFLAGS)
#--------------------------------------------------------------------
# Cyrus SASL
AC_ARG_WITH([sasl],
[AC_HELP_STRING([--with-sasl=<dir>],
[use SASL binaries rooted at prefix <dir>])],
[
SASL_BASE_PATH="$withval"
],
[
SASL_BASE_PATH="/usr"
])
AC_ARG_WITH([sasl-includes],
[AC_HELP_STRING([--with-sasl-includes=<dir>],
[use SASL headers located in prefix <dir>])],
[
SASL_INCLUDES="-I$withval"
],
[
SASL_INCLUDES="-I$SASL_BASE_PATH/include"
])
AC_ARG_WITH([sasl-libs],
[AC_HELP_STRING([--with-sasl-libs=<dir>],
[use SASL libraries located in prefix <dir>])],
[
SASL_LIBPATH="$withval"
SASL_LDFLAGS="-L$withval"
],
[
SASL_LIBPATH="$SASL_BASE_PATH/lib64"
SASL_LDFLAGS="-L$SASL_BASE_PATH/lib64"
])
AC_ARG_WITH([sasl-plugins],
[AC_HELP_STRING([--with-sasl-plugins=<dir>],
[assume SASL plugins at runtime are located in <dir>])],
[
SASL_PLUGINSPATH="$withval"
],
[
SASL_PLUGINSPATH="$SASL_BASE_PATH/lib64/sasl2"
])
AC_SUBST(SASL_BASE_PATH)
AC_SUBST(SASL_INCLUDES)
AC_SUBST(SASL_LDFLAGS)
AC_DEFINE_UNQUOTED(VMDIR_CONFIG_SASL2_LIB_PATH, "$SASL_PLUGINSPATH", [SASL2 Library path])
#--------------------------------------------------------------------
# Jansson
AC_ARG_WITH([jansson],
[AC_HELP_STRING([--with-jansson=<dir>],
[use jansson binaries rooted at prefix <dir>])],
[
JANSSON_BASE_PATH="$withval"
],
[
JANSSON_BASE_PATH="/usr"
])
JANSSON_INCLUDES="-I$JANSSON_BASE_PATH/include"
JANSSON_LDFLAGS="-L$JANSSON_BASE_PATH/lib"
AC_CHECK_HEADERS(jansson.h)
AC_SUBST(JANSSON_BASE_PATH)
AC_SUBST(JANSSON_INCLUDES)
AC_SUBST(JANSSON_LDFLAGS)
#--------------------------------------------------------------------
# Copenapi
AC_ARG_WITH([copenapi],
[AC_HELP_STRING([--with-copenapi=<dir>],
[use copenapi binaries rooted at prefix <dir>])],
[
COPENAPI_BASE_PATH="$withval"
],
[
COPENAPI_BASE_PATH="/usr"
])
COPENAPI_INCLUDES="-I$COPENAPI_BASE_PATH/include"
COPENAPI_LDFLAGS="-L$COPENAPI_BASE_PATH/lib"
AC_CHECK_HEADERS(copenapi/copenapi.h)
AC_SUBST(COPENAPI_BASE_PATH)
AC_SUBST(COPENAPI_INCLUDES)
AC_SUBST(COPENAPI_LDFLAGS)
#--------------------------------------------------------------------
# C rest engine
AC_ARG_WITH([c-rest-engine],
[AC_HELP_STRING([--with-c-rest-engine=<dir>],
[use c-rest-engine server binaries rooted at prefix <dir>])],
[
CRESTENGINE_BASE_PATH="$withval"
],
[
CRESTENGINE_BASE_PATH="/usr"
])
CRESTENGINE_INCLUDES="-I$CRESTENGINE_BASE_PATH/include"
CRESTENGINE_LDFLAGS="-L$CRESTENGINE_BASE_PATH/lib"
AC_CHECK_HEADERS(vmrest.h)
AC_SUBST(CRESTENGINE_BASE_PATH)
AC_SUBST(CRESTENGINE_INCLUDES)
AC_SUBST(CRESTENGINE_LDFLAGS)
#--------------------------------------------------------------------
# Likewise components
AC_ARG_WITH([likewise],
[AC_HELP_STRING([--with-likewise=<dir>],
[use likewise binaries rooted at prefix <dir>])],
[
LW_BASE_PATH="$withval"
],
[
LW_BASE_PATH="/opt/likewise"
])
case "${host_os}:${host_cpu}" in
linux*:x86_64)
LIKEWISE_DEFAULT_PATH=$LW_BASE_PATH/lib64
;;
darwin*:x86_64)
LIKEWISE_DEFAULT_PATH=$LW_BASE_PATH/lib
;;
linux*:aarch64)
LIKEWISE_DEFAULT_PATH=$LW_BASE_PATH/lib
;;
*)
AC_ERROR("Unsupported operating system - ${host_os}:${host_cpu}")
;;
esac
AC_ARG_WITH([likewise-rpath],
[AC_HELP_STRING([--with-likewise-rpath=<dir>],
[use likewise libraries located at <dir> at runtime])],
[
LW_RPATH="$withval"
],
[
LW_RPATH=$LIKEWISE_DEFAULT_PATH
])
AC_ARG_WITH([likewise-includes],
[AC_HELP_STRING([--with-likewise-includes=<dir>],
[use likewise headers located in prefix <dir>])],
[
LW_INCLUDES="-I$withval"
],
[
LW_INCLUDES="-I$LW_BASE_PATH/include"
])
AC_ARG_WITH([likewise-libs],
[AC_HELP_STRING([--with-likewise-libs=<dir>],
[use likewise libraries located in prefix <dir>])],
[
LW_LDFLAGS="-L$withval -Wl,-rpath,$LW_RPATH -Wl,-rpath-link,$withval"
],
[
LW_LDFLAGS="-L$LW_BASE_PATH/$PLATFORM_LIB_PREFIX -Wl,-rpath,$LW_RPATH -Wl,-rpath-link,$LW_BASE_PATH/$PLATFORM_LIB_PREFIX"
])
AC_SUBST(LW_BASE_PATH)
AC_SUBST(LW_INCLUDES)
AC_SUBST(LW_LDFLAGS)
#--------------------------------------------------------------------
DCERPC_PATH=$LW_BASE_PATH/bin
DCERPC_INCLUDES=$LW_INCLUDES
DCERPC_LDFLAGS=$LW_LDFLAGS
AC_ARG_WITH([dcerpc],
[AC_HELP_STRING([--with-dcerpc=<dir>],
[use DCERPC binaries rooted at prefix <dir>])],
[
DCERPC_BASE_PATH="$withval/bin"
],
[
DCERPC_BASE_PATH="$LW_BASE_PATH"
])
DCERPC_PATH="$DCERPC_BASE_PATH/bin"
AC_ARG_WITH([dcerpc-includes],
[AC_HELP_STRING([--with-dcerpc-includes=<dir>],
[use DCERPC headers located in prefix <dir>])],
[
DCERPC_INCLUDES="-I$withval"
],
[
DCERPC_INCLUDES="-I$DCERPC_BASE_PATH/include"
])
AC_ARG_WITH([dcerpc-libs],
[AC_HELP_STRING([--with-dcerpc-libs=<dir>],
[use DCERPC libraries located in prefix <dir>])],
[
DCERPC_LDFLAGS="-L$withval"
],
[
DCERPC_LDFLAGS="-L$DCERPC_BASE_PATH/lib64"
])
AC_SUBST(DCERPC_PATH)
AC_SUBST(DCERPC_INCLUDES)
AC_SUBST(DCERPC_LDFLAGS)
for i in $CPPFLAGS ${DCERPC_INCLUDES} ${LW_INCLUDES}; do
j=`echo $i | grep '^-I'`
if test x != x"$j"
then
IDLFLAGS="$IDLFLAGS $j"
fi
done
AC_SUBST(IDLFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LW_INCLUDES $OPENSSL_INCLUDES"
AC_CHECK_HEADERS(lw/base.h lw/types.h uuid/uuid.h lwrpcrt/lwrpcrt.h dce/rpc.h)
AC_CHECK_HEADERS(lwsm/lwsm.h)
AC_CHECK_HEADERS(reg/lwreg.h)
AC_CHECK_HEADERS(reg/regutil.h)
AC_CHECK_HEADERS(lwmem.h)
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
AC_ARG_ENABLE([pac],
AS_HELP_STRING([--disable-pac], [Disable Kerberos PAC]))
AM_CONDITIONAL([VMDIR_ENABLE_PAC], [test "x$enable_pac" != "xno"]])
if test x"$enable_pac" != x"no"
then
AC_DEFINE_UNQUOTED(VMDIR_ENABLE_PAC, 1, [ Enable PAC ])
fi
#--------------------------------------------------------------------
# POPT components
AC_ARG_WITH([popt],
[AC_HELP_STRING([--with-popt=<dir>],
[use POPT binaries rooted at prefix <dir>])],
[
POPT_BASE_PATH="$withval"
],
[
POPT_BASE_PATH="/usr"
])
POPT_INCLUDES="-I$POPT_BASE_PATH/include"
POPT_LDFLAGS="-L$POPT_BASE_PATH/lib"
AC_SUBST(POPT_BASE_PATH)
AC_SUBST(POPT_INCLUDES)
AC_SUBST(POPT_LDFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $POPT_INCLUDES"
AC_CHECK_HEADERS(popt.h)
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# SQLITE components
AC_ARG_WITH([sqlite],
[AC_HELP_STRING([--with-sqlite=<dir>],
[use SQLITE binaries rooted at prefix <dir>])],
[
SQLITE_BASE_PATH="$withval"
],
[
SQLITE_BASE_PATH="/usr"
])
SQLITE_INCLUDES="-I$SQLITE_BASE_PATH/include"
SQLITE_LDFLAGS="-L$SQLITE_BASE_PATH/lib"
AC_SUBST(SQLITE_BASE_PATH)
AC_SUBST(SQLITE_INCLUDES)
AC_SUBST(SQLITE_LDFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SQLITE_INCLUDES"
AC_CHECK_HEADERS(sqlite3.h)
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# BOOST components
AC_ARG_WITH([boost],
[AC_HELP_STRING([--with-boost=<dir>],
[use BOOST binaries rooted at prefix <dir>])],
[
BOOST_BASE_PATH="$withval"
],
[
BOOST_BASE_PATH="/usr"
])
AC_ARG_WITH([boost-includes],
[AC_HELP_STRING([--with-boost-includes=<dir>],
[use BOOST headers located in prefix <dir>])],
[
BOOST_INCLUDES="-I$withval"
],
[
BOOST_INCLUDES="-I$BOOST_BASE_PATH/include"
])
AC_ARG_WITH([boost-libs],
[AC_HELP_STRING([--with-boost-libs=<dir>],
[use BOOST libraries located in prefix <dir>])],
[
BOOST_LDFLAGS="-L$withval"
],
[
BOOST_LDFLAGS="-L$BOOST_BASE_PATH/lib"
])
AC_ARG_WITH([boost-python-lib],
[AC_HELP_STRING([--with-boost-python-lib=<dir>],
[use BOOST Python library extension])],
[
BOOST_PYTHON_EXT="$withval"
BOOST_PYTHON_LDFLAGS="$BOOST_BASE_PATH/lib/libboost_python-$BOOST_PYTHON_EXT.a"
])
AC_SUBST(BOOST_BASE_PATH)
AC_SUBST(BOOST_INCLUDES)
AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_PYTHON_EXT)
AC_SUBST(BOOST_PYTHON_LDFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS(boost/asio.hpp)
AC_LANG_POP([C++])
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# Python components
AC_ARG_WITH([python],
[AC_HELP_STRING([--with-python=<dir>],
[use Python binaries rooted at prefix <dir>])],
[
PYTHON_BASE_PATH="$withval"
],
[
PYTHON_BASE_PATH="/usr"
])
AC_ARG_WITH([python-includes],
[AC_HELP_STRING([--with-python-includes=<dir>],
[use Python headers located in prefix <dir>])],
[
PYTHON_INCLUDES="-I$withval"
],
[
PYTHON_INCLUDES="-I$PYTHON_BASE_PATH/include/python2.7"
])
AC_ARG_WITH([python-libs],
[AC_HELP_STRING([--with-python-libs=<dir>],
[use Python libraries located in prefix <dir>])],
[
PYTHON_LDFLAGS="-L$withval"
],
[
PYTHON_LDFLAGS="-L$PYTHON_BASE_PATH/lib"
])
AC_SUBST(PYTHON_BASE_PATH)
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(PYTHON_LDFLAGS)
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_CHECK_HEADERS(python.h)
CPPFLAGS="$saved_CPPFLAGS"
#--------------------------------------------------------------------
# Maven component
AC_ARG_WITH([maven],
[AC_HELP_STRING([--with-maven=<dir>],
[use Apache Maven binaries rooted at prefix <dir>])],
[
MAVEN_HOME="$withval"
],
[
MAVEN_HOME="/var/opt/apache-maven"
])
AC_SUBST(MAVEN_HOME)
#--------------------------------------------------------------------
# Java
AC_ARG_WITH([java],
[AC_HELP_STRING([--with-java=<dir>],
[use java binaries rooted at prefix <dir>])],
[
JAVA_HOME="$withval"
],
[
JAVA_HOME="/etc/alternatives/jre/../"
])
AC_ARG_WITH([java-includes],
[AC_HELP_STRING([--with-java-includes=<dir>],
[use java headers located in prefix <dir>])],
[
JDK_INCLUDES="-I$withval"
],
[
JDK_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
])
AC_ARG_WITH([java-libs],
[AC_HELP_STRING([--with-java-libs=<dir>],
[use java libraries located in prefix <dir>])],
[
JDK_LDFLAGS="-L$withval"
],
[
JDK_LDFLAGS="-L$JAVA_HOME/lib"
])
TOOLS_CLASSPATH=$JAVA_HOME/lib/tools.jar
AC_SUBST(JAVA_HOME)
AC_SUBST(JDK_INCLUDES)
AC_SUBST(JDK_LDFLAGS)
AC_SUBST(TOOLS_CLASSPATH)
JDK_PATH=$JAVA_HOME/bin
AC_SUBST(JDK_PATH)
JAVA=$JAVA_HOME/bin/java
AC_SUBST(JAVA)
JRE_EXT=$JAVA_HOME/jre/lib/ext
AC_SUBST(JRE_EXT)
AC_PATH_PROG([JAVAH], [javah], [no], [$PATH:$JDK_PATH])
if test x"$JAVAH" = x"no"; then
AC_MSG_ERROR([JAVAH compiler not found])
fi
#--------------------------------------------------------------------
# aws kms sdk
AS_IF([test "x$ENABLE_PLUGINS" != "xfalse"], [
AS_IF([test "x$ENABLE_SECURITY_AWS_KMS" != "xfalse"], [
PKG_CHECK_MODULES([AWS_SDK_KMS], [aws-cpp-sdk-kms], [have_aws_sdk_kms=yes], [have_aws_sdk_kms=no])
if test "$have_aws_sdk_kms" = "no"; then
AC_MSG_ERROR([--enable-security-aws-kms specified, but not available])
fi
])
])
AC_CHECK_LIB([dl],
[dlopen],
[DL_LIBS="-ldl"])
AC_CHECK_LIB([pthread],
[pthread_self],
[PTHREAD_LIBS="-lpthread"])
AC_CHECK_LIB([z],
[inflate],
[ZLIB_LIBS="-lz"],
[],
[$ZLIB_LDFLAGS])
AC_CHECK_LIB([bz2],
[BZ2_bzdopen],
[BZIP_LIBS="-lbz2"],
[],
[$BZIP_LDFLAGS])
AC_CHECK_LIB([uuid],
[uuid_copy],
[UUID_LIBS="-luuid"],
[],
[$LW_LDFLAGS -luuid])
AC_CHECK_LIB([crypto],
[MD5_Init],
[CRYPTO_LIBS="-lcrypto -lssl"],
[],
[$OPENSSL_LDFLAGS])
AC_CHECK_LIB([lber],
[ber_scanf],
[LBER_LIBS="-llber"],
[],
[$LW_LDFLAGS -llber])
AC_CHECK_LIB([gssapi_krb5],
[gss_accept_sec_context],
[GSSAPI_LIBS="-lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err"],
[],
[$LW_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err])
AC_CHECK_LIB([sasl2],
[sasl_server_init],
[SASL_LIBS="-lsasl2"],
[],
[$SASL_LDFLAGS])
AC_CHECK_LIB([ldap_r],
[ldap_initialize],
[LDAP_LIBS="-lldap_r -llber"],
[],
[$LW_LDFLAGS -llber $SASL_LDFLAGS $SASL_LIBS $GSSAPI_LIBS $OPENSSL_LDFLAGS $CRYPTO_LIBS])
AC_CHECK_LIB([lwbase],
[LwRtlMemoryAllocate],
[LWBASE_LIBS="-llwbase -llwbase_nothr"],
[],
[$LW_LDFLAGS -llwbase_nothr])
AC_CHECK_LIB([lwadvapi],
[LwFreeMemory],
[LWADVAPI_LIBS="-llwadvapi -llwadvapi_nothr"],
[],
[$LW_LDFLAGS -llwadvapi_nothr $LWBASE_LIBS $LDAP_LIBS $GSSAPI_LIBS $OPENSSL_LDFLAGS $CRYPTO_LIBS])
AC_CHECK_LIB([lwmsg],
[lwmsg_connection_new],
[LWMSG_LIBS="-llwmsg -llwmsg_nothr"],
[],
[$LW_LDFLAGS -llwmsg_nothr $LWBASE_LIBS])
AC_CHECK_LIB([regclient],
[LwRegOpenKeyExW],
[LWREG_LIBS="-lregclient -lregcommon"],
[],
[$LW_LDFLAGS -lregcommon $LWMSG_LIBS $LWBASE_LIBS])
AC_CHECK_LIB([rsutils],
[RegUtilSetValue],
[LWRSUTILS_LIBS="-lrsutils"],
[],
[$LW_LDFLAGS -lrsutils $LWREG_LIBS $LWMSG_LIBS $LWBASE_LIBS])
AC_CHECK_LIB([schannel],
[schn_init_creds],
[SCHANNEL_LIBS="-lschannel"],
[],
[$LW_LDFLAGS $LWBASE_LIBS $OPENSSL_LDFLAGS $CRYPTO_LIBS])
AC_CHECK_LIB([lwioclient],
[LwNtCreateFile],
[LWIO_LIBS="-llwioclient -llwioshareinfo -llwiocommon"],
[],
[$LW_LDFLAGS -llwioshareinfo -llwiocommon
$LWREG_LIBS $LWMSG_LIBS $LWBASE_LIBS $GSSAPI_LIBS])
AC_CHECK_LIB([dcerpc],
[rpc__init],
[DCERPC_LIBS="-ldcerpc"],
[],
[$DCERPC_LDFLAGS $OPENSSL_LDFLAGS $GSSAPI_LIBS $SCHANNEL_LIBS $CRYPTO_LIBS $LWIO_LIBS
$LWREG_LIBS $LWMSG_LIBS $LWBASE_LIBS])
AC_CHECK_LIB([jansson],
[json_object],
[JANSSON_LIBS="-ljansson"],
[],
[$JANSSON_LDFLAGS])