From f81daac9c0db1b78136d4e7865cac99a640a215e Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 14 Oct 2017 12:56:16 -0400 Subject: [PATCH] Fix MacOS portability, bug1231. --- Changes | 2 +- configure.ac | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 15d26d075..70c342d03 100644 --- a/Changes +++ b/Changes @@ -37,7 +37,7 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix float-conversion warning, bug1229. [Robert Henry] -**** Fix MacOS portability, bug1230. [Jeff Bush] +**** Fix MacOS portability, bug1230, bug1231. [Jeff Bush] * Verilator 3.912 2017-09-23 diff --git a/configure.ac b/configure.ac index c95c5524b..350013c93 100644 --- a/configure.ac +++ b/configure.ac @@ -111,10 +111,11 @@ AC_DEFUN([_MY_CXX_CHECK_FLAG], # Set $_my_result appropriately ACO_SAVE_CXXFLAGS="$CXXFLAGS" # -Werror needed otherwise unknown -Wno-div-by-zero won't report problems + # new/delete is needed to find -faligned-new link problem on Darwin CXXFLAGS="$CXXFLAGS $1 -Werror" AC_MSG_CHECKING([whether $CXX accepts $1]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([],[])], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [[int* a=new int; delete a; ]])], [_my_result=yes if test -s conftest.err; then if grep -e "$1" conftest.err >/dev/null; then @@ -223,7 +224,7 @@ AC_SUBST(CFG_CXXFLAGS_NO_UNUSED) # Checks for library functions. AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec], - [AC_DEFINE([HAVE_STAT_NSEC],[1],[Define if struct stat has st_mtim.tv_nsec.])], + [AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])], [], [#include ]) # Checks for system services