Get log stream
[petitboot] / configure.ac
index 88e5833ca213fa0897688ed6d9779d4ce4c72343..340cdbf8da0ed0bd7aa4c2e361efc47246a3ed3b 100644 (file)
@@ -29,9 +29,28 @@ fi
 AC_PROG_CC
 AC_PROG_INSTALL
 
-PKG_CHECK_MODULES([twin], [libtwin])
-
-mkdir -p discover ui/test ui/common lib/talloc lib/pb-protocol lib/list \
-             lib/waiter lib/log
+AC_ARG_WITH([twin],
+       [AS_HELP_STRING([--with-twin],
+               [build GUI versions using the twin window system])],
+       [],
+       [with_twin=check])
+
+PBTWIN=
+LIBTWIN=
+AS_IF([test "x$with_twin" != xno],
+       [PKG_CHECK_MODULES([twin], [libtwin], [],
+               [AC_MSG_RESULT([$twin_PKG_ERRORS])
+               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 lib/list lib/log lib/pb-protocol lib/talloc lib/waiter \
+       test ui/common ui/ncurses ui/test ui/twin
 
 AC_OUTPUT