libtool-patches
[Top][All Lists]
Advanced

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

FYI: 350-gary-maintain-private-libobj-namespace


From: Gary V. Vaughan
Subject: FYI: 350-gary-maintain-private-libobj-namespace
Date: Fri, 1 Feb 2008 00:17:20 +0800 (PHT)
User-agent: mailnotify/0.9

Applied to HEAD.

  Index: ChangeLog
  from  Gary V. Vaughan  <address@hidden>
  
        Unfortunately, the autoconf implementation of AC_LIBOBJ and
        friends requires all libobjs to be in the same directory, as
        declared by AC_CONFIG_LIBOBJ_DIR.  That might prevent using
        either recursive or nonrecursive libltdl if the parent project
        has libobjs of its own, except that this patch tracks libltdl's
        libobjs in another namespace:
  
        * libltdl/m4/ltdl.m4 (_LT_LIBOBJ, _LT_LIBSOURCES): Versions of
        AC_LIBOBJ and AC_LIBSOURCES that save missing sources in a
        ltdl_LIBOBJS automake macro, instead of the global LIBOBJS
        automake macro.  Content of the macros inspired by code from
        gnulib-tool.
        (_LTDL_MODE_DISPATCH): Initialise lt_libobj_prefix in
        nonrecursive mode.
        (LTDL_INIT): Push and pop the new definitions around potential
        sites that call AC_LIBOBJ.  Also, using lt_libobj_prefix,
        initialise ltdl_LIBOBJS and ltdl_LTLIBOBJS.
        * libtoolize.m4sh (func_fixup_Makefile): Substitute ltdl_LIBOBJS
        and ltdl_LTLIBOBJS for LIBOBJS and LTLIBOBJS during copying
        either Makefile.am or Makefile.inc, depending on ltdl_mode.
        Reported by Eric Blake <address@hidden>
  
  Index: libtoolize.m4sh
  ===================================================================
  RCS file: /sources/libtool/libtool/libtoolize.m4sh,v
  retrieving revision 1.74
  diff -u -u -r1.74 libtoolize.m4sh
  --- libtoolize.m4sh 31 Jan 2008 16:14:09 -0000 1.74
  +++ libtoolize.m4sh 31 Jan 2008 16:15:56 -0000
  @@ -320,6 +320,7 @@
       IFS="$my_save_IFS"
   }
   
  +
   # func_fixup_Makefile srcfile srcdir destdir
   func_fixup_Makefile ()
   {
  @@ -328,6 +329,8 @@
       my_srcdir="$2"
       my_destdir="$3"
       my_fixup_non_subpackage_script="\
  +      s,(LIBOBJS),(ltdl_LIBOBJS),g
  +      s,(LTLIBOBJS),(ltdl_LTLIBOBJS),g
         s,libltdl/configure.ac,,
         s,libltdl/configure,,
         s,libltdl/aclocal.m4,,
  @@ -1004,7 +1007,7 @@
   {
       $opt_debug
   
  -    # argz.m4, libtool.m4 and ltdl.m4 are handled specially below:
  +    # argz.m4, libtool.m4 and ltdl.m4 are handled specially:
       func_massage_aclocal_DATA 'argz.m4|libtool.m4|ltdl.m4'
   
     # 1. Parent has separate macrodir to subproject ltdl:
  Index: libltdl/m4/ltdl.m4
  ===================================================================
  RCS file: /sources/libtool/libtool/libltdl/m4/ltdl.m4,v
  retrieving revision 1.42
  diff -u -u -r1.42 ltdl.m4
  --- libltdl/m4/ltdl.m4 17 Jan 2008 05:32:42 -0000 1.42
  +++ libltdl/m4/ltdl.m4 31 Jan 2008 16:15:59 -0000
  @@ -198,7 +198,7 @@
       [m4_case(m4_default(_LTDL_MODE, [subproject]),
          [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
                          _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
  -       [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
  +       [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; 
lt_libobj_prefix="$lt_ltdl_dir/"])],
          [recursive], [],
        [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
   dnl Be careful not to expand twice:
  @@ -206,6 +206,32 @@
   ])# _LTDL_MODE_DISPATCH
   
   
  +# _LT_LIBOBJ(MODULE_NAME)
  +# -----------------------
  +# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
  +# of into LIBOBJS.
  +AC_DEFUN([_LT_LIBOBJ], [
  +  m4_pattern_allow([^_LT_LIBOBJS$])
  +  AS_LITERAL_IF([$1], [_LT_LIBSOURCES([$1.c])])dnl
  +  _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
  +])# _LT_LIBOBJS
  +
  +
  +# _LT_LIBSOURCES(MODULE_NAMES)
  +# ----------------------------
  +# Like AC_LIBSOURCES, except the directory where the libltdl source files
  +# are expected is distinct from the user LIBOBJ directory.
  +AC_DEFUN([_LT_LIBSOURCES], [
  +  m4_foreach([_LTNAME], [$1], [
  +    m4_syscmd([test -r "$lt_libobj_prefix]_LTNAME[" ||
  +             test -z "$lt_libobj_prefix" ||
  +             test ! -d "$lt_libobj_prefix"])dnl
  +    m4_if(m4_sysval, [0], [],
  +      [AC_FATAL([missing $lt_libobj_prefix/]_LTNAME)])
  +  ])
  +])# _LT_LIBSOURCES
  +
  +
   # LTDL_INIT([OPTIONS])
   # --------------------
   # Clients of libltdl can use this macro to allow the installer to
  @@ -217,6 +243,12 @@
   [dnl Parse OPTIONS
   _LT_SET_OPTIONS([$0], [$1])
   
  +dnl We need to keep our own list of libobjs separate from our parent project,
  +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
  +dnl we look for our own LIBOBJs. Definitions in ltdl-libobj.m4.
  +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
  +m4_pushdef([AC_LIBSOURCES], m4_defn([_LT_LIBSOURCES]))
  +
   dnl If not otherwise defined, default to the 1.5.x compatible subproject 
mode:
   m4_if(_LTDL_MODE, [],
           [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
  @@ -309,6 +341,25 @@
   
   _LTDL_SETUP
   
  +dnl restore autoconf definition.
  +m4_popdef([AC_LIBOBJ])
  +m4_popdef([AC_LIBSOURCES])
  +
  +AC_CONFIG_COMMANDS_PRE([
  +    _ltdl_libobjs=
  +    _ltdl_ltlibobjs=
  +    if test -n "$_LT_LIBOBJS"; then
  +      # Remove the extension.
  +      _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
  +      for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed 
"$_lt_sed_drop_objext" | sort -u`; do
  +        _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
  +        _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
  +      done
  +    fi
  +    AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
  +    AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
  +])
  +
   # Only expand once:
   m4_define([LTDL_INIT])
   ])# LTDL_INIT
-- 
  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_ 
_________________________________________________________
This patch notification generated by vcsapply version 1.0
http://savannah.gnu.org/projects/cvs-utils

Attachment: pgpiBr5q595Eu.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]