Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Sep 2001 14:06:45 -0700
From:      Peter Wemm <peter@wemm.org>
To:        "David E. O'Brien" <obrien@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/gnu/usr.bin/binutils/libiberty Makefile 
Message-ID:  <20010908210645.BEF9D380A@overcee.netplex.com.au>
In-Reply-To: <200109062259.f86MxVT88167@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

"David E. O'Brien" wrote:
> obrien      2001/09/06 15:59:31 PDT
> 
>   Modified files:
>     gnu/usr.bin/binutils/libiberty Makefile 
>   Log:
>   Fix the upgrade path from 4.1 and earlier.

This is bogusly testing the kernel version, not the libc version.  The
version of the kernel has no bearing on what is in libc.

IMHO, either put basename.c in unconditionally (it is not worth the pain)
or do this:

peter@ftp-master[5:46pm]~-129#  ar t /usr/lib/libc.a | grep basename
basename.o

If you must test for it, I would feel happier if you had something along the
lines of this:   [**UNTESTED**]

Index: Makefile
===================================================================
RCS file: /home/ncvs/src/gnu/usr.bin/binutils/libiberty/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	2001/09/06 22:59:31	1.10
+++ Makefile	2001/09/08 21:01:20
@@ -2,13 +2,7 @@
 
 .include "../Makefile.inc0"
 
-# Get __FreeBSD_version
-.if exists(/sbin/sysctl)
-SYSCTL=	/sbin/sysctl
-.else
-SYSCTL=	/usr/sbin/sysctl
-.endif
-OSVERSION!=	${SYSCTL} -n kern.osreldate
+LIBC_BASENAME!=	ar tv /usr/lib/libc.a | grep basename
 
 .PATH: ${SRCDIR}/libiberty
 
@@ -18,7 +12,7 @@
 	hex.c floatformat.c lbasename.c objalloc.c obstack.c safe-ctype.c \
 	xatexit.c xexit.c xmalloc.c \
 	xstrdup.c xstrerror.c
-.if ${OSVERSION} < 420000
+.if ${LIBC_BASENAME} == ""
 SRCS+=	basename.c
 .endif
 CFLAGS+=	-DHAVE_CONFIG_H

peter@overcee[2:01pm]/home/src/gnu/usr.bin/binutils/libiberty-105> make -V LIBC_BASENAME
rw-r--r-- 0/0   1230 Aug 24 03:49 2001 basename.o

However, this is all still a bit bogus as it will (like the sysctl method)
cause basename.o to be linked into the cross-build as well as the host build.

It would probably be better to test if we were doing the initial host build
and unconditionally include that.  Once we've generated the target libc
we know that basename is available.  (maybe test for $TOOLS_PREFIX or
something).

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


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




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