2007-05-14 09:55:24 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<HTML>
|
|
|
|
|
|
|
|
<HEAD>
|
|
|
|
<TITLE>
|
|
|
|
libsndfile : pkg-config
|
|
|
|
</TITLE>
|
2004-02-13 11:55:42 +00:00
|
|
|
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
2009-11-30 08:00:42 +00:00
|
|
|
<LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
|
|
|
|
<LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
|
2007-05-14 09:55:24 +00:00
|
|
|
</HEAD>
|
|
|
|
|
2004-04-25 13:09:52 +00:00
|
|
|
<BODY>
|
2007-05-14 09:55:24 +00:00
|
|
|
|
|
|
|
<BR>
|
|
|
|
<H1>libsndfile and pkg-config</H1>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
From version 1.0.0 libsndfile has had the ability to read and write files of
|
|
|
|
greater than 2 Gig in size on most OSes even if sizeof (long) == 4.
|
|
|
|
OSes which support this feature include Linux (2.4 kernel, glibc6) on x86, PPC and
|
2009-12-02 09:23:51 +00:00
|
|
|
probably others, Win32, MacOS X, *BSD, Solaris and probably others.
|
2007-05-14 09:55:24 +00:00
|
|
|
OSes on 64 bit processors where the default compile environment is LP64 (longs and
|
|
|
|
pointers are 64 bit ie Linux on DEC/Compaq/HP Alpha processors) automatically
|
|
|
|
support large file access.
|
|
|
|
</P>
|
|
|
|
<P>
|
|
|
|
Other OSes including Linux on 32 bit processors, 32 bit Solaris and others require
|
|
|
|
special compiler flags to add large file support.
|
|
|
|
This applies to both the compilation of the library itself and the compilation of
|
|
|
|
programs which link to the library.
|
|
|
|
</P>
|
|
|
|
<P>
|
2009-12-02 09:23:51 +00:00
|
|
|
Note : People using Win32, MacOS (both OS X and pre-OS X) or *BSD can disregard the
|
2007-05-14 09:55:24 +00:00
|
|
|
rest of this document as it does not apply to either of these OSes.
|
|
|
|
</P>
|
|
|
|
<P>
|
|
|
|
The <B>pkg-config</B> program makes finding the correct compiler flag values and
|
|
|
|
library location far easier.
|
|
|
|
During the installation of libsndfile, a file named <B>sndfile.pc</B> is installed
|
|
|
|
in the directory <B>${libdir}/pkgconfig</B> (ie if libsndfile is installed in
|
|
|
|
<B>/usr/local/lib</B>, <B>sndfile.pc</B> will be installed in
|
2004-02-14 03:02:56 +00:00
|
|
|
<B>/usr/local/lib/pkgconfig/</B>).
|
2007-05-14 09:55:24 +00:00
|
|
|
</P>
|
|
|
|
<P>
|
|
|
|
In order for pkg-config to find sndfile.pc it may be necessary to point the
|
|
|
|
environment variable <B>PKG_CONFIG_PATH</B> in the right direction.
|
|
|
|
</P>
|
|
|
|
<PRE>
|
|
|
|
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Then, to compile a C file into an object file, the command would be:
|
|
|
|
</P>
|
|
|
|
<PRE>
|
|
|
|
gcc `pkg-config --cflags sndfile` -c somefile.c
|
|
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
and to link a number of objects into an executable that links against libsndfile,
|
|
|
|
the command would be:
|
|
|
|
</P>
|
|
|
|
<PRE>
|
|
|
|
gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
Obviously all this can be rolled into a Makefile for easier maintenance.
|
|
|
|
</P>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|