diff options
author | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2016-10-20 04:11:35 -0200 |
---|---|---|
committer | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2016-10-20 04:11:35 -0200 |
commit | c6b6ff1e4168c2eb4311e185887d55d722fc5e24 (patch) | |
tree | 9bb5b9366ff027d99cc1cf5e02c75d3922e92124 | |
parent | 1e39599bb80ccb7a65d7031a2c37ca95a1360a14 (diff) | |
download | efl-c6b6ff1e4168c2eb4311e185887d55d722fc5e24.tar.gz |
Attempts to try add support for C# in EFL's automake
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | m4/efl_mono.m4 | 97 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/Makefile_Csharp_Helper.am | 11 | ||||
-rw-r--r-- | src/Makefile_Eolian_Csharp.am | 25 | ||||
-rw-r--r-- | src/bin/eolian_csharp/main.cs | 9 |
6 files changed, 108 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac index 079485232f..93faf3365b 100644 --- a/configure.ac +++ b/configure.ac @@ -317,6 +317,7 @@ AC_LANG(C) AC_PROG_CC_C99 AM_PROG_CC_C_O AC_PROG_SED +AC_PROG_MCS AM_CONDITIONAL([BUILD_EFL_NATIVE], [test "x${cross_compiling}" = "xno"]) @@ -365,6 +366,13 @@ fi AM_CONDITIONAL([EFL_ENABLE_COVERAGE], [test "${want_coverage}" = "yes"]) +if test "x${HAVE_MCS}" = "x1"; then + have_mcs="yes" +else + have_mcs="no" +fi +AM_CONDITIONAL([HAVE_MCS], [test "x${have_mcs}" = "xyes"]) + #### Checks for libraries # check unit testing library @@ -5993,6 +6001,7 @@ echo " Cryptography..: ${build_crypto}" echo " X11...........: ${with_x11}" echo " OpenGL........: ${with_opengl} ${opengl_egl}" echo " C++11.........: ${have_cxx11}" +echo " C#............: ${have_mcs}" echo " JavaScript....: ${want_js}" echo " JavaScript flg: $EINA_JS_LIBS" echo "Eina............: yes (${features_eina} unwind=$have_unwind)" diff --git a/m4/efl_mono.m4 b/m4/efl_mono.m4 index 8bba44afec..807526ee24 100644 --- a/m4/efl_mono.m4 +++ b/m4/efl_mono.m4 @@ -1,48 +1,46 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXXFLAGS to enable support. -# -# The first argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The second argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline C++11 support is required and that the macro -# should error out if no mode with that support is found. If specified -# 'optional', then configuration proceeds regardless, after defining -# HAVE_CXX11 if and only if a supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2016 Felipe Magno de Almeida <felipe@expertisesolutions.com.br> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. +# # ============================================================================ +# # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# # ============================================================================ +# # +# # SYNOPSIS +# # +# # AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) +# # +# # DESCRIPTION +# # +# # Check for baseline language coverage in the compiler for the C++11 +# # standard; if necessary, add switches to CXXFLAGS to enable support. +# # +# # The first argument, if specified, indicates whether you insist on an +# # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# # -std=c++11). If neither is specified, you get whatever works, with +# # preference for an extended mode. +# # +# # The second argument, if specified 'mandatory' or if left unspecified, +# # indicates that baseline C++11 support is required and that the macro +# # should error out if no mode with that support is found. If specified +# # 'optional', then configuration proceeds regardless, after defining +# # HAVE_CXX11 if and only if a supporting mode is found. +# # +# # LICENSE +# # +# # Copyright (c) 2016 Felipe Magno de Almeida <felipe@expertisesolutions.com.br> +# # +# # Copying and distribution of this file, with or without modification, are +# # permitted in any medium without royalty provided the copyright notice +# # and this notice are preserved. This file is offered as-is, without any +# # warranty. -#serial 3 - -# AC_LANG(D) +# AC_LANG(CSHARP) # ----------- -AC_LANG_DEFINE([C sharp], [csharp], [MCS], [], +AC_LANG_DEFINE([CSHARP], [csharp], [MCS], [], [ac_ext=cs ac_compile='$MCS $MCSFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' ]) -AU_DEFUN([AC_LANG_CSHARP], [AC_LANG(C sharp)]) +AU_DEFUN([AC_LANG_CSHARP], [AC_LANG(CSHARP)]) -m4_define([AC_LANG_PROGRAM(C sharp)], +m4_define([AC_LANG_PROGRAM(CSHARP)], [$1 class MyClass { @@ -52,15 +50,15 @@ class MyClass } }]) -AC_DEFUN([AC_LANG_COMPILER(C sharp)], +AC_DEFUN([AC_LANG_COMPILER(CSHARP)], [AC_REQUIRE([AC_PROG_MCS])]) AN_MAKEVAR([MCS], [AC_PROG_MCS]) AN_PROGRAM([mcs], [AC_PROG_MCS]) AC_DEFUN([AC_PROG_MCS], -[AC_LANG_PUSH(C sharp)dnl -AC_ARG_VAR([MCS], [MCS (C\#) compiler command])dnl -AC_ARG_VAR([MCSFLAGS], [MCS (C\#) compiler flags])dnl +[AC_LANG_PUSH(CSHARP)dnl +AC_ARG_VAR([MCS], [MCS (C#) compiler command])dnl +AC_ARG_VAR([MCSFLAGS], [MCS (C#) compiler flags])dnl dnl _AC_ARG_VAR_LDFLAGS()dnl m4_ifval([$1], [AC_CHECK_TOOLS(MCS, [$1])], @@ -73,6 +71,15 @@ fi if test -z "$MCS"; then AC_CHECK_PROG(MCS, mcs, mcs, , , false) fi +if test -z "$MCS"; then + HAVE_MCS=0 + AC_MSG_NOTICE([No C sharp compiler was found]) +else + HAVE_MCS=1 + AC_DEFINE(HAVE_MCS,1, + [define if the MCS compiler is available]) +fi +AC_SUBST(HAVE_MCS) ]) # Provide some information about the compiler. @@ -82,5 +89,7 @@ ac_compiler=$[2] _AC_DO_LIMIT([$ac_compiler --version >&AS_MESSAGE_LOG_FD]) m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl -AC_LANG_POP(C sharp)dnl -])# AC_PROG_CSHARP +AC_LANG_POP(CSHARP)dnl +])# AC_PROG_MCS + + diff --git a/src/Makefile.am b/src/Makefile.am index cbf258e33e..e8a19cf418 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,6 +75,7 @@ include Makefile_Elementary.am include Makefile_Cxx.am include Makefile_Eolian_Cxx.am +include Makefile_Eolian_Csharp.am include Makefile_Elua.am diff --git a/src/Makefile_Csharp_Helper.am b/src/Makefile_Csharp_Helper.am new file mode 100644 index 0000000000..7f897280ab --- /dev/null +++ b/src/Makefile_Csharp_Helper.am @@ -0,0 +1,11 @@ +AM_V_MCS = $(am__v_MCS_@AM_V@) +am__v_MCS_ = $(am__v_MCS_@AM_DEFAULT_V@) +am__v_MCS_0 = @echo " MCS " $@; + +.cs.$(OBJEXT): + cp $< $@ + +#.cs.exe: +# $(AM_V_MCS) \ +# $(MKDIR_P) $(dir $@); \ +# $(MCS) $(MCS_FLAGS) $< diff --git a/src/Makefile_Eolian_Csharp.am b/src/Makefile_Eolian_Csharp.am new file mode 100644 index 0000000000..a9c37b7095 --- /dev/null +++ b/src/Makefile_Eolian_Csharp.am @@ -0,0 +1,25 @@ + +### Library + +if HAVE_MCS +### Binary + +bin_PROGRAMS += bin/eolian_csharp/eolian_csharp + +bin_eolian_csharp_eolian_csharp_SOURCES = \ + bin/eolian_csharp/main.cs +bin_eolian_csharp_eolian_csharp_LINK = $(MCS) $(bin_eolian_csharp_eolian_csharp_SOURCES:.o=.cs) #$(patsubst %.$(OBJEXT),%.cs,$<) + +#bin_eolian_csharp_eolian_csharp_CXXFLAGS = -I$(top_builddir)/src/lib/efl \ +-I$(top_srcdir)/src/lib/eolian_cxx/ \ +@CHECK_CFLAGS@ @EINA_CFLAGS@ @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @ECORE_CXX_CFLAGS@ @EO_CFLAGS@ \ +-I$(top_srcdir)/src/bindings/cxx/eina_cxx \ +@EOLIAN_CXX_CFLAGS@ @EOLIAN_CFLAGS@ + +#bin_eolian_cxx_eolian_cxx_LDADD = @CHECK_LIBS@ @USE_EOLIAN_LIBS@ + +#bin_eolian_cxx_eolian_cxx_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@ + +include Makefile_Csharp_Helper.am + +endif diff --git a/src/bin/eolian_csharp/main.cs b/src/bin/eolian_csharp/main.cs new file mode 100644 index 0000000000..b6e0dfa148 --- /dev/null +++ b/src/bin/eolian_csharp/main.cs @@ -0,0 +1,9 @@ + +class MainClass +{ + static void Main(string[] args) + { + $2 + } +} + |