diff --git a/Makefile b/Makefile index 8213e6346..974b1ee37 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ all: infer configure: configure.ac $(wildcard m4/*.m4) ./autogen.sh -Makefile.autoconf: configure +Makefile.autoconf: configure Makefile.autoconf.in # rerun ./configure with the flags that were used last time it was run (if available) ./configure $(shell ./config.status --config || true) @@ -233,7 +233,7 @@ endtoend_test: print_direct_tests print_build_systems_tests inferTraceBugs_test: infer ifeq ($(BUILD_JAVA_ANALYZERS),yes) $(INFER_BIN) -o __test-infer-out__ -- \ - javac $(EXAMPLES_DIR)/Hello.java \ + $(JAVAC) $(EXAMPLES_DIR)/Hello.java \ > /dev/null else $(INFER_BIN) -o __test-infer-out__ -- \ diff --git a/Makefile.autoconf.in b/Makefile.autoconf.in index 8b7a725ef..cc9865695 100644 --- a/Makefile.autoconf.in +++ b/Makefile.autoconf.in @@ -13,6 +13,7 @@ bindir = @bindir@ BUCK = @BUCK@ BUILD_C_ANALYZERS = @BUILD_C_ANALYZERS@ BUILD_JAVA_ANALYZERS = @BUILD_JAVA_ANALYZERS@ +CAML_LD_LIBRARY_PATH = @CAML_LD_LIBRARY_PATH@ CC = @CC@ CFLAGS = @CFLAGS@ CLANG_INCLUDES = @CLANG_INCLUDES@ @@ -32,9 +33,11 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ IS_FACEBOOK_TREE = @IS_FACEBOOK_TREE@ IS_RELEASE_TREE = @IS_RELEASE_TREE@ +JAVAC = @JAVAC@ LDFLAGS = @LDFLAGS@ libdir = @libdir@ LIBS = @LIBS@ +MENHIR = @MENHIR@ MKDIR_P_CMD = case "@MKDIR_P@" in \ ./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \ *) printf "@MKDIR_P@\n";; \ @@ -43,8 +46,12 @@ MKDIR_P = $(shell $(MKDIR_P_CMD)) MVN = @MVN@ NCPU = @NCPU@ NDKBUILD = @NDKBUILD@ +OCAMLC = @OCAMLC@ +OCAMLLEX = @OCAMLLEX@ +OCAMLOPT = @OCAMLOPT@ prefix = @prefix@ PYTHON_lxml = @PYTHON_lxml@ +REBUILD = @REBUILD@ USER_JAVA_HOME = @USER_JAVA_HOME@ XCODE_SELECT = @XCODE_SELECT@ XCPRETTY = @XCPRETTY@ @@ -55,3 +62,10 @@ LN_S = @LN_S@ else LN_S = @LN_S@ -v endif + +# Export parts of the config relevant to the compilation (taken from `opam config env`) in case the +# user runs `./configure` in some configuration but `make` in another. +export PATH := $(shell cd "$(dir $(REBUILD))" && pwd):$(PATH) +ifneq ($(CAML_LD_LIBRARY_PATH),) +export CAML_LD_LIBRARY_PATH := $(CAML_LD_LIBRARY_PATH) +endif diff --git a/configure.ac b/configure.ac index 566d139e6..c36fecd33 100644 --- a/configure.ac +++ b/configure.ac @@ -94,7 +94,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [ AC_CHECK_TOOL([SHASUM], [shasum], [no]) AC_ASSERT_PROG([shasum], [$SHASUM]) # cmake is required to build llvm+clang - AC_CHECK_TOOL([CMAKE], [cmake], [no]) + AC_PATH_TOOL([CMAKE], [cmake], [no]) AS_IF([test "x$is_release_tree" = "xno"], [ AC_ASSERT_PROG([cmake], [$CMAKE]) ]) @@ -111,7 +111,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [ AC_CHECK_TOOL([PYTHON27], [python2.7], [no]) AC_ASSERT_PROG([python2.7], [$PYTHON27]) -AC_CHECK_TOOL([XCODE_SELECT], [xcode-select], [no]) +AC_PATH_TOOL([XCODE_SELECT], [xcode-select], [no]) # prefer clang over gcc because the plugins makes use of @@ -174,8 +174,8 @@ AC_ASSERT_PROG([ocamlbuild], [$OCAMLBUILD]) AC_PROG_FINDLIB AC_PROG_OCAMLLEX AC_ASSERT_PROG([ocamllex], [$OCAMLLEX]) -AC_PROG_OCAMLYACC -AC_ASSERT_PROG([ocamlyacc], [$OCAMLYACC]) +AC_PATH_TOOL([MENHIR], [menhir], [no]) +AC_ASSERT_PROG([menhir], [$MENHIR]) AC_ASSERT_OCAML_PKG([atdgen], [], [1.6.0]) AC_ASSERT_OCAML_PKG([biniou]) AC_ASSERT_OCAML_PKG([camlzip], [zip]) @@ -185,12 +185,15 @@ AC_ASSERT_OCAML_PKG([reason]) AC_ASSERT_OCAML_PKG([yojson]) # check for rebuild after checking for Reason since `rebuild` is normally provided by Reason. This # way if Reason is missing we get a more helpful error message and not "rebuild not found". -AC_CHECK_TOOL([REBUILD], [rebuild], [no]) +AC_PATH_TOOL([REBUILD], [rebuild], [no]) AC_ASSERT_PROG([rebuild], [$REBUILD]) +AC_ARG_VAR([CAML_LD_LIBRARY_PATH], + [Additional directories to search for dynamically-loaded libraries.]) + if test "x$enable_java_analyzers" = "xyes"; then AC_CHECK_TOOL([JAVA], [java], [no]) - AC_CHECK_TOOL([JAVAC], [javac], [no]) + AC_PATH_TOOL([JAVAC], [javac], [no]) AC_ASSERT_PROG([javac], [$JAVAC]) AC_ASSERT_PROG([java], [$JAVA]) AC_ASSERT_OCAML_PKG([javalib], [], [2.3.3]) @@ -224,7 +227,7 @@ _ACEOF fi -AC_CHECK_TOOL([ATDGEN], [atdgen], [no]) +AC_PATH_TOOL([ATDGEN], [atdgen], [no]) AC_ASSERT_PROG([atdgen], [$ATDGEN]) AC_ARG_ENABLE(ocaml-bin-annot, @@ -247,11 +250,11 @@ echo $buck_version > "$buckversion_file" AC_MSG_RESULT([$buck_version]) -AC_CHECK_TOOL([GETCONF], [getconf], [no]) +AC_PATH_TOOL([GETCONF], [getconf], [no]) AC_MSG_CHECKING([the number of cpus the build host has]) if test "$GETCONF" != "no"; then - if test $(getconf _NPROCESSORS_ONLN); then - NCPU=$(getconf _NPROCESSORS_ONLN) + if test $("$GETCONF" _NPROCESSORS_ONLN); then + NCPU=$("$GETCONF" _NPROCESSORS_ONLN) AC_MSG_RESULT([$NCPU]) fi else @@ -262,20 +265,20 @@ AC_SUBST([NCPU]) # optional progs and libraries that, eg build systems to be run in integration tests -AC_CHECK_TOOL([ANT], [ant], [no]) +AC_PATH_TOOL([ANT], [ant], [no]) if test ! -z "$SANDCASTLE"; then BUCK=buck AC_SUBST([BUCK]) else - AC_CHECK_TOOL([BUCK], [buck], [no]) + AC_PATH_TOOL([BUCK], [buck], [no]) fi AC_ARG_VAR([MVN], [command to execute Maven when running tests]) AS_IF([test "x$MVN" = "x"], [ - AC_CHECK_TOOL([MVN], [mvn], [no]) + AC_PATH_TOOL([MVN], [mvn], [no]) ], [ AC_MSG_RESULT([checking for mvn... $MVN]) ]) -AC_CHECK_TOOL([NDKBUILD], [ndk-build], [no]) +AC_PATH_TOOL([NDKBUILD], [ndk-build], [no]) if test x"$NDKBUILD" = x"no"; then # ndk-build not in $PATH, look into potential android NDK install paths and record the absolute path # to ndk-build @@ -285,7 +288,7 @@ fi AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml]) -AC_CHECK_TOOL([XCPRETTY], [xcpretty], [no]) +AC_PATH_TOOL([XCPRETTY], [xcpretty], [no]) BREW=no if which brew > /dev/null; then diff --git a/infer/annotations/Makefile b/infer/annotations/Makefile index 0851f41fc..058eaa5d1 100644 --- a/infer/annotations/Makefile +++ b/infer/annotations/Makefile @@ -20,14 +20,14 @@ SOURCES_JAR = $(CWD)/annotations-src.jar all: $(ANNOTATIONS_JAR) $(SOURCES_JAR) $(ANNOTATIONS_JAR): $(ANNOT_SOURCES) - mkdir -p $(ANNOT_CLASSES) - javac -source 7 -target 7 -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) + $(MKDIR_P) $(ANNOT_CLASSES) + $(JAVAC) -source 7 -target 7 -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com $(SOURCES_JAR): $(ANNOT_SOURCES) jar cvf $(SOURCES_JAR) $(SOURCES_DIR)/com clean: - @rm -rf $(ANNOT_CLASSES) - @rm -f $(ANNOTATIONS_JAR) - @rm -f $(SOURCES_JAR) + @$(REMOVE_DIR) $(ANNOT_CLASSES) + @$(REMOVE) $(ANNOTATIONS_JAR) + @$(REMOVE) $(SOURCES_JAR) diff --git a/infer/models/java/Makefile b/infer/models/java/Makefile index 5975792cb..8d399f648 100644 --- a/infer/models/java/Makefile +++ b/infer/models/java/Makefile @@ -25,7 +25,7 @@ clean: @rm -f $(JAVA_MODELS_JAR) compile: - javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES) + $(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES) $(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES) @rm -fr $(MODELS_OUT) @@ -33,7 +33,7 @@ $(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES) @rm -f $(JAVA_MODELS_JAR) $(call silent_on_success,\ $(INFER_BIN) --jobs 1 --results-dir $(INFER_RESULTS_DIR) --models-mode -- \ - javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \ + $(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \ $(JAVA_SOURCES)) $(MODELS_JAR): $(INFER_REPORT) diff --git a/infer/models/objc/src/Makefile b/infer/models/objc/src/Makefile index 2506b0e79..2eedf48ac 100644 --- a/infer/models/objc/src/Makefile +++ b/infer/models/objc/src/Makefile @@ -1,8 +1,18 @@ +# Copyright (c) 2017 - present Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +ROOT_DIR = ../../../.. +include $(ROOT_DIR)/Makefile.config + M_SOURCES=$(shell find . -name "*.m") C_SOURCES=$(shell find . -name "*.c") OBJECTS=$(M_SOURCES:.m=.o) $(C_SOURCES:.c=.o) CC=clang -XCODE_PATH=$(shell xcode-select -p) +XCODE_PATH=$(shell $(XCODE_SELECT) -p) IPHONE_SIMULATOR_PATH=$(XCODE_PATH)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk CFLAGS=--target=x86_64-apple-darwin14 -x objective-c -c -mios-simulator-version-min=8.2 -isysroot $(IPHONE_SIMULATOR_PATH) diff --git a/infer/src/Makefile b/infer/src/Makefile index 1b666a867..aca078681 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -22,7 +22,7 @@ OCAML_FATAL_WARNINGS = +3+5+6+8+10+11+12+18+19+20+23+26+29+27+33+34+35+37+38+39+ # Notice that use-ocamlfind is used here to avoid a linker bug in ocamlbuild when using -tag thread OCAMLBUILD_OPTIONS = \ -r \ - -use-menhir -menhir 'menhir --explain --strict'\ + -use-menhir -menhir '$(MENHIR) --explain --strict'\ -use-ocamlfind \ -lflags -cclib,-lffi \ -cflags -g -lflags -g \ @@ -124,7 +124,7 @@ endif DEPENDENCIES = IR backend base checkers eradicate harness integration tp/fts quandary bufferoverrun $(EXTRA_DEPS) # ocamlbuild command with options common to all build targets -OCAMLBUILD_BASE = rebuild $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) +OCAMLBUILD_BASE = $(REBUILD) $(OCAMLBUILD_OPTIONS) -j $(NCPU) $(addprefix -I , $(DEPENDENCIES)) # ocamlbuild with options necessary to build all targets at once, regardless of configure flags OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS) @@ -166,7 +166,7 @@ OCAML_CONFIG_SOURCES += $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) endif OCAML_ALL_SOURCES = $(OCAML_BASE_SOURCES) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) -export OCAMLFIND_IGNORE_DUPS_IN=$(shell ocamlc -where)/compiler-libs +export OCAMLFIND_IGNORE_DUPS_IN=$(shell $(OCAMLC) -where)/compiler-libs .PHONY: all all: infer @@ -243,10 +243,10 @@ test_build: $(TEST_BUILD_DIR)/$(INFER_MAIN).byte # to generate interface file.mli from implementation file.ml execute: # make M=file mli mli: - ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i $(M).ml > $(M).mli + $(OCAMLFIND) ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i $(M).ml > $(M).mli rei: - ocamlfind ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei + $(OCAMLFIND) ocamlc -package atdgen,oUnit,str,unix,yojson,zip $(addprefix -I $(INFER_BUILD_DIR),$(DEPENDENCIES)) -i -pp refmt -impl $(M).re > $(M).rei # convert to reason %.re : %.ml @@ -313,7 +313,7 @@ toplevel: $(INFER_BUILD_DIR)/toplevel.cmo checkCopyright: $(CHECKCOPYRIGHT_BIN) $(CHECKCOPYRIGHT_BIN): $(BUILD_DIR) $(CHECKCOPYRIGHT_MAIN).ml Makefile - rebuild -quiet -r -j $(NCPU) -build-dir $(BUILD_DIR)/checkCopyright \ + $(REBUILD) -quiet -r -j $(NCPU) -build-dir $(BUILD_DIR)/checkCopyright \ -cflags -g,-safe-string -lflags -g \ -pkgs core,str -tag thread -use-ocamlfind $(CHECKCOPYRIGHT_MAIN).native $(INSTALL_PROGRAM) \ diff --git a/infer/tests/build_systems/ant/Makefile b/infer/tests/build_systems/ant/Makefile index c5a024725..c71e1599e 100644 --- a/infer/tests/build_systems/ant/Makefile +++ b/infer/tests/build_systems/ant/Makefile @@ -16,11 +16,11 @@ include $(TESTS_DIR)/java.make include $(TESTS_DIR)/base.make $(OBJECTS): $(SOURCES) - ant + $(ANT) infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(call silent_on_success,\ - $(INFER_BIN) -a $(ANALYZER) --project-root $(TESTS_DIR) --inferconfig-home . -- ant) + $(INFER_BIN) -a $(ANALYZER) --project-root $(TESTS_DIR) --inferconfig-home . -- $(ANT)) clean: - ant clean + $(ANT) clean diff --git a/infer/tests/build_systems/buck/Makefile b/infer/tests/build_systems/buck/Makefile index a5f0cbcc0..f1544130e 100644 --- a/infer/tests/build_systems/buck/Makefile +++ b/infer/tests/build_systems/buck/Makefile @@ -22,7 +22,7 @@ $(OBJECTS): $(JAVA_SOURCE_FILES) cd $(ROOT_DIR) && \ $(call silent_on_success,\ INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \ - buck build --no-cache $(BUCK_TARGET)) + $(BUCK) build --no-cache $(BUCK_TARGET)) infer-out/report.json: $(JAVA_DEPS) $(JAVA_SOURCE_FILES) cd $(ROOT_DIR) && \ @@ -30,4 +30,4 @@ infer-out/report.json: $(JAVA_DEPS) $(JAVA_SOURCE_FILES) $(call silent_on_success,\ INFER_BIN=$(INFER_BIN) NO_BUCKD=1 \ $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- \ - buck build --no-cache $(BUCK_TARGET)) + $(BUCK) build --no-cache $(BUCK_TARGET)) diff --git a/infer/tests/build_systems/differential_resolve_infer_eradicate_conflict/Makefile b/infer/tests/build_systems/differential_resolve_infer_eradicate_conflict/Makefile index e978ce3a5..208f74b00 100644 --- a/infer/tests/build_systems/differential_resolve_infer_eradicate_conflict/Makefile +++ b/infer/tests/build_systems/differential_resolve_infer_eradicate_conflict/Makefile @@ -18,9 +18,9 @@ $(CURRENT_REPORT): .inferconfig cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java $(call silent_on_success,\ $(INFER_BIN) \ - -o $(CURRENT_DIR) -- javac src/com/example/DiffExample.java src/DiffExampleTwo.java) + -o $(CURRENT_DIR) -- $(JAVAC) src/com/example/DiffExample.java src/DiffExampleTwo.java) $(PREVIOUS_REPORT): .inferconfig cp src/com/example/DiffExample.java.previous src/com/example/DiffExample.java $(call silent_on_success,\ - $(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/com/example/DiffExample.java) + $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/com/example/DiffExample.java) diff --git a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/Makefile b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/Makefile index 74c4f40c4..f731f9647 100644 --- a/infer/tests/build_systems/differential_skip_anonymous_class_renamings/Makefile +++ b/infer/tests/build_systems/differential_skip_anonymous_class_renamings/Makefile @@ -14,8 +14,8 @@ include ../../differential.make $(CURRENT_REPORT): cp src/DiffExample.java.current src/DiffExample.java - $(call silent_on_success, $(INFER_BIN) -o $(CURRENT_DIR) -- javac src/*.java) + $(call silent_on_success, $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/*.java) $(PREVIOUS_REPORT): cp src/DiffExample.java.previous src/DiffExample.java - $(call silent_on_success, $(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/*.java) + $(call silent_on_success, $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/*.java) diff --git a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/Makefile b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/Makefile index 4c13893c8..27f5b6948 100644 --- a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/Makefile +++ b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames/Makefile @@ -16,9 +16,9 @@ $(CURRENT_REPORT): cp src/DiffExample.java.current src/DiffExample.java cp src/DiffExampleTwo.java.current src/DiffExampleTwo.java $(call silent_on_success,\ - $(INFER_BIN) -o $(CURRENT_DIR) -- javac src/DiffExample.java src/DiffExampleTwo.java) + $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/DiffExample.java src/DiffExampleTwo.java) $(PREVIOUS_REPORT): cp src/DiffExample.java.previous src/DiffExample.java $(call silent_on_success,\ - $(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/DiffExample.java) + $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/DiffExample.java) diff --git a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/Makefile b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/Makefile index 5a2873536..a07d177e2 100644 --- a/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/Makefile +++ b/infer/tests/build_systems/differential_skip_duplicated_types_on_filenames_with_renamings/Makefile @@ -16,9 +16,9 @@ include ../../differential.make $(CURRENT_REPORT): cp src/DiffExampleRenamed.java.current src/DiffExampleRenamed.java $(call silent_on_success,\ - $(INFER_BIN) -o $(CURRENT_DIR) -- javac src/DiffExampleRenamed.java) + $(INFER_BIN) -o $(CURRENT_DIR) -- $(JAVAC) src/DiffExampleRenamed.java) $(PREVIOUS_REPORT): cp src/DiffExample.java.previous src/DiffExample.java $(call silent_on_success,\ - $(INFER_BIN) -o $(PREVIOUS_DIR) -- javac src/DiffExample.java) + $(INFER_BIN) -o $(PREVIOUS_DIR) -- $(JAVAC) src/DiffExample.java) diff --git a/infer/tests/build_systems/genrule/Makefile b/infer/tests/build_systems/genrule/Makefile index 68e4fd978..b7a9ab173 100644 --- a/infer/tests/build_systems/genrule/Makefile +++ b/infer/tests/build_systems/genrule/Makefile @@ -24,7 +24,7 @@ include $(TESTS_DIR)/base.make $(OBJECTS): $(JAVA_SOURCE_FILES) cd $(ROOT_DIR) && \ $(call silent_on_success,\ - NO_BUCKD=1 buck build --no-cache $(BUCK_TARGET)) + NO_BUCKD=1 $(BUCK) build --no-cache $(BUCK_TARGET)) .PHONY: genrule genrule: $(JSON_REPORT) @@ -35,7 +35,7 @@ $(JSON_REPORT): $(JAVA_DEPS) $(JAVA_SOURCE_FILES) $(REMOVE_DIR) buck-out && \ $(call silent_on_success,\ INFER_BIN="$(INFER_BIN)" NO_BUCKD=1 GENERATE_INFER_GENRULES=1 \ - buck build --no-cache $(INFER_TARGET)) + $(BUCK) build --no-cache $(INFER_TARGET)) touch $@ infer-out/report.json: $(JSON_REPORT) diff --git a/infer/tests/build_systems/utf8_in_pwd/Makefile b/infer/tests/build_systems/utf8_in_pwd/Makefile index 4eff31eda..001cf5bb9 100644 --- a/infer/tests/build_systems/utf8_in_pwd/Makefile +++ b/infer/tests/build_systems/utf8_in_pwd/Makefile @@ -85,7 +85,7 @@ infer-out-javac/report.json: $(JAVA_DEPS) $(JAVAC_DIR) cd $(JAVAC_DIR) && \ $(call silent_on_success,\ $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/$(@D) -- \ - javac -cp $(CLASSPATH) $(foreach source,$(JAVAC_SOURCES),$(notdir $(source)))) + $(JAVAC) -cp $(CLASSPATH) $(foreach source,$(JAVAC_SOURCES),$(notdir $(source)))) infer-out-make/report.json: $(CLANG_DEPS) $(MAKE_DIR) cd $(MAKE_DIR) && \ diff --git a/infer/tests/codetoanalyze/java/crashcontext/Makefile b/infer/tests/codetoanalyze/java/crashcontext/Makefile index 8d6e785eb..7b57e82b6 100644 --- a/infer/tests/codetoanalyze/java/crashcontext/Makefile +++ b/infer/tests/codetoanalyze/java/crashcontext/Makefile @@ -19,13 +19,13 @@ EXP_TESTs = $(sort $(patsubst %.java,%.exp.test.noreplace,$(SOURCES))) INFER_OUTs = $(patsubst %.java,infer-out-%,$(SOURCES)) $(OBJECTS): $(SOURCES) - javac -cp $(CLASSPATH) $(SOURCES) + $(JAVAC) -cp $(CLASSPATH) $(SOURCES) # analyze a single source file and generate the test results for it %.exp.test.noreplace: $(JAVA_DEPS) %.stacktrace.json %.java $(call silent_on_success,\ $(INFER_BIN) -a $(ANALYZER) -o infer-out-$* --stacktrace $*.stacktrace.json \ - -- javac -cp $(CLASSPATH) $*.java) + -- $(JAVAC) -cp $(CLASSPATH) $*.java) # add a newline at the end of the json when creating the exp.test $(COPY) infer-out-$*/crashcontext/crashcontext.json $@ && echo >> $@ diff --git a/infer/tests/codetoanalyze/objc/errors/Makefile b/infer/tests/codetoanalyze/objc/errors/Makefile index d79b77d2f..74a5f55cd 100644 --- a/infer/tests/codetoanalyze/objc/errors/Makefile +++ b/infer/tests/codetoanalyze/objc/errors/Makefile @@ -9,7 +9,7 @@ TESTS_DIR = ../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) ANALYZER = infer CLANG_OPTIONS = -x objective-c \ diff --git a/infer/tests/codetoanalyze/objc/frontend/arc/Makefile b/infer/tests/codetoanalyze/objc/frontend/arc/Makefile index 13abd7062..8ce137692 100644 --- a/infer/tests/codetoanalyze/objc/frontend/arc/Makefile +++ b/infer/tests/codetoanalyze/objc/frontend/arc/Makefile @@ -10,7 +10,7 @@ TESTS_DIR = ../../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = \ /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) CLANG_OPTIONS = -x objective-c \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ diff --git a/infer/tests/codetoanalyze/objc/frontend/noarc/Makefile b/infer/tests/codetoanalyze/objc/frontend/noarc/Makefile index baf928bf5..87062881b 100644 --- a/infer/tests/codetoanalyze/objc/frontend/noarc/Makefile +++ b/infer/tests/codetoanalyze/objc/frontend/noarc/Makefile @@ -10,7 +10,7 @@ TESTS_DIR = ../../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = \ /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) CLANG_OPTIONS = -x objective-c \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ diff --git a/infer/tests/codetoanalyze/objc/ioslints/Makefile b/infer/tests/codetoanalyze/objc/ioslints/Makefile index 422bc0cef..ef6cbfd44 100644 --- a/infer/tests/codetoanalyze/objc/ioslints/Makefile +++ b/infer/tests/codetoanalyze/objc/ioslints/Makefile @@ -9,7 +9,7 @@ TESTS_DIR = ../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) CLANG_OPTIONS = -x objective-c \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ diff --git a/infer/tests/codetoanalyze/objc/quandary/Makefile b/infer/tests/codetoanalyze/objc/quandary/Makefile index 2c2dc325e..8dd45e197 100644 --- a/infer/tests/codetoanalyze/objc/quandary/Makefile +++ b/infer/tests/codetoanalyze/objc/quandary/Makefile @@ -9,7 +9,7 @@ TESTS_DIR = ../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) CLANG_OPTIONS = -x objective-c \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ diff --git a/infer/tests/codetoanalyze/objcpp/frontend/Makefile b/infer/tests/codetoanalyze/objcpp/frontend/Makefile index 75273c05e..e083555b9 100644 --- a/infer/tests/codetoanalyze/objcpp/frontend/Makefile +++ b/infer/tests/codetoanalyze/objcpp/frontend/Makefile @@ -9,7 +9,7 @@ TESTS_DIR=../../.. IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -XCODEROOT = $(shell xcode-select -p) +XCODEROOT = $(shell $(XCODE_SELECT) -p) CLANG_OPTIONS = -x objective-c++ -std=c++11 \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ diff --git a/infer/tests/javac.make b/infer/tests/javac.make index f02854e70..3f4007023 100644 --- a/infer/tests/javac.make +++ b/infer/tests/javac.make @@ -20,9 +20,9 @@ include $(TESTS_DIR)/base.make PROJECT_ROOT ?= $(TESTS_DIR) $(OBJECTS): $(SOURCES) - javac -cp $(CLASSPATH) $(SOURCES) + $(JAVAC) -cp $(CLASSPATH) $(SOURCES) infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(call silent_on_success,\ $(INFER_BIN) -a $(ANALYZER) --inferconfig-home . --project-root $(PROJECT_ROOT) $(INFER_OPTIONS) -- \ - javac -cp $(CLASSPATH) $(SOURCES)) + $(JAVAC) -cp $(CLASSPATH) $(SOURCES)) diff --git a/m4/ocaml.m4 b/m4/ocaml.m4 index 7bfdc00f7..4a594b008 100644 --- a/m4/ocaml.m4 +++ b/m4/ocaml.m4 @@ -37,7 +37,7 @@ dnl For documentation, please read the ocaml.m4 man page. AC_DEFUN([AC_PROG_OCAML], [dnl # checking for ocamlc - AC_CHECK_TOOL([OCAMLC],[ocamlc],[no]) + AC_PATH_TOOL([OCAMLC],[ocamlc],[no]) if test "$OCAMLC" != "no"; then OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` @@ -54,7 +54,7 @@ AC_DEFUN([AC_PROG_OCAML], AC_SUBST([OCAMLLIB]) # checking for ocamlopt - AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no]) + AC_PATH_TOOL([OCAMLOPT],[ocamlopt],[no]) OCAMLBEST=byte if test "$OCAMLOPT" = "no"; then AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.]) @@ -71,7 +71,7 @@ AC_DEFUN([AC_PROG_OCAML], AC_SUBST([OCAMLBEST]) # checking for ocamlc.opt - AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no]) + AC_PATH_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no]) if test "$OCAMLCDOTOPT" != "no"; then TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then @@ -83,7 +83,7 @@ AC_DEFUN([AC_PROG_OCAML], # checking for ocamlopt.opt if test "$OCAMLOPT" != "no" ; then - AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no]) + AC_PATH_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no]) if test "$OCAMLOPTDOTOPT" != "no"; then TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then @@ -112,31 +112,31 @@ AC_DEFUN([AC_PROG_OCAML], AC_SUBST([OCAMLNATDYNLINK]) # checking for ocaml toplevel - AC_CHECK_TOOL([OCAML],[ocaml],[no]) + AC_PATH_TOOL([OCAML],[ocaml],[no]) # checking for ocamldep - AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no]) + AC_PATH_TOOL([OCAMLDEP],[ocamldep],[no]) # checking for ocamlmktop - AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no]) + AC_PATH_TOOL([OCAMLMKTOP],[ocamlmktop],[no]) # checking for ocamlmklib - AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no]) + AC_PATH_TOOL([OCAMLMKLIB],[ocamlmklib],[no]) # checking for ocamldoc - AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no]) + AC_PATH_TOOL([OCAMLDOC],[ocamldoc],[no]) # checking for ocamlbuild - AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no]) + AC_PATH_TOOL([OCAMLBUILD],[ocamlbuild],[no]) ]) AC_DEFUN([AC_PROG_OCAMLLEX], [dnl # checking for ocamllex - AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no]) + AC_PATH_TOOL([OCAMLLEX],[ocamllex],[no]) if test "$OCAMLLEX" != "no"; then - AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no]) + AC_PATH_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no]) if test "$OCAMLLEXDOTOPT" != "no"; then OCAMLLEX=$OCAMLLEXDOTOPT fi @@ -146,7 +146,7 @@ AC_DEFUN([AC_PROG_OCAMLLEX], AC_DEFUN([AC_PROG_OCAMLYACC], [dnl - AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no]) + AC_PATH_TOOL([OCAMLYACC],[ocamlyacc],[no]) AC_SUBST([OCAMLYACC]) ]) @@ -156,7 +156,7 @@ AC_DEFUN([AC_PROG_CAMLP4], AC_REQUIRE([AC_PROG_OCAML])dnl # checking for camlp4 - AC_CHECK_TOOL([CAMLP4],[camlp4],[no]) + AC_PATH_TOOL([CAMLP4],[camlp4],[no]) if test "$CAMLP4" != "no"; then TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'` if test "$TMPVERSION" != "$OCAMLVERSION" ; then @@ -167,14 +167,14 @@ AC_DEFUN([AC_PROG_CAMLP4], AC_SUBST([CAMLP4]) # checking for companion tools - AC_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no]) - AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no]) - AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no]) - AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no]) - AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no]) - AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no]) - AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no]) - AC_CHECK_TOOL([CAMLP4RF],[camlp4rf],[no]) + AC_PATH_TOOL([CAMLP4BOOT],[camlp4boot],[no]) + AC_PATH_TOOL([CAMLP4O],[camlp4o],[no]) + AC_PATH_TOOL([CAMLP4OF],[camlp4of],[no]) + AC_PATH_TOOL([CAMLP4OOF],[camlp4oof],[no]) + AC_PATH_TOOL([CAMLP4ORF],[camlp4orf],[no]) + AC_PATH_TOOL([CAMLP4PROF],[camlp4prof],[no]) + AC_PATH_TOOL([CAMLP4R],[camlp4r],[no]) + AC_PATH_TOOL([CAMLP4RF],[camlp4rf],[no]) AC_SUBST([CAMLP4BOOT]) AC_SUBST([CAMLP4O]) AC_SUBST([CAMLP4OF]) @@ -191,7 +191,7 @@ AC_DEFUN([AC_PROG_FINDLIB], AC_REQUIRE([AC_PROG_OCAML])dnl # checking for ocamlfind - AC_CHECK_TOOL([OCAMLFIND],[ocamlfind],[no]) + AC_PATH_TOOL([OCAMLFIND],[ocamlfind],[no]) AC_SUBST([OCAMLFIND]) ])