From 1bf94924d6ae35c4369006ddbb6405ff0af74fe8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 9 Jun 2008 04:18:34 +0200 Subject: Use system lib directories and pkg-config directory from target when specified. --- Makefile | 2 +- configure | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 014b8450..d8b40237 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ objects = account.o bitlbee.o crypting.o help.o ipc.o irc.o irc_commands.o nick. headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h subdirs = lib protocols -ifeq ($(ARCH),Windows) +ifeq ($(TARGET),i586-mingw32msvc) objects += win32.o else objects += unix.o conf.o log.o diff --git a/configure b/configure index a83bd94d..23e0a5c3 100755 --- a/configure +++ b/configure @@ -19,6 +19,7 @@ libevent='/usr/' pidfile='/var/run/bitlbee.pid' ipcsocket='/var/run/bitlbee.sock' pcdir='$prefix/lib/pkgconfig' +systemlibdirs="/lib /usr/lib /usr/local/lib" msn=1 jabber=1 @@ -108,6 +109,7 @@ CONFIG=$config INCLUDEDIR=$includedir PCDIR=$pcdir +TARGET=$target ARCH=$arch CPU=$cpu OUTFILE=bitlbee @@ -133,13 +135,18 @@ cat<config.h #define CPU "$cpu" EOF + + if [ -n "$target" ]; then - PKG_CONFIG_PATH=/usr/$target/lib/pkgconfig + PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig + export PKG_CONFIG_LIBDIR PATH=/usr/$target/bin:$PATH CC=$target-cc LD=$target-ld + systemlibdirs="/usr/$target/lib" fi + if [ "$debug" = "1" ]; then [ -z "$CFLAGS" ] && CFLAGS=-g echo 'DEBUG=1' >> Makefile.settings @@ -342,7 +349,7 @@ fi; echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings -for i in /lib /usr/lib /usr/local/lib; do +for i in $systemlibdirs; do if [ -f $i/libresolv.a ]; then echo '#define HAVE_RESOLV_A' >> config.h echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings -- cgit v1.2.3