libtool-patches
[Top][All Lists]
Advanced

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

Re: SCO/bugfix patch 3 of 10: AC_LIBTOOL_DLOPEN_SELF


From: Kean Johnston
Subject: Re: SCO/bugfix patch 3 of 10: AC_LIBTOOL_DLOPEN_SELF
Date: Mon, 31 Oct 2005 09:14:27 -0800
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

You have to escape the quotes.  Your example above won't work always:
lt_prog_compiler_static may begin with `-n':
  lt_prog_compiler_static=-non-shared
`echo' may interpret `-n'.  Boom.  Prepending `echo's first argument
with a space fixes that.
Aha. Right you are.

Actually, you just need to escape the quotes, there's no need
to actually add a space. This shell script worked on all of
ksh, bourne shell (real one, not bash masquerading as one),
zsh and bash:

compiler_wl='-Wl,'
static='-n ${wl}-foo,bar ${wl}baz'
flags=`wl=$compiler_wl eval echo \"$static\"`
echo "$flags"

Not that the extra spacing matters, but I'm doing that pedantic
thing again :)

So getting back to an actual bit of libtool code, we could have:

sflag=`wl=$lt_prog_compiler_wl eval echo \"$lt_prog_compiler_static\"`
LDFLAGS="$LDFLAGS $sflag"

Again using a short variable for the sake of my mailer. In actual
code I'd use something like 'tmpstaticflag' to its obviously a
temporary variable.

Kean




reply via email to

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