Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Oct 2000 02:55:14 +0900
From:      "R. Imura" <imura@af.airnet.ne.jp>
To:        ports@freebsd.org
Subject:   How about new variable LINUX_CROSS_BUILD to bsd.port.mk?
Message-ID:  <20001012025514V.imura@cs.titech.ac.jp>

next in thread | raw e-mail | index | archive | help
I'm a maintainer of www/linux-lesstif-ns, but
I can't say this port's Makefile is good.

So, I thought.
How about this small patch?

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.355
diff -u -r1.355 bsd.port.mk
--- bsd.port.mk	2000/10/08 11:43:54	1.355
+++ bsd.port.mk	2000/10/11 17:18:49
@@ -621,6 +621,10 @@
 .else
 PREFIX?=		${LOCALBASE}
 .endif
+.if defined(LINUX_CROSS_BUILD)
+USE_LINUX=		yes
+PREFIX?=		${LOCALBASE}
+.endif
 
 .if defined(USE_OPENSSL)
 .if ${OSVERSION} >= 400014
@@ -773,6 +777,13 @@
 
 .if defined(USE_LINUX)
 RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.endif
+
+.if defined(LINUX_CROSS_BUILD)
+USE_GMAKE=	yes
+GMAKE=		${LINUXBASE}/usr/bin/make
+BUILD_DEPENDS+=	${LINUXBASE}/usr/bin/cc:${PORTSDIR}/devel/linux_devtools
+CONFIGURE_ENV+=	MAKE=${GMAKE} ${LINUXBASE}/bin/bash
 .endif
 
 .if defined(REQUIRES_MOTIF)
==================== end of patch

By this line,
"+GMAKE=		${LINUXBASE}/usr/bin/make"
all build tools(cc, ld, as...) will be work in the Linuxulator.

By this line
"+CONFIGURE_ENV+=	MAKE=${GMAKE} ${LINUXBASE}/bin/bash"
configure will be done by ${LINUXBASE}/bin/bash, so
all command called from configure file will be work in the Linuxulator, too.

I put this line
"+USE_GMAKE=	yes"
after what usual USE_GMAKE do, so you can forget FreeBSD's world.
(sorry for strange English)

If *_WRKSRC patch is also applied, linux-lesstif-ns's Makefile will be
tiny clean.

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/linux-lesstif-ns/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	2000/10/02 15:44:13	1.3
+++ Makefile	2000/10/11 17:25:44
@@ -21,26 +21,19 @@
 
 MAINTAINER=	imura@FreeBSD.org
 
-BUILD_DEPENDS=	${LINUXBASE}/usr/bin/cc:${PORTSDIR}/devel/linux_devtools
-
-USE_LINUX_PREFIX=	yes
+LINUX_CROSS_BUILD=	yes
+BUILD_WRKSRC=	${WRKSRC}/lib/Xm
 PREFIX=		${LINUXBASE}${X11BASE}
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	--host=${MACHINE_ARCH}--linux-gnu --enable-shared --enable-production \
 		--disable-build-20 --disable-debug --no-recursion \
 		--without-motif --disable-build-Xlt --disable-build-Xbae
-GMAKE=		${LINUXBASE}/usr/bin/make
-
-do-build:
-	cd ${WRKSRC}/lib/Xm && ${GMAKE}
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/lib/Xm/.libs/libXm.so.1.0.2 \
+	${INSTALL_SCRIPT} ${BUILD_WRKSRC}/.libs/libXm.so.1.0.2 \
 					${PREFIX}/lib/libXm-ns.so.1.0.2
 	${LN} -sf libXm-ns.so.1.0.2 ${PREFIX}/lib/libXm.so.1
 	${LN} -sf libXm.so.1 ${PREFIX}/lib/libXm.so
 	${LINUXBASE}/sbin/ldconfig
 
 .include <bsd.port.mk>
-
-CONFIGURE_ENV+=	${LINUXBASE}/bin/bash
==================== end of patch

Any thought?

- R. Imura


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001012025514V.imura>