Use configure time check for Objective-C runtime header directory

workaround on Darwin/OS X.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32956 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2011-04-30 07:43:56 +00:00
parent 1fb736ce5e
commit 3795c60175
5 changed files with 66 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2011-04-12 Wolfgang Lux <wolfgang.lux@gmail.com>
* configure.ac:
* config.make.in:
* target.make: Use configure time check for Objective-C runtime
header directory workaround on Darwin/OS X.
* configure: Regenerated.
2011-04-14 Adam Fedor <fedor@gnu.org>
* Version 2.6.0

View file

@ -169,6 +169,7 @@ LATEX2HTML = @LATEX2HTML@
# Darwin specific flags
CC_CPPPRECOMP = @cc_cppprecomp@
CC_BUNDLE = @cc_bundle@
CC_GNURUNTIME = @cc_gnuruntime@
# Backend bundle
BACKEND_BUNDLE=@BACKEND_BUNDLE@

27
configure vendored
View file

@ -593,6 +593,7 @@ OBJCXX
ac_cv_objc_threaded
objc_threaded
OBJC_LIB_FLAG
cc_gnuruntime
BACKEND_BUNDLE
GNUSTEP_MULTI_PLATFORM
GNUSTEP_USER_DIR
@ -5165,6 +5166,32 @@ if test "$gs_cv_objc_libdir" != "NONE"; then
esac
fi
# Special case for Apple systems: When compiling plain C source files that
# include Objective-C runtime headers we must make sure that the correct
# header files are used with a gnu-*-* combo. The -fgnu-runtime compiler
# option takes care of this when compiling Objective-C source files, but
# has no effect when compiling plain C (or C++) source files.
cc_gnuruntime=
case $target_os-$ac_cv_library_combo in
darwin*-gnu-*-* )
if test "$gs_cv_objc_libdir" = "NONE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking GNU Objective-C runtime header directory" >&5
$as_echo_n "checking GNU Objective-C runtime header directory... " >&6; }
install_dir="`$CC -print-search-dirs | sed -n 's/install: //p'`"
if test -n "${install_dir}" && \
test -d "${install_dir}"include-gnu-runtime; then
cc_gnuruntime="${install_dir}"include-gnu-runtime
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_gnuruntime" >&5
$as_echo "$cc_gnuruntime" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: NONE" >&5
$as_echo "NONE" >&6; }
fi
fi
;;
esac
# TODO: This flag needs to be moved to gnustep-base since it concerns
# the runtime library (see explanations at the beginning of this
# file).

View file

@ -1098,6 +1098,29 @@ if test "$gs_cv_objc_libdir" != "NONE"; then
esac
fi
# Special case for Apple systems: When compiling plain C source files that
# include Objective-C runtime headers we must make sure that the correct
# header files are used with a gnu-*-* combo. The -fgnu-runtime compiler
# option takes care of this when compiling Objective-C source files, but
# has no effect when compiling plain C (or C++) source files.
cc_gnuruntime=
case $target_os-$ac_cv_library_combo in
darwin*-gnu-*-* )
if test "$gs_cv_objc_libdir" = "NONE"; then
AC_MSG_CHECKING(GNU Objective-C runtime header directory)
install_dir="`$CC -print-search-dirs | sed -n 's/install: //p'`"
if test -n "${install_dir}" && \
test -d "${install_dir}"include-gnu-runtime; then
cc_gnuruntime="${install_dir}"include-gnu-runtime
AC_MSG_RESULT($cc_gnuruntime)
else
AC_MSG_RESULT(NONE)
fi
fi
;;
esac
AC_SUBST(cc_gnuruntime)
# TODO: This flag needs to be moved to gnustep-base since it concerns
# the runtime library (see explanations at the beginning of this
# file).

View file

@ -296,14 +296,14 @@ endif
ifeq ($(OBJC_RUNTIME_LIB), gnu)
# GNU runtime
# FIXME: The following will cause a shell + compiler + sed invocation
# for every single recursive make invocation ... which is extremely
# slow. It needs to be rewritten as a configure check.
# Make sure that the compiler includes the right Objective-C runtime headers
# when compiling plain C source files. When compiling Objective-C source files
# the necessary directory is implicitly added by the -fgnu-runtime option, but
# this option is ignored when compiling plain C files.
ifneq ($(strip $(CC_GNURUNTIME)),)
INTERNAL_CFLAGS += -isystem $(CC_GNURUNTIME)
endif
# Make sure that compiler includes the right Objective-C runtime headers when
# compiling C source files. Normally, the required include path is implicitly
# added -fgnu-runtime, but this seems to be ignored when compiling C files.
INTERNAL_CFLAGS := -isystem $(shell $(CC) -print-search-dirs | sed -n '/install:/s/install: //p')include-gnu-runtime
INTERNAL_LDFLAGS += -undefined dynamic_lookup
SHARED_LD_PREFLAGS += -Wl,-noall_load -read_only_relocs warning $(CC_LDFLAGS)