* More consequent handling of libsupc++. configure looks it up now and
provides it via BuildConfig. We link everything against it. * Temporarily pass --no-undefined to the linker. Should be in the compiler specs, but isn't in the gcc 4 I built. * Define _BEOS_R5_COMPATIBLE_ macro when building with gcc 2. Can be used in headers for instance. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14913 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+13
-7
@@ -160,10 +160,12 @@ for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|||||||
HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# gcc version dependent defines
|
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
||||||
# if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
# TODO: Temporary work-around. Should be defined in the compiler specs
|
||||||
# HAIKU_DEFINES += __FUNCTION__=__func__ ;
|
HAIKU_LINKFLAGS += -Xlinker --no-undefined ;
|
||||||
# }
|
} else {
|
||||||
|
HAIKU_DEFINES += _BEOS_R5_COMPATIBLE_ ;
|
||||||
|
}
|
||||||
|
|
||||||
# private kernel headers do be used when compiling kernel code
|
# private kernel headers do be used when compiling kernel code
|
||||||
HAIKU_PRIVATE_KERNEL_HEADERS =
|
HAIKU_PRIVATE_KERNEL_HEADERS =
|
||||||
@@ -185,10 +187,12 @@ if $(HAIKU_SHARED_LIBSTDC++) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# the C++ support library
|
# the C++ support library
|
||||||
if $(HAIKU_GCC_VERSION[1]) < 3 {
|
if $(HAIKU_SHARED_LIBSUPC++) {
|
||||||
HAIKU_LIBSUPC++ = ;
|
HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
|
||||||
|
} else if $(HAIKU_STATIC_LIBSUPC++) {
|
||||||
|
HAIKU_LIBSUPC++ = $(HAIKU_STATIC_LIBSUPC++) ;
|
||||||
} else {
|
} else {
|
||||||
HAIKU_LIBSUPC++ = supc++ ;
|
HAIKU_LIBSTDC++ = ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# library and executable glue code
|
# library and executable glue code
|
||||||
@@ -203,6 +207,8 @@ HAIKU_LIBRARY_BEGIN_GLUE_CODE =
|
|||||||
<src!system!glue>init_term_dyn.o
|
<src!system!glue>init_term_dyn.o
|
||||||
;
|
;
|
||||||
HAIKU_LIBRARY_END_GLUE_CODE =
|
HAIKU_LIBRARY_END_GLUE_CODE =
|
||||||
|
# TODO: For the time being always link against libsupc++.a.
|
||||||
|
$(HAIKU_STATIC_LIBSUPC++)
|
||||||
crtend.o
|
crtend.o
|
||||||
<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
|
<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ rule KernelLd
|
|||||||
if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
|
if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
|
||||||
|
|
||||||
# Remove any preset LINKLIBS, but link against libgcc.a
|
# Remove any preset LINKLIBS, but link against libgcc.a
|
||||||
LINKLIBS on $(1) = -l$(TARGET_LIBSUPC++) $(TARGET_GCC_LIBGCC) ;
|
LINKLIBS on $(1) = $(TARGET_STATIC_LIBSUPC++) $(TARGET_GCC_LIBGCC) ;
|
||||||
# TODO: Linking against TARGET_LIBSUPC++ is OK, but doing it like
|
|
||||||
# this is not so nice.
|
|
||||||
|
|
||||||
# TODO: Do we really want to invoke SetupKernel here? The objects should
|
# TODO: Do we really want to invoke SetupKernel here? The objects should
|
||||||
# have been compiled with KernelObjects anyway, so we're doing that twice.
|
# have been compiled with KernelObjects anyway, so we're doing that twice.
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ standard_gcc_settings()
|
|||||||
HAIKU_GCC_HEADERS_DIR=${gccdir}/include
|
HAIKU_GCC_HEADERS_DIR=${gccdir}/include
|
||||||
HAIKU_GCC_LIBGCC_OBJECTS=`ar t ${HAIKU_GCC_LIBGCC}`
|
HAIKU_GCC_LIBGCC_OBJECTS=`ar t ${HAIKU_GCC_LIBGCC}`
|
||||||
|
|
||||||
# for gcc 4 we use the libstdc++ that comes with the compiler
|
# for gcc 4 we use the libstdc++ and libsupc++ that come with the compiler
|
||||||
case $haikuGCCVersion in
|
case $haikuGCCVersion in
|
||||||
4.*)
|
4.*)
|
||||||
haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a`
|
haikuStaticLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.a`
|
||||||
haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so`
|
haikuSharedLibStdCxx=`$HAIKU_CC -print-file-name=libstdc++.so`
|
||||||
|
haikuStaticLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.a`
|
||||||
|
haikuSharedLibSupCxx=`$HAIKU_CC -print-file-name=libsupc++.so`
|
||||||
local headers=$gccdir/../../../../include/c++/$haikuGCCVersion
|
local headers=$gccdir/../../../../include/c++/$haikuGCCVersion
|
||||||
haikuCxxHeadersDir=$headers
|
haikuCxxHeadersDir=$headers
|
||||||
for d in $haikuGCCMachine backward ext debug; do
|
for d in $haikuGCCMachine backward ext debug; do
|
||||||
@@ -97,6 +99,12 @@ standard_gcc_settings()
|
|||||||
if [ $haikuSharedLibStdCxx = libstdc++.so ]; then
|
if [ $haikuSharedLibStdCxx = libstdc++.so ]; then
|
||||||
haikuSharedLibStdCxx=
|
haikuSharedLibStdCxx=
|
||||||
fi
|
fi
|
||||||
|
if [ $haikuStaticLibSupCxx = libsupc++.a ]; then
|
||||||
|
haikuStaticLibSupCxx=
|
||||||
|
fi
|
||||||
|
if [ $haikuSharedLibSupCxx = libsupc++.so ]; then
|
||||||
|
haikuSharedLibSupCxx=
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -150,6 +158,8 @@ platform=`uname`
|
|||||||
haikuGCCVersion=
|
haikuGCCVersion=
|
||||||
haikuStaticLibStdCxx=
|
haikuStaticLibStdCxx=
|
||||||
haikuSharedLibStdCxx=
|
haikuSharedLibStdCxx=
|
||||||
|
haikuStaticLibSupCxx=
|
||||||
|
haikuSharedLibSupCxx=
|
||||||
haikuCxxHeadersDir=
|
haikuCxxHeadersDir=
|
||||||
hostGCCVersion=`cc -dumpversion`
|
hostGCCVersion=`cc -dumpversion`
|
||||||
floppy=
|
floppy=
|
||||||
@@ -261,6 +271,8 @@ HAIKU_GCC_LIBGCC ?= ${HAIKU_GCC_LIBGCC} ;
|
|||||||
|
|
||||||
HAIKU_STATIC_LIBSTDC++ ?= ${haikuStaticLibStdCxx} ;
|
HAIKU_STATIC_LIBSTDC++ ?= ${haikuStaticLibStdCxx} ;
|
||||||
HAIKU_SHARED_LIBSTDC++ ?= ${haikuSharedLibStdCxx} ;
|
HAIKU_SHARED_LIBSTDC++ ?= ${haikuSharedLibStdCxx} ;
|
||||||
|
HAIKU_STATIC_LIBSUPC++ ?= ${haikuStaticLibSupCxx} ;
|
||||||
|
HAIKU_SHARED_LIBSUPC++ ?= ${haikuSharedLibSupCxx} ;
|
||||||
HAIKU_C++_HEADERS_DIR ?= ${haikuCxxHeadersDir} ;
|
HAIKU_C++_HEADERS_DIR ?= ${haikuCxxHeadersDir} ;
|
||||||
|
|
||||||
HAIKU_BUILD_ATTRIBUTES_DIR ?= ${buildAttributesDir} ;
|
HAIKU_BUILD_ATTRIBUTES_DIR ?= ${buildAttributesDir} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user