[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r38377 - trunk/build/ac-macros

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 09 Jul 2009 09:27:31 +0100

Arfrever Frehtes Taifersar Arahesis wrote:
> Author: arfrever
> Date: Wed Jul 8 18:17:57 2009
> New Revision: 38377
>
> Log:
> Filter out redundant library directories (e.g. /usr/lib) to avoid linking
> against Subversion libraries potentially placed in these directories.
>
> * build/ac-macros/svn-macros.m4
> (SVN_REMOVE_REDUNDANT_LIB_DIRS): New.
[...]

Hi Arfrever.

I'm sure this is a useful change but I'd like to understand what it is
for.

Please can you tell me, in a few more words, what problem you are
solving, and what you mean by "redundant".

> Modified: trunk/build/ac-macros/svn-macros.m4
[...]
> +dnl SVN_REMOVE_REDUNDANT_LIB_DIRS
> +dnl
> +dnl Remove redundant library directories (e.g. /usr/lib).

In this function's doc string, I think you need to make clear what the
meaning of "redundant" is (libraries that are mentioned more than once?
no, I don't think so), and what the inputs and outputs are.

Having read through the function, can I suggest this for a better
doc-string:

  Remove some particular linker options from the given list.
  The only argument is a space-separated list of linker options.
  Return the same list except omitting all options that match
  any of the following:
    -L/lib -L/lib64 -L/usr/lib -L/usr/lib64
  A directory name must not end with a trailing '/' in order
  to match one of these.

However, that's still a low-level description: it says what it does but
not why it does it.

Why are those four particular directories chosen to be special?

> +AC_DEFUN([SVN_REMOVE_REDUNDANT_LIB_DIRS],
> +[
> + input_flags="$1"
> + output_flags=""
> + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64"
> + for flag in $input_flags; do
> + filter="no"
> + for dir in $filtered_dirs; do
> + if test "$flag" = "-L$dir"; then
> + filter="yes"
> + break
> + fi
> + done
> + if test "$filter" = "no"; then
> + output_flags="$output_flags $flag"
> + fi
> + done
> + if test -n "$output_flags"; then
> + printf "%s" "${output_flags# }"
> + fi
> +])

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2369292
Received on 2009-07-09 10:28:02 CEST

This is an archived mail posted to the Subversion Dev mailing list.