You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2003/01/22 19:19:51 UTC

[PATCH] apxs specifies apr ldflags when linking a DSO

the problem to solve is that run-time linking is not enabled
for DSOs built with apxs+gcc on AIX...  somehow libtool does the
right thing with apxs+native-compiler, but a lot of folks are
trying to use gcc and don't know to add the right ld option to
the apxs invocation

adding apr ldflags to other flags when linking does the trick,
but I wonder what this might break or if there is a better way

Index: support/apxs.in
===================================================================
RCS file: /home/cvs/httpd-2.0/support/apxs.in,v
retrieving revision 1.49
diff -u -r1.49 apxs.in
--- support/apxs.in	23 Dec 2002 19:21:15 -0000	1.49
+++ support/apxs.in	22 Jan 2003 18:11:57 -0000
@@ -449,14 +449,16 @@
          $opt .= " -l$opt_l";
      }

+    my $apr_bindir = get_vars("APR_BINDIR");
+
+    if (! -x "$apr_bindir/apr-config") {
+        error("$apr_bindir/apr-config not found!");
+        exit(1);
+    }
+
      if ($opt_p == 1) {
-        my $apr_bindir = get_vars("APR_BINDIR");
          my $apu_bindir = get_vars("APU_BINDIR");

-        if (! -x "$apr_bindir/apr-config") {
-            error("$apr_bindir/apr-config not found!");
-            exit(1);
-        }
          if (! -x "$apu_bindir/apu-config") {
              error("$apu_bindir/apu-config not found!");
              exit(1);
@@ -470,7 +472,9 @@
          $opt .= " ".$apu_libs." ".$apr_libs;
      }
      else {
-        $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version";
+        my $apr_ldflags=`$apr_bindir/apr-config --ldflags`;
+        chomp($apr_ldflags);
+        $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
      }

      push(@cmds, "$installbuilddir/libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo");


Re: [PATCH] apxs specifies apr ldflags when linking a DSO

Posted by Justin Erenkrantz <je...@apache.org>.
--On Wednesday, January 22, 2003 13:19:51 -0500 Jeff Trawick 
<tr...@attglobal.net> wrote:

> the problem to solve is that run-time linking is not enabled
> for DSOs built with apxs+gcc on AIX...  somehow libtool does the
> right thing with apxs+native-compiler, but a lot of folks are
> trying to use gcc and don't know to add the right ld option to
> the apxs invocation
>
> adding apr ldflags to other flags when linking does the trick,
> but I wonder what this might break or if there is a better way

We compile/link the rest of the server with these flags - makes sense to 
compile DSOs with the same flags.  +1.  -- justin