I'm trying to make a pluging for XMMS (=shared object) using Autoconf and Automake. Just started using these tools yesterday and after some trial and error I've finaly managed to get something working (or so I thought). When XMMS tries to load the plugin, it spits out the following error:
invalid ELF header.
So now I'm stuck... Here's what I do;
aclocal
autoconf
touch README AUTHORS NEWS ChangeLog
automake -a
./configure
This produces a .la file which I rename to .so and copy to the XMMS plugin directory. Don't know if this is a 'valid' way of doing this.
So what am I doing wrong? I don't get it anymore... Been reading a bunch of tutorials, but the problem with these is that old and new ways of building libraries are mixed...... which is very confusing if you're new to this...
The files;
configure.ac
Code:
AC_INIT([LiQuiD-MP3], [0.1],
[myname <***>],
[liquidmp3])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_CONFIG_FILES([
Makefile
src/Makefile])
AC_OUTPUT()
Makefile.am
Code:
EXTRA_DIST = reconf
SUBDIRS = src
src/Makefile.am
Code:
lib_LTLIBRARIES = libliquidmp3.la
AM_CXXFLAGS = -I/usr/include/glib-1.2 -I/usr/lib/glib/include
libliquidmp3_la_SOURCES = liquidmp3_xmms.cpp \
...etc.cpp
NB, The sourcecode itself is ok. When compiling it by hand (g++ -shared ....) al goes fine and the plugin works.