View Issue Details

IDProjectCategoryView StatusLast Update
0000060fileGeneralpublic2019-02-18 16:45
Reportersilvioprog Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
PlatformLinuxOSUbuntuOS Version18.04
Product Version5.35 
Summary0000060: Build fails on mingw-w64 (even installing third party required packages)
DescriptionHello,

I've tried to compile the "libmagic" (static only) for Win32 via cross-compile using the MinGW-w64 available on Ubuntu 18.04, but the build fails at configure time, even installing the library "libgnurx" from a unofficial PPA.
Steps To ReproduceBelow the first steps I've tried:

$ wget -c ftp://ftp.astron.com/pub/file/file-5.35.tar.gz
$ tar -zxvf file-5.35.tar.gz
$ cd file-5.35/
$ ./configure --host=i686-w64-mingw32 --enable-static=yes --enable-shared=no
[snip]
...
checking for ctime_r... no
checking for asctime_r... no
checking for localtime_r... no
checking for gmtime_r... no
checking for pread... no
checking for strcasestr... no
checking for fmtcheck... no
checking for dprintf... no
checking for gzopen in -lz... no
checking for seccomp_init in -lseccomp... no
checking for regexec in -lgnurx... no
configure: error: libgnurx is required to build file(1) with MinGW
Additional InformationI've tried to solve the error "libgnurx is required to build file(1) with MinGW" installing the "gnurx" from a third party PPA (since it is not an official distribution, I really would like to not use it), but, just for testing, let's go to install it anyway:

sudo add-apt-repository ppa:tobydox/mingw-w64
sudo apt update
sudo apt install libgnurx-mingw-w64


Now the "configure" step get finished, but when I try to build the library:

make
[snip]
...
  CC       file.o
  CC       seccomp.o
  CCLD     file.exe
make[3]: Leaving directory '~/file-5.35/src'
make[2]: Leaving directory '~/file-5.35/src'
Making all in magic
make[2]: Entering directory '~/file-5.35/magic'
/bin/bash: line 3: file.exe: command not found
Cannot use the installed version of file () to
cross-compile file 5.35
Please install file 5.35 locally first
Makefile:808: recipe for target 'magic.mgc' failed
make[2]: *** [magic.mgc] Error 1
make[2]: Leaving directory '~/file-5.35/magic'
Makefile:399: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '~/file-5.35'
Makefile:331: recipe for target 'all' failed
make: *** [all] Error 2
Tagsmagic

Activities

silvioprog

2019-02-07 06:23

reporter  

config.log.tar.gz (15,579 bytes)

silvioprog

2019-02-07 06:23

reporter   ~0003207

Full build log in attachment.

christos

2019-02-18 16:44

manager   ~0003208

Looks like the file program "file.exe" built correctly and now it is trying to compile the magic file but it cannot execute it. It then tries to execute the installed copy and complains (correctly) because that will not work. Perhaps edit the Makefile and make the command point directly to the locally built file.exe and try again?

Issue History

Date Modified Username Field Change
2019-02-07 06:20 silvioprog New Issue
2019-02-07 06:20 silvioprog Tag Attached: magic
2019-02-07 06:23 silvioprog File Added: config.log.tar.gz
2019-02-07 06:23 silvioprog Note Added: 0003207
2019-02-18 16:44 christos Note Added: 0003208
2019-02-18 16:45 christos Assigned To => christos
2019-02-18 16:45 christos Status new => feedback