pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang GCC generates and uses its own libtool to build s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1a4e94922878
branches:  trunk
changeset: 480388:1a4e94922878
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Sep 08 10:22:01 2004 +0000

description:
GCC generates and uses its own libtool to build shared libraries, and
the resulting shared library names don't necessarily match the NetBSD
names.  Instead of hardcoding the shared library names in the PLISTs,
only list the libtool archives in the PLISTs and dynamically determine
the shared library names at post-install time and insert them into
the PLIST.  This fixes PLIST errors on non-NetBSD platforms.

All of the magic is done in pkgsrc/lang/gcc3/language.mk.  This should
probably be generalized into something that could be used by all
packages that use libtool.

diffstat:

 lang/gcc3-c++/PLIST   |   7 +------
 lang/gcc3-f77/PLIST   |   6 +-----
 lang/gcc3-java/PLIST  |  14 +-------------
 lang/gcc3-objc/PLIST  |   6 +-----
 lang/gcc3/language.mk |  22 +++++++++++++++++++++-
 5 files changed, 25 insertions(+), 30 deletions(-)

diffs (124 lines):

diff -r 6193b4aeee1c -r 1a4e94922878 lang/gcc3-c++/PLIST
--- a/lang/gcc3-c++/PLIST       Wed Sep 08 08:51:31 2004 +0000
+++ b/lang/gcc3-c++/PLIST       Wed Sep 08 10:22:01 2004 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2004/07/02 15:40:01 drochner Exp $
+@comment $NetBSD: PLIST,v 1.5 2004/09/08 10:22:01 jlam Exp $
 ${GCC_SUBPREFIX}/bin/c++
 ${GCC_SUBPREFIX}/bin/g++
 ${GCC_SUBPREFIX}/bin/${GCC_PLATFORM}-c++
@@ -190,12 +190,7 @@
 ${GCC_SUBPREFIX}/include/c++/${PKGVERSION}/valarray
 ${GCC_SUBPREFIX}/include/c++/${PKGVERSION}/vector
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/cc1plus
-${GCC_SUBPREFIX}/lib/libstdc++.a
 ${GCC_SUBPREFIX}/lib/libstdc++.la
-${GCC_SUBPREFIX}/lib/libstdc++.so
-${GCC_SUBPREFIX}/lib/libstdc++.so.5
-${GCC_SUBPREFIX}/lib/libstdc++.so.5.6
-${GCC_SUBPREFIX}/lib/libsupc++.a
 ${GCC_SUBPREFIX}/lib/libsupc++.la
 ${GCC_SUBPREFIX}/man/man1/g++.1
 ${GCC_SUBPREFIX}/mk/c++.mk
diff -r 6193b4aeee1c -r 1a4e94922878 lang/gcc3-f77/PLIST
--- a/lang/gcc3-f77/PLIST       Wed Sep 08 08:51:31 2004 +0000
+++ b/lang/gcc3-f77/PLIST       Wed Sep 08 10:22:01 2004 +0000
@@ -1,13 +1,9 @@
-@comment $NetBSD: PLIST,v 1.3 2003/07/08 16:07:04 drochner Exp $
+@comment $NetBSD: PLIST,v 1.4 2004/09/08 10:22:01 jlam Exp $
 ${GCC_SUBPREFIX}/bin/g77
 ${GCC_SUBPREFIX}/info/g77.info
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/f771
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/g2c.h
 ${GCC_SUBPREFIX}/lib/libfrtbegin.a
-${GCC_SUBPREFIX}/lib/libg2c.a
 ${GCC_SUBPREFIX}/lib/libg2c.la
-${GCC_SUBPREFIX}/lib/libg2c.so
-${GCC_SUBPREFIX}/lib/libg2c.so.0
-${GCC_SUBPREFIX}/lib/libg2c.so.0.0
 ${GCC_SUBPREFIX}/man/man1/g77.1
 ${GCC_SUBPREFIX}/mk/f77.mk
diff -r 6193b4aeee1c -r 1a4e94922878 lang/gcc3-java/PLIST
--- a/lang/gcc3-java/PLIST      Wed Sep 08 08:51:31 2004 +0000
+++ b/lang/gcc3-java/PLIST      Wed Sep 08 10:22:01 2004 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2003/07/08 16:07:04 drochner Exp $
+@comment $NetBSD: PLIST,v 1.4 2004/09/08 10:22:01 jlam Exp $
 ${GCC_SUBPREFIX}/bin/addr2name.awk
 ${GCC_SUBPREFIX}/bin/gcj
 ${GCC_SUBPREFIX}/bin/gcjh
@@ -1688,21 +1688,9 @@
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/gcj/libgcj-config.h
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/jc1
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/jvgenmain
-${GCC_SUBPREFIX}/lib/lib-org-w3c-dom.a
 ${GCC_SUBPREFIX}/lib/lib-org-w3c-dom.la
