On Fri, Feb 17, 2006, Ralf S. Engelschall wrote:
>On Thu, Feb 16, 2006, Bill Campbell wrote:
>
>> I just ran into an issue build the jpeg package on OS X where it
>> needs to have shared libraries enabled, which in turn requires
>> having a copy of ./libtool in the build directory to build the
>> shared libraries.
>>
>> One problem is that there is no configure.ac or configure.in in
>> the dorectory so aclocal and libtoolize.  It worked when I copied
>> the %{l_prefix}/bin/libtool script into the directory, which
>> probably comes under the term Crude Hacks(tm).
>>
>> I would like to make the jpeg package depend on the libtool
>> package, but I don't really know how to define conditionals in
>> the top part of a SPEC file that match patterns.  It's easy
>> enough in the scripted parts to use ``case "%{l_target t}"'''.
>>
>> I have seen some %defines that execute shell scripts, but these
>> seem even more of a kludge -- not to mention I would have to dig
>> through some ancient Caldera SRPMS to remember how they work.
>
>Theoretically it would be possible to use something like '%if
>"%{l_target -t}" == "..."' inside a *.spec file but this has two
>problems: (1) you can compare only against a fixed string (which is
>not practical) and (2) it will horribly break the existing FTP service
>XML/RDF generator ("openpkg index") parsing tools ("openpkg build") as
>they do not understand those types of conditions.
>
>Currently the only possibility I see would be create an option
>"with_shared", depend on "libtool" under "with_shared=yes" and use a
>'case "%{l_target t}"' inside the %build section in combination with
>a wrapping '%if "%{with_shared}" == "yes"' to activate the stuff. Not
>elegant, I know. But we are contraint by the RPM features and the
>post-processing tools.

I think I suggested recently that we add a macro to rpm which
could be globally set, say %{l_with_shared}, that would normally
be set to ``--disable-shared'', but could be ``--with-shared''
for targets that require it.

This would cover the vast majority of the spec files I've seen,
but wouldn't be sufficient in cases where considerable effort is
made to remove shared configurations (e.g. gtk2 where a good
chunk of the %prep and %build sections are devoted to this).  It
would be much cleaner to be able to wrap these in %if..%endifs
than in ``case'' statements.

The only package I've come across so far that required more than
changing the ``--disable-shared'' to ``--enable-shared'' is the
tiff package where ``--disable-shared --enable-static'' was
necessary to duplicate the current action.

>But BTW, what is the reason that we need shared libraries for JPEG under
>MacOS X?

There a few issues, all related, that lead me to believe that all
libraries must be built --with-shared on OS X.

First off, the linker frequently doesn't find components in a
static library, even with ``-L%{l_prefix}/lib -l$libname'', but
will find if the appropriate .dylib file is present.

Another issue that I found yesterday while trying to build
abiword, which requires a metric tonne of libraries, is that
building with shared libraries uses ``-fno-common'' which is
neceaary to avoid linking failures.  I'm still trying to get this
build done, but so far I've had to rebuild jpeg, gettext, tiff,
xrender, fontconfig, cairo, and gtk2 with shared libraries.

Bill
--
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

When I hear a man applauded by the mob I always feel a pang of pity
for him.  All he has to do to be hissed is to live long enough.
                -- H.L. Mencken, ``Minority Report''
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   openpkg-dev@openpkg.org

Reply via email to