# Patch created by krokas
# Date: Mon Aug 28 17:00:19 MSD 2006
# Repository: pnet
# Comments:
# 
#### End of Preamble ####

#### Patch data follows ####
Index: configure.in
===================================================================
RCS file: /sources/dotgnu-pnet/pnet/configure.in,v
retrieving revision 1.217
diff -c -r1.217 configure.in
*** configure.in	11 Jul 2006 17:29:37 -0000	1.217
--- configure.in	28 Aug 2006 13:00:15 -0000
***************
*** 132,147 ****
  	fi
  ])
  
! AC_DEFUN([AC_SEARCH_LIBJIT], [
  	AC_MSG_CHECKING([location of libjit])
! 	AC_LIBJIT(../libjit/include/jit,jit.h, -ljit -L../../libjit/jit/.libs, -I../../libjit/include, "../libjit")
  	AC_LIBJIT(/usr/include/jit, jit.h, -ljit, -I/usr/include, "/usr")
  	AC_LIBJIT(/usr/local/include/jit, jit.h, -ljit, -I/usr/local/include, "/usr/local")
  ])
  
  AC_SUBST(JIT_LIBS)
  AC_SUBST(JIT_INCLUDE)
  search_libjit=false
  AC_ARG_WITH(jit,
  [  --with-jit             Use the Just In Time compiler],
  [
--- 132,177 ----
  	fi
  ])
  
! AC_DEFUN([AC_SEARCH_DYNAMIC_LIBJIT], [
  	AC_MSG_CHECKING([location of libjit])
! 	AC_LIBJIT(../libjit/include/jit, jit.h, -ljit -L../../libjit/jit/.libs, -I../../libjit/include, "../libjit")
  	AC_LIBJIT(/usr/include/jit, jit.h, -ljit, -I/usr/include, "/usr")
  	AC_LIBJIT(/usr/local/include/jit, jit.h, -ljit, -I/usr/local/include, "/usr/local")
  ])
  
+ AC_DEFUN([AC_SEARCH_STATIC_LIBJIT], [
+ 	AC_MSG_CHECKING([location of libjit])
+ 	AC_LIBJIT(../libjit/include/jit, jit.h, ../../libjit/jit/.libs/libjit.a -L../../libjit/jit/.libs, -I../../libjit/include, "../libjit")
+ 	AC_LIBJIT(/usr/include/jit, jit.h, /usr/lib/libjit.a, -I/usr/include, "/usr")
+ 	AC_LIBJIT(/usr/local/include/jit, jit.h, /usr/local/lib/libjit.a, -I/usr/local/include, "/usr/local")
+ ])
+ 
  AC_SUBST(JIT_LIBS)
  AC_SUBST(JIT_INCLUDE)
  search_libjit=false
+ 
+ AC_ARG_WITH(libjit,
+ [ --with-libjit		Include static libjit in ilrun],
+ [
+    	withlibjit=yes
+ 	if test x$withval = xyes ; then
+ 		search_libjit=true
+ 		AC_DEFINE([IL_USE_JIT], 1, [Use the just in time compiler])
+ 		withjit=yes
+ 		withffi=no
+ 	elif test x$withval != xyes ; then
+ 		JIT_LIBS="$LIBS -L$withval/lib -ljit"
+ 		JIT_INCLUDE="-I$withval/include"
+ 		search_libjit=false
+ 		AC_DEFINE([IL_USE_JIT], 1, [Use the just in time compiler])
+ 		withjit=yes
+ 		withffi=no
+ 	fi
+ ],
+ [
+     withlibjit=no
+ ])
+ 
  AC_ARG_WITH(jit,
  [  --with-jit             Use the Just In Time compiler],
  [
***************
*** 166,184 ****
  dnl Make sure one engine type is selected
  
  if test x$withjit = xyes ; then
! 	if test x$withcvm = xyes ; then
  		AC_MSG_ERROR(Only one engine type can be selected. Either --with-jit or --with-cvm.)
! 	fi
! elif test x$withjit = xno ; then
! 	if test x$withcvm = xno ; then
! 		AC_DEFINE([IL_USE_CVM], 1, [Use the CVM interpreter])
! 		withcvm=yes
  	fi
  fi
  
  if $search_libjit
  then
!         AC_SEARCH_LIBJIT()
  fi
  dnl end of libjit check
  
--- 196,223 ----
  dnl Make sure one engine type is selected
  
  if test x$withjit = xyes ; then
!         if test x$withcvm = xyes ; then
  		AC_MSG_ERROR(Only one engine type can be selected. Either --with-jit or --with-cvm.)
! 
! 	elif test x$withjit = xno ; then
! 		if test x$withcvm = xno ; then
! 			if test x$withlibjit = xno ; then
! 				AC_DEFINE([IL_USE_CVM], 1, [Use the CVM interpreter])
! 				withcvm=yes
! 			elif test x$withlibjit = xyes ; then
! 				withjit=yes		
! 			fi
! 		fi
  	fi
  fi
  
  if $search_libjit
  then
! 	if test x$withlibjit = xyes; then
! 		AC_SEARCH_STATIC_LIBJIT()
! 	elif test x$withlibjit = xno; then
! 		AC_SEARCH_DYNAMIC_LIBJIT()
! 	fi
  fi
  dnl end of libjit check
  
#### End of Patch data ####
