If ng runtime is selected, we need clang

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@39439 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2016-03-02 12:05:34 +00:00
parent f5317ea6e1
commit f801889750
3 changed files with 126 additions and 83 deletions

137
configure vendored
View file

@ -693,8 +693,6 @@ RANLIB
CYGWIN
cc_bundle
cc_cppprecomp
ac_cv_library_combo
OBJC_WITH_GC
target_os
target_vendor
target_cpu
@ -720,6 +718,8 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
ac_cv_library_combo
OBJC_WITH_GC
target_alias
host_alias
build_alias
@ -2278,10 +2278,84 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# have an Objective-C runtime available yet.
#
targetArgument=${target}
#--------------------------------------------------------------------
# Setup the library combination
#--------------------------------------------------------------------
targetArgument=${target}
#--------------------------------------------------------------------
# Check if objc should use garbage collection.
#--------------------------------------------------------------------
# Check whether --enable-objc-garbage-collection was given.
if test "${enable_objc_garbage_collection+set}" = set; then :
enableval=$enable_objc_garbage_collection; OBJC_WITH_GC=$enableval
else
OBJC_WITH_GC=""
fi
if test "$OBJC_WITH_GC" = "yes"; then
ac_cv_library_combo="gnugc-gnu-gnu"
elif test "$OBJC_WITH_GC" = "no"; then
if test "$ac_cv_library_combo"="gnugc-gnu-gnu"; then
ac_cv_library_combo="gnu-gnu-gnu"
fi
else
OBJC_WITH_GC=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library combo" >&5
$as_echo_n "checking for library combo... " >&6; }
# Check whether --with-library-combo was given.
if test "${with_library_combo+set}" = set; then :
withval=$with_library_combo; ac_cv_library_combo=$withval
else
ac_cv_library_combo=$ac_cv_library_combo
fi
if test "$ac_cv_library_combo" = "" -o "$ac_cv_library_combo" = "no"; then
case "$host_os" in
darwin*) ac_cv_library_combo=apple-apple-apple ;;
nextstep4) ac_cv_library_combo=nx-nx-nx ;;
openstep4) ac_cv_library_combo=nx-nx-nx ;;
*) ac_cv_library_combo=gnu-gnu-gnu ;;
esac
fi
case "$ac_cv_library_combo" in
apple) ac_cv_library_combo=apple-apple-apple ;;
gnu) ac_cv_library_combo=gnu-gnu-gnu ;;
ng) ac_cv_library_combo=ng-gnu-gnu ;;
nx) ac_cv_library_combo=nx-nx-nx ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_library_combo" >&5
$as_echo "$ac_cv_library_combo" >&6; }
OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'`
# The ng runtime library setting requires clang rather than gcc
if test "$OBJC_RUNTIME_LIB" = "ng"; then
if test "$OBJCC" = ""; then
OBJCC=clang
fi
if test "$CC" = ""; then
CC=clang
fi
if test "$OBJCXX" = ""; then
OBJCXX=clang++
fi
if test "$CXX" = ""; then
CXX=clang++
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -3748,63 +3822,6 @@ test -n "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
#--------------------------------------------------------------------
# Check if objc should use garbage collection.
#--------------------------------------------------------------------
# Check whether --enable-objc-garbage-collection was given.
if test "${enable_objc_garbage_collection+set}" = set; then :
enableval=$enable_objc_garbage_collection; OBJC_WITH_GC=$enableval
else
OBJC_WITH_GC=""
fi
if test "$OBJC_WITH_GC" = "yes"; then
ac_cv_library_combo="gnugc-gnu-gnu"
elif test "$OBJC_WITH_GC" = "no"; then
if test "$ac_cv_library_combo"="gnugc-gnu-gnu"; then
ac_cv_library_combo="gnu-gnu-gnu"
fi
else
OBJC_WITH_GC=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library combo" >&5
$as_echo_n "checking for library combo... " >&6; }
# Check whether --with-library-combo was given.
if test "${with_library_combo+set}" = set; then :
withval=$with_library_combo; ac_cv_library_combo=$withval
else
ac_cv_library_combo=$ac_cv_library_combo
fi
if test "$ac_cv_library_combo" = "" -o "$ac_cv_library_combo" = "no"; then
case "$host_os" in
darwin*) ac_cv_library_combo=apple-apple-apple ;;
nextstep4) ac_cv_library_combo=nx-nx-nx ;;
openstep4) ac_cv_library_combo=nx-nx-nx ;;
*) ac_cv_library_combo=gnu-gnu-gnu ;;
esac
fi
case "$ac_cv_library_combo" in
apple) ac_cv_library_combo=apple-apple-apple ;;
gnu) ac_cv_library_combo=gnu-gnu-gnu ;;
ng) ac_cv_library_combo=ng-gnu-gnu ;;
nx) ac_cv_library_combo=nx-nx-nx ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_library_combo" >&5
$as_echo "$ac_cv_library_combo" >&6; }
OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'`
#--------------------------------------------------------------------
# Check if we are using Apple cc
#--------------------------------------------------------------------

