pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Hardcode a workaround for perl's DynaLoader.a which...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0fa6f83b90a6
branches:  trunk
changeset: 497841:0fa6f83b90a6
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Aug 05 19:46:41 2005 +0000

description:
Hardcode a workaround for perl's DynaLoader.a which is definitely a
PIC code archive, but libtool isn't smart enough to realize it.  Munge
the name within cmd-sink-libtool into something that will make libtool
recognize it as a PIC code archive.  We unmunge it in arg-pp-main so
non-libtool wrappers see the right thing.  This let's us use libtool
to link applications with an embedded Perl interpreter.

I feel so dirty...

diffstat:

 mk/buildlink3/cmd-sink-libtool |  15 ++++++++++++++-
 mk/wrapper/arg-pp-main         |  15 ++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diffs (58 lines):

diff -r cef98eeeaf9a -r 0fa6f83b90a6 mk/buildlink3/cmd-sink-libtool
--- a/mk/buildlink3/cmd-sink-libtool    Fri Aug 05 19:43:44 2005 +0000
+++ b/mk/buildlink3/cmd-sink-libtool    Fri Aug 05 19:46:41 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-sink-libtool,v 1.1 2004/09/21 15:01:40 jlam Exp $
+# $NetBSD: cmd-sink-libtool,v 1.2 2005/08/05 19:46:41 jlam Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,6 +40,19 @@
        $debug_log $wrapperlog "    (cmd-sink-libtool) pop:  $arg"
        case $arg in
        ##############################################################
+       # Hardcode a workaround for perl's DynaLoader.a which is
+       # definitely a PIC code archive, but libtool isn't smart
+       # enough to realize it.  Munge the name into something that
+       # will make libtool recognize it as a PIC code archive.  We
+       # unmunge it in arg-pp-main so non-libtool wrappers see the
+       # right thing.
+       ##############################################################
+       */DynaLoader.a)
+               arg="${arg%/DynaLoader.a}/libDynaLoader_pic.a"
+               $debug_log $wrapperlog "    (cmd-sink-libtool) to:   $arg"
+               . $buildcmd
+               ;;
+       ##############################################################
        # If we're in "compile" mode, then don't add any linker options
        # to the command line.
        ##############################################################
diff -r cef98eeeaf9a -r 0fa6f83b90a6 mk/wrapper/arg-pp-main
--- a/mk/wrapper/arg-pp-main    Fri Aug 05 19:43:44 2005 +0000
+++ b/mk/wrapper/arg-pp-main    Fri Aug 05 19:46:41 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: arg-pp-main,v 1.4 2005/02/14 21:33:36 jlam Exp $
+# $NetBSD: arg-pp-main,v 1.5 2005/08/05 19:46:41 jlam Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,6 +36,19 @@
 
 case $arg in
 ######################################################################
+# Hardcode a workaround for perl's DynaLoader.a which is definitely
+# a PIC code archive, but libtool isn't smart enough to realize it.
+# cmd-sink-libtool munged it into something libtool recognizes, but
+# now we need to unmunge it so that the compiler/linker are called
+# with the right name for the archive.
+######################################################################
+*/libDynaLoader_pic.a)
+       arg="${arg%/libDynaLoader_pic.a}/DynaLoader.a"
+       prepend_queue argbuf "$arg"
+       $debug_log $wrapperlog "    (arg-pp-main) pre:  $arg"
+       argmatch=yes
+       ;;
+######################################################################
 # Split direct paths to shared libraries into the "-Ldir -llib"
 # equivalent.
 ######################################################################



Home | Main Index | Thread Index | Old Index