[avahi] Crosscompiling Avahi onto a uClinux system
Grant Erickson
gerickson at nuovations.com
Sat Feb 9 00:20:33 PST 2008
Anthony,
I figured out the libexpat problem. It turns out that when you build
libexpat like:
cd $(objdir) && \
$(CURDIR)/$(srcdir)/configure \
CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
--build=$(build) \
--host=$(host) \
--prefix=/usr
and then install/stage it like:
unset MAKEFLAGS && \
$(MAKE) -C $(objdir) DESTDIR=$(resultdir) install
You end up with a libexpat.la that specifies "libdir='/usr/lib'". This,
unfortunately, will send Avahi's libtool off into the weeds assuming the
/usr/lib/libexpat.so will satisfy the link requirement. If you're building
on i686 and cross-compiling to ARM, MIPS or PPC, things die right there.
So, expat MUST instead be built like:
cd $(objdir) && \
$(CURDIR)/$(srcdir)/configure \
CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
--build=$(build) \
--host=$(host) \
--prefix=$(resultdir)
and then installed/staged like:
unset MAKEFLAGS && \
$(MAKE) -C $(objdir) install
Note DESTDIR is removed and replaced, to the same effect, by --prefix.
With that simple change, you can successfully build avahi-daemon and
avahi-autoipd in a cross-compile environment with:
cd $(objdir) && \
$(CURDIR)/$(srcdir)/configure \
CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) STRIP=$(STRIP) \
CPPFLAGS="-I$(resultdir)../expat/include" \
LDFLAGS="-L$(resultdir)../expat/lib" \
LIBDAEMON_CFLAGS="-I$(resultdir)../libdaemon/usr/include " \
LIBDAEMON_LIBS="-L$(resultdir)../libdaemon/usr/lib -ldaemon" \
--build=$(build) \
--host=$(host) \
--disable-dbus \
--disable-gdbm \
--disable-glib \
--disable-gobject \
--disable-gtk \
--disable-manpages \
--disable-monodoc \
--disable-python \
--disable-qt3 \
--disable-qt4 \
--enable-libdaemon \
--with-distro=none \
--with-xml=expat \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var
and install/stage it with:
unset MAKEFLAGS && \
$(MAKE) -C $(objdir) DESTDIR=$(resultdir) install
and will end up with the following in $(resultdir):
etc/
etc/avahi/
etc/avahi/avahi-autoipd.action
etc/avahi/avahi-dnsconfd.action
etc/avahi/hosts
etc/avahi/services/
etc/avahi/services/sftp-ssh.service
etc/avahi/services/ssh.service
etc/avahi/avahi-daemon.conf
usr/
usr/include/
usr/include/avahi-core/
usr/include/avahi-core/log.h
usr/include/avahi-core/lookup.h
usr/include/avahi-core/core.h
usr/include/avahi-core/rr.h
usr/include/avahi-core/publish.h
usr/include/avahi-common/
usr/include/avahi-common/cdecl.h
usr/include/avahi-common/llist.h
usr/include/avahi-common/error.h
usr/include/avahi-common/rlist.h
usr/include/avahi-common/timeval.h
usr/include/avahi-common/gccmacro.h
usr/include/avahi-common/thread-watch.h
usr/include/avahi-common/address.h
usr/include/avahi-common/simple-watch.h
usr/include/avahi-common/malloc.h
usr/include/avahi-common/domain.h
usr/include/avahi-common/strlst.h
usr/include/avahi-common/alternative.h
usr/include/avahi-common/defs.h
usr/include/avahi-common/watch.h
usr/share/
usr/share/locale/
usr/share/locale/de/
usr/share/locale/de/LC_MESSAGES/
usr/share/locale/de/LC_MESSAGES/avahi.mo
usr/share/man/
usr/share/man/man8/
usr/share/man/man1/
usr/share/man/man5/
usr/share/avahi/
usr/share/avahi/avahi-service.dtd
usr/share/avahi/service-types
usr/share/avahi/introspection/
usr/share/applications/
usr/sbin/
usr/sbin/avahi-dnsconfd
usr/sbin/avahi-daemon
usr/sbin/avahi-autoipd
usr/lib/
usr/lib/libavahi-core.so.5.0.4
usr/lib/libavahi-common.la
usr/lib/libavahi-core.la
usr/lib/libavahi-common.so.3
usr/lib/libavahi-core.so
usr/lib/libavahi-core.a
usr/lib/libavahi-common.so.3.5.0
usr/lib/avahi/
usr/lib/libavahi-common.a
usr/lib/pkgconfig/
usr/lib/pkgconfig/avahi-core.pc
usr/lib/libavahi-common.so
usr/lib/libavahi-core.so.5
usr/bin/
var/
var/run/
Good luck!
Regards,
Grant
Principal
Nuovation System Designs, LLC
More information about the avahi
mailing list