From 80091454ce5d2ef47531685a13b493850e365a48 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Wed, 17 Jun 2015 09:00:18 -0500 Subject: [PATCH] Make Trick Mac Homebrew friendly Added /usr/local to the list of search directories in the configure script for the motif header files. Added -lc++abi to the list of link libraries. refs #66 --- configure | 21 +++++++++++++++++++ configure.ac | 5 +++-- .../codegen/Interface_Code_Gen/makefile | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/configure b/configure index bde98141..3feb2c5a 100755 --- a/configure +++ b/configure @@ -4845,6 +4845,24 @@ done ac_fn_cxx_check_header_mongrel "$LINENO" "Xm/Xm.h" "ac_cv_header_Xm_Xm_h" "$ac_includes_default" if test "x$ac_cv_header_Xm_Xm_h" = xyes; then : MOTIF_HOME="/usr" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/local/include/Xm/Xm.h" >&5 +$as_echo_n "checking for /usr/local/include/Xm/Xm.h... " >&6; } +if ${ac_cv_file__usr_local_include_Xm_Xm_h+:} 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 "/usr/local/include/Xm/Xm.h"; then + ac_cv_file__usr_local_include_Xm_Xm_h=yes +else + ac_cv_file__usr_local_include_Xm_Xm_h=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_local_include_Xm_Xm_h" >&5 +$as_echo "$ac_cv_file__usr_local_include_Xm_Xm_h" >&6; } +if test "x$ac_cv_file__usr_local_include_Xm_Xm_h" = xyes; then : + MOTIF_HOME="/usr/local" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /sw/include/Xm/Xm.h" >&5 $as_echo_n "checking for /sw/include/Xm/Xm.h... " >&6; } @@ -4863,10 +4881,13 @@ fi $as_echo "$ac_cv_file__sw_include_Xm_Xm_h" >&6; } if test "x$ac_cv_file__sw_include_Xm_Xm_h" = xyes; then : MOTIF_HOME="/sw" +else + as_fn_error $? "could not find Xm/Xm.h" "$LINENO" 5 fi fi +fi diff --git a/configure.ac b/configure.ac index 6c2e774d..1169daff 100644 --- a/configure.ac +++ b/configure.ac @@ -121,9 +121,10 @@ AX_GSL_HOME([]) AX_GTEST_HOME([]) AX_PYTHON_DEVEL([>='2.5']) -AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_HOME="/usr"], AC_CHECK_FILE(/sw/include/Xm/Xm.h, [MOTIF_HOME="/sw"])) +AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_HOME="/usr"], + AC_CHECK_FILE(/usr/local/include/Xm/Xm.h, [MOTIF_HOME="/usr/local"], + AC_CHECK_FILE(/sw/include/Xm/Xm.h, [MOTIF_HOME="/sw"],AC_MSG_ERROR([could not find Xm/Xm.h])))) AC_SUBST([MOTIF_HOME]) - AC_OUTPUT([share/trick/makefiles/config_user.mk]) diff --git a/trick_source/codegen/Interface_Code_Gen/makefile b/trick_source/codegen/Interface_Code_Gen/makefile index aa430f0e..691947aa 100644 --- a/trick_source/codegen/Interface_Code_Gen/makefile +++ b/trick_source/codegen/Interface_Code_Gen/makefile @@ -50,6 +50,7 @@ endif ifeq ($(TRICK_HOST_TYPE),Darwin) CXXFLAGS += -std=c++11 CLANGLIBS += -lLLVMOption -lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMSupport $(shell $(LLVM_HOME)/bin/llvm-config --system-libs) +CXXFLAGS += -lc++abi endif all: $(ICG)