2004-11-26 Martin Baulig <martin@ximian.com>
[mono.git] / configure.in
index 224c3402862be6af4dd3cb0d1d5df46f44f8c995..6cd2572ca5bd534d052cf569f82bf8ca4d3015f8 100644 (file)
@@ -6,6 +6,13 @@ AM_MAINTAINER_MODE
 
 AC_PROG_LN_S
 
+# In case of cygwin, override LN_S, irrespective of what it determines.
+# The build uses cygwin, but the actual runtime doesn't.
+case $host_os in
+*cygwin* ) LN_S='cp -p';;
+esac
+
+
 dnl
 dnl libgc checks
 dnl
@@ -358,6 +365,11 @@ fi
 AC_ARG_WITH(sigaltstack, [  --with-sigaltstack=yes,no      enable/disable support for sigaltstack],[],[with_sigaltstack=no])
 
 AC_ARG_WITH(static_mono, [  --with-static_mono=yes,no      link mono statically to libmono (faster)],[],[with_static_mono=yes])
+
+if test "x$enable_static" = "xno"; then
+   with_static_mono=no
+fi
+
 AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
 
 # assembly bundle support, see metadata/make-bundle.pl for more info
@@ -1458,6 +1470,54 @@ AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(LDFLAGS)
 
+mono_build_root=`pwd`
+AC_SUBST(mono_build_root)
+
+if test x$USEJIT = xtrue; then
+  mono_runtime=mono/mini/mono
+else
+  mono_runtime=mono/interpreter/mint
+fi
+AC_SUBST(mono_runtime)
+
+mono_cfg_root=$mono_build_root/runtime
+if test x$platform_win32 = xyes; then
+  mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
+else
+  mono_cfg_dir=$mono_cfg_root/etc
+fi
+AC_SUBST(mono_cfg_dir)
+
+AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
+
+AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
+[   depth=../../../..
+    case $srcdir in
+    [\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
+    .) reldir=$depth ;;
+    *) reldir=$depth/$srcdir ;;
+    esac
+    $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
+    cd runtime/etc/mono/1.0
+    rm -f machine.config
+    $LN_S $reldir/data/net_1_1/machine.config machine.config
+    cd $depth
+],[LN_S='$LN_S'])
+
+AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
+[   depth=../../../..
+    case $srcdir in
+    [\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
+    .) reldir=$depth ;;
+    *) reldir=$depth/$srcdir ;;
+    esac
+    $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
+    cd runtime/etc/mono/2.0
+    rm -f machine.config
+    $LN_S $reldir/data/net_2_0/machine.config machine.config
+    cd $depth
+],[LN_S='$LN_S'])
+
 AC_OUTPUT([
 Makefile
 mint.pc
@@ -1492,8 +1552,6 @@ mono/mini/Makefile
 mono/profiler/Makefile
 ikvm-jni/Makefile
 runtime/Makefile
-runtime/net_1_1/Makefile
-runtime/net_2_0/Makefile
 scripts/Makefile
 man/Makefile
 web/Makefile