[make] kill PATH hack

Reviewed By: mbouaziz

Differential Revision: D5470571

fbshipit-source-id: bde1ada
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent c2acc670ef
commit 4792e37a73

@ -75,8 +75,5 @@ LN_S = @LN_S@ -v
endif endif
# Export parts of the config relevant to running other programs # Export parts of the config relevant to running other programs
# be merciful and allow PATH to be updated between ./configure and make export PATH := $(PATH)
# except for OCaml-related executables
# TODO(17630614) get rid of this hack
export PATH := $(dir $(OCAMLC)):$(shell printf "%s" "$$PATH"):$(PATH)
export CAML_LD_LIBRARY_PATH := $(CAML_LD_LIBRARY_PATH) export CAML_LD_LIBRARY_PATH := $(CAML_LD_LIBRARY_PATH)

@ -96,7 +96,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [
AC_CHECK_TOOL([SHASUM], [shasum], [no]) AC_CHECK_TOOL([SHASUM], [shasum], [no])
AC_ASSERT_PROG([shasum], [$SHASUM]) AC_ASSERT_PROG([shasum], [$SHASUM])
# cmake is required to build llvm+clang # cmake is required to build llvm+clang
AC_PATH_TOOL([CMAKE], [cmake], [no]) AC_CHECK_TOOL([CMAKE], [cmake], [no])
AS_IF([test "x$is_release_tree" = "xno"], [ AS_IF([test "x$is_release_tree" = "xno"], [
AC_ASSERT_PROG([cmake], [$CMAKE]) AC_ASSERT_PROG([cmake], [$CMAKE])
]) ])
@ -113,7 +113,7 @@ AS_IF([test "x$enable_c_analyzers" = "xyes"], [
AC_CHECK_TOOL([PYTHON27], [python2.7], [no]) AC_CHECK_TOOL([PYTHON27], [python2.7], [no])
AC_ASSERT_PROG([python2.7], [$PYTHON27]) AC_ASSERT_PROG([python2.7], [$PYTHON27])
AC_PATH_TOOL([XCODE_SELECT], [xcode-select], [no]) AC_CHECK_TOOL([XCODE_SELECT], [xcode-select], [no])
# prefer clang over gcc because the plugins makes use of # prefer clang over gcc because the plugins makes use of
@ -175,12 +175,12 @@ AC_ASSERT_PROG([ocamlc], [$OCAMLC])
# check the version of OCaml # check the version of OCaml
AC_ASSERT_OCAML_MIN_VERSION([4.04.2]) AC_ASSERT_OCAML_MIN_VERSION([4.04.2])
AC_ASSERT_PROG([ocamlopt], [$OCAMLOPT]) AC_ASSERT_PROG([ocamlopt], [$OCAMLOPT])
AC_PATH_TOOL([OCAMLBUILD], [ocamlbuild], [no]) AC_CHECK_TOOL([OCAMLBUILD], [ocamlbuild], [no])
AC_ASSERT_PROG([ocamlbuild], [$OCAMLBUILD]) AC_ASSERT_PROG([ocamlbuild], [$OCAMLBUILD])
AC_PROG_FINDLIB AC_PROG_FINDLIB
AC_PROG_OCAMLLEX AC_PROG_OCAMLLEX
AC_ASSERT_PROG([ocamllex], [$OCAMLLEX]) AC_ASSERT_PROG([ocamllex], [$OCAMLLEX])
AC_PATH_TOOL([MENHIR], [menhir], [no]) AC_CHECK_TOOL([MENHIR], [menhir], [no])
AC_ASSERT_PROG([menhir], [$MENHIR]) AC_ASSERT_PROG([menhir], [$MENHIR])
AC_ASSERT_OCAML_PKG([atdgen], [], []) AC_ASSERT_OCAML_PKG([atdgen], [], [])
AC_ASSERT_OCAML_PKG([biniou]) AC_ASSERT_OCAML_PKG([biniou])
@ -203,7 +203,7 @@ AC_SUBST([OPAMSWITCH])
if test "x$enable_java_analyzers" = "xyes"; then if test "x$enable_java_analyzers" = "xyes"; then
AC_CHECK_TOOL([JAVA], [java], [no]) AC_CHECK_TOOL([JAVA], [java], [no])
AC_PATH_TOOL([JAVAC], [javac], [no]) AC_CHECK_TOOL([JAVAC], [javac], [no])
AC_ASSERT_PROG([javac], [$JAVAC]) AC_ASSERT_PROG([javac], [$JAVAC])
AC_ASSERT_PROG([java], [$JAVA]) AC_ASSERT_PROG([java], [$JAVA])
AC_ASSERT_OCAML_PKG([javalib], [], [2.3.3]) AC_ASSERT_OCAML_PKG([javalib], [], [2.3.3])
@ -240,7 +240,7 @@ _ACEOF
fi fi
# end if($enable_java_analyzers) # end if($enable_java_analyzers)
AC_PATH_TOOL([ATDGEN], [atdgen], [no]) AC_CHECK_TOOL([ATDGEN], [atdgen], [no])
AC_ASSERT_PROG([atdgen], [$ATDGEN]) AC_ASSERT_PROG([atdgen], [$ATDGEN])
AC_ARG_ENABLE(ocaml-bin-annot, AC_ARG_ENABLE(ocaml-bin-annot,
@ -262,7 +262,7 @@ cat "$buckversion_file" > ".buckversion"
AC_MSG_RESULT([$buckversion_file]) AC_MSG_RESULT([$buckversion_file])
AC_PATH_TOOL([GETCONF], [getconf], [no]) AC_CHECK_TOOL([GETCONF], [getconf], [no])
AC_MSG_CHECKING([the number of cpus the build host has]) AC_MSG_CHECKING([the number of cpus the build host has])
if test "$GETCONF" != "no"; then if test "$GETCONF" != "no"; then
if test $("$GETCONF" _NPROCESSORS_ONLN); then if test $("$GETCONF" _NPROCESSORS_ONLN); then
@ -277,20 +277,15 @@ AC_SUBST([NCPU])
# optional progs and libraries that, eg build systems to be run in integration tests # optional progs and libraries that, eg build systems to be run in integration tests
AC_PATH_TOOL([ANT], [ant], [no]) AC_CHECK_TOOL([ANT], [ant], [no])
if test ! -z "$SANDCASTLE"; then AC_CHECK_TOOL([BUCK], [buck], [no])
BUCK=buck
AC_SUBST([BUCK])
else
AC_PATH_TOOL([BUCK], [buck], [no])
fi
AC_ARG_VAR([MVN], [command to execute Maven when running tests]) AC_ARG_VAR([MVN], [command to execute Maven when running tests])
AS_IF([test "x$MVN" = "x"], [ AS_IF([test "x$MVN" = "x"], [
AC_PATH_TOOL([MVN], [mvn], [no]) AC_CHECK_TOOL([MVN], [mvn], [no])
], [ ], [
AC_MSG_RESULT([checking for mvn... $MVN]) AC_MSG_RESULT([checking for mvn... $MVN])
]) ])
AC_PATH_TOOL([NDKBUILD], [ndk-build], [no]) AC_CHECK_TOOL([NDKBUILD], [ndk-build], [no])
if test x"$NDKBUILD" = x"no"; then if test x"$NDKBUILD" = x"no"; then
# ndk-build not in $PATH, look into potential android NDK install paths and record the absolute path # ndk-build not in $PATH, look into potential android NDK install paths and record the absolute path
# to ndk-build # to ndk-build
@ -300,9 +295,9 @@ fi
AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml]) AC_CHECK_PYTHON_MODULE([$PYTHON27], [lxml])
AC_PATH_TOOL([XCPRETTY], [xcpretty], [no]) AC_CHECK_TOOL([XCPRETTY], [xcpretty], [no])
AC_PATH_TOOL([BREW], [brew], [no]) AC_CHECK_TOOL([BREW], [brew], [no])
# warn about broken pkg-config version for brew users # warn about broken pkg-config version for brew users
if test "$BREW" != "no"; then if test "$BREW" != "no"; then

@ -0,0 +1,21 @@
# 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.
# you have to set MODELS_DIR to infer/models/ before including this file
# We want infer to still be able to override PATH so that it can capture compilation
# commands. Makefile.config will override PATH to be the configure-time one, which defeats
# infer.
#
# When called from our models Makefile PATH will be set by Makefile.config already, then infer will
# add its wrappers, so we can trust the original PATH here.
#
# Save the original PATH, include Makefile.config, and use the original PATH.
ORIGPATH = $(shell printf "%s" "$$PATH")
ROOT_DIR = $(MODELS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
export PATH := $(ORIGPATH)

@ -5,16 +5,17 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = ../../../.. MODELS_DIR = ../..
include $(ROOT_DIR)/Makefile.config include $(MODELS_DIR)/models-config.make
M_SOURCES=$(shell find . -name "*.m") M_SOURCES=$(shell find . -name "*.m")
C_SOURCES=$(shell find . -name "*.c") C_SOURCES=$(shell find . -name "*.c")
OBJECTS=$(M_SOURCES:.m=.o) $(C_SOURCES:.c=.o) OBJECTS=$(M_SOURCES:.m=.o) $(C_SOURCES:.c=.o)
# let infer override CC by letting the shell resolve its location according to PATH
CC=clang 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 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) CFLAGS += --target=x86_64-apple-darwin14 -x objective-c -c -mios-simulator-version-min=8.2 -isysroot $(IPHONE_SIMULATOR_PATH)
all: $(OBJECTS) all: $(OBJECTS)

Loading…
Cancel
Save