From d0349772d5bca9e44166cb5cef2dbbb55bbc2e2c Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 23 Aug 2016 08:58:16 -0500 Subject: [PATCH] configure script doesn't check for clang headers #287 Added a configure check for clang/Basic/LLVM.h. Also removed -lz from the link libraries. I don't think we need it. --- autoconf/configure.ac | 2 ++ bin/trick-CP | 5 +++-- configure | 24 ++++++++++++++++++++++++ share/trick/makefiles/Makefile.common | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 62a5752c..edd7752d 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -237,6 +237,8 @@ dnl process the optional --with-llvm command line arguments AX_LLVM_HOME([]) LLVM_LIB_DIR=`$LLVM_CONFIG --libdir` LLVM_BIN_DIR=`$LLVM_CONFIG --bindir` +LLVM_INCLUDE_DIR=`$LLVM_CONFIG --includedir` +AC_CHECK_FILE([$LLVM_INCLUDE_DIR/clang/Basic/LLVM.h],[],AC_MSG_ERROR([could not find clang development headers])) AC_CHECK_FILE([$LLVM_LIB_DIR/libLLVMSupport.a], [], AC_MSG_ERROR([could not find clang library files in $LLVM_LIB_DIR]) diff --git a/bin/trick-CP b/bin/trick-CP index 030c8633..f6a4b8ab 100755 --- a/bin/trick-CP +++ b/bin/trick-CP @@ -55,6 +55,7 @@ endif -include ${TRICK_HOME}/share/trick/makefiles/Makefile.sim -include S_overrides.mk +ifndef CLEAN_RULES_DEFINED no_makefile_sim: @echo ${TRICK_HOME}/share/trick/makefiles/Makefile.sim not found exit -1 @@ -63,7 +64,7 @@ tidy: -rm -f S_source.hh S_sie.resource -rm -f S_main* T_main* -rm -f build/Makefile_* - -rm -rf S_default.dat + -rm -f S_default.dat clean: tidy -rm -f DP_Product/DP_rt_frame DP_Product/DP_rt_itimer @@ -75,4 +76,4 @@ spotless: clean apocalypse: clean @echo "I love the smell of napalm in the morning" - +endif diff --git a/configure b/configure index 9d559793..516775c9 100755 --- a/configure +++ b/configure @@ -7184,6 +7184,30 @@ fi LLVM_LIB_DIR=`$LLVM_CONFIG --libdir` LLVM_BIN_DIR=`$LLVM_CONFIG --bindir` +LLVM_INCLUDE_DIR=`$LLVM_CONFIG --includedir` +as_ac_File=`$as_echo "ac_cv_file_$LLVM_INCLUDE_DIR/clang/Basic/LLVM.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LLVM_INCLUDE_DIR/clang/Basic/LLVM.h" >&5 +$as_echo_n "checking for $LLVM_INCLUDE_DIR/clang/Basic/LLVM.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$LLVM_INCLUDE_DIR/clang/Basic/LLVM.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + +else + as_fn_error $? "could not find clang development headers" "$LINENO" 5 +fi + as_ac_File=`$as_echo "ac_cv_file_$LLVM_LIB_DIR/libLLVMSupport.a" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LLVM_LIB_DIR/libLLVMSupport.a" >&5 $as_echo_n "checking for $LLVM_LIB_DIR/libLLVMSupport.a... " >&6; } diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index aea1a0bb..62a39e07 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -39,7 +39,7 @@ export TRICK_SWIG_EXCLUDE export TRICK_EXT_LIB_DIRS export TRICK_GTE_EXT export TRICK_HOST_CPU := $(shell export TRICK_CC=$(TRICK_CC) && $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU) -export TRICK_EXEC_LINK_LIBS = ${PTHREAD_LIBS} $(PYTHON_LIB) $(UDUNITS_LDFLAGS) $(PLATFORM_LIBS) -lm -ldl -lz +export TRICK_EXEC_LINK_LIBS = ${PTHREAD_LIBS} $(PYTHON_LIB) $(UDUNITS_LDFLAGS) $(PLATFORM_LIBS) -lm -ldl export TRICK_LIBS = ${RPATH} -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip -ltrick_comm -ltrick_math -ltrick_units -ltrick_mm export TRICK_SYSTEM_CFLAGS export TRICK_SYSTEM_CXXFLAGS