[Top][All Lists]

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

[Mingw-cross-env-list] Proposal: libgnurx.mk and file.mk

From: Moritz Bunkus
Subject: [Mingw-cross-env-list] Proposal: libgnurx.mk and file.mk
Date: Sun, 23 Oct 2011 17:42:44 +0200
User-agent: Roundcube Webmail/0.5.3


I need libmagic.a for my project, MKVToolNix. libmagic.a is part of the 'file' utility package. This in turn needs libgnurx, a somewhat evolved version of libregex.a (see http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/regex.README for that sad story).

Here are two build files for the two packages. Both need patches, but for different reasons. Compilation & dependencies have been tested against a minimal environment.

1. libgnurx:

libgnurx's upstream is set up to be built into DLLs only. No way to build it statically without patching it. Therefore the patch simply adds its own Makefile.mingw-cross-env and builds the static library itself (easy enough, it's only a single source file). This Makefile also takes care of installing only the static version.

2. file/magic:

In order to build libmagic an executable of 'file' is needed that can be run on the building machine (necessary for generation of the magic.mgc file). This requires that the version of the 'file' executable matches the version of the library we're trying to build.

Therefore file.mk first builds a non-cross compiled version of 'file' and saves it. Then it re-runs configure with --host set and compiles & installs the whole package.

The patch is needed for two reasons: First, magic/Makefile.am has to use the locally built 'file' executable. Second, configure seems not to think that it's being cross-compiled for some reason. Therefore I had to hardcode this in magic/Makefile.am as well.

Kind regards,

Attachment: file.mk
Description: Text document

Attachment: file-1-fix-cross-compilation-detection.patch
Description: Text document

Attachment: libgnurx.mk
Description: Text document

Attachment: libgnurx-1-build-static-lib.patch
Description: Text document

reply via email to

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