Subject: Re: make libtool pkg depend on c++rt0 pkg ?
To: None <mcmahill@mtl.mit.edu>
From: Nick Hudson <nick@nthcliff.demon.co.uk>
List: tech-pkg
Date: 10/06/2000 17:45:29
This is a multi-part message in MIME format.
--------------C3C031BAAC23A7F061EC978C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

mcmahill@mtl.mit.edu wrote:
> 
> On Fri, 6 Oct 2000, Alistair Crooks wrote:
> 
> >
> > On Fri, 6 Oct 2000 16:43:13 +0200 (MET DST), Hubert Feyrer wrote:
> >
> > >  On Fri, 6 Oct 2000, Nick Hudson wrote:
> > >  > If everyone can agree at what they want to happen I can take a look at
> > >  > doing it. Todd's suggestion seems to make sense.
> > >
> > >  I don't really care, plus I'm not familiar with the internals.
> > >  So -=> Todd's the boss. :)
> >
> > Well, I do care (passionately) about what happens to things in pkgsrc.
> > Having said that, it's a sane thing to do - go for it.
> 
> as long as we're sure that libtool isn't the only place that wants to link
> c++rt0.o   Ie, if there are other places in pkgsrc which do that without
> using libtool, things will still not be quite right.  I'm not sure if this
> is the case or not.

I guess these packages could also be made to depend on the c++rt0
package.

Anyway I've put together the following patches which should do the
trick. Unfortunately they are untested. 

Nick
--------------C3C031BAAC23A7F061EC978C
Content-Type: text/plain; charset=us-ascii;
 name="sparc-aout.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sparc-aout.diff"

Index: devel/libtool/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool/Makefile,v
retrieving revision 1.20
diff -c -r1.20 Makefile
*** devel/libtool/Makefile	2000/09/14 10:20:46	1.20
--- devel/libtool/Makefile	2000/10/06 16:38:10
***************
*** 17,22 ****
--- 17,26 ----
  
  .include "../../mk/bsd.prefs.mk"
  
+ .if ${MACHINE_PLATFORM:MNetBSD-1.4-sparc} != "" || ${MACHINE_PLATFORM:MNetBSD-1.4.[12]-sparc} != ""
+ DEPENDS+=	c++rt0>=1.0:../../sysutils/c++rt0
+ .endif
+ 
  .if ${OPSYS} == "NetBSD"
  .if !exists(/usr/libexec/ld.so) && !exists(/usr/libexec/ld.elf_so)
  CONFIGURE_ARGS=	--disable-shared
Index: devel/libtool/files/patch-sum
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool/files/patch-sum,v
retrieving revision 1.11
diff -c -r1.11 patch-sum
*** devel/libtool/files/patch-sum	2000/09/14 10:20:46	1.11
--- devel/libtool/files/patch-sum	2000/10/06 16:38:10
***************
*** 1,5 ****
  $NetBSD: patch-sum,v 1.11 2000/09/14 10:20:46 skrll Exp $
  
! MD5 (patch-aa) = 40127f6b3bfe5747ccb450017417487c
  MD5 (patch-ab) = b550fbb6345a031c6ea34ee66ec257e1
  MD5 (patch-ac) = be7e8b63e245f3d9ba4e19c5fd928d00
--- 1,5 ----
  $NetBSD: patch-sum,v 1.11 2000/09/14 10:20:46 skrll Exp $
  
! MD5 (patch-aa) = 94ad8181c920e37a3759f2db9e0428c1
  MD5 (patch-ab) = b550fbb6345a031c6ea34ee66ec257e1
  MD5 (patch-ac) = be7e8b63e245f3d9ba4e19c5fd928d00
Index: devel/libtool/patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/devel/libtool/patches/patch-aa,v
retrieving revision 1.13
diff -c -r1.13 patch-aa
*** devel/libtool/patches/patch-aa	2000/09/14 10:20:46	1.13
--- devel/libtool/patches/patch-aa	2000/10/06 16:38:11
***************
*** 1,8 ****
! $NetBSD: patch-aa,v 1.13 2000/09/14 10:20:46 skrll Exp $
  
  --- ltconfig.in.orig	Sat May 27 02:58:57 2000
  +++ ltconfig.in
! @@ -1194,11 +1194,15 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
--- 1,8 ----
! $NetBSD$
  
  --- ltconfig.in.orig	Sat May 27 02:58:57 2000
  +++ ltconfig.in
! @@ -1194,11 +1194,17 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
***************
*** 10,17 ****
  -      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  +      wlarc=
! +      if test -f /usr/lib/c++rt0.o; then
! +        # Add in C++ constructor/destructor support
  +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
--- 10,19 ----
  -      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  +      wlarc=
! +      # Add in C++ constructor/destructor support
! +      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
! +        archive_cmds="$archive_cmds ${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
! +      elif test -f /usr/lib/c++rt0.o; then
  +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
***************
*** 22,36 ****
       fi
       ;;
   
! @@ -1392,9 +1396,17 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
  +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  +      wl=
! +      if test -f /usr/lib/c++rt0.o; then
! +        # Add in C++ constructor/destructor support
  +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
--- 24,40 ----
       fi
       ;;
   
! @@ -1392,9 +1398,19 @@
   
     netbsd*)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  -      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
  +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  +      wl=
! +      # Add in C++ constructor/destructor support
! +      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
! +        archive_cmds="$archive_cmds ${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
! +      elif test -f /usr/lib/c++rt0.o; then
  +        archive_cmds="$archive_cmds /usr/lib/c++rt0.o"
  +      fi
       else
***************
*** 41,47 ****
       fi
       hardcode_libdir_flag_spec='${wl}-R$libdir'
       hardcode_direct=yes
! @@ -2012,6 +2024,9 @@
       finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
       dynamic_linker='NetBSD (a.out) ld.so'
     else
--- 45,51 ----
       fi
       hardcode_libdir_flag_spec='${wl}-R$libdir'
       hardcode_direct=yes
! @@ -2012,6 +2028,9 @@
       finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
       dynamic_linker='NetBSD (a.out) ld.so'
     else
***************
*** 51,57 ****
       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
       soname_spec='${libname}${release}.so$major'
       dynamic_linker='NetBSD ld.elf_so'
! @@ -2069,7 +2084,7 @@
     ;;
   
   solaris*)
--- 55,61 ----
       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
       soname_spec='${libname}${release}.so$major'
       dynamic_linker='NetBSD ld.elf_so'
! @@ -2069,7 +2088,7 @@
     ;;
   
   solaris*)
Index: sysutils/c++rt0/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/c++rt0/Makefile,v
retrieving revision 1.2
diff -c -r1.2 Makefile
*** sysutils/c++rt0/Makefile	2000/10/05 14:11:57	1.2
--- sysutils/c++rt0/Makefile	2000/10/06 16:38:11
***************
*** 22,28 ****
  	${INSTALL_DATA}	${_DISTDIR}/c++rt0.o.pic ${PREFIX}/lib/c++rt0
  	${INSTALL_DATA}	${_DISTDIR}/c++rt0.o.PIC ${PREFIX}/lib/c++rt0
  	${INSTALL_DATA}	${_DISTDIR}/README	${PREFIX}/lib/c++rt0
- 	${MV} /usr/lib/c++rt0.o /usr/lib/c++rt0.o.unPKGd
- 	${INSTALL} -c -m 444 -o root -g wheel ${PREFIX}/lib/c++rt0/c++rt0.o.PIC /usr/lib/c++rt0.o
  
  .include "../../mk/bsd.pkg.mk"
--- 22,26 ----



--------------C3C031BAAC23A7F061EC978C--