File rub-external-l4env.patch of Package rub-l4-secserv

---
 configure.in |   42 ++++++++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 12 deletions(-)

--- configure.in.orig
+++ configure.in
@@ -100,7 +100,9 @@ AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_CHECK_GCC_VERSION
 AC_CHECK_CXX_VERSION
-AC_PROG_FIG2DEV
+if test "x$with_external_l4env" = "x" -o "x$with_external_l4env" = "xno"; then
+    AC_PROG_FIG2DEV
+fi
 AC_PROG_LN_S
 AC_DISABLE_STATIC         dnl Prevent libtool from generating static libraries
 AC_PROG_LIBTOOL
@@ -194,6 +196,15 @@ dnl ====================================
 AC_PREFIX_DEFAULT( `pwd` )
 
 dnl ============================================================================
+dnl whether to use an installed l4env
+dnl ============================================================================
+AC_ARG_WITH(external-l4env,
+  AS_HELP_STRING([--with-external-l4env[=directory]], [Use an installed l4env in directory]),[],[with_external_l4env=no])
+if test "x$with_external_l4env" = "xyes"; then
+    with_external_l4env=/usr
+fi
+
+dnl ============================================================================
 dnl Check whether we can build the QX cpp unit testing client
 dnl ============================================================================
 AC_MSG_CHECKING(whether to build the QxCppUnit Application)
@@ -361,11 +372,17 @@ dnl ====================================
 dnl Define directory of binaries, libraries and include files (hypervisor)
 dnl ============================================================================
 
-dnl hypervisor_libdir=`pwd`'/hypervisor/lib/x86_586'
-hypervisor_includedir=`pwd`'/hypervisor/include'
-hypervisor_bindir=`pwd`'/hypervisor/bin'
+if test "x$with_external_l4env" = "xno"; then
+    hypervisor_includedir=`pwd`'/hypervisor/include'
+    hypervisor_bindir=`pwd`'/hypervisor/bin'
+    hypervisor_libdir=`pwd`'/hypervisor/lib/x86_586'
+else
+    hypervisor_includedir="$with_external_l4env/include"
+    hypervisor_bindir="$with_external_l4env/bin"
+    hypervisor_libdir="$with_external_l4env/lib/x86_586"
+fi
 
-dnl AC_SUBST(hypervisor_libdir)
+AC_SUBST(hypervisor_libdir)
 AC_SUBST(hypervisor_includedir)
 AC_SUBST(hypervisor_bindir)
 
@@ -400,6 +417,7 @@ if test "$subsystem" = "perseus"; then
 elif test "$subsystem" = "hyper"; then
   AC_MSG_RESULT(hyper)
   AC_DEFINE( SUBSYSTEM_HYPER, 1, [Defines whether the Hypervisor subsystem should be used.] )
+  dnl FIXME - handle $with_external_l4env
   SUBSYSTEM_LDFLAGS="-L\$(top_builddir)/hypervisor/lib"
   SUBSYSTEM_LIBS=""
   SUBSYSTEM_CFLAGS=""
@@ -414,8 +432,8 @@ else
 
   dnl NOTE: The order of these two paths is important!
   SUBSYSTEM_LDFLAGS="\
-	-L\$(top_builddir)/hypervisor/lib/x86_586/l4v2 \
-	-L\$(top_builddir)/hypervisor/lib/x86_586"
+	-L\$(hypervisor_libdir)/l4v2 \
+	-L\$(hypervisor_libdir)"
 
   SUBSYSTEM_LIBS="\
 	-lgeneric_ts -ll4env -ll4rm -ldm_generic \
@@ -440,8 +458,8 @@ else
 	-I\$(hypervisor_includedir)/x86 \
         -I\$(hypervisor_includedir)/l4v2 \
 	-I\$(hypervisor_includedir) \
-	-I\$(top_builddir)/hypervisor/include/uclibc \
-	-I\$(top_builddir)/hypervisor/include/l4/util"
+	-I\$(hypervisor_includedir)/uclibc \
+	-I\$(hypervisor_includedir)/l4/util"
   dnl NOTE: The order of these paths is important!
   SUBSYSTEM_CPPFLAGS="\
 	-DL4API_l4v2 \
@@ -450,13 +468,13 @@ else
         -I\$(hypervisor_includedir)/l4v2 \
 	-I\$(hypervisor_includedir) \
 	-I\$(hypervisor_includedir)/uclibc \
-	-I\$(top_builddir)/hypervisor/include/l4/util"
+	-I\$(hypervisor_includedir)/l4/util"
 
   LINKER_SCRIPT="\
-	\$(top_builddir)/hypervisor/lib/x86_586/main_stat.ld"
+	\$(hypervisor_libdir)/main_stat.ld"
 
   CRT0="\
-	\$(top_builddir)/hypervisor/lib/x86_586/crt0.o"
+	\$(hypervisor_libdir)/crt0.o"
 fi
 
 AC_SUBST(subsystem)
openSUSE Build Service is sponsored by