Hookup the --with-twin configure option
authorGeoff Levand <geoffrey.levand@am.sony.com>
Fri, 27 Feb 2009 14:53:57 +0000 (14:53 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 23 Mar 2009 10:47:55 +0000 (21:47 +1100)
Add some missing makefile parts to make the --with-twin configure
option work properly.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Makefile.in
configure.ac
rules.mk

index 47adfd6a7fd50fb7596161ddfe4db6e8a1dbf817..ff5e6f4797031b6f2c17ba8de2d5166539cf2386 100644 (file)
@@ -11,6 +11,8 @@ DEFS = @DEFS@
 CPPFLAGS = @CPPFLAGS@ $(DEFS)
 
 # dependencies
+PBTWIN = @PBTWIN@
+LIBTWIN = @LIBTWIN@
 twin_CFLAGS = @twin_CFLAGS@
 twin_LDFLAGS = @twin_LIBS@
 
index 467104a67fd75a390a6b00c87962a87f976ed5a0..117c065a368945cd60072f96318e83457575e938 100644 (file)
@@ -35,6 +35,7 @@ AC_ARG_WITH([twin],
        [],
        [with_twin=check])
 
+PBTWIN=
 LIBTWIN=
 AS_IF([test "x$with_twin" != xno],
        [PKG_CHECK_MODULES([twin], [libtwin], [],
@@ -42,13 +43,13 @@ AS_IF([test "x$with_twin" != xno],
                AC_MSG_RESULT([Consider adjusting PKG_CONFIG_PATH environment variable])])
        AC_CHECK_LIB([twin], [main],
                [AC_SUBST([LIBTWIN], ["-ltwin"])
+                       AC_SUBST([PBTWIN], ["y"])
                        AC_DEFINE([HAVE_LIBTWIN], [1], [Define if you have libtwin])],
                [if test "x$with_twin" != xcheck; then
                        AC_MSG_FAILURE([--with-twin was given, but test for twin failed])
                fi],
                [${twin_LIBS}])])
 
-
 mkdir -p discover ui/test ui/common lib/talloc lib/pb-protocol lib/list \
              lib/waiter lib/log
 
index 0eb4cab48eac783a8d1add318c89af3401131807..dd6562ca1e615cf2861ac44e60cb2209dad5f4f5 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -8,12 +8,15 @@ CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(builddir)
 DEFS += '-DPREFIX="$(prefix)"' '-DPKG_SHARE_DIR="$(pkgdatadir)"' \
        '-DLOCAL_STATE_DIR="$(localstatedir)"'
 
-#uis = ui/twin/pb-twin
 uis = ui/test/pb-test
 #parsers = native yaboot kboot
 parsers = kboot
 artwork = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
 
+ifeq ($(PBTWIN),y)
+       uis += ui/twin/pb-twin
+endif
+
 log_objs = lib/log/log.o
 talloc_objs = lib/talloc/talloc.o
 list_objs = lib/list/list.o
@@ -27,7 +30,7 @@ parser_test_objs = parser-test.o $(parser_objs)
 all: $(uis) discover/pb-discover
 
 # twin gui
-ui/twin/pb-twin: LDFLAGS+=$(twin_LDFLAGS)
+ui/twin/pb-twin: LDFLAGS+=$(twin_LDFLAGS) $(LIBTWIN)
 ui/twin/pb-twin: CFLAGS+=$(twin_CFLAGS)
 
 pb_twin_objs = ui/twin/pb-twin.o ui/common/devices.o