annotate src/libsndfile-1.0.25/doc/pkgconfig.html @ 88:fe7c3a0b0259

Add some MinGW builds
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 13:49:36 +0000
parents 545efbb81310
children
rev   line source
cannam@85 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
cannam@85 2 <HTML>
cannam@85 3
cannam@85 4 <HEAD>
cannam@85 5 <TITLE>
cannam@85 6 libsndfile : pkg-config
cannam@85 7 </TITLE>
cannam@85 8 <META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
cannam@85 9 <LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
cannam@85 10 <LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
cannam@85 11 </HEAD>
cannam@85 12
cannam@85 13 <BODY>
cannam@85 14
cannam@85 15 <BR>
cannam@85 16 <H1>libsndfile and pkg-config</H1>
cannam@85 17
cannam@85 18 <P>
cannam@85 19 From version 1.0.0 libsndfile has had the ability to read and write files of
cannam@85 20 greater than 2 Gig in size on most OSes even if sizeof (long) == 4.
cannam@85 21 OSes which support this feature include Linux (2.4 kernel, glibc6) on x86, PPC and
cannam@85 22 probably others, Win32, MacOS X, *BSD, Solaris and probably others.
cannam@85 23 OSes on 64 bit processors where the default compile environment is LP64 (longs and
cannam@85 24 pointers are 64 bit ie Linux on DEC/Compaq/HP Alpha processors) automatically
cannam@85 25 support large file access.
cannam@85 26 </P>
cannam@85 27 <P>
cannam@85 28 Other OSes including Linux on 32 bit processors, 32 bit Solaris and others require
cannam@85 29 special compiler flags to add large file support.
cannam@85 30 This applies to both the compilation of the library itself and the compilation of
cannam@85 31 programs which link to the library.
cannam@85 32 </P>
cannam@85 33 <P>
cannam@85 34 Note : People using Win32, MacOS (both OS X and pre-OS X) or *BSD can disregard the
cannam@85 35 rest of this document as it does not apply to either of these OSes.
cannam@85 36 </P>
cannam@85 37 <P>
cannam@85 38 The <B>pkg-config</B> program makes finding the correct compiler flag values and
cannam@85 39 library location far easier.
cannam@85 40 During the installation of libsndfile, a file named <B>sndfile.pc</B> is installed
cannam@85 41 in the directory <B>${libdir}/pkgconfig</B> (ie if libsndfile is installed in
cannam@85 42 <B>/usr/local/lib</B>, <B>sndfile.pc</B> will be installed in
cannam@85 43 <B>/usr/local/lib/pkgconfig/</B>).
cannam@85 44 </P>
cannam@85 45 <P>
cannam@85 46 In order for pkg-config to find sndfile.pc it may be necessary to point the
cannam@85 47 environment variable <B>PKG_CONFIG_PATH</B> in the right direction.
cannam@85 48 </P>
cannam@85 49 <PRE>
cannam@85 50 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cannam@85 51 </PRE>
cannam@85 52
cannam@85 53 <P>
cannam@85 54 Then, to compile a C file into an object file, the command would be:
cannam@85 55 </P>
cannam@85 56 <PRE>
cannam@85 57 gcc `pkg-config --cflags sndfile` -c somefile.c
cannam@85 58 </PRE>
cannam@85 59 <P>
cannam@85 60 and to link a number of objects into an executable that links against libsndfile,
cannam@85 61 the command would be:
cannam@85 62 </P>
cannam@85 63 <PRE>
cannam@85 64 gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
cannam@85 65 </PRE>
cannam@85 66
cannam@85 67 <P>
cannam@85 68 Obviously all this can be rolled into a Makefile for easier maintenance.
cannam@85 69 </P>
cannam@85 70 </BODY>
cannam@85 71 </HTML>