summaryrefslogtreecommitdiff
path: root/cross/i386-linux/Makefile
blob: 722cdf4af2a6e3621461f1eff04e783acc77a0a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# $NetBSD: Makefile,v 1.11 2001/08/27 14:35:06 tron Exp $
#

DISTVERSION=		2.0.7.1
DISTFILES=		${LINUXDEVEL_FILES}
EXTRACT_ONLY=		# none of the RPM files
MASTER_SITES=		ftp://ftp.cdrom.com/pub/linux/redhat/redhat-5.1/i386/RedHat/RPMS/

MAINTAINER=		packages@netbsd.org
COMMENT=		Cross-compile environment for iX86 Linux, libc v6

BUILD_DEPENDS+=		rpm-*:../../misc/rpm
BUILD_DEPENDS+=		autoconf>=2.13:../../devel/autoconf

CHECK_SHLIBS=		no
WRKSRC=			${WRKDIR}

USE_CROSS_BINUTILS=	yes
BINUTILS_GNUTARGET=	elf32-i386
BINUTILS_LDEMULATION=	elf_i386
USE_CROSS_EGCS=		yes

LINUXDEVEL_FILES=	glibc-2.0.7-13.i386.rpm \
			glibc-devel-2.0.7-13.i386.rpm \
			kernel-headers-2.0.34-0.6.i386.rpm

TARGET_ARCH=		i386-linux
CROSS_SYS_INCLUDE=	${WRKDIR}/usr/include
SYS_LIB=		${WRKDIR}/usr/lib
LDFLAGS_FOR_TARGET=	-Wl,-rpath-link=${SYS_LIB}

# Extract and rearrange Linux distribution files.
post-extract:
	@cd ${WRKDIR}; \
		for file in ${LINUXDEVEL_FILES}; do \
			rpm2cpio ${_DISTDIR}/$$file | cpio -id; \
		done
	@cd ${WRKDIR}/lib && ${MV} -f * ${SYS_LIB}
	@cd ${CROSS_SYS_INCLUDE} && ${RM} -f asm linux scsi
	@cd ${WRKDIR}/usr/src/linux-2.0.34/include && \
		${MV} -f asm-i386 ${CROSS_SYS_INCLUDE}/asm && \
		${MV} -f linux scsi ${CROSS_SYS_INCLUDE}
	@cd ${SYS_LIB}; \
		for so in libBrokenLocale libcrypt libdb libdl libm libndbm \
			  libnsl libnss_compat libnss_db libnss_dns \
			  libnss_files libnss_nis libpthread libresolv \
			  libutil; do \
			${LN} -sf $$so.so.* $$so.so; \
		done
	@${LN} -f ${SYS_LIB}/crt* ${EGCS_WRKSRC}/gcc/

post-patch:
	@${RM} -f ${SYS_LIB}/*.orig

.include "../COMMON/cross.mk"