llvm.org GIT mirror llvm / cbd84f7
Add a BUILD_FLAGS variable so that autoconf checks have a place to store additional flag options since too many things can and do override CPPFLAGS. Also, this is exported, unlike CPPFLAGS so it can be actually used elsewhere. This should enable us to remove the AC_SUBSTs in the intel checks, but I have no way of testing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161233 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
4 changed file(s) with 17 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
195195 HAVE_PTHREAD := @HAVE_PTHREAD@
196196
197197 LIBS := @LIBS@
198 BUILD_FLAGS := @BUILD_FLAGS@
198199
199200 # Targets that we should build
200201 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
729729 endif
730730
731731 Compile.C = $(Compile.Wrapper) \
732 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
732 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) $(BUILD_FLAGS) \
733733 $(TargetCommonOpts) $(CompileCommonOpts) -c
734734 Compile.CXX = $(Compile.Wrapper) \
735 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
735 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) $(BUILD_FLAGS) \
736736 $(TargetCommonOpts) $(CompileCommonOpts) -c
737737 Preprocess.CXX= $(Compile.Wrapper) \
738 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
738 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) $(BUILD_FLAGS) \
739739 $(CompileCommonOpts) $(CXX.Flags) -E
740740 Link = $(Compile.Wrapper) \
741741 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
12001200 no) llvm_cv_oppath=
12011201 AC_SUBST(USE_OPROFILE, [0]) ;;
12021202 *) llvm_cv_oppath="${withval}/lib/oprofile"
1203 CPPFLAGS="-I${withval}/include";;
1203 BUILD_FLAGS="-I${withval}/include";;
12041204 esac
12051205 case $llvm_cv_os_type in
12061206 Linux)
12611261 AC_SUBST(INTEL_JITEVENTS_LIBDIR)
12621262
12631263 LIBS="$LIBS -L${INTEL_JITEVENTS_LIBDIR}"
1264 CPPFLAGS="$CPPFLAGS -I$INTEL_JITEVENTS_INCDIR"
1264 BUILD_FLAGS="$CPPFLAGS -I$INTEL_JITEVENTS_INCDIR"
12651265
12661266 AC_SEARCH_LIBS(iJIT_IsProfilingActive, jitprofiling, [], [
12671267 echo "Error! Cannot find libjitprofiling.a. Please check path specified in flag --with-intel-jitevents"
12781278 ])
12791279 AC_DEFINE_UNQUOTED([LLVM_USE_INTEL_JITEVENTS],$USE_INTEL_JITEVENTS,
12801280 [Define if we have the Intel JIT API runtime support library])
1281
1282 dnl Substitute this here for now.
1283 AC_SUBST(BUILD_FLAGS)
12811284
12821285 dnl===-----------------------------------------------------------------------===
12831286 dnl===
764764 USE_INTEL_JITEVENTS
765765 INTEL_JITEVENTS_INCDIR
766766 INTEL_JITEVENTS_LIBDIR
767 BUILD_FLAGS
767768 HAVE_PTHREAD
768769 HUGE_VAL_SANITY
769770 MMAP_FILE
1020910210 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1021010211 lt_status=$lt_dlunknown
1021110212 cat > conftest.$ac_ext <
10212 #line 10213 "configure"
10213 #line 10214 "configure"
1021310214 #include "confdefs.h"
1021410215
1021510216 #if HAVE_DLFCN_H
1307213073 USE_OPROFILE=0
1307313074 ;;
1307413075 *) llvm_cv_oppath="${withval}/lib/oprofile"
13075 CPPFLAGS="-I${withval}/include";;
13076 BUILD_FLAGS="-I${withval}/include";;
1307613077 esac
1307713078 case $llvm_cv_os_type in
1307813079 Linux)
1349913500
1350013501
1350113502 LIBS="$LIBS -L${INTEL_JITEVENTS_LIBDIR}"
13502 CPPFLAGS="$CPPFLAGS -I$INTEL_JITEVENTS_INCDIR"
13503 BUILD_FLAGS="$CPPFLAGS -I$INTEL_JITEVENTS_INCDIR"
1350313504
1350413505 { echo "$as_me:$LINENO: checking for library containing iJIT_IsProfilingActive" >&5
1350513506 echo $ECHO_N "checking for library containing iJIT_IsProfilingActive... $ECHO_C" >&6; }
1378213783 cat >>confdefs.h <<_ACEOF
1378313784 #define LLVM_USE_INTEL_JITEVENTS $USE_INTEL_JITEVENTS
1378413785 _ACEOF
13786
13787
1378513788
1378613789
1378713790
2205822061 USE_INTEL_JITEVENTS!$USE_INTEL_JITEVENTS$ac_delim
2205922062 INTEL_JITEVENTS_INCDIR!$INTEL_JITEVENTS_INCDIR$ac_delim
2206022063 INTEL_JITEVENTS_LIBDIR!$INTEL_JITEVENTS_LIBDIR$ac_delim
22064 BUILD_FLAGS!$BUILD_FLAGS$ac_delim
2206122065 HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
2206222066 HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim
2206322067 MMAP_FILE!$MMAP_FILE$ac_delim
2208322087 LTLIBOBJS!$LTLIBOBJS$ac_delim
2208422088 _ACEOF
2208522089
22086 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
22090 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
2208722091 break
2208822092 elif $ac_last_try; then
2208922093 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5