Wednesday, July 23, 2008

autotools mono integration

In short:

configure.ac:

AC_ARG_VAR([MCS], [the Mono C# compiler])

PKG_CHECK_EXISTS([mono])

MONO_PATH="`$PKG_CONFIG --variable=exec_prefix mono`/bin"

AC_PATH_PROG([MCS], [gmcs], [AC_MSG_ERROR([not found])], [$MONO_PATH])


Makefile.am:

EXEEXT=.dll

LINK=$(MCS) -target:library -out:$@

bin_PROGRAMS=foo

foo_SOURCES=foo.cs

foo_LDADD=$(foo_SOURCES)

No comments: