mingw-cross-env-list
[Top][All Lists]
Advanced

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

Re: [Mingw-cross-env-list] libarchive


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] libarchive
Date: Fri, 11 Jun 2010 14:09:04 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Natalie Tasman <address@hidden> schrieb:
> On Thu, Jun 10, 2010 at 1:32 AM, Tony Theodore <address@hidden> wrote:
> > The simplest link test is probably to remove the --disable-bsdtar
[...]
> > Do you think it's reasonable to build bsdtar.exe as a link test then
> > write a simple batch file as a runtime test?

We should build bsdtar.exe only if it has a practical need on the
target (Windows) platform, such as psql.exe for PostgreSQL.

For testing, I prefer the simple libarchive-test.c of Natalie,
because it is a test program that is independent of libarchive.

Instead of writing a shell script around the bsdtar.exe around
the libarchive, I propose to put the testing into libarchive-test.c
directly. However, that isn't of high priority, because we should
assume that libarchive does its job correctly. We test to check
whether it runs at all, and not to thouroughly check all edges
and corners of the lib.

> > Try compiling the test program with a line like:
> >
> > i686-pc-mingw32-gcc -o libarchive-test.exe libarchive-test.c \
> > `i686-pc-mingw32-pkg-config libarchive --cflags --libs` \
> > -DLIBARCHIVE_STATIC
> >
> > and you should get no errors, though this doesn't seem ideal.
> 
> Yes!  That works, with no errors.

Okay, so "-DLIBARCHIVE_STATIC" is missing somewhere. It should
either be part of the libarchive headers:

    #define LIBARCHIVE_STATIC

or it should be returned by pkg-config:

    i686-pc-mingw32-pkg-config libarchive --cflags

I'm not sure which is the best solution, but we are currently
exclusively using the first variant, see:

    src/curl.mk     (#define CURL_STATICLIB)
    src/pthreads.mk (#define PTW32_STATIC_LIB)
    src/taglib.mk   (#define TAGLIB_STATIC)

so I recommend to go that route.

> I don't know if this makes sense right now, as user's won't know to
> add all of the special flags to get their own programs to work...
> unless this is expected behavior?  I will also forward this to the
> libarchive list at this point-- it doesn't seem right that users
> should have to #define something in order to be able to correctly link
> to a library.

Other libraries do that, too. I already mentioned curl, pthreads
and taglib. We know how to handle that, so it's not a big issue.

However, I agree that it would be nicer if libarchive would care
about the LIBARCHIVE_STATIC itself, e.g. during its ./configure
phase.


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR



reply via email to

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