-${GCC_SUBPREFIX}/lib/lib-org-w3c-dom.so
-${GCC_SUBPREFIX}/lib/lib-org-w3c-dom.so.0
-${GCC_SUBPREFIX}/lib/lib-org-w3c-dom.so.0.0
-${GCC_SUBPREFIX}/lib/lib-org-xml-sax.a
 ${GCC_SUBPREFIX}/lib/lib-org-xml-sax.la
-${GCC_SUBPREFIX}/lib/lib-org-xml-sax.so
-${GCC_SUBPREFIX}/lib/lib-org-xml-sax.so.0
-${GCC_SUBPREFIX}/lib/lib-org-xml-sax.so.0.0
-${GCC_SUBPREFIX}/lib/libgcj.a
 ${GCC_SUBPREFIX}/lib/libgcj.la
-${GCC_SUBPREFIX}/lib/libgcj.so
-${GCC_SUBPREFIX}/lib/libgcj.so.4
-${GCC_SUBPREFIX}/lib/libgcj.so.4.0
 ${GCC_SUBPREFIX}/lib/libgcj.spec
 ${GCC_SUBPREFIX}/lib/security/classpath.security
 ${GCC_SUBPREFIX}/lib/security/libgcj.security
diff -r 6193b4aeee1c -r 1a4e94922878 lang/gcc3-objc/PLIST
--- a/lang/gcc3-objc/PLIST      Wed Sep 08 08:51:31 2004 +0000
+++ b/lang/gcc3-objc/PLIST      Wed Sep 08 10:22:01 2004 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.2 2003/07/08 15:05:03 drochner Exp $
+@comment $NetBSD: PLIST,v 1.3 2004/09/08 10:22:01 jlam Exp $
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/cc1obj
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc/NXConstStr.h
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc/Object.h
@@ -11,9 +11,5 @@
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc/sarray.h
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc/thr.h
 ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc/typedstream.h
-${GCC_SUBPREFIX}/lib/libobjc.a
 ${GCC_SUBPREFIX}/lib/libobjc.la
-${GCC_SUBPREFIX}/lib/libobjc.so
-${GCC_SUBPREFIX}/lib/libobjc.so.1
-${GCC_SUBPREFIX}/lib/libobjc.so.1.0
 @dirrm ${GCC_SUBPREFIX}/lib/gcc-lib/${GCC_PLATFORM}/${PKGVERSION}/include/objc
diff -r 6193b4aeee1c -r 1a4e94922878 lang/gcc3/language.mk
--- a/lang/gcc3/language.mk     Wed Sep 08 08:51:31 2004 +0000
+++ b/lang/gcc3/language.mk     Wed Sep 08 10:22:01 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: language.mk,v 1.1 2004/04/10 15:47:08 seb Exp $
+# $NetBSD: language.mk,v 1.2 2004/09/08 10:22:01 jlam Exp $
 
 BUILDLINK_DEPENDS.gcc3-c+=     gcc3${GCC3_PKGMODIF}-c-${GCC_VERSION}{,nb*}
 BUILDLINK_DEPMETHOD.gcc3-c+=   full
@@ -11,4 +11,24 @@
        ${LN} -s ${GCC_PREFIX}/lib/libiberty.a ${WRKSRC}/libiberty
        ${LN} -s ${GCC_PREFIX}/bin/gcc ${WRKSRC}/gcc/xgcc
 
+.if exists(${PKGDIR}/PLIST)
+GCC_PLIST_AWK_SCRIPT=  '
+GCC_PLIST_AWK_SCRIPT+= ${_PLIST_AWK_SUBST}
+GCC_PLIST_AWK_SCRIPT+= \
+       /\.la$$/ {                                                      \
+               lafile = "${PREFIX}/" $$0;                              \
+               dir = $$0;                                              \
+               sub("/[^/]*\.la$$", "", dir);                           \
+               system("( . " lafile "; for lib in $$library_names $$old_library; do ${ECHO} " dir "/$$lib; done; ${ECHO} " $$0 " ) | ${SORT} -u"); \
+               next;                                                   \
+       }
+GCC_PLIST_AWK_SCRIPT+= { print $$0; }
+GCC_PLIST_AWK_SCRIPT+= '
+PLIST_SRC=             ${WRKDIR}/.PLIST_SRC
+
+post-install: gcc-plist
+gcc-plist:
+       @${CAT} ${PKGDIR}/PLIST | ${AWK} ${GCC_PLIST_AWK_SCRIPT} > ${PLIST_SRC}
+.endif
+
 .include "../../lang/gcc3-c/buildlink3.mk"



Home | Main Index | Thread Index | Old Index