apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Schumann <sas...@schumann.cx>
Subject Re: Run-time linking paths via LDFLAGS on Linux with gcc.
Date Mon, 07 Jan 2002 13:11:50 GMT
> This is a complete Catch-22.  The question is what to do about it.
> I have some ideas, but I'd like to hear what other people think.

    I'll outline what PHP is doing quite successfully in this
    area.  The described method allows you to build native
    objects as well as libtool objects which is what you probably
    need here as well (the former is usually required for
    autoconf-checks).

    First, in PHP we check what kind of flag the native compiler
    requires to add a runtime library search path.

    Second, we have a macro PHP_ADD_LIBPATH which does:

    - set up LDFLAGS to contain the proper native compiler
      settings (e.g. -Wl,-rpath,...), so that test programs can
      execute properly

    - store the plain path in PHP_RPATHS

    Third, before generating the Makefiles, PHP_RPATHS is
    expanded into LIBTOOL_RPATHS and NATIVE_RPATHS(*), each
    containing the proper flags.  This step enables Makefile
    authors to differentiate.

    Fourth, all runpath elements are 'erased'(*) from LDFLAGS.

    * deliberately changed for improved clearness

    - Sascha                                     Experience IRCG
      http://schumann.cx/                http://schumann.cx/ircg


Mime
View raw message