summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-02-06 02:49:54 +0000
committerjlam <jlam@pkgsrc.org>2004-02-06 02:49:54 +0000
commit8478662a54f80121699c5985b54d16ee2f679324 (patch)
treec286d2e1fe5e6f6649ba414bfa5283afb1fbfc9c /lang
parent063d720aeb6db55cb63f85cd26196a6ae8730762 (diff)
downloadpkgsrc-8478662a54f80121699c5985b54d16ee2f679324.tar.gz
Correctly depend on binutils if binutils is already installed and
${LOCALBASE}/bin is in the ${PATH}.
Diffstat (limited to 'lang')
-rw-r--r--lang/gcc3-c/Makefile.common25
1 files changed, 21 insertions, 4 deletions
diff --git a/lang/gcc3-c/Makefile.common b/lang/gcc3-c/Makefile.common
index f528cde47b8..b50dc5361cf 100644
--- a/lang/gcc3-c/Makefile.common
+++ b/lang/gcc3-c/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.10 2004/02/06 01:42:29 jlam Exp $
+# $NetBSD: Makefile.common,v 1.11 2004/02/06 02:49:54 jlam Exp $
GCC_VERSION= 3.3.2
DISTNAME= gcc-${GCC_VERSION}
@@ -49,18 +49,35 @@ GCC_PLATFORM= ${MACHINE_GNU_PLATFORM}
CONFIGURE_ARGS+= --host=${GCC_PLATFORM}
PLIST_SUBST+= GCC_PLATFORM=${GCC_PLATFORM}
-.if ${OPSYS} == "NetBSD" && !defined(USE_BINUTILS)
+.if ${OPSYS} == "NetBSD"
+. if !defined(USE_BINUTILS)
+AS_PATH:= ${AS}
+. for _dir_ in ${PATH:C/\:/ /g}
+. if empty(AS_PATH:M/*)
+. if exists(${_dir_}/${AS})
+AS_PATH:= ${_dir_}/${AS}
+. endif
+. endif
+. endfor
+. if !empty(AS_PATH:M${LOCALBASE}/*)
+USE_BINUTILS= YES
+. else
AS_VERSION!= ${AS} --version | ${AWK} '{ \
split($$3, v, /[.]/); \
printf "%02d%02d%02d%02d\n",v[1],v[2],v[3],v[4]; \
exit; \
}'
-USE_BINUTILS!= ${TEST} ${AS_VERSION} -lt 02130201 && echo YES || echo NO
+USE_BINUTILS!= ${TEST} ${AS_VERSION} -lt 02130201 && ${ECHO} YES || ${ECHO} NO
+. endif
+MAKEFLAGS+= USE_BINUTILS="${USE_BINUTILS}"
+. endif
.endif
.if defined(USE_BINUTILS) && !empty(USE_BINUTILS:M[yY][eE][sS])
DEPENDS+= binutils>=2.13.2.1:../../devel/binutils
-CONFIGURE_ARGS+= --with-as=${PREFIX}/${MACHINE_GNU_PLATFORM}/bin/as
+EVAL_PREFIX+= BINUTILS_PREFIX=binutils
+BINUTILS_PREFIX_DEFAULT= ${LOCALBASE}
+CONFIGURE_ARGS+= --with-as=${BINUTILS_PREFIX}/${MACHINE_GNU_PLATFORM}/bin/as
.endif
.if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux" || ${OPSYS} == "SunOS"