forked from apache/mesos
-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
2966 lines (2479 loc) · 105 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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Generated with autoscan, then modified appropriately.
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([mesos], [1.12.0])
# Have autoconf setup some variables related to the system.
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
AC_DISABLE_STATIC
AC_LANG([C++])
# Default to gcc toolchain (we rely on some atomic builtins for now,
# that are also present with clang).
AC_PROG_CXX([g++])
AC_PROG_CC([gcc])
AC_PROG_LN_S
AX_COMPILER_VERSION
AX_COMPILER_VENDOR
AC_CONFIG_MACRO_DIR([m4])
# Initialize automake.
# -Wno-portability, since we require GNU Make for % patterns
# Removal of -Werror due warnings introduced by automake 1.14.
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign tar-pax])
AM_MAINTAINER_MODE([enable])
# This is required for linking non-POSIX libs.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Initialize libtool (LT_OUTPUT builds ./libtool immediately, needed
# if we want to do tests with libtool during configuration).
LT_PREREQ([2.2])
LT_INIT
LT_LANG([C++])
LT_OUTPUT
# Save the configure arguments so we can pass them to any third-party
# libraries that we might run configure on (see 3rdparty/Makefile.am).
# One downside of our strategy for shipping and building third-party
# libraries is that we can't expose options from nested third-party
# configure scripts.
CONFIGURE_ARGS="$ac_configure_args"
AC_SUBST(CONFIGURE_ARGS)
AM_CONDITIONAL([STANDALONE_LIBPROCESS], [false])
AM_CONDITIONAL([STANDALONE_STOUT], [false])
AC_CONFIG_FILES([Makefile mesos.pc])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([3rdparty/Makefile])
AC_CONFIG_FILES([3rdparty/libprocess/Makefile])
AC_CONFIG_FILES([3rdparty/libprocess/include/Makefile])
AC_CONFIG_FILES([3rdparty/stout/Makefile])
AC_CONFIG_FILES([3rdparty/stout/include/Makefile])
AC_CONFIG_FILES([3rdparty/gmock_sources.cc])
AC_CONFIG_FILES(
[bin/mesos.sh],
[chmod +x bin/mesos.sh])
AC_CONFIG_FILES(
[bin/mesos-agent.sh],
[chmod +x bin/mesos-agent.sh])
AC_CONFIG_FILES(
[bin/mesos-local.sh],
[chmod +x bin/mesos-local.sh])
AC_CONFIG_FILES(
[bin/mesos-master.sh],
[chmod +x bin/mesos-master.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[bin/mesos-slave.sh:bin/mesos-agent.sh.in],
[chmod +x bin/mesos-slave.sh])
AC_CONFIG_FILES(
[bin/mesos-tests.sh],
[chmod +x bin/mesos-tests.sh])
AC_CONFIG_FILES(
[bin/mesos-agent-flags.sh],
[chmod +x bin/mesos-agent-flags.sh])
AC_CONFIG_FILES(
[bin/mesos-local-flags.sh],
[chmod +x bin/mesos-local-flags.sh])
AC_CONFIG_FILES(
[bin/mesos-master-flags.sh],
[chmod +x bin/mesos-master-flags.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[bin/mesos-slave-flags.sh:bin/mesos-agent-flags.sh.in],
[chmod +x bin/mesos-slave-flags.sh])
AC_CONFIG_FILES(
[bin/mesos-tests-flags.sh],
[chmod +x bin/mesos-tests-flags.sh])
AC_CONFIG_FILES(
[bin/gdb-mesos-agent.sh],
[chmod +x bin/gdb-mesos-agent.sh])
AC_CONFIG_FILES(
[bin/gdb-mesos-local.sh],
[chmod +x bin/gdb-mesos-local.sh])
AC_CONFIG_FILES(
[bin/gdb-mesos-master.sh],
[chmod +x bin/gdb-mesos-master.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[bin/gdb-mesos-slave.sh:bin/gdb-mesos-agent.sh.in],
[chmod +x bin/gdb-mesos-slave.sh])
AC_CONFIG_FILES(
[bin/gdb-mesos-tests.sh],
[chmod +x bin/gdb-mesos-tests.sh])
AC_CONFIG_FILES(
[bin/lldb-mesos-agent.sh],
[chmod +x bin/lldb-mesos-agent.sh])
AC_CONFIG_FILES(
[bin/lldb-mesos-local.sh],
[chmod +x bin/lldb-mesos-local.sh])
AC_CONFIG_FILES(
[bin/lldb-mesos-master.sh],
[chmod +x bin/lldb-mesos-master.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[bin/lldb-mesos-slave.sh:bin/lldb-mesos-agent.sh.in],
[chmod +x bin/lldb-mesos-slave.sh])
AC_CONFIG_FILES(
[bin/lldb-mesos-tests.sh],
[chmod +x bin/lldb-mesos-tests.sh])
AC_CONFIG_FILES(
[bin/valgrind-mesos-agent.sh],
[chmod +x bin/valgrind-mesos-agent.sh])
AC_CONFIG_FILES(
[bin/valgrind-mesos-local.sh],
[chmod +x bin/valgrind-mesos-local.sh])
AC_CONFIG_FILES(
[bin/valgrind-mesos-master.sh],
[chmod +x bin/valgrind-mesos-master.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[bin/valgrind-mesos-slave.sh:bin/valgrind-mesos-agent.sh.in],
[chmod +x bin/valgrind-mesos-slave.sh])
AC_CONFIG_FILES(
[bin/valgrind-mesos-tests.sh],
[chmod +x bin/valgrind-mesos-tests.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-daemon.sh],
[chmod +x src/deploy/mesos-daemon.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-start-agents.sh],
[chmod +x src/deploy/mesos-start-agents.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-start-cluster.sh],
[chmod +x src/deploy/mesos-start-cluster.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-start-masters.sh],
[chmod +x src/deploy/mesos-start-masters.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[src/deploy/mesos-start-slaves.sh:src/deploy/mesos-start-agents.sh.in],
[chmod +x src/deploy/mesos-start-slaves.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-stop-agents.sh],
[chmod +x src/deploy/mesos-stop-agents.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-stop-cluster.sh],
[chmod +x src/deploy/mesos-stop-cluster.sh])
AC_CONFIG_FILES(
[src/deploy/mesos-stop-masters.sh],
[chmod +x src/deploy/mesos-stop-masters.sh])
# TODO(tomxing): Remove this script once the
# slave->agent rename is complete(MESOS-3782).
AC_CONFIG_FILES(
[src/deploy/mesos-stop-slaves.sh:src/deploy/mesos-stop-agents.sh.in],
[chmod +x src/deploy/mesos-stop-slaves.sh])
AC_CONFIG_FILES([include/mesos/version.hpp])
AC_CONFIG_FILES([src/java/generated/org/apache/mesos/MesosNativeLibrary.java])
###############################################################################
# Optional features.
###############################################################################
AC_ARG_ENABLE([bundled],
AS_HELP_STRING([--disable-bundled],
[build against preinstalled dependencies instead
of bundled libraries]),
[], [enable_bundled=yes])
AC_ARG_ENABLE([bundled-pip],
AS_HELP_STRING([--disable-bundled-pip],
[excludes building and using the bundled pip
package in lieu of an installed version in
PYTHONPATH]),
[], [enable_bundled_pip=yes])
AC_ARG_ENABLE([bundled-setuptools],
AS_HELP_STRING([--disable-bundled-setuptools],
[excludes building and using the bundled setuptools
package in lieu of an installed version in
PYTHONPATH]),
[], [enable_bundled_setuptools=yes])
AC_ARG_ENABLE([bundled-wheel],
AS_HELP_STRING([--disable-bundled-wheel],
[excludes building and using the bundled wheel
package in lieu of an installed version in
PYTHONPATH]),
[], [enable_bundled_wheel=yes])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],
[enable debugging. If CFLAGS/CXXFLAGS are set, this
option will not change them]),
[], [enable_debug=no])
AC_ARG_ENABLE([gc-unused],
AS_HELP_STRING([--enable-gc-unused],
[enable garbage collection of unused program segments]),
[], [enable_gc_unused=no])
AC_ARG_ENABLE([hardening],
AS_HELP_STRING([--disable-hardening],
[disables security measures such as stack
protection and position independent library code]),
[], [enable_hardening=yes])
AC_ARG_ENABLE([install-module-dependencies],
AS_HELP_STRING([--enable-install-module-dependencies],
[Install third-party bundled dependencies required
for module development]),
[], [enable_install_module_dependencies=no])
AC_ARG_ENABLE([network-ports-isolator],
AS_HELP_STRING([--enable-network-ports-isolator],
[enable network ports isolator]),
[], [enable_network_ports_isolator=no])
AC_ARG_ENABLE([java],
AS_HELP_STRING([--disable-java],
[do not build Java bindings]),
[], [enable_java=yes])
AC_ARG_ENABLE([nvml],
AS_HELP_STRING([--disable-nvml],
[do not use the NVML headers]),
[], [enable_nvml=yes])
# TODO(bevers): Eventually make this enabled by default.
AC_ARG_ENABLE([jemalloc-allocator],
AS_HELP_STRING([--enable-jemalloc-allocator],
[Use jemalloc as the default memory allocator for the
mesos-master and mesos-agent binaries.]),
[], [enable_jemalloc_allocator=no])
# TODO(benh): Eventually make this enabled by default.
AC_ARG_ENABLE([last_in_first_out_fixed_size_semaphore],
AS_HELP_STRING([--enable-last-in-first-out-fixed-size-semaphore],
[enables the optimized LIFO fixed-size semaphore in libprocess]),
[], [enable_last_in_first_out_fixed_size_semaphore=no])
AC_ARG_ENABLE([launcher_sealing],
AS_HELP_STRING([--enable-launcher-sealing],
[Enables sealing of launcher binary during
initialization of Mesos containerizer.
A copy of launcher's binary is cloned into
memory and sealed to prevent overwriting of
launcher's executable by containers.
This is a Linux-specific feature and requires
the support of memfd by the kernel.]),
[], [enable_launcher_sealing=no])
AC_ARG_ENABLE([libevent],
AS_HELP_STRING([--enable-libevent],
[use libevent instead of libev]),
[], [enable_libevent=no])
# TODO(benh): Eventually make this enabled by default.
AC_ARG_ENABLE([lock_free_event_queue],
AS_HELP_STRING([--enable-lock-free-event-queue],
[enables the lock-free event queue in libprocess]),
[], [enable_lock_free_event_queue=no])
# TODO(benh): Eventually make this enabled by default.
AC_ARG_ENABLE([lock_free_run_queue],
AS_HELP_STRING([--enable-lock-free-run-queue],
[enables the lock-free run queue in libprocess]),
[], [enable_lock_free_run_queue=no])
AC_ARG_ENABLE([new_cli],
AS_HELP_STRING([--enable-new-cli],
[enable building the new CLI instead of the old one]),
[], [enable_new_cli=no])
AC_ARG_ENABLE([libtool-wrappers],
AS_HELP_STRING([--disable-libtool-wrappers],
[Directly create binaries instead of libtool
wrapper scripts to prevent relinking when first
executing binaries from the build directory. This
flag leads to binaries with the build directory
encoded in the executables' RPATH which makes them
in general unfit for installation.
USE WITH CARE.]))
AC_ARG_ENABLE([optimize],
AS_HELP_STRING([--enable-optimize],
[enable optimizations. If CFLAGS/CXXFLAGS are set,
this option will not change them]),
[], [enable_optimize=no])
AC_ARG_ENABLE([parallel_test_execution],
AS_HELP_STRING([--disable-parallel-test-execution],
[disable the parallel runner used during make check]),
[], [enable_parallel_test_execution=yes])
AC_ARG_ENABLE([perftools],
AS_HELP_STRING([--enable-perftools],
[enable Google perftools]),
[], [enable_perftools=no])
AC_ARG_ENABLE([port-mapping-isolator],
AS_HELP_STRING([--enable-port-mapping-isolator],
[enable port mapping network isolator]),
[], [enable_port_mapping_isolator=no])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python],
[do not build Python bindings]),
[], [enable_python=yes])
# This is used to make distcheck and python install work together. For more
# information, see the comment above AM_DISTCHECK_CONFIGURE_FLAGS in
# Makefile.am.
AC_ARG_ENABLE([python-dependency-install],
AS_HELP_STRING([--disable-python-dependency-install],
[when the python packages are installed during
make install, no external dependencies are
downloaded or installed]),
[], [enable_python_dependency_install=yes])
AC_ARG_ENABLE([seccomp-isolator],
AS_HELP_STRING([--enable-seccomp-isolator],
[Builds the Seccomp isolator which depends on
libseccomp and requires Linux kernel 3.5+
This flag will be deprecated in the future when
we drop support for the outdated Linux kernels.]),
[], [enable_seccomp_isolator=no])
AC_ARG_ENABLE([ssl],
AS_HELP_STRING([--enable-ssl],
[use ssl for libprocess communication]),
[], [enable_ssl=no])
AC_ARG_ENABLE([static-unimplemented],
AS_HELP_STRING([--enable-static-unimplemented],
[generate static assertion errors for unimplemented
functions]),
[], [enable_static_unimplemented=no])
AC_ARG_ENABLE([tests-install],
AS_HELP_STRING([--enable-tests-install],
[build and install tests and their helper tools]),
[], [enable_tests_install=no])
AC_ARG_ENABLE([werror],
AS_HELP_STRING([--disable-werror],
[do not treat compiler warnings as fatal errors]))
AC_ARG_ENABLE([xfs-disk-isolator],
AS_HELP_STRING([--enable-xfs-disk-isolator],
[builds the XFS disk isolator]),
[], [enable_xfs_disk_isolator=no])
###############################################################################
# Optional packages.
###############################################################################
AC_ARG_WITH([apr],
AS_HELP_STRING([--with-apr=@<:@=DIR@:>@],
[specify where to locate the apr-1 library]),
[], [])
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@],
[excludes building and using the bundled Boost
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_boost=yes], [])
AC_ARG_WITH([concurrentqueue],
AS_HELP_STRING([--with-concurrentqueue@<:@=DIR@:>@],
[excludes building and using the bundled concurrentqueue
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_concurrentqueue=yes], [])
AC_ARG_WITH([curl],
AS_HELP_STRING([--with-curl=@<:@=DIR@:>@],
[specify where to locate the curl library]),
[], [])
AC_ARG_WITH([elfio],
AS_HELP_STRING([--with-elfio@<:@=DIR@:>@],
[excludes building and using the bundled ELFIO
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_elfio=yes], [])
AC_ARG_WITH([glog],
AS_HELP_STRING([--with-glog@<:@=DIR@:>@],
[excludes building and using the bundled glog
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_glog=yes], [])
AC_ARG_WITH([gmock],
AS_HELP_STRING([--with-gmock@<:@=DIR@:>@],
[excludes building and using the bundled gmock
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_gmock=yes], [])
AC_ARG_WITH([grpc],
AS_HELP_STRING([--with-grpc@<:@=DIR@:>@],
[excludes building and using the bundled grpc
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_grpc=yes], [])
AC_ARG_WITH([http-parser],
AS_HELP_STRING([--with-http-parser@<:@=DIR@:>@],
[excludes building and using the bundled http-parser
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_http_parser=yes], [])
AC_ARG_WITH([jemalloc],
AS_HELP_STRING([--with-jemalloc@<:@=DIR@:>@],
[excludes building and using the bundled jemalloc
package in lieu of an installed version at a
location prefixed by the given path.]),
[without_bundled_jemalloc=yes], [])
AC_ARG_WITH([leveldb],
AS_HELP_STRING([--with-leveldb@<:@=DIR@:>@],
[excludes building and using the bundled LevelDB
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_leveldb=yes], [])
AC_ARG_WITH([libev],
AS_HELP_STRING([--with-libev@<:@=DIR@:>@],
[excludes building and using the bundled libev
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_libev=yes], [])
AC_ARG_WITH([libevent],
AS_HELP_STRING([--with-libevent=@<:@=DIR@:>@],
[specify where to locate the libevent library]),
[without_bundled_libevent=yes], [])
AC_ARG_WITH([libarchive],
AS_HELP_STRING([--with-libarchive=@<:@=DIR@:>@],
[specify where to locate the libarchive library]),
[without_bundled_libarchive=yes], [])
AC_ARG_WITH([libprocess],
AS_HELP_STRING([--with-libprocess=@<:@=DIR@:>@],
[specify where to locate the libprocess library]),
[], [])
AC_ARG_WITH([libseccomp],
AS_HELP_STRING([--with-libseccomp=@<:@=DIR@:>@],
[specify where to locate the libseccomp library]),
[without_bundled_libseccomp=yes], [])
AC_ARG_WITH([network-isolator],
AS_HELP_STRING([--with-network-isolator],
[builds the network isolator]),
[AC_MSG_WARN([--with-network-isolator is being deprecated, please use --enable-port-mapping-isolator instead.]);
enable_port_mapping_isolator=yes],
[])
AC_ARG_WITH([nvml],
AS_HELP_STRING([--with-nvml@<:@=DIR@:>@],
[excludes building and using the bundled NVML headers
in lieu of an installed version at a location
prefixed by the given path]),
[without_bundled_nvml=yes], [])
AC_ARG_WITH([picojson],
AS_HELP_STRING([--with-picojson@<:@=DIR@:>@],
[excludes building and using the bundled picojson
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_picojson=yes], [])
AC_ARG_WITH([rapidjson],
AS_HELP_STRING([--with-rapidjson@<:@=DIR@:>@],
[excludes building and using the bundled rapidjson
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_rapidjson=yes], [])
AC_ARG_WITH([re2],
AS_HELP_STRING([--with-re2@<:@=DIR@:>@],
[excludes building and using the bundled re2
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_re2=yes], [])
AC_ARG_WITH([protobuf],
AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
[excludes building and using the bundled protobuf
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_protobuf=yes], [])
AC_ARG_WITH([sasl],
AS_HELP_STRING([--with-sasl=@<:@=DIR@:>@],
[specify where to locate the sasl2 library]),
[], [])
AC_ARG_WITH([ssl],
AS_HELP_STRING([--with-ssl=@<:@=DIR@:>@],
[specify where to locate the ssl library]),
[], [])
AC_ARG_WITH([stout],
AS_HELP_STRING([--with-stout=@<:@=DIR@:>@],
[specify where to locate stout library]),
[], [])
AC_ARG_WITH([svn],
AS_HELP_STRING([--with-svn=@<:@=DIR@:>@],
[specify where to locate the svn-1 library]),
[], [])
AC_ARG_WITH([zlib],
AS_HELP_STRING([--with-zlib=@<:@=DIR@:>@],
[specify where to locate the zlib library]),
[], [])
AC_ARG_WITH([zookeeper],
AS_HELP_STRING([--with-zookeeper@<:@=DIR@:>@],
[excludes building and using the bundled ZooKeeper
package in lieu of an installed version at a
location prefixed by the given path]),
[without_bundled_zookeeper=yes], [])
###############################################################################
# Debug/Optimization checks.
###############################################################################
# Check if we should enable debugging, optimization. Note we only
# update CFLAGS and CXXFLAGS if none are provided.
AM_CONDITIONAL([DEBUG], [test x"$enable_debug" = "xyes"])
AM_CONDITIONAL([OPTIMIZE], [test x"$enable_optimize" = "xyes"])
debug_flags="-g1"
if test "x$enable_debug" = "xyes"; then
debug_flags="-g -fno-omit-frame-pointer"
elif test "x$enable_optimize" = "xyes"; then
debug_flags=""
fi
if test "x$enable_optimize" = "xyes"; then
optimize_flags="-O2"
else
optimize_flags="-O0"
fi
AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
[CFLAGS="$debug_flags $optimize_flags"])
AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
[CXXFLAGS="$debug_flags $optimize_flags"])
###############################################################################
# Compiler checks.
###############################################################################
# Check if we should use the LIFO fixed-size semaphore.
AS_IF([test "x$enable_last_in_first_out_fixed_size_semaphore" = "xyes"],
[AC_DEFINE([LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE])])
# Check if we should use the lock-free event queue.
AS_IF([test "x$enable_lock_free_event_queue" = "xyes"],
[AC_DEFINE([LOCK_FREE_EVENT_QUEUE])])
# Check if we should use the lock-free run queue.
AS_IF([test "x$enable_lock_free_run_queue" = "xyes"],
[AC_DEFINE([LOCK_FREE_RUN_QUEUE])])
# Check if we should link the mesos binaries against jemalloc.
AM_CONDITIONAL([ENABLE_JEMALLOC_ALLOCATOR],
[test x"$enable_jemalloc_allocator" = "xyes"])
# Check to see if we should harden or not.
AM_CONDITIONAL([ENABLE_HARDENING], [test x"$enable_hardening" = "xyes"])
AC_MSG_CHECKING([whether to enable GC of unused sections])
AC_MSG_RESULT([$enable_gc_unused])
AS_IF([test "x$enable_gc_unused" = "xyes"], [
AC_LANG_PUSH([C++])
saved_CXXFLAGS="$CXXFLAGS"
saved_LDFLAGS="$LDFLAGS"
CXXFLAGS="-ffunction-sections -fdata-sections"
LDFLAGS="-Wl,--gc-sections"
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([], [return 0;]) ],
[],
[
AC_MSG_ERROR([cannot enable GC of unused sections
-------------------------------------------------------------------
The current toolchain does not support the necessary options to
enable garbage collection of unused sections.
-------------------------------------------------------------------
])
]
)
CXXFLAGS="$saved_CXXFLAGS"
LDFLAGS="$saved_LDFLAGS"
AC_LANG_POP()
])
AS_IF([test "x${enable_gc_unused}" = "xyes"], [
CCFLAGS="$CCFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
LDFLAGS="$LDFLAGS -Wl,--gc-sections"
])
AS_CASE($ax_cv_cxx_compiler_vendor,
[clang], [
# Upstream Clang 3.6 emits `-Wunused-local-typedef` warnings when compiling
# Boost so we suppress them here. Apple LLVM based on Clang 3.6 doesn't have
# the same behavior. See: https://reviews.apache.org/r/32749/
# NOTE(chhsiao): Clang 3.6.0 from the link below seems to compile Boost
# 1.53.0/1.65.0 just fine: http://releases.llvm.org/download.html#3.6.0
#
# Clang 3.6+ emits `-Winconsistent-missing-override` warnings for most uses
# of the Google Mock `MOCK_METHOD` family of macros so we suppress them
# here. See: https://github.com/google/googletest/issues/533
AX_APPEND_COMPILE_FLAGS([-Wno-unused-local-typedef \
-Wno-inconsistent-missing-override],
[CXXFLAGS], [-Werror])
], [gnu], [
# Check for GCC version >= 4.8.
AX_COMPARE_VERSION([$ax_cv_cxx_compiler_version], [ge], [4.8],
[is_ge_gxx48=yes], [is_ge_gxx48=no])
if test "x$is_ge_gxx48" != "xyes"; then
# GCC < 4.8 is not supported.
AC_MSG_ERROR([GCC 4.8 or higher required (found $ax_cv_cxx_compiler_version)])
fi
AC_MSG_NOTICE([Setting up CXXFLAGS for g++ version >= 4.8])
# Boost fails to compile with GCC 4.8+ without `-Wno-unused-local-typedefs`,
# and automake does not recognize the flag.
# TODO(brenden): Remove this when Boost has a resolution.
CFLAGS="${CFLAGS} -Wno-unused-local-typedefs"
CXXFLAGS="${CXXFLAGS} -Wno-unused-local-typedefs"
# Disable 'maybe-uninitialized' warning when "-O2" is enabled due
# to MESOS-2690. This is short term fix until the GCC bug is fixed.
case $CXXFLAGS in
*-O2*) CXXFLAGS="${CXXFLAGS} -Wno-maybe-uninitialized" ;;
*) ;;
esac
], [
AC_MSG_WARN([$ax_cv_cxx_compiler_vendor is an unsupported compiler])
]
)
# If our compiler supports strong stack protection, use it.
# If not, use a lesser form of stack protection.
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong],
[AC_SUBST(STACK_PROTECTOR, "-fstack-protector-strong")],
[AC_SUBST(STACK_PROTECTOR, "-fstack-protector")])
# Ensure that CXX supports C++11 (with "strict" conformance), and set
# "--std=" flag and CXXFLAGS environment variable as appropriate.
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
# Blacklist known incompatible C++ standard libraries to reduce chance
# of users accidentally using them.
# - libstdc++ (Pre 4.8.0, version datestamp 20130322)
# - libc++ (Pre 3.5.0, version string 1101)
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#include <vector>
#ifdef __GLIBCXX__
#if __GLIBCXX__ < 20130322
#error Force the compiler to fail and set COMPATIBLE_CXX_STDLIB=no.
#endif
#elif _LIBCPP_VERSION < 1101
#error Force the compiler to fail and set COMPATIBLE_CXX_STDLIB=no.
#endif
]])],
[COMPATIBLE_CXX_STDLIB=yes], [COMPATIBLE_CXX_STDLIB=no])
AC_LANG_POP([C++])
if test "x$COMPATIBLE_CXX_STDLIB" = "xno"; then
AC_MSG_ERROR([known incompatible C++ Standard library in use
-------------------------------------------------------------------
libstdc++ from GCC 4.8.0+ or libc++ from LLVM/Clang 3.5+ is required.
If a new enough GCC installed (4.8.0+) it should automatically find
the right libstdc++. If clang is in use, it will automatically find
the newest libstdc++ on the host.
If you are trying to use a different compiler from (clang, gcc) or a
alternate C++ Standard Library implementation, likely the flags being
passed to the compiler (CXXFLAGS) are not currently correct / being
picked up.
-------------------------------------------------------------------
])
fi
case "$host_os" in
darwin* )
# If we're using clang, we need to pass -stdlib=libc++ too.
if test "x$ax_cv_cxx_compiler_vendor" = "xclang"; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
;;
freebsd* )
# If we're using clang, we need to pass -stdlib=libc++ too.
if test "x$ax_cv_cxx_compiler_vendor" = "xclang"; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
# FreeBSD needs GTEST_HAS_PTHREAD for this version of gmock/gtest and
# _WITH_GETLINE for getline().
CXXFLAGS="$CXXFLAGS -DGTEST_HAS_PTHREAD -D_WITH_GETLINE"
# Add no-sentinal so that stout builds with system clang on 11.0 and later
# (3.8+).
CXXFLAGS="$CXXFLAGS -Wno-sentinel"
;;
esac
###############################################################################
# Miscellaneous flags/library/tool checks.
###############################################################################
AC_ARG_VAR([JAVA_HOME], [location of Java Development Kit (JDK)])
AC_ARG_VAR([JAVA_CPPFLAGS], [preprocessor flags for JNI])
AC_ARG_VAR([JAVA_JVM_LIBRARY], [full path to libjvm.so])
AC_ARG_VAR([MAVEN_HOME], [looks for mvn at MAVEN_HOME/bin/mvn])
AC_ARG_VAR([PROTOBUF_JAR], [full path to protobuf jar on prefixed builds])
AC_ARG_VAR([PYTHON], [which Python 2 interpreter to use])
AC_ARG_VAR([PYTHON_3], [which Python 3 interpreter to use])
AC_ARG_VAR([TEST_DRIVER], [executable and arguments of a test driver])
# Check for pthreads (uses m4/ax_pthread.m4).
AX_PTHREAD([], [AC_MSG_ERROR([failed to find pthreads])])
if test "x$enable_static_unimplemented" = "xyes"; then
AC_DEFINE([ENABLE_STATIC_UNIMPLEMENTED], [1])
fi
# Build libprocess as a static library with position independent code so
# that we can produce a final shared library which includes everything
# necessary (and only install that).
AM_CONDITIONAL([ENABLE_STATIC_LIBPROCESS], [true])
AC_MSG_NOTICE([Setting up build environment for ${target_cpu} ${target_os}])
# Determine the current OS (TODO(benh): Does autotools do this for us?).
case "${host_os}" in
linux*)
OS_NAME=linux
LIBS="$LIBS -lrt"
;;
darwin*)
OS_NAME=darwin
;;
freebsd*)
OS_NAME=freebsd
;;
*)
AC_MSG_ERROR("Mesos is currently unsupported on your platform.")
esac
AM_CONDITIONAL([DISABLE_LIBTOOL_WRAPPERS],
[test x"$enable_libtool_wrappers" = "xno"])
# Used for conditionally including source files.
AM_CONDITIONAL([OS_LINUX], [test "x$OS_NAME" = "xlinux"])
AM_CONDITIONAL([OS_FREEBSD], [test "x$OS_NAME" = "xfreebsd"])
AM_CONDITIONAL([HAS_GPERFTOOLS], [test "x$enable_perftools" = "xyes"])
AM_CONDITIONAL([INSTALL_MODULE_DEPENDENCIES],
[test x"$enable_install_module_dependencies" = "xyes"])
AS_IF([test "x$enable_install_module_dependencies" = "xyes"],
[AC_SUBST(MODULE_CFLAGS, "-I${libdir}/mesos/3rdparty/include")
AC_SUBST(MODULE_LDFLAGS, "-L${libdir}/mesos/3rdparty/lib64 -L${libdir}/mesos/3rdparty/lib")])
AM_CONDITIONAL([INSTALL_TESTS], [test x"$enable_tests_install" = "xyes"])
AS_IF([test x"$enable_tests_install" = "xyes"],
[AC_DEFINE([MESOS_INSTALL_TESTS], [1])])
# If we use our own test runner to parallelize gtests we can run
# everything but ROOT tests in parallel.
# We here set up `TEST_DRIVER` to contain an unexpanded automake
# variable name; this allows us to reuse the test runner to run bundled
# 3rdparty checks. The special quoting ensures that this containing a
# space is not expanded by autoconf.
# TODO(bbannier): Make this more readible by using autoconf/m4 magic.
AS_IF([test "x$enable_parallel_test_execution" = "xyes"],
[AC_SUBST([TEST_DRIVER],
'${abs_top_srcdir}/support/mesos-gtest-runner.py'[' --sequential='*ROOT_*'']]))
# Define `WERROR` if the use of `-Werror` was not disabled, leave
# unset otherwise. An unset variable evaluates to an empty string
# in autoconf's substitution.
AS_IF([test "x$enable_werror" != "xno"],
[AC_SUBST([WERROR], [-Werror])])
# Check for libunwind - used by glog for tracebacks - and link it in if
# present.
# `-lgcc_s` is necessary on e.g. ARM64 and IA-64, see
# https://bugzilla.redhat.com/show_bug.cgi?id=480412
# Notes:
# - Omitting it causes glog to link it anyway, resulting in the same problem.
# - If `-lgcc_s` isn't available, e.g. if compiling with a pure LLVM toolchain,
# then we won't link it here but glog will link it anyway, but it won't suffer
# from the problem which affects only libgcc.
if test "x$OS_NAME" = "xfreebsd"; then
AC_CHECK_LIB(execinfo, backtrace, LIBS="$LIBS -lexecinfo")
else
AC_CHECK_LIB(unwind, backtrace, LIBS="$LIBS -lgcc_s -lunwind")
fi
# Check if libssl prefix path was provided, and if so, add it to
# the CPPFLAGS and LDFLAGS with respective /include and /lib path
# suffixes.
if test -z "`echo $with_ssl`" &&
test "$OS_NAME" = "darwin" &&
test -n "`command -v brew`" &&
test -n "`brew list --versions openssl`"; then
with_ssl=`brew --prefix openssl`
fi
if test -n "`echo $with_ssl`"; then
SSL_CPPFLAGS="-I${with_ssl}/include"
SSL_LINKERFLAGS="-L${with_ssl}/lib"
CPPFLAGS="$SSL_CPPFLAGS $CPPFLAGS"
LDFLAGS="$SSL_LINKERFLAGS $LDFLAGS"
fi
AC_CHECK_LIB([crypto], [RAND_poll], [found_crypto=yes])
AC_CHECK_HEADERS([openssl/ssl.h],
[AC_CHECK_LIB([ssl],
[SSL_CTX_new],
[found_ssl=yes],
[],
[-lcrypto])])
if test "x$enable_ssl" = "xyes"; then
if test "x$found_ssl" != "xyes"; then
AC_MSG_ERROR([cannot find libssl
-------------------------------------------------------------------
libssl is required for an SSL-enabled build.
-------------------------------------------------------------------
])
fi
if test "x$found_crypto" != "xyes"; then
AC_MSG_ERROR([cannot find libcrypto
-------------------------------------------------------------------
libcrypto is required for an SSL-enabled build.
-------------------------------------------------------------------
])
fi
LIBS="-lssl -lcrypto $LIBS"
AC_DEFINE([USE_SSL_SOCKET], [1])
fi
AM_CONDITIONAL([ENABLE_SSL],
[test "x$enable_ssl" = "xyes"])
AC_SUBST([SSL_CPPFLAGS])
AC_SUBST([SSL_LINKERFLAGS])
# Check if gflags are present. If so, make sure we link against them
# when building the Python module.
AC_CHECK_LIB([gflags],
[main],
[found_gflags=yes])
if test "x$found_gflags" = "xyes"; then
GFLAGS_LIBS="-lgflags"
else
GFLAGS_LIBS=""
fi
AC_CHECK_TOOL([PATCHCOMMAND_TEST], [patch], [], [$PATH])
if test -z "`echo $PATCHCOMMAND_TEST`"; then
AC_MSG_ERROR([patch command not found in PATH])
fi
# Check if we need to do anything special to use the fts_*
# functions. On some systems (e.g., those that use musl instead of
# glibc), FTS support requires linking against an additional library.
AC_CHECK_HEADERS([fts.h], [], [AC_MSG_ERROR([cannot find fts.h
-------------------------------------------------------------------
Failed to find fts.h. If this header file is not provided by libc
on this system (e.g., musl), a separate FTS package must be installed.
-------------------------------------------------------------------
])])
AC_SEARCH_LIBS(fts_close, fts, [], [AC_MSG_ERROR([cannot find libfts
-------------------------------------------------------------------
Failed to find fts_close. If this function is not provided by libc
on this system (e.g., musl), a separate FTS package must be installed.
-------------------------------------------------------------------
])])
###############################################################################
# Miscellaneous checks related to (un)bundled software.
###############################################################################
# Attempt to use preinstalled dependencies instead of the bundled
# versions in cases where the user specified their location
# (--with-XXX=DIR) or asked us to attempt to detect them
# (--disable-bundled).
# On OS X, if `--with-apr` was not provided, we try to use an available
# brew installed version.
if test -z "`echo $with_apr`" &&
test "$OS_NAME" = "darwin" &&
test -n "`command -v brew`" &&
test -n "`brew list --versions apr`"; then
with_apr=`brew --prefix apr`/libexec
fi
# Check if libapr-1 prefix path was provided, and if so, add it to
# the CPPFLAGS and LDFLAGS with respective /include/apr-1 and /lib path
# suffixes. We include /include/apr-1 because we include <apr*>
# headers directly.
if test -n "`echo $with_apr`" ; then
CPPFLAGS="-I${with_apr}/include/apr-1 \
-I${with_apr}/include/apr-1.0 $CPPFLAGS"
LDFLAGS="-L${with_apr}/lib $LDFLAGS"
else
CPPFLAGS="-I/usr/include/apr-1 -I/usr/include/apr-1.0 \
$CPPFLAGS"
fi
AC_CHECK_HEADERS([apr_pools.h],
[AC_CHECK_LIB([apr-1], [apr_initialize], [],
[AC_MSG_ERROR([cannot find libapr-1
-------------------------------------------------------------------