legacy gcc: add --with-hybrid-secondary configure option

This commit is contained in:
Ingo Weinhold 2013-08-14 11:47:55 +02:00
parent d36fc8e97b
commit 86fe91bce2
5 changed files with 337 additions and 206 deletions

View File

@ -182,6 +182,12 @@ program_transform_cross_name = s,^,$(target_alias)-,
build_canonical = @build_canonical@
host_canonical = @host_canonical@
HYBRID_SECONDARY = @HYBRID_SECONDARY@
HYBRID_SECONDARY_DEFINES =
ifneq ($(HYBRID_SECONDARY),)
HYBRID_SECONDARY_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\""
endif
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
@ -1412,7 +1418,8 @@ DRIVER_DEFINES = \
-DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
$(HYBRID_SECONDARY_DEFINES)
gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
Makefile $(lang_specs_files) prefix.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
@ -1976,6 +1983,7 @@ cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
$(HYBRID_SECONDARY_DEFINES) \
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
LIBCPP_OBJS = cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o cppfiles.o \
@ -2010,6 +2018,7 @@ cppinit.o: cppinit.c $(CONFIG_H) cpplib.h intl.h system.h \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
$(HYBRID_SECONDARY_DEFINES) \
-c `echo $(srcdir)/cppinit.c | sed 's,^\./,,'`
# Note for the stamp targets, we run the program `true' instead of
@ -2034,6 +2043,7 @@ protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DSTD_PROTO_DIR=\"$(libsubdir)\" \
$(HYBRID_SECONDARY_DEFINES) \
$(srcdir)/protoize.c
unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h \

View File

@ -353,10 +353,13 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
/* For native compiler, use standard Haiku include file search paths
rooted in /boot/system/develop/headers. For a cross compiler, don't expect
the host to use the Haiku directory scheme, and instead look for the Haiku
include files relative to TOOL_INCLUDE_DIR. */
include files relative to TOOL_INCLUDE_DIR. When building as the compiler
for the secondary architecture of a hybrid, use slightly different paths. */
#undef INCLUDE_DEFAULTS
#ifndef CROSS_COMPILE
#undef INCLUDE_DEFAULTS
#ifndef HYBRID_SECONDARY
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
@ -396,8 +399,50 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
{ "/boot/system/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
#else /* HYBRID_SECONDARY */
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
{ GCC_INCLUDE_DIR, "GCC", 0, 0 },\
{ "/boot/common/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0 },\
{ "/boot/common/develop/headers/" HYBRID_SECONDARY, 0, 0, 0 },\
{ "/boot/system/develop/headers/os", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/app", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/device", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/drivers", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/game", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/interface", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/kernel", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/locale", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/mail", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/media", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/midi", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/midi2", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/net", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/opengl", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/storage", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/support", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/translation", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1 },\
{ "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1 },\
{ "/boot/system/develop/headers/3rdparty", 0, 0, 0 },\
/* TODO: To be removed when libtiff has been outsourced. */\
{ "/boot/system/develop/headers/bsd", 0, 0, 1 },\
{ "/boot/system/develop/headers/glibc", 0, 0, 1 },\
{ "/boot/system/develop/headers/gnu", 0, 0, 1 },\
{ "/boot/system/develop/headers/posix", 0, 0, 1 },\
{ "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0 }, \
{ "/boot/system/develop/headers", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
#endif
#else /* CROSS_COMPILE */
#undef INCLUDE_DEFAULTS
#ifndef HYBRID_SECONDARY
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
@ -434,6 +479,45 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
{ CROSS_INCLUDE_DIR , 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
#else /* HYBRID_SECONDARY */
#define INCLUDE_DEFAULTS \
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },\
{ GCC_INCLUDE_DIR, "GCC", 0, 0 },\
{ CROSS_INCLUDE_DIR "/os", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/app", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/device", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/drivers", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/game", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/interface", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/kernel", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/locale", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/mail", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/media", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/midi", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/midi2", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/net", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/opengl", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/storage", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/support", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/translation", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/add-ons/graphics", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/add-ons/input_server", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/add-ons/screen_saver", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/add-ons/tracker", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/be_apps/Deskbar", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/be_apps/NetPositive", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/os/be_apps/Tracker", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/3rdparty", 0, 0, 0 },\
{ CROSS_INCLUDE_DIR "/bsd", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/glibc", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/gnu", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/posix", 0, 0, 1 },\
{ CROSS_INCLUDE_DIR "/" HYBRID_SECONDARY, 0, 0, 0 }, \
{ CROSS_INCLUDE_DIR , 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
};
#endif
#endif
/* Whee. LIBRARY_PATH is Haiku's LD_LIBRARY_PATH, which of course will
@ -444,7 +528,12 @@ extern union tree_node *i386_pe_merge_decl_attributes ();
and "/boot/system/develop/lib/", MD_STARTFILE_PREFIX adds the last one of the
standard paths. The user specific paths are set via LIBRARY_PATH_ENV. */
#undef MD_STARTFILE_PREFIX
#ifdef HYBRID_SECONDARY
#define MD_STARTFILE_PREFIX \
"/boot/common/non-packaged/develop/lib/" HYBRID_SECONDARY "/"
#else
#define MD_STARTFILE_PREFIX "/boot/common/non-packaged/develop/lib/"
#endif
/* Haiku doesn't have a separate math library. */
#define MATH_LIBRARY ""

File diff suppressed because it is too large Load Diff

View File

@ -292,6 +292,14 @@ AC_ARG_WITH(dwarf2,
dwarf2="$with_dwarf2",
dwarf2=no)
# handle --with-hybrid-secondary
AC_ARG_WITH(hybrid_secondary,
[ --with-hybrid_secondary specify the packaging architecture for building a secondary compiler for a Haiku hybrid system.],
[HYBRID_SECONDARY=$withval],
[HYBRID_SECONDARY=]
)
AC_SUBST(HYBRID_SECONDARY)
# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM

View File

@ -1409,10 +1409,19 @@ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
#ifdef MD_STARTFILE_PREFIX_1
static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
#endif
static const char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
#if defined(__HAIKU__)
#ifdef HYBRID_SECONDARY
static const char *standard_startfile_prefix_1 =
"/boot/common/develop/lib/" HYBRID_SECONDARY "/";
static const char *standard_startfile_prefix_2 =
"/boot/system/develop/lib/" HYBRID_SECONDARY "/";
#else
static const char *standard_startfile_prefix_1 = "/boot/common/develop/lib/";
static const char *standard_startfile_prefix_2 = "/boot/system/develop/lib/";
#endif
#else
static const char *standard_startfile_prefix_1 = "/lib/";
static const char *standard_startfile_prefix_2 = "/usr/lib/";