ports/73647: Problem of building sysutils/pecl-fileinfo

Uranus uranus at it.muds.net
Sun Nov 7 18:40:26 UTC 2004

>Number:         73647
>Category:       ports
>Synopsis:       Problem of building sysutils/pecl-fileinfo
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 07 18:40:25 GMT 2004
>Originator:     Uranus
>Release:        FreeBSD 5.3-STABLE i386
System: FreeBSD it.muds.net 5.3-STABLE FreeBSD 5.3-STABLE #0: Sun Nov  7 13:15:09 CST 2004     root at it.muds.net:/usr/obj/usr/src/sys/ED  i386
The port sysutils/pecl-fileinfo can't be built on FreeBSD 5.3-STABLE.
When I build this one, I got the following error messages at configuration time:
checking for fileinfo support... yes, shared
checking for magic files in default path... not found
configure: error: Please reinstall the libmagic distribution
1. cd /usr/ports/sysutils/pecl-fileinfo
2. make install
I can't find the `magic.h' in the /usr/include and /usr/local/include directories
which are searched by the `configure' program.
But I can find out it in the path `/usr/src/contrib/file/magic.h'.
So I just copied it into `/usr/include' and then make it again.

I got the following messages when I did it:
checking for magic files in default path... found in /usr
checking for magic_open in -lmagic... no
configure: error: wrong magic lib version or lib not found

Then I read `libmagic' and write a little program to test magic_open().
I used the command "gcc test.c -o test -lmagic" and got the messages:
/usr/lib/libmagic.so: undefined reference to 	nflate'
/usr/lib/libmagic.so: undefined reference to 	nflateEnd'
/usr/lib/libmagic.so: undefined reference to 	nflateInit2_'

It seems to lack of the libz.
So I re-compiled by `-lz': gcc test.c -o test -lmagic -lz.
It's no any linking errors.

Finally, I modified the `config.m4' in `/usr/ports/sysutils/pecl-fileinfo/work/Fileinfo-0.2':
--- config.m4.bak       Mon Nov  8 02:32:59 2004
+++ config.m4   Mon Nov  8 02:33:21 2004
@@ -36,7 +36,7 @@
     AC_MSG_ERROR([wrong magic lib version or lib not found])
-    -L$FILEINFO_DIR/lib -lm
+    -L$FILEINFO_DIR/lib -lm -lz
   MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /etc/magic"

And then I configured and built successfully.
I can't ensure that it will work fine at runtime.

I just hope that this information is helpful.

More information about the freebsd-ports-bugs mailing list