View file

@ -39,29 +39,11 @@ AC_CONFIG_SRCDIR([application.make])
# have an Objective-C runtime available yet.
#
targetArgument=${target}
#--------------------------------------------------------------------
# Setup the library combination
#--------------------------------------------------------------------
targetArgument=${target}
AC_PROG_CC
AC_PROG_CPP
# We also look for a C++ compiler. While not strictly needed, some
# people use gnustep-make to compile C++ code. It's nice to detect a
# C++ compiler, if we have one, and automatically use it to
# compile/link C++ code. :-)
AC_PROG_CXX
# Similarly for the ObjC++ compiler ... but only new versions of autoconf
# support it, so we pretend by using the C++ compiler
#AC_PROG_OBJCXX
OBJCXX="${CXX}"
# We may use egrep for some tests further down below
AC_PROG_EGREP
AC_CANONICAL_TARGET([])
#--------------------------------------------------------------------
# Check if objc should use garbage collection.
@ -133,6 +115,41 @@ AC_MSG_RESULT($ac_cv_library_combo)
OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'`
# The ng runtime library setting requires clang rather than gcc
if test "$OBJC_RUNTIME_LIB" = "ng"; then
if test "$OBJCC" = ""; then
OBJCC=clang
fi
if test "$CC" = ""; then
CC=clang
fi
if test "$OBJCXX" = ""; then
OBJCXX=clang++
fi
if test "$CXX" = ""; then
CXX=clang++
fi
fi
AC_PROG_CC
AC_PROG_CPP
# We also look for a C++ compiler. While not strictly needed, some
# people use gnustep-make to compile C++ code. It's nice to detect a
# C++ compiler, if we have one, and automatically use it to
# compile/link C++ code. :-)
AC_PROG_CXX
# Similarly for the ObjC++ compiler ... but only new versions of autoconf
# support it, so we pretend by using the C++ compiler
#AC_PROG_OBJCXX
OBJCXX="${CXX}"
# We may use egrep for some tests further down below
AC_PROG_EGREP
AC_CANONICAL_TARGET([])
#--------------------------------------------------------------------
# Check if we are using Apple cc
#--------------------------------------------------------------------

View file

@ -110,6 +110,15 @@ ifeq ($(OBJC_RUNTIME_LIB), ng)
OBJC_LIBS = $(OBJC_LIB_FLAG) -fobjc-nonfragile-abi
RUNTIME_FLAG = -fobjc-runtime=gnustep-1.8 -fblocks -fno-objc-legacy-dispatch
RUNTIME_DEFINE = -DGNUSTEP_RUNTIME=1 -D_NONFRAGILE_ABI=1
# By default we enable ARC for ng code, but projects may disable it
# by defining GS_WITH_ARC=0 at the start of their GNUmakefile
ifeq ($(GS_WITH_ARC),)
GS_WITH_ARC = 1
endif
ifeq ($(GS_WITH_ARC), 1)
RUNTIME_FLAG += -fobjc-arc
RUNTIME_DEFINE += -DGS_WITH_ARC=1
endif
endif
ifeq ($(OBJC_RUNTIME_LIB), gnugc)
@ -118,7 +127,7 @@ ifeq ($(OBJC_RUNTIME_LIB), gnugc)
OBJC_LIBS = $(OBJC_LIB_FLAG) -ldl -lgc
RUNTIME_FLAG = -fgnu-runtime
RUNTIME_DEFINE = -DGNU_RUNTIME=1 -DGS_WITH_GC=1
ifeq ($(debug),yes)
ifeq ($(debug), yes)
RUNTIME_DEFINE += -DGC_DEBUG
endif
endif
@ -146,7 +155,7 @@ FND_LIBS =
#
# Set the appropriate Foundation library
#
ifeq ($(FOUNDATION_LIB),gnu)
ifeq ($(FOUNDATION_LIB), gnu)
FOUNDATION_LIBRARY_NAME = gnustep-base
FOUNDATION_LIBRARY_DEFINE = -DGNUSTEP_BASE_LIBRARY=1
endif
@ -180,7 +189,7 @@ endif
# FIXME - Ask Helge to move this inside his libFoundation, and have
# it installed as a $(GNUSTEP_MAKEFILES)/Additional/libFoundation.make
#
ifeq ($(FOUNDATION_LIB),fd)
ifeq ($(FOUNDATION_LIB), fd)
-include $(GNUSTEP_MAKEFILES)/libFoundation.make
FND_DEFINE = -DLIB_FOUNDATION_LIBRARY=1