Free Web Space | BlueHost Review  


Homepage: http://linuxhelp.150m.com/


Compiling Lame & mp3x.


While looking around the lame source code I found that lame has an mp3 frame analyzer, called mp3x. I thought it would be interesting to take a look at it, but quickly ran in problems trying to compile it. This article assumes you have been following the article on compiling mplayer, however, I will try and make it self contained, as possible.

It is assumed you already have the lame source code in the directory /mplayer

lame-3.97b2.tar.gz from lame.sourceforge.net

The first problem, was that current Linux distributions do not include the development files for GTK+, so if you try configuring lame with the --enable-mp3x option, you will get an error like:

checking for GTK - version >= 1.2.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.

If you compile GTK, without the corresponding GLIB files, you will get an error like:

checking for GLIB - version >= 1.2.8... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GLIB was incorrectly installed
*** or that you have moved GLIB since it was installed. In the latter case, you
*** may want to edit the glib-config script: /opt/gnome/bin/glib-config

So, download the following extra files and save them in /mplayer

glib-1.2.8.tar.gz
gtk+-1.2.9.tar.gz
patch-gtk+-1.2.9-1.2.10.gz from www.gtk.org

Do not bother to download glib-1.2.9.tar.gz or patch-glib-1.2.9-1.2.10 as versions 1.2.9 and 1.2.10 do not compile. I got the error:

gstrfuncs.c: In function 'g_printf_string_upper_bound':
gstrfuncs.c:870: error: syntax error before string constant

Unpack the archives:

 for a in glib-1.2.8.tar.gz gtk+-1.2.9.tar.gz; do tar zxf $a; done
 gunzip patch-gtk+-1.2.9-1.2.10.gz

Patch the 1.2.9 source to get the 1.2.10 version:

 cd /mplayer
 patch -p1 < patch-gtk+-1.2.9-1.2.10

 cd /mplayer/glib-1.2.8
 ./configure
 make
 make install

 GLIB_CONFIG=/usr/local/bin  (this might not be necessary, but doesn't hurt)
 LD_LIBRARY_PATH=/usr/local/lib/

 cd /mplayer/gtk+-1.2.9
 ./configure --disable-glibtest  (this option is necessary for it to compile)
 make
 make install

 cd /mplayer/lame-3.97
 ./configure --enable-mp3x --with-fileio=sndfile
 make
 make install

And now you should have lame and mp3x in /usr/local/bin/.

mp3x probably wasn't worth the effort, but apparently similar problems arise whenever you have to compile a GTK+ 1.2 application, so I figured I would write my experience up, and share it with you all.