Skip to content

Commit

Permalink
updates based on contribution by Jean-Charles Bertin
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@36258 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
rfm committed Mar 4, 2013
1 parent cec29db commit b8aab3a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2012-03-01 Richard Frith-Macdonald <[email protected]>

* common.make: Remove -shared-libgcc linker flag
* configure.ac: Add check for clang and add -shared-libgcc to linker
flags if we aren't using it (using gcc) but are using exceptions.
Tidy a little.
Patch based on contribtion by Jean-Charles Bertin.

2012-03-01 Richard Frith-Macdonald <[email protected]>

* Version ... bump subminor number in preparation for next release.
Expand Down
2 changes: 1 addition & 1 deletion common.make
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ CFLAGS =
# use them, turn them on!
ifeq ($(USE_OBJC_EXCEPTIONS), yes)
INTERNAL_OBJCFLAGS += -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS
INTERNAL_LDFLAGS += -shared-libgcc -fexceptions
INTERNAL_LDFLAGS += -fexceptions
endif

# If the compiler supports nonfragile ABI and the user wants us to
Expand Down
33 changes: 27 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1373,13 +1373,13 @@ return __has_feature(objc_nonfragile_abi) ? 0 : 1;
AC_MSG_RESULT($USE_NONFRAGILE_ABI)
CFLAGS="$CFLAGS_no_nonfragile"

if test x$USE_NONFRAGILE_ABI = xno; then
if test x"$USE_NONFRAGILE_ABI" = x"no"; then
AC_MSG_NOTICE([The nonfragile ABI was requested, but the compiler])
AC_MSG_NOTICE([doesn't support it.])
AC_MSG_ERROR([compiler doesn't support nonfragile ABI])
fi
else
if test x$USE_NONFRAGILE_ABI != xno; then
if test x"$USE_NONFRAGILE_ABI" != x"no"; then
default_nonfragile=`echo -e '#ifndef __has_feature\n#define __has_feature(x) 0\n#endif\n__has_feature(objc_nonfragile_abi)'|$CC $CFLAGS -E -x objective-c - -o - |tail -1`

if test x$default_nonfragile = x1; then
Expand All @@ -1388,7 +1388,7 @@ else
USE_NONFRAGILE_ABI=no;
fi
fi
if test x$USE_NONFRAGILE_ABI = xyes; then
if test x"$USE_NONFRAGILE_ABI" = x"yes"; then
AC_MSG_RESULT([yes (compiler default)])
else
AC_MSG_RESULT(not requested by user)
Expand Down Expand Up @@ -1432,7 +1432,7 @@ AC_SUBST(OBJ_MERGE_CMD_FLAG)
#--------------------------------------------------------------------

AC_MSG_CHECKING(for the GCC version)
if test ! ${GCC} = "yes" ; then
if test ! x"${GCC}" = x"yes" ; then
AC_MSG_RESULT(no: it's not gcc)
else
# Running gcc -dumpversion we get something like 2.95.4 or
Expand All @@ -1459,6 +1459,21 @@ else
AC_MSG_RESULT(version: ${gs_cv_gcc_parsed_version})
fi

AC_MSG_CHECKING(whether the compiler is clang)
if test ! x"${GCC}" = x"yes" ; then
CLANG_CC=no
AC_MSG_RESULT(no)
else
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
CLANG_CC=yes
AC_MSG_RESULT(yes)
else
CLANG_CC=no
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(CLANG_CC)

# Do not restore LIBS and CFLAGS yet as we need to test if the
# compiler supports native exceptions.

Expand Down Expand Up @@ -1507,7 +1522,7 @@ int test (Test *o)
return 0;
}
]], USE_OBJC_EXCEPTIONS=yes, USE_OBJC_EXCEPTIONS=no)
if test x$USE_OBJC_EXCEPTIONS = xno; then
if test x"$USE_OBJC_EXCEPTIONS" = x"no"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
Expand All @@ -1516,9 +1531,15 @@ int test (Test *o)
else
AC_MSG_RESULT($USE_OBJC_EXCEPTIONS)
fi

AC_SUBST(USE_OBJC_EXCEPTIONS)

# Check if we need -shared-libgcc linker flags
if test x"$USE_OBJC_EXCEPTIONS" = x"yes" -a x"${GCC}" = x"yes"; then
if test x"$CLANG_CC" = x"no"; then
LDFLAGS="$LDFLAGS -shared-libgcc"
fi
fi

#--------------------------------------------------------------------
# Check if compiler supports -MMD -MP to generate %.d files ...
#--------------------------------------------------------------------
Expand Down

0 comments on commit b8aab3a

Please sign in to comment.