Mike Edenfield kutulu at
Thu Mar 31 11:23:08 PST 2005

Chuck Robey wrote:
> Aaron Siegel wrote:

>> The file magic.h is the header file to libmagic a libary that is part 
>> of the system, magic(3). The header is  located in 
>> /usr/src/contrib/file/magic.h. The only reason for doing I did this 
>> crazy stunt is I followed a thread on one of the list recommended that 
>> I copy the magic.h to /usr/include. I do not know if this is correct 
>> or not?  Andy Fawcett  found an error in the configure script which 
>> solved the problem, see thread for more details.
> Anyhow, rule 1: anyone on FreeBSD who urges you to change the 
> /usr/include, or /usr/lib. or /usr/share stuff is not your friend.  Know 
> that there are possible exceptions: Linuxer's apparently have far less 
> respect for the system directories than FreeBSDers have, so that advice 
> would be less bad on one of those hosts.  On FreeBSD, there is a very 
> healthy respect maintained between system software, and user-installed 
> software, which is usually stuck in /usr/local/*.  After you get to know 
> your way around, you might modify that, but it's rare even then.  Some 
> folks like /opt instead of /usr/local, but there is *always* respect (in 
> FreeBSD) for the sytem dirs defined in man page hier(7).
> My advice was (and still is) go looking in your port, using the "file" 
> command, to locate text files, and find out what dependencies your 
> software wants.  That magic.h file comes from *somewhere* and it's very 
> likely writen up for you.  Also, try googling "magic.h"

Good advice, in general, but may not help him here.  The file he's 
looking for *is* part of the base system and *should* be in 
/usr/include.  The real problem he needs to solve is, why isn't this 
file getting installed on his system?  It's present on both my -CURRENT 
and -STABLE systems, where it belongs:

kutulu at basement:/usr/src/lib/libmagic$ ls /usr/include/magic.h
4 -r--r--r--  1 root  wheel  2785 Feb  3 11:02 /usr/include/magic.h

The header (part of the file utility, contrib/file) is the interface for 
the libmagic library, again part of the base system:

kutulu at basement:/usr/src/lib/libmagic$ ls /usr/lib/*
  52 -r--r--r--  1 root  wheel  52848 Mar  2 22:30 /usr/lib/


More information about the freebsd-ports mailing list