Revert "Merge branch 'master' of https://github.com/mono/mono"
[mono.git] / mono / mini / Makefile.am.in
old mode 100644 (file)
new mode 100755 (executable)
index 4cbf423..55e5f14
@@ -24,14 +24,6 @@ sgen_libs = \
        $(monodir)/mono/utils/libmonoutils.la \
        $(GLIB_LIBS) $(LIBICONV)
 
-if MOONLIGHT
-moon_libs = \
-       $(monodir)/mono/metadata/libmonoruntimemoon.la  \
-       $(monodir)/mono/io-layer/libwapi.la     \
-       $(monodir)/mono/utils/libmonoutils.la \
-       $(GLIB_LIBS) $(LIBICONV)
-endif
-
 static_libs=   \
        $(monodir)/mono/metadata/libmonoruntime-static.la       \
        $(monodir)/mono/io-layer/libwapi.la     \
@@ -47,7 +39,7 @@ sgenstatic_libs = \
 
 CLASS=$(mcs_topdir)/class/lib/net_4_5
 
-RUNTIME_EXECUTABLE = $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/runtime/mono-wrapper)
+RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_builddir)/runtime/mono-wrapper)
 
 RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
 RUNTIME_AOTCHECK = MONO_PATH=$(CLASS):. $(RUNTIME_EXECUTABLE)
@@ -75,16 +67,20 @@ genmdesc_CFLAGS = $(AM_CFLAGS)
 
 if NO_VERSION_SCRIPT
 monoldflags=$(export_ldflags)
-monobinldflags=$(export_ldflags)
+monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
 else
 monoldflags=-Wl,-version-script=$(srcdir)/ldscript $(export_ldflags)
-monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags)
+monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags) $(extra_runtime_ldflags)
 endif
 
 if HOST_WIN32
-libmono_2_0_la_LDFLAGS=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
+libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
+else
+if PLATFORM_ANDROID
+libmonoldflags= -avoid-version $(monoldflags)
 else
-libmono_2_0_la_LDFLAGS=$(monoldflags) -version-info 1:0:0
+libmonoldflags=$(monoldflags) -version-info 1:0:0
+endif
 endif
 
 if JIT_SUPPORTED
@@ -96,9 +92,30 @@ sgen_static_libraries = libmini-static.la $(sgenstatic_libs)
 endif
 
 if SUPPORT_BOEHM
-boehm_libraries = libmono-2.0.la
+boehm_libraries = libmonoboehm-2.0.la
 boehm_static_libraries = libmini-static.la $(static_libs)
-boehm_binaries  = mono
+boehm_binaries  = mono-boehm
+endif
+
+#The mono uses sgen, while libmono remains boehm
+if SUPPORT_SGEN
+mono_bin_suffix = sgen
+else
+mono_bin_suffix = boehm
+endif
+libmono_suffix = boehm
+
+if DISABLE_EXECUTABLES
+else
+mono: mono-$(mono_bin_suffix)
+       ln -sf $< $@
+
+mono.exe: mono-$(mono_bin_suffix).exe
+       ln -sf $< $@
+
+install-exec-hook:
+       (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix) mono)
+       (cd $(DESTDIR)$(libdir); shopt -s nullglob 2>/dev/null; for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done)
 endif
 
 if DISABLE_EXECUTABLES
@@ -110,7 +127,11 @@ bin_PROGRAMS = $(boehm_binaries) $(sgen_binaries)
 endif
 endif
 
+if DISABLE_EXECUTABLES
 noinst_PROGRAMS = genmdesc
+else
+noinst_PROGRAMS = genmdesc mono
+endif
 
 if DISABLE_EXECUTABLES
 shared_libraries = $(boehm_libraries) $(sgen_libraries)
@@ -134,14 +155,6 @@ else
 noinst_LTLIBRARIES = $(mini_common_lib) libmini-static.la
 endif
 
-if MOONLIGHT
-noinst_LTLIBRARIES += libmono-moon.la
-moon-do-build: $(BUILT_SOURCES) mono libmono-moon.la
-moon-do-clean: maintainer-clean-generic
-       -test -z "mono$(EXEEXT)" || rm -f mono$(EXEEXT)
-       -test -z "libmono-moon.la" || rm -f libmono-moon.la
-endif
-
 if LOADED_LLVM
 lib_LTLIBRARIES += libmono-llvm.la
 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp
