Allow the specification of a prefix for gcc to find all the various bits.

If one wishes to anchor the compiler toolchain tree somewhere other than /,
all one needs to do is set "TOOLS_PREFIX" to a different rooting.

Submitted by:	marcel (in a different format and reworked by me)
This commit is contained in:
David E. O'Brien 1999-12-29 14:42:46 +00:00
parent 19c5221906
commit 253745e1fc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55220
5 changed files with 19 additions and 21 deletions

View File

@ -144,6 +144,7 @@ BOOTSTRAPENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
DESTDIR=${WORLDTMP} \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
MACHINE_ARCH=${BUILD_ARCH} \
TOOLS_PREFIX=${WORLDTMP} \
PATH=${TMPPATH}
# Common environment for world related stages
@ -473,14 +474,10 @@ includes:
cd ${.CURDIR}/gnu/lib/libgmp; ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
.if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
.if exists(${.CURDIR}/secure/lib/libcrypto)
cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
.endif
cd ${.CURDIR}/secure/lib/libdes; ${MAKE} beforeinstall
.if exists(${.CURDIR}/secure/lib/libssl)
cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
.endif
.endif
.if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
defined(MAKE_KERBEROS4)
cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall

View File

@ -2666,7 +2666,7 @@ process_command (argc, argv)
}
GET_ENV_PATH_LIST (temp, "LIBRARY_PATH");
if (temp && *cross_compile == '0')
if (temp)
{
const char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + 3);
@ -3083,11 +3083,11 @@ process_command (argc, argv)
{
case OBJFMT_AOUT:
n_switches++; /* add implied -maout */
add_prefix (&exec_prefixes, "/usr/libexec/aout/", "BINUTILS",
add_prefix (&exec_prefixes, PREFIX"/libexec/aout/", "BINUTILS",
0, 0, NULL_PTR);
break;
case OBJFMT_ELF:
add_prefix (&exec_prefixes, "/usr/libexec/elf/", "BINUTILS",
add_prefix (&exec_prefixes, PREFIX"/libexec/elf/", "BINUTILS",
0, 0, NULL_PTR);
break;
case OBJFMT_UNKNOWN:

View File

@ -6,17 +6,19 @@
.if !defined(GCCDIR)
GCCDIR= ${.CURDIR}/../../../../contrib/gcc
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == "mipsel" || ${TARGET_ARCH} == "mipseb"
GCC_ARCH= mips
.else
GCC_ARCH= ${MACHINE_ARCH}
GCC_ARCH= ${TARGET_ARCH}
.endif
# Machine description.
MD_FILE= ${GCCDIR}/config/${GCC_ARCH}/${GCC_ARCH}.md
OUT_FILE= ${GCC_ARCH}.c
OUT_OBJ= ${GCC_ARCH}
target= ${MACHINE_ARCH}-unknown-freebsd
target= ${TARGET_ARCH}-unknown-freebsd
# These architectures are Cygnus's default for enabling Haifa.
.if ${GCC_ARCH} == "alpha" || ${GCC_ARCH} == "sparc"
@ -28,6 +30,7 @@ version!= sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${GCCDIR}/version.c
CFLAGS+= -DFREEBSD_NATIVE -DIN_GCC -DHAVE_CONFIG_H
CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\"
CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\"
.if defined(LONG_TYPE_SIZE)
CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
.endif
@ -36,11 +39,7 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
CFLAGS+= -DHAIFA
.endif
# If hw.machine_arch doesn't match ${MACHINE_ARCH}, then we're cross
# compiling. gcc needs to know about this, so we set the -DCROSS_COMPILE
# define.
__M!= /sbin/sysctl -b hw.machine_arch
.if ${__M} != ${MACHINE_ARCH}
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
CFLAGS+= -DCROSS_COMPILE
.endif

View File

@ -6,7 +6,6 @@
SRCS= multilib.h choose-temp.c obstack.c prefix.c pexecute.c version.c
CFLAGS+= -DPREFIX=\"/usr\"
CFLAGS+= -DIN_GCC
LIB= cc_drv

View File

@ -10,8 +10,11 @@
#undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */
/* Look for the include files in the system-defined places. */
#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
#define GCC_INCLUDE_DIR "/usr/include"
#define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/g++"
#define GCC_INCLUDE_DIR PREFIX"/include"
#ifdef CROSS_COMPILE
#define CROSS_INCLUDE_DIR PREFIX"/include"
#endif
/* Under FreeBSD, the normal location of the compiler back ends is the
/usr/libexec directory.
@ -30,8 +33,8 @@
#undef TOOLDIR_BASE_PREFIX /* Old?? This is not documented. */
#undef MD_EXEC_PREFIX
#define STANDARD_EXEC_PREFIX "/usr/libexec/"
#define MD_EXEC_PREFIX "/usr/libexec/"
#define STANDARD_EXEC_PREFIX PREFIX"/libexec/"
#define MD_EXEC_PREFIX PREFIX"/libexec/"
/* Under FreeBSD, the normal location of the various *crt*.o files is the
/usr/lib directory. */
@ -39,7 +42,7 @@
#undef STANDARD_STARTFILE_PREFIX
#undef MD_STARTFILE_PREFIX /* We don't need one for now. */
#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
#define STANDARD_STARTFILE_PREFIX PREFIX"/lib/"
/* FreeBSD is 4.4BSD derived */
#define bsd4_4