@@ -149,33 +162,48 @@ libmono_llvm_la_LIBADD = $(LLVM_LIBS) $(LLVM_LDFLAGS)
 if PLATFORM_DARWIN
 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 else
-libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmono-$(API_VER).la $(libs)
+libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmonoboehm-$(API_VER).la $(libs)
 endif
 endif
 
 endif
 
-mono_SOURCES = \
+mono_boehm_SOURCES = \
        main.c
 
 mono_CFLAGS = $(AM_CFLAGS)
 
+mono_boehm_CFLAGS = $(AM_CFLAGS)
+
 AM_CPPFLAGS = $(LIBGC_CPPFLAGS)
 
-mono_sgen_SOURCES = $(mono_SOURCES)
+mono_sgen_SOURCES = \
+       main-sgen.c
+
+mono_SOURCES = \
+       main-sgen.c
+
 mono_sgen_CFLAGS = $(AM_CFLAGS)
 
 # We build this after libmono was built so it contains the date when the final
 # link was done
 if SUPPORT_BOEHM
-buildver.h: libmini-static.la
-       @echo "const char *build_date = \"`date`\";" > buildver.h
-mono-main.$(OBJEXT): buildver.h
+if DISABLE_EXECUTABLES
+buildver-boehm.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntime.la
+else
+buildver-boehm.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntime-static.la
+endif
+       @echo "const char *build_date = \"`date`\";" > buildver-boehm.h
+mono_boehm-main.$(OBJEXT): buildver-boehm.h
 endif
 
-buildver-sgen.h: libmini-static.la
+if DISABLE_EXECUTABLES
+buildver-sgen.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntimesgen.la
+else
+buildver-sgen.h: libmini-static.la $(monodir)/mono/metadata/libmonoruntimesgen-static.la
+endif
        @echo "const char *build_date = \"`date`\";" > buildver-sgen.h
-mono_sgen-main.$(OBJEXT): buildver-sgen.h
+mono_sgen-main-sgen.$(OBJEXT): buildver-sgen.h
 
 if DTRACE_G_REQUIRED
 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
@@ -195,7 +223,7 @@ if STATIC_MONO
 MONO_LIB=$(boehm_static_libraries)
 MONO_SGEN_LIB=$(sgen_static_libraries)
 else 
-MONO_LIB=libmono-2.0.la
+MONO_LIB=libmonoboehm-2.0.la
 MONO_SGEN_LIB=libmonosgen-2.0.la
 endif
 
@@ -205,7 +233,7 @@ else
 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
 endif
 
-mono_LDADD = \
+mono_boehm_LDADD = \
        $(MONO_LIB)             \
        $(GLIB_LIBS)            \
        $(LLVMMONOF)            \
@@ -213,7 +241,7 @@ mono_LDADD = \
        -lm                     \
        $(MONO_DTRACE_OBJECT)
 
-mono_LDFLAGS = \
+mono_boehm_LDFLAGS = \
        $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
 
 mono_sgen_LDADD = \
@@ -226,6 +254,14 @@ mono_sgen_LDADD = \
 
 mono_sgen_LDFLAGS = $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
 
+# if SUPPORT_SGEN
+# 
+# mono_LDADD = $(mono_sgen_LDADD)
+# mono_LDFLAGS = $(mono_sgen_LDFLAGS)
+# 
+# endif
+
+
 if DTRACE_G_REQUIRED
 
 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
@@ -240,9 +276,9 @@ endif
 
 # Create monow.exe, linked for the 'windows' subsystem
 if HOST_WIN32
-monow_LDADD = $(mono_LDADD)
-monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
-monow_SOURCES = $(mono_SOURCES)
+monow_LDADD = $(mono_boehm_LDADD)
+monow_LDFLAGS = $(mono_boehm_LDFLAGS) -mwindows
+monow_SOURCES = $(mono_boehm_SOURCES)
 endif
 
 genmdesc_SOURCES = \
@@ -353,7 +389,6 @@ common_sources = \
        local-propagation.c     \
        driver.c                \
        debug-mini.c            \
-       debug-mini.h            \
        linear-scan.c           \
        aot-compiler.c          \
        aot-runtime.c           \
@@ -371,6 +406,7 @@ common_sources = \
        tasklets.c              \
        tasklets.h              \
        simd-intrinsics.c       \
+       mini-native-types.c \
        mini-unwind.h           \
        unwind.c                \
        image-writer.h          \
@@ -381,11 +417,10 @@ common_sources = \
        mini-gc.c               \
        debugger-agent.h        \
        debugger-agent.c        \
-       debug-debugger.c        \
-       debug-debugger.h        \
        xdebug.c                        \
        mini-llvm.h                     \
-       mini-llvm-cpp.h
+       mini-llvm-cpp.h \
+       alias-analysis.c
 
 test_sources =                         \
        basic-calls.cs          \
@@ -414,26 +449,13 @@ regtests += nacl.exe
 endif
 
 if X86
-if MONO_DEBUGGER_SUPPORTED
-if PLATFORM_DARWIN
-mdb_x86 = mdb-debug-info32-darwin.s
-else
-mdb_x86 = mdb-debug-info32.s
-endif
-else
-mdb_x86 = 
-endif
-arch_sources = $(x86_sources) $(mdb_x86)
+arch_sources = $(x86_sources)
 arch_built=cpu-x86.h
 arch_define=__i386__
 endif
 
 if AMD64
-if MONO_DEBUGGER_SUPPORTED
-arch_sources = $(amd64_sources) mdb-debug-info64.s
-else
 arch_sources = $(amd64_sources)
-endif
 arch_built=cpu-amd64.h
 arch_define=__x86_64__
 endif
@@ -457,7 +479,7 @@ arch_define=__mips__
 endif
 
 if ARM
-# pick up arm_dpimacros.h and arm_fpamacros.h
+# pick up arm_dpimacros.h
 ARCH_CFLAGS = -I../arch/arm
 arch_sources = $(arm_sources)
 arch_built=cpu-arm.h
@@ -476,7 +498,7 @@ arch_built=cpu-sparc.h
 arch_define=__sparc__
 endif
 
-if S390x
+if S390X
 arch_sources = $(s390x_sources)
 arch_built=cpu-s390x.h
 arch_define=__s390__
@@ -500,35 +522,22 @@ endif
 
 if PLATFORM_DARWIN
 os_sources = $(darwin_sources) $(posix_sources)
-#monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation
-monobin_platform_ldflags=-framework CoreFoundation
+#monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
+monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
 endif
 
 libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
 libmini_la_CFLAGS = $(mono_CFLAGS)
 
-libmono_2_0_la_SOURCES =
-libmono_2_0_la_CFLAGS = $(mono_CFLAGS)
-libmono_2_0_la_LIBADD = libmini.la $(libs) $(LIBMONO_DTRACE_OBJECT)
+libmonoboehm_2_0_la_SOURCES =
+libmonoboehm_2_0_la_CFLAGS = $(mono_boehm_CFLAGS)
+libmonoboehm_2_0_la_LIBADD = libmini.la $(libs) $(LIBMONO_DTRACE_OBJECT)
+libmonoboehm_2_0_la_LDFLAGS = $(libmonoldflags)
 
 libmonosgen_2_0_la_SOURCES =
 libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS)
 libmonosgen_2_0_la_LIBADD = libmini.la $(sgen_libs) $(LIBMONO_DTRACE_OBJECT)
-
-if PLATFORM_ANDROID
-libmonosgen_2_0_la_LDFLAGS = -avoid-version
-endif
-
-if MOONLIGHT
-libmono_moon_la_SOURCES = $(libmini_la_SOURCES)
-if MOONLIGHT_BOEHM
-libmono_moon_la_CFLAGS = $(mono_CFLAGS) $(MOONLIGHT_DEFINES)
-libmono_moon_la_LIBADD = $(moon_libs) $(libgc_libs) $(LIBMONO_DTRACE_OBJECT)
-else
-libmono_moon_la_CFLAGS = $(mono_sgen_CFLAGS) $(MOONLIGHT_DEFINES)
-libmono_moon_la_LIBADD = $(moon_libs) $(LIBMONO_DTRACE_OBJECT)
-endif
-endif
+libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags)
 
 #
 # This library is shared between mono and mono-sgen, since the code in mini/ doesn't contain
@@ -691,7 +700,7 @@ docu: mini.sgm
 check-local: rcheck
 
 clean-local:
-       rm -f mono a.out gmon.out *.o buildver.h buildver-sgen.h test.exe
+       rm -f mono a.out gmon.out *.o buildver-boehm.h buildver-sgen.h test.exe
 
 pkgconfigdir = $(libdir)/pkgconfig
 
@@ -741,3 +750,9 @@ patch-automake:
 
 tags:
        etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
+
+if HAS_EXTENSION_MODULE
+else
+Makefile.am: Makefile.am.in
+       cp $< $@
+endif