未验证 提交 faf71f36 编写于 作者: A Alexander Köplinger 提交者: GitHub

Clean up old Makefile-based build system from src/mono (#47758)

* Clean up old Makefile-based build system from src/mono

Everything is using CMake now.

* Fix extraction of MONO_CORLIB_VERSION from configure.ac

Move the version into CMakeLists.txt
上级 3e100e1a
......@@ -20,8 +20,6 @@
/src/mono/llvm @vargaz @SamMonoRT @imhameed @EgorBo
/src/mono/mono/arch @vargaz
/src/mono/mono/benchmark @SamMonoRT @naricc
/src/mono/mono/dis @lambdageek @vargaz
/src/mono/mono/eglib @vargaz @lambdageek @CoffeeFlux
/src/mono/mono/metadata @vargaz @lambdageek @thaystg @CoffeeFlux
......@@ -43,7 +41,6 @@
/src/mono/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek
/src/mono/mono/mini/interp/* @BrzVlad @vargaz
/src/mono/mono/native @egorbo @marek-safar
/src/mono/mono/profiler @BrzVlad @lambdageek
/src/mono/mono/sgen @BrzVlad @lambdageek @naricc
......@@ -56,4 +53,4 @@
/src/mono/mono/utils/mono-state* @lambdageek
/src/mono/mono/utils/mono-threads* @lambdageek @vargaz
/src/mono/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
/src/mono/netcore @marek-safar @akoeplinger @vargaz @steveisok
Makefile.in
/aclocal.m4
/autom4te.cache
/compile
/config.guess
/config.h.in
/config.h
/config.sub
/configure
/depcomp
/install-sh
/ltmain.sh
/missing
mono_crash*
\ No newline at end of file
......@@ -7,8 +7,7 @@
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
"${workspaceRoot}/mono/eglib"
],
"defines": [],
"intelliSenseMode": "clang-x64",
......@@ -18,8 +17,7 @@
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
"${workspaceRoot}/mono/eglib"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
......@@ -38,8 +36,7 @@
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
"${workspaceRoot}/mono/eglib"
],
"defines": [],
"intelliSenseMode": "clang-x64",
......@@ -50,8 +47,7 @@
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
"${workspaceRoot}/mono/eglib"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
......@@ -65,7 +61,6 @@
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
],
"defines": [
"_DEBUG",
......@@ -78,8 +73,7 @@
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}",
"${workspaceRoot}/mono",
"${workspaceRoot}/mono/eglib",
"${workspaceRoot}/support"
"${workspaceRoot}/mono/eglib"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
......
......@@ -46,47 +46,46 @@ if(ENABLE_MINIMAL)
process_enable_minimal()
endif()
function(extract_mono_corlib_version)
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/configure.ac corlib_version_line REGEX ^MONO_CORLIB_VERSION=)
if(corlib_version_line STREQUAL "")
message(FATAL_ERROR "Couldn't find MONO_CORLIB_VERSION from configure.ac")
endif()
string(REGEX REPLACE "MONO_CORLIB_VERSION=([0-9a-fA-F\-]+)" "\\1" corlib_version ${corlib_version_line})
if(corlib_version STREQUAL "")
message(FATAL_ERROR "Couldn't parse corlib version")
endif()
set(MONO_CORLIB_VERSION "\"${corlib_version}\"" PARENT_SCOPE)
endfunction()
extract_mono_corlib_version()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mono.proj")
set(ENABLE_NETCORE 1)
endif()
if(ENABLE_NETCORE)
set(DISABLE_REMOTING 1)
set(DISABLE_REFLECTION_EMIT_SAVE 1)
set(DISABLE_APPDOMAINS 1)
set(DISABLE_SHADOW_COPY 1)
set(DISABLE_CLEANUP 1)
set(DISABLE_ASSEMBLY_REMAPPING 1)
set(DISABLE_SECURITY 1)
set(DISABLE_MDB 1)
set(DISABLE_COM 1)
set(DISABLE_GAC 1)
set(DISABLE_PERFCOUNTERS 1)
set(DISABLE_ATTACH 1)
set(DISABLE_CONFIG 1)
set(DISABLE_CFGDIR_CONFIG 1)
set(DISABLE_VERIFIER 1)
else()
message(FATAL_ERROR "Building without -DENABLE_NETCORE=1 is not supported.")
endif()
#
# This is the version of the corlib-runtime interface. When
# making changes to this interface (by changing the layout
# of classes the runtime knows about, changing icall signature or
# semantics etc), change this variable.
#
# This must be unique relative to corlib interface and semantics.
#
# If you change corlib such that a runtime change is required, or
# vice versa, change this string. Examples include removing icalls,
# adding icalls, changing icall signatures, and changing type layouts
# that both sides know.
#
# It is an arbitrary string and should be parsed as such.
# A guid works and is encouraged.
#
# There is no ordering of corlib versions, no old or new,
# an exact match is required between corlib and runtime.
#
# This line is parsed by other tools, it should remain in the format they expect.
#
set(MONO_CORLIB_VERSION 1A5E0066-58DC-428A-B21C-0AD6CDAE2789)
set(ENABLE_NETCORE 1)
set(DISABLE_REMOTING 1)
set(DISABLE_REFLECTION_EMIT_SAVE 1)
set(DISABLE_APPDOMAINS 1)
set(DISABLE_SHADOW_COPY 1)
set(DISABLE_CLEANUP 1)
set(DISABLE_ASSEMBLY_REMAPPING 1)
set(DISABLE_SECURITY 1)
set(DISABLE_MDB 1)
set(DISABLE_COM 1)
set(DISABLE_GAC 1)
set(DISABLE_PERFCOUNTERS 1)
set(DISABLE_ATTACH 1)
set(DISABLE_CONFIG 1)
set(DISABLE_CFGDIR_CONFIG 1)
set(DISABLE_VERIFIER 1)
# Dependencies between options
if(DISABLE_ASSEMBLY_REMAPPING)
......
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = @MONO_SUBDIRS@
noinst_SUBDIRS = @MONO_NOINST_SUBDIRS@
DIST_SUBDIRS = $(SUBDIRS) m4
if !ENABLE_NETCORE
all: $(update_submodules)
update_submodules:
@cd $(srcdir) && scripts/update_submodules.sh
.PHONY: update_submodules
EXTRA_DIST= \
README.md \
LICENSE \
autogen.sh \
mkinstalldirs \
mono-uninstalled.pc.in \
winconfig.h \
code_of_conduct.md \
external \
mcs/class/referencesource
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
# Distribute the 'mcs' tree too
GIT_DIR ?= $(srcdir)/.git
dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -rf `find $(top_distdir)/external -path '*\.libs'`
rm -rf `find $(top_distdir)/external -path '*\.deps'`
rm -f `find $(top_distdir)/external -path '*\.o'`
rm -f `find $(top_distdir)/external -path '*\.so'`
rm -f `find $(top_distdir)/external -path '*\.lo'`
rm -f `find $(top_distdir)/external -path '*\.Plo'`
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*' -not -path '*/helix-binaries/*'`
rm -rf "$(top_distdir)/external/linker/test"
rm -rf "$(top_distdir)/external/llvm-project/lldb/test"
rm -rf "$(top_distdir)/external/llvm-project/libcxx/test"
rm -rf "$(top_distdir)/external/llvm-project/clang/test"
pkgconfigdir = $(libdir)/pkgconfig
noinst_DATA = mono-uninstalled.pc
DISTCLEANFILES= mono-uninstalled.pc
# building with monolite
.PHONY: get-monolite-latest
get-monolite-latest:
$(MAKE) -C $(mcs_topdir)/class get-monolite-latest
if BITCODE
BITCODE_CHECK=yes
endif
if DEFAULT_TESTS
CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-default.sh
else
CI_TEST_SCRIPT=$(srcdir)/scripts/ci/run-test-$(TEST_PROFILE).sh
endif
.PHONY: check-ci
check-ci:
MONO_LLVMONLY=$(BITCODE_CHECK) $(CI_TEST_SCRIPT)
.PHONY: validate do-build-mono-mcs mcs-do-clean mcs-do-tests
validate: do-build-mono-mcs
$(MAKE) mcs-do-tests
do-build-mono-mcs: mcs-do-clean
$(MAKE) all
mcs-do-clean:
cd runtime && $(MAKE) clean-local
cd mono/tests && $(MAKE) clean
mcs-do-tests:
cd runtime && $(MAKE) check-local
cd mono/tests && $(MAKE) check
.PHONY: compiler-tests mcs-do-compiler-tests
compiler-tests:
$(MAKE) test_select='TEST_SUBDIRS="tests errors"' validate
mcs-do-compiler-tests:
$(MAKE) test_select='TEST_SUBDIRS="tests errors"' mcs-do-tests
.PHONY: bootstrap-world
bootstrap-world: compiler-tests
$(MAKE) install
install:
for mydir in $(filter-out $(noinst_SUBDIRS),$(SUBDIRS)); do \
(cd $${mydir} && ${MAKE} install) \
done
update-csproj:
-rm msvc/scripts/order
-rm msvc/scripts/order.xml
-rm -rf msvc/scripts/inputs
-mkdir msvc/scripts/inputs
(cd runtime; $(MAKE) V=1 extra_targets=csproj-local)
package-inputs:
echo '<?xml version="1.0" encoding="utf-8"?>' > msvc/scripts/order.xml
echo '<root>' >> msvc/scripts/order.xml
for i in `cat msvc/scripts/order`; do \
set `echo $$i | sed -e 's/:/ /' -e 's/.input//'`; \
cat msvc/scripts/inputs/$$2.input | sed -e 's/\\\\/\\/g' -e 's/\\/\\\\/g' | \
(echo " <project dir=\"$$1\" library=\"$$2\">"; \
read boot; echo " <boot>$$boot</boot>"; \
read flags; echo " <flags>$$flags</flags>"; \
read sources;echo " <sources>$$sources</sources>"; \
read output; echo " <output>$$output</output>"; \
read built; echo " <built_sources>`echo $$built | sed 's/\\\/\\\\/g'`</built_sources>"; \
read libou; echo " <library_output>$$libou</library_output>"; \
read fx_ver; echo " <fx_version>$$fx_ver</fx_version>"; \
read profile; echo " <profile>$$profile</profile>"; \
read resxt; echo " <resources>$$resxt</resources>"; \
read resp; echo " <response>$$resp</response>"; \
echo " </project>") >> msvc/scripts/order.xml; \
done
echo "</root>" >> msvc/scripts/order.xml
# Update llvm version in configure.ac to the output of $LLVM_DIR/bin/llvm-config --version
update-llvm-version:
if test "x$$LLVM_DIR" = "x"; then echo "Set the make variable LLVM_DIR to the directory containing the LLVM installation."; exit 1; fi
REV=`$(LLVM_DIR)/bin/llvm-config --version` && sed -e "s,expected_llvm_version=.*,expected_llvm_version=\"$$REV\"," < configure.ac > tmp && mv tmp configure.ac && echo "Version set to $$REV."
update-solution-files:
cd msvc/scripts && $(MAKE) genproj.exe || exit $$?;
$(MAKE) update-csproj
$(MAKE) package-inputs
(cd msvc/scripts; mono --debug genproj.exe $(GENPROJ_ARGS))
update-solution-files-with-tests:
$(MAKE) "GENPROJ_ARGS=2012 true true" update-solution-files
endif
dnl dolt, a replacement for libtool
dnl Copyright © 2007-2008 Josh Triplett <josh@freedesktop.org>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
dnl installed when running autoconf on your project.
AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool
# Josh Triplett <josh@freedesktop.org>
AC_PATH_PROG(DOLT_BASH, bash)
AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes
if test x$DOLT_BASH = x; then
dolt_supported=no
fi
if test x$GCC != xyes; then
dolt_supported=no
fi
case $host in
i?86-*-linux*|i?86-apple-darwin*|x86_64-*-linux*|powerpc-*-linux*|powerpc64-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*|arm*-*-linux*|sparc*-*-linux*|mips*-*-linux*|x86_64-apple-darwin*|aarch64*)
pic_options='-fPIC'
;;
?86-pc-cygwin*|i?86-pc-cygwin*|i?86-pc-mingw32*)
pic_options='-DDLL_EXPORT'
;;
i?86-apple-darwin*|arm-apple-darwin*)
pic_options='-fno-common'
;;
*)
dolt_supported=no
;;
esac
if test x$dolt_supported = xno ; then
AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
else
AC_MSG_RESULT([yes, replacing libtool])
dnl Start writing out doltcompile.
cat <<__DOLTCOMPILE__EOF__ >doltcompile
#!$DOLT_BASH
__DOLTCOMPILE__EOF__
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
args=("$[]@")
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
if test x"${args@<:@$arg@:>@}" = x-o ; then
objarg=$((arg+1))
break
fi
done
if test x$objarg = x ; then
echo 'Error: no -o on compiler command line' 1>&2
exit 1
fi
lo="${args@<:@$objarg@:>@}"
obj="${lo%.lo}"
if test x"$lo" = x"$obj" ; then
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
exit 1
fi
objbase="${obj##*/}"
__DOLTCOMPILE__EOF__
dnl Write out shared compilation code.
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
libobjdir="${obj%$objbase}.libs"
if test ! -d "$libobjdir" ; then
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
mkdir_ret=$?
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
echo "$mkdir_out" 1>&2
exit $mkdir_ret
fi
fi
pic_object="$libobjdir/$objbase.o"
args@<:@$objarg@:>@="$pic_object"
__DOLTCOMPILE__EOF__
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
__DOLTCOMPILE__EOF__
fi
dnl Write out static compilation code.
dnl Avoid duplicate compiler output if also building shared objects.
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
non_pic_object="$obj.o"
args@<:@$objarg@:>@="$non_pic_object"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" || exit $?
__DOLTCOMPILE__EOF__
fi
fi
dnl Write out the code to write the .lo file.
dnl The second line of the .lo file must match "^# Generated by .*libtool"
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
{
echo "# $lo - a libtool object file"
echo "# Generated by doltcompile, not libtool"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "pic_object='.libs/${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo pic_object=none
__DOLTCOMPILE__EOF__
fi
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "non_pic_object='${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo non_pic_object=none
__DOLTCOMPILE__EOF__
fi
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
} > "$lo"
__DOLTCOMPILE__EOF__
dnl Done writing out doltcompile; substitute it for libtool compilation.
chmod +x doltcompile
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
dnl a target, so write out a libtool wrapper to handle that case.
dnl Note that doltlibtool does not handle inferred tags or option arguments
dnl without '=', because automake does not use them.
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
#!$DOLT_BASH
__DOLTLIBTOOL__EOF__
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
top_builddir_slash="${0%%doltlibtool}"
: ${top_builddir_slash:=./}
args=()
modeok=false
tagok=false
for arg in "$[]@"; do
case "$arg" in
--silent) ;;
--mode=compile) modeok=true ;;
--tag=CC|--tag=CXX) tagok=true ;;
--quiet) ;;
*) args@<:@${#args[@]}@:>@="$arg" ;;
esac
done
if $modeok && $tagok ; then
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
else
exec ${top_builddir_slash}libtool "$[]@"
fi
__DOLTLIBTOOL__EOF__
dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool'
fi
AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE)
# end dolt
])
#!/usr/bin/env bash
# Run this to generate all the initial makefiles, etc.
# Ripped off from GNOME macros version
DIE=0
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
if [ -n "$MONO_PATH" ]; then
# from -> /mono/lib:/another/mono/lib
# to -> /mono /another/mono
for i in `echo ${MONO_PATH} | tr ":" " "`; do
i=`dirname ${i}`
if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
fi
if [ -n "{i}" -a -d "${i}/bin" ]; then
PATH="${i}/bin:$PATH"
fi
done
export PATH
fi
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to compile Mono."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if [ -z "$LIBTOOLIZE" ]; then
LIBTOOLIZE=`which glibtoolize 2>/dev/null`
if [ ! -x "$LIBTOOLIZE" ]; then
LIBTOOLIZE=`which libtoolize`
fi
fi
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtoolize' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/gnu/libtool/libtool-1.2.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed to compile Mono."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test x$NOCONFIGURE = x && test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
am_opt="--add-missing --copy --gnu -Wno-portability -Wno-obsolete"
case $CC in
xlc )
am_opt="$am_opt --include-deps";;
esac
if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
$LIBTOOLIZE --force --copy
fi
fi
# Parse parameters
has_ext_mod=false
ext_mod_args=''
has_disable_boehm=false
for PARAM; do
if [[ $PARAM =~ "--enable-extension-module" ]] ; then
has_ext_mod=true
if [[ $PARAM =~ "=" ]] ; then
ext_mod_args=`echo $PARAM | cut -d= -f2`
fi
fi
if [[ $PARAM =~ "--disable-boehm" ]] ; then
has_disable_boehm=true
fi
done
#
# Plug in the extension module
#
if test x$has_ext_mod = xtrue; then
pushd $top_srcdir../mono-extensions/scripts
sh ./prepare-repo.sh $ext_mod_args || exit 1
popd
else
cat mono/mini/Makefile.am.in > mono/mini/Makefile.am
fi
echo "Running aclocal -I m4 -I . $ACLOCAL_FLAGS ..."
aclocal -Wnone -I m4 -I . $ACLOCAL_FLAGS || {
echo
echo "**Error**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
echo "for the prefix where you installed the packages whose"
echo "macros were not found"
exit 1
}
if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
echo "Running autoheader..."
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
fi
echo "Running automake $am_opt ..."
automake $am_opt ||
{ echo "**Error**: automake failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
# Update all submodules recursively to ensure everything is checked out
if test -e $srcdir/scripts/update_submodules.sh; then
(cd $srcdir && scripts/update_submodules.sh)
fi
if test x$has_disable_boehm = xfalse -a -d $srcdir/external/bdwgc; then
echo Running external/bdwgc/autogen.sh ...
(cd $srcdir/external/bdwgc ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running external/bdwgc/autogen.sh ...
fi
if test x$MONO_EXTRA_CONFIGURE_FLAGS != x; then
echo "MONO_EXTRA_CONFIGURE_FLAGS is $MONO_EXTRA_CONFIGURE_FLAGS"
fi
host_conf_flag=
build_uname_all=`(uname -a) 2>/dev/null`
case "$build_uname_all" in
CYGWIN*)
if [[ "$@" != *"--host="* ]]; then
echo "Missing --host parameter, configure using ./configure --host=i686-w64-mingw32 or --host=x86_64-w64-mingw32"
echo "Falling back using --host=x86_64-w64-mingw32 as default."
host_conf_flag="--host=x86_64-w64-mingw32"
fi
;;
esac
conf_flags="$MONO_EXTRA_CONFIGURE_FLAGS --enable-maintainer-mode --enable-compile-warnings $host_conf_flag" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
else
echo Skipping configure process.
fi
......@@ -72,7 +72,7 @@
#cmakedefine PACKAGE_URL 1
/* Version of the corlib-runtime interface */
#define MONO_CORLIB_VERSION @MONO_CORLIB_VERSION@
#cmakedefine MONO_CORLIB_VERSION "@MONO_CORLIB_VERSION@"
/* Disables the IO portability layer */
#cmakedefine DISABLE_PORTABILITY 1
......
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2010 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux* | k*bsd*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
library_names_spec='$libname.a'
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd1*)
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
nto-qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF
此差异已折叠。
if ENABLE_LLVM
if HOST_WIN32
llvm_config=llvm-config.exe
else
llvm_config=llvm-config
endif
if HAVE_STATIC_ZLIB
llvm_extra_libs = $(STATIC_ZLIB_PATH)
else
if HAVE_SYS_ZLIB
llvm_extra_libs=-lz
else
llvm_extra_libs=
endif
endif
if INTERNAL_LLVM_ASSERTS
ENABLE_ASSERTS=On
else
ENABLE_ASSERTS=Off
endif
all-local: llvm_config.mk
clean-local: clean-llvm-config
$(mono_build_root)/llvm/llvm_config.mk: $(top_srcdir)/llvm/Makefile.am
$(top_srcdir)/llvm/build_llvm_config.sh "$(EXTERNAL_LLVM_CONFIG)" "$(LLVM_CODEGEN_LIBS)" "$(llvm_extra_libs)" | tee $@
llvm_config.mk: $(mono_build_root)/llvm/llvm_config.mk
clean-llvm-config:
- rm -rf llvm_config.mk
else
all-local:
clean-local:
endif
# Override this so we don't try to re-copy llvm when we install mono
install:
if TARGET_WASM
LLVM_TARGET=wasm32
else
LLVM_TARGET=
endif
#!/bin/bash
llvm_config=$1
llvm_codegen_libs="$2"
llvm_extra_libs="${@:3}"
use_llvm_config=1
llvm_host_win32=0
llvm_host_win32_wsl=0
llvm_host_win32_cygwin=0
function win32_format_path {
local formatted_path=$1
if [[ $llvm_host_win32_wsl = 1 ]] && [[ $1 != "/mnt/"* ]]; then
# if path is not starting with /mnt under WSL it could be a windows path, convert using wslpath.
formatted_path="$(wslpath -a "$1")"
elif [[ $llvm_host_win32_cygwin = 1 ]] && [[ $1 != "/cygdrive/"* ]]; then
# if path is not starting with /cygdrive under CygWin it could be a windows path, convert using cygpath.
formatted_path="$(cygpath -a "$1")"
fi
echo "$formatted_path"
}
if [[ $llvm_config = *".exe" ]]; then
llvm_host_win32=1
# llvm-config is a windows binary. Check if we are running CygWin or WSL since then we might still be able to run llvm-config.exe
host_uname="$(uname -a)"
case "$host_uname" in
*Microsoft*)
use_llvm_config=1
llvm_host_win32_wsl=1
;;
CYGWIN*)
use_llvm_config=1
llvm_host_win32_cygwin=1
;;
*)
use_llvm_config=0
esac
fi
local_osname="$(uname -s)"
if [ "x$local_osname" == "xLinux" ]; then
local_arch="$(file /bin/bash | cut -f2 -d',')"
llvm_config_arch="$(file $llvm_config | cut -f2 -d',')"
if [ "x$llvm_config_arch" != "x$local_arch" ]; then
use_llvm_config=0
linux_cross_llvm=1
fi
fi
if [[ $llvm_host_win32 = 1 ]]; then
llvm_config=$(win32_format_path "$llvm_config")
fi
if [[ $use_llvm_config = 1 ]]; then
llvm_api_version=`$llvm_config --mono-api-version` || "0"
with_llvm=`$llvm_config --prefix`
llvm_config_cflags=`$llvm_config --cflags`
llvm_system=`$llvm_config --system-libs`
llvm_core_components=`$llvm_config --libs analysis core bitwriter`
if [[ $llvm_api_version -lt 600 ]]; then
llvm_old_jit=`$llvm_config --libs mcjit jit 2>>/dev/null`
else
llvm_old_jit=`$llvm_config --libs mcjit 2>>/dev/null`
fi
llvm_new_jit=`$llvm_config --libs orcjit 2>>/dev/null`
if [[ ! -z $llvm_codegen_libs ]]; then
llvm_extra=`$llvm_config --libs $llvm_codegen_libs`
fi
# When building for Windows subsystem using WSL or CygWin the path returned from llvm-config.exe
# could be a Windows style path, make sure to format it into a path usable for WSL/CygWin.
if [[ $llvm_host_win32 = 1 ]]; then
with_llvm=$(win32_format_path "$with_llvm")
fi
fi
# If building for one architecture, but running on a different architecture, we cannot execute that arch's llvm-config
# e.g. building an ARM64 build from x64.
if [[ $linux_cross_llvm = 1 ]] && [[ $use_llvm_config = 0 ]]; then
# Assume we have llvm-config sitting in llvm-install-root/bin directory, get llvm-install-root directory.
with_llvm="$(dirname $llvm_config)"
with_llvm="$(dirname $with_llvm)"
llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
# llvm-config --mono-api-version
llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
# llvm-config --cflags, returned information currently not used.
llvm_config_cflags=
# llvm-config --system-libs
llvm_system="-lz -lrt -ldl -lpthread -lm"
# llvm-config --libs analysis core bitwriter
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBitReader -lLLVMBitstreamReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
# llvm-config --libs mcjit
llvm_old_jit="-lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMBitstreamReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
# llvm-config --libs orcjit
llvm_new_jit="-lLLVMOrcJIT -lLLVMTransformUtils -lLLVMJITLink -lLLVMExecutionEngine -lLLVMTarget -lLLVMAnalysis -lLLVMProfileData -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMBitstreamReader -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
# Check codegen libs and add needed libraries.
case "$llvm_codegen_libs" in
*x86codegen*)
# llvm-config --libs x86codegen
llvm_extra="-lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMX86Desc -lLLVMX86Utils -lLLVMX86Info -lLLVMMCDisassembler -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBitReader -lLLVMBitstreamReader -lLLVMCore -lLLVMRemarks -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
;;
*armcodegen*)
# llvm-config --libs armcodegen
llvm_extra="-lLLVMARMCodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMBitstreamReader -lLLVMCore -lLLVMRemarks -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMARMUtils -lLLVMARMInfo -lLLVMSupport -lLLVMDemangle"
;;
*aarch64codegen*)
# llvm-config --libs aarch64codegen
llvm_extra="-lLLVMAArch64CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMBitstreamReader -lLLVMCore -lLLVMRemarks -lLLVMAArch64Desc -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMSupport -lLLVMDemangle"
;;
*)
llvm_extra=$llvm_codegen_libs
esac
fi
# When cross compiling for Windows on system not capable of running Windows binaries, llvm-config.exe can't be used to query for
# LLVM parameters. In that scenario we will need to fallback to default values.
if [[ $llvm_host_win32 = 1 ]] && [[ $use_llvm_config = 0 ]]; then
# Assume we have llvm-config sitting in llvm-install-root/bin directory, get llvm-install-root directory.
with_llvm="$(dirname $llvm_config)"
with_llvm="$(dirname $with_llvm)"
llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
# llvm-config.exe --mono-api-version
llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
# llvm-config.exe --cflags, returned information currently not used.
llvm_config_cflags=
# llvm-config.exe --system-libs
if [[ $llvm_api_version -lt 600 ]]; then
llvm_system="-limagehlp -lpsapi -lshell32"
else
llvm_system="-lpsapi -lshell32 -lole32 -luuid -ladvapi32"
fi
# llvm-config.exe --libs analysis core bitwriter
if [[ $llvm_api_version -lt 600 ]]; then
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
else
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
fi
# llvm-config.exe --libs mcjit jit
if [[ $llvm_api_version -lt 600 ]]; then
llvm_old_jit="-lLLVMJIT -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore -lLLVMSupport"
else
# Current build of LLVM 60 for cross Windows builds doesn't support LLVM JIT.
llvm_old_jit=
fi
# LLVM 36 doesn't support new JIT and LLVM 60 is build without LLVM JIT support for cross Windows builds.
llvm_new_jit=
# Check codegen libs and add needed libraries.
case "$llvm_codegen_libs" in
*x86codegen*)
# llvm-config.exe --libs x86codegen
if [[ $llvm_api_version -lt 600 ]]; then
llvm_extra="-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMObject -lLLVMBitReader -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
else
llvm_extra="-lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
fi
;;
*armcodegen*)
# llvm-config.exe --libs armcodegen
if [[ $llvm_api_version -lt 600 ]]; then
llvm_extra="-lLLVMARMCodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMMC -lLLVMSupport"
else
llvm_extra="-lLLVMARMCodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMMC -lLLVMSupport -lLLVMDemangle"
fi
;;
*aarch64codegen*)
# llvm-config.exe --libs aarch64codegen
if [[ $llvm_api_version -lt 600 ]]; then
llvm_extra="-lLLVMAArch64CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport"
else
llvm_extra="-lLLVMAArch64CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport -lLLVMDemangle"
fi
;;
*)
llvm_extra=$llvm_codegen_libs
esac
fi
if [[ $llvm_config_cflags = *"stdlib=libc++"* ]]; then
llvm_libc_c="-stdlib=libc++"
# llvm_libc_link="-lc++"
else
llvm_libc_c=""
# llvm_libc_link="-lstdc++"
fi
if [[ $llvm_host_win32 = 1 ]]; then
host_cxxflag_additions="-std=gnu++11"
host_cflag_additions="-DNDEBUG"
else
host_cxxflag_additions="-std=c++11"
host_cflag_additions=""
fi
if [[ ! -z $llvm_extra_libs ]]; then
llvm_extra="$llvm_extra $llvm_extra_libs"
fi
# llvm-config --clfags adds warning and optimization flags we don't want
cflags_additions="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=$llvm_api_version $llvm_libc_c $host_cflag_additions"
cxxflag_additions="-fno-rtti -fexceptions $host_cxxflag_additions"
ldflags="-L$with_llvm/lib"
llvm_lib_components="$llvm_core_components $llvm_old_jit $llvm_new_jit $llvm_extra"
echo "LLVM_CFLAGS_INTERNAL=$cflags_additions"
echo "LLVM_CXXFLAGS_INTERNAL=$cflags_additions $cxxflag_additions"
echo "LLVM_LDFLAGS_INTERNAL=$ldflags"
echo "LLVM_LIBS_INTERNAL=$llvm_lib_components $ldflags $llvm_system $llvm_libc_link"
Makefile
Makefile.in
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
EXTRA_DIST = lib-ld.m4 lib-link.m4 lib-prefix.m4 $(wildcard *.m4)
# Usage:
# AC_MONO_APPLE_TARGET(target-name, action-if-found, action-if-not-found)
#
# Checks whether `target-name` is defined in "TargetConditionals.h"
#
AC_DEFUN([AC_MONO_APPLE_TARGET], [
AC_MONO_APPLE_AVAILABLE([$1], [for $1], [$1 == 1], $2, $3)
])
# Usage:
# AC_MONO_APPLE_AVAILABLE(name, message, conditional, action-if-found, action-if-not-found)
#
# Checks for `conditional` using "TargetConditionals.h" and "AvailabilityMacros.h"
#
AC_DEFUN([AC_MONO_APPLE_AVAILABLE], [
# cache the compilation check
AC_CACHE_CHECK([$2], [ac_cv_apple_available_[]$1], [
AC_TRY_COMPILE([
#include "TargetConditionals.h"
#include "AvailabilityMacros.h"
],[
#if !($3)
#error failed
#endif
], [
ac_cv_apple_available_[]$1=yes
], [
ac_cv_apple_available_[]$1=no
])
])
# keep the actions out of the cache check because they need to be always executed.
if test x$ac_cv_apple_available_[]$1 = xyes; then
$1=yes
[$4]
else
$1=no
[$5]
fi
])
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
#
# DESCRIPTION
#
# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
# added in between.
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
# FLAG.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 7
m4_ifndef([AS_VAR_APPEND],
[m4_define([AS_VAR_APPEND],
[$1=$$1$2])])
AC_DEFUN([AX_APPEND_FLAG],
[dnl
AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
AS_CASE([" AS_VAR_GET(FLAGS) "],
[*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
[
AS_VAR_APPEND(FLAGS,[" $1"])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
],
[
AS_VAR_SET(FLAGS,[$1])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# For every FLAG1, FLAG2 it is checked whether the linker works with the
# flag. If it does, the flag is added FLAGS-VARIABLE
#
# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
# used. During the check the flag is always added to the linker's flags.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
#
# LICENSE
#
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 6
AC_DEFUN([AX_APPEND_LINK_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
done
])dnl AX_APPEND_LINK_FLAGS
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the linker or gives an error.
# (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_LINK_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_LINK_FLAG],
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS $4 $1"
AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
LDFLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_LINK_FLAGS
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
# been defined and thus are available for use. This avoids random issues
# where a macro isn't expanded. Instead the configure script emits a
# non-fatal:
#
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
# It's like AC_REQUIRE except it doesn't expand the required macro.
#
# Here's an example:
#
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
#
# 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 2
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED
# lib-ld.m4 serial 4 (gettext-0.18)
dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Subroutines of libtool.m4,
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
dnl with libtool.m4.
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;;
*)
acl_cv_prog_gnu_ld=no ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
dnl From libtool-1.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD],
[AC_ARG_WITH([gnu-ld],
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)]
[re_direlt='/[^/][^/]*/\.\./']
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL([acl_cv_path_LD],
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;;
*)
test "$with_gnu_ld" != yes && break ;;
esac
fi
done
IFS="$ac_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT([$LD])
else
AC_MSG_RESULT([no])
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
此差异已折叠。
# lib-prefix.m4 serial 7 (gettext-0.18)
dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
prefix="$acl_save_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])
dnl AC_LIB_PREPARE_MULTILIB creates
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
dnl "lib" or "lib64" or "lib/64",
dnl - a variable acl_libdirstem2, as a secondary possible value for
dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
dnl "lib/amd64".
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
[
dnl There is no formal standard regarding lib and lib64.
dnl On glibc systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
dnl the compiler's default mode by looking at the compiler's library search
dnl path. If at least one of its elements ends in /lib64 or points to a
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
dnl Otherwise we use the default, namely "lib".
dnl On Solaris systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
AC_REQUIRE([AC_CANONICAL_HOST])
acl_libdirstem=lib
acl_libdirstem2=
case "$host_os" in
solaris*)
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
dnl symlink is missing, so we set acl_libdirstem2 too.
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
[AC_EGREP_CPP([sixtyfour bits], [
#ifdef _LP64
sixtyfour bits
#endif
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
])
if test $gl_cv_solaris_64bit = yes; then
acl_libdirstem=lib/64
case "$host_cpu" in
sparc*) acl_libdirstem2=lib/sparcv9 ;;
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
esac
fi
;;
*)
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
if test -n "$searchpath"; then
acl_save_IFS="${IFS= }"; IFS=":"
for searchdir in $searchpath; do
if test -d "$searchdir"; then
case "$searchdir" in
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
*/../ | */.. )
# Better ignore directories of this form. They are misleading.
;;
*) searchdir=`cd "$searchdir" && pwd`
case "$searchdir" in
*/lib64 ) acl_libdirstem=lib64 ;;
esac ;;
esac
fi
done
IFS="$acl_save_IFS"
fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
])
# Usage:
# AC_MONO_OUTPUT()
#
# Generates the output files used by Mono.
#
AC_DEFUN([AC_MONO_OUTPUT], [
AC_OUTPUT([
Makefile
llvm/Makefile
mono/Makefile
mono/utils/Makefile
mono/metadata/Makefile
mono/zlib/Makefile
mono/arch/Makefile
mono/arch/x86/Makefile
mono/arch/amd64/Makefile
mono/arch/ppc/Makefile
mono/arch/sparc/Makefile
mono/arch/s390x/Makefile
mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/mips/Makefile
mono/arch/riscv/Makefile
mono/sgen/Makefile
mono/mini/Makefile
mono/profiler/Makefile
mono/eglib/Makefile
mono/eglib/eglib-config.h
mono/eglib/test/Makefile
])
])
# nls.m4 serial 5 (gettext-0.18)
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
AC_PREREQ([2.50])
AC_DEFUN([AM_NLS],
[
AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE([nls],
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=profile_default)
AC_MSG_RESULT([$USE_NLS])
AC_SUBST([USE_NLS])
])
# po.m4 serial 17 (gettext-0.18)
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
AC_PREREQ([2.50])
dnl Checks for all prerequisites of the po subdirectory.
AC_DEFUN([AM_PO_SUBDIRS],
[
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
AC_REQUIRE([AM_NLS])dnl
dnl Release version of the gettext macros. This is used to ensure that
dnl the gettext macros and po/Makefile.in.in are in sync.
AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
dnl Perform the following tests also if --disable-nls has been given,
dnl because they are needed for "make dist" to work.
dnl Search for GNU msgfmt in the PATH.
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
dnl The second test excludes FreeBSD msgfmt.
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
:)
AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
dnl Test whether it is GNU msgfmt >= 0.15.
changequote(,)dnl
case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
*) MSGFMT_015=$MSGFMT ;;
esac
changequote([,])dnl
AC_SUBST([MSGFMT_015])
changequote(,)dnl
case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
*) GMSGFMT_015=$GMSGFMT ;;
esac
changequote([,])dnl
AC_SUBST([GMSGFMT_015])
dnl Search for GNU xgettext 0.12 or newer in the PATH.
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
dnl The second test excludes FreeBSD xgettext.
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
(if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
:)
dnl Remove leftover from FreeBSD xgettext call.
rm -f messages.po
dnl Test whether it is GNU xgettext >= 0.15.
changequote(,)dnl
case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
*) XGETTEXT_015=$XGETTEXT ;;
esac
changequote([,])dnl
AC_SUBST([XGETTEXT_015])
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
dnl Installation directories.
dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
dnl have to define it here, so that it can be used in po/Makefile.
test -n "$localedir" || localedir='${datadir}/locale'
AC_SUBST([localedir])
dnl Support for AM_XGETTEXT_OPTION.
test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
AC_CONFIG_COMMANDS([po-directories], [[
for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"
case "$ac_file" in
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
esac
# PO directories have a Makefile.in generated from Makefile.in.in.
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
# Treat a directory as a PO directory if and only if it has a
# POTFILES.in file. This allows packages to have multiple PO
# directories under different names or in different locations.
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
POMAKEFILEDEPS="POTFILES.in"
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
# on $ac_dir but don't depend on user-specified configuration
# parameters.
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
# The LINGUAS file contains the set of available languages.
if test -n "$OBSOLETE_ALL_LINGUAS"; then
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
# Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else
# The set of available languages was given in configure.in.
# Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
fi
# Compute POFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
# Compute UPDATEPOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
# Compute DUMMYPOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
# Compute GMOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
case "$ac_given_srcdir" in
.) srcdirpre= ;;
*) srcdirpre='$(srcdir)/' ;;
esac
POFILES=
UPDATEPOFILES=
DUMMYPOFILES=
GMOFILES=
for lang in $ALL_LINGUAS; do
POFILES="$POFILES $srcdirpre$lang.po"
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
done
# CATALOGS depends on both $ac_dir and the user's LINGUAS
# environment variable.
INST_LINGUAS=
if test -n "$ALL_LINGUAS"; then
for presentlang in $ALL_LINGUAS; do
useit=no
if test "%UNSET%" != "$LINGUAS"; then
desiredlanguages="$LINGUAS"
else
desiredlanguages="$ALL_LINGUAS"
fi
for desiredlang in $desiredlanguages; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
INST_LINGUAS="$INST_LINGUAS $presentlang"
fi
done
fi
CATALOGS=
if test -n "$INST_LINGUAS"; then
for lang in $INST_LINGUAS; do
CATALOGS="$CATALOGS $lang.gmo"
done
fi
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
if test -f "$f"; then
case "$f" in
*.orig | *.bak | *~) ;;
*) cat "$f" >> "$ac_dir/Makefile" ;;
esac
fi
done
fi
;;
esac
done]],
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
# from automake < 1.5.
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
# Capture the value of LINGUAS because we need it to compute CATALOGS.
LINGUAS="${LINGUAS-%UNSET%}"
])
])
dnl Postprocesses a Makefile in a directory containing PO files.
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
[
# When this code is run, in config.status, two variables have already been
# set:
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
# - LINGUAS is the value of the environment variable LINGUAS at configure
# time.
changequote(,)dnl
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
# Find a way to echo strings without interpreting backslash.
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
gt_echo='echo'
else
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
gt_echo='printf %s\n'
else
echo_func () {
cat <<EOT
$*
EOT
}
gt_echo='echo_func'
fi
fi
# A sed script that extracts the value of VARIABLE from a Makefile.
sed_x_variable='
# Test if the hold space is empty.
x
s/P/P/
x
ta
# Yes it was empty. Look if we have the expected variable definition.
/^[ ]*VARIABLE[ ]*=/{
# Seen the first line of the variable definition.
s/^[ ]*VARIABLE[ ]*=//
ba
}
bd
:a
# Here we are processing a line from the variable definition.
# Remove comment, more precisely replace it with a space.
s/#.*$/ /
# See if the line ends in a backslash.
tb
:b
s/\\$//
# Print the line, without the trailing backslash.
p
tc
# There was no trailing backslash. The end of the variable definition is
# reached. Clear the hold space.
s/^.*$//
x
bd
:c
# A trailing backslash means that the variable definition continues in the
# next line. Put a nonempty string into the hold space to indicate this.
s/^.*$/P/
x
:d
'
changequote([,])dnl
# Set POTFILES to the value of the Makefile variable POTFILES.
sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
# Compute POTFILES_DEPS as
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
POTFILES_DEPS=
for file in $POTFILES; do
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
done
POMAKEFILEDEPS=""
if test -n "$OBSOLETE_ALL_LINGUAS"; then
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
# The LINGUAS file contains the set of available languages.
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
fi
# Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
# Compute POFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
# Compute UPDATEPOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
# Compute DUMMYPOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
# Compute GMOFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
# Compute PROPERTIESFILES
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
# Compute CLASSFILES
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
# Compute QMFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
# Compute MSGFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
# Compute RESOURCESDLLFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
case "$ac_given_srcdir" in
.) srcdirpre= ;;
*) srcdirpre='$(srcdir)/' ;;
esac
POFILES=
UPDATEPOFILES=
DUMMYPOFILES=
GMOFILES=
PROPERTIESFILES=
CLASSFILES=
QMFILES=
MSGFILES=
RESOURCESDLLFILES=
for lang in $ALL_LINGUAS; do
POFILES="$POFILES $srcdirpre$lang.po"
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
QMFILES="$QMFILES $srcdirpre$lang.qm"
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
done
# CATALOGS depends on both $ac_dir and the user's LINGUAS
# environment variable.
INST_LINGUAS=
if test -n "$ALL_LINGUAS"; then
for presentlang in $ALL_LINGUAS; do
useit=no
if test "%UNSET%" != "$LINGUAS"; then
desiredlanguages="$LINGUAS"
else
desiredlanguages="$ALL_LINGUAS"
fi
for desiredlang in $desiredlanguages; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
INST_LINGUAS="$INST_LINGUAS $presentlang"
fi
done
fi
CATALOGS=
JAVACATALOGS=
QTCATALOGS=
TCLCATALOGS=
CSHARPCATALOGS=
if test -n "$INST_LINGUAS"; then
for lang in $INST_LINGUAS; do
CATALOGS="$CATALOGS $lang.gmo"
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
QTCATALOGS="$QTCATALOGS $lang.qm"
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
done
fi
sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
# Add dependencies that cannot be formulated as a simple suffix rule.
for lang in $ALL_LINGUAS; do
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
cat >> "$ac_file.tmp" <<EOF
$frobbedlang.msg: $lang.po
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
EOF
done
fi
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
# Add dependencies that cannot be formulated as a simple suffix rule.
for lang in $ALL_LINGUAS; do
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
cat >> "$ac_file.tmp" <<EOF
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
EOF
done
fi
if test -n "$POMAKEFILEDEPS"; then
cat >> "$ac_file.tmp" <<EOF
Makefile: $POMAKEFILEDEPS
EOF
fi
mv "$ac_file.tmp" "$ac_file"
])
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
[
XGETTEXT_EXTRA_OPTIONS=
])
dnl Registers an option to be passed to xgettext in the po subdirectory.
AC_DEFUN([AM_XGETTEXT_OPTION],
[
AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
])
# progtest.m4 serial 6 (gettext-0.18)
dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
AC_PREREQ([2.50])
# Search path for a program which passes the given test.
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
[
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
# Find out how to test for executable files. Don't use a zero-byte file,
# as systems may use methods other than mode bits to determine executability.
cat >conf$$.file <<_ASEOF
#! /bin/sh
exit 0
_ASEOF
chmod +x conf$$.file
if test -x conf$$.file >/dev/null 2>&1; then
ac_executable_p="test -x"
else
ac_executable_p="test -f"
fi
rm -f conf$$.file
# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL([ac_cv_path_$1],
[case "[$]$1" in
[[\\/]]* | ?:[[\\/]]*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in ifelse([$5], , $PATH, [$5]); do
IFS="$ac_save_IFS"
test -z "$ac_dir" && ac_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
break 2
fi
fi
done
done
IFS="$ac_save_IFS"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$][$1])
else
AC_MSG_RESULT([no])
fi
AC_SUBST([$1])dnl
])
......@@ -14,8 +14,3 @@ curly_bracket_next_line = false
spaces_around_operators = true
spaces_around_brackets = outside
[Makefile*]
indent_style = tab
[*.mk]
indent_style = tab
/
/Makefile
/Makefile.in
/semantic.cache
/TAGS
/.metadata
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
if SUPPORT_SGEN
sgen_dirs = sgen
endif
if BTLS
btls_dirs = btls
endif
if MONO_NATIVE
native_dirs = native
endif
if ENABLE_NETCORE
btls_dirs =
managed_unit_test_dirs =
native_unit_test_dirs =
culture_dirs =
else
managed_unit_test_dirs = tests
native_unit_test_dirs = unit-tests
culture_dirs = culture
endif
if ENABLE_NETCORE
SUBDIRS = eglib arch utils sgen zlib metadata mini profiler $(native_unit_test_dirs)
else
if CROSS_COMPILING
SUBDIRS = $(btls_dirs) $(culture_dirs) eglib arch utils cil zlib $(sgen_dirs) metadata mini dis profiler $(native_dirs)
else
if INSTALL_MONOTOUCH
SUBDIRS = $(btls_dirs) $(culture_dirs) eglib arch utils zlib $(sgen_dirs) metadata mini profiler $(native_dirs)
else
SUBDIRS = $(btls_dirs) $(culture_dirs) eglib arch utils cil zlib $(sgen_dirs) metadata mini dis $(managed_unit_test_dirs) $(native_unit_test_dirs) benchmark profiler $(native_dirs)
endif
endif
endif
DIST_SUBDIRS = btls $(culture_dirs) native eglib arch utils cil zlib $(sgen_dirs) metadata mini dis $(managed_unit_test_dirs) $(native_unit_test_dirs) benchmark profiler
/Makefile
/Makefile.in
/.deps
/.libs
/*.la
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
DIST_SUBDIRS = x86 ppc sparc arm arm64 s390x amd64 mips riscv
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
if ARM
# arm needs to build some stuff even in JIT mode
SUBDIRS = arm
endif
if RISCV
SUBDIRS = riscv
endif
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = amd64-codegen.h
/Makefile
/Makefile.in
/.deps
/.libs
/*.o
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
arm_dpimacros.h: dpiops.sh mov_macros.th dpi_macros.th cmp_macros.th
(cd $(srcdir); bash ./dpiops.sh) > $@t
mv $@t $@
arm_vfpmacros.h: vfpops.sh vfpm_macros.th vfp_macros.th
(cd $(srcdir); bash ./vfpops.sh) > $@t
mv $@t $@
gen: arm_dpimacros.h arm_vfpmacros.h
EXTRA_DIST = arm-codegen.h dpiops.sh mov_macros.th dpi_macros.th cmp_macros.th \
vfpm_macros.th vfp_macros.th arm-vfp-codegen.h vfpops.sh \
arm_dpimacros.h arm_vfpmacros.h
/
/Makefile
/Makefile.in
/*.o
/*.lo
/.deps
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = arm64-codegen.h codegen-test.c
test-codegen:
$(CC) $(CFLAGS) -I../../.. -I../../eglib/ ../../eglib/.libs/libeglib.a -o codegen-test codegen-test.c
./codegen-test > tmp.s
$(CC) $(CFLAGS) -c -o tmp.o tmp.s
objdump -d --triple=arm64e tmp.o
/
/Makefile
/Makefile.in
/*.o
/*.lo
/.deps
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
noinst_LTLIBRARIES = libmonoarch-mips.la
libmonoarch_mips_la_SOURCES = mips-codegen.h
/Makefile
/Makefile.in
/.libs
/.deps
/*.la
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = ppc-codegen.h
\ No newline at end of file
/Makefile
/riscv-codegen-test
/riscv-codegen
/riscv-codegen.elf
......
AM_CPPFLAGS = $(GLIB_CFLAGS)
EXTRA_DIST = riscv-codegen.h
bin_PROGRAMS = riscv-codegen-test
riscv_codegen_test_SOURCES = riscv-codegen-test.c
if RISCV64
bits = 64
else
bits = 32
endif
check-local: riscv-codegen-test
./riscv-codegen-test > riscv-codegen.s
$(AS) riscv-codegen.s -o riscv-codegen.elf
$(OBJDUMP) -D -M numeric,no-aliases riscv-codegen.elf > riscv-codegen.res
diff -u riscv-codegen.exp$(bits) riscv-codegen.res
/Makefile
/Makefile.in
/.libs
/.deps
/*.la
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
noinst_LTLIBRARIES = libmonoarch-s390x.la
libmonoarch_s390x_la_SOURCES = tramp.c s390x-codegen.h
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = sparc-codegen.h
/Makefile
/Makefile.in
/.libs
/.deps
/*.la
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = x86-codegen.h
\ No newline at end of file
# empty placeholder for netcore build
# empty placeholder for netcore build
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
# opcode.def is not built by default -- based on timestamps.
# CI does not have the dependencies installed (perl, XML::Parser).
# The derived file is checked in.
opcode.def: make-opcodes-def.pl cil-opcodes.xml
perl $(srcdir)/make-opcodes-def.pl $(srcdir)/cil-opcodes.xml $@.tmp
mv $@.tmp $@
defdir = $(includedir)/mono-$(API_VER)/mono/cil
def_DATA = opcode.def
xmldir = $(datadir)/mono-$(API_VER)/mono/cil
xml_DATA = cil-opcodes.xml
EXTRA_DIST=tables.def opcode.def make-opcodes-def.pl make-opcode-def.xsl $(xml_DATA) $(def_DATA)
# empty placeholder for netcore build
# empty placeholder for netcore build
/Makefile
/Makefile.in
/.libs
/.deps
/*.lo
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
if !ENABLE_MSVC_ONLY
SUBDIRS = . test
noinst_LTLIBRARIES = libeglib.la
AM_CFLAGS = $(SHARED_CFLAGS)
win_files = \
eglib-config.hw \
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
gmodule-win32.c gtimer-win32.c gunicode-win32.c
unix_files = \
gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \
gmodule-unix.c gtimer-unix.c gmodule-aix.c \
gspawn.c
if HOST_WIN32
os_files = $(win_files)
else
os_files = $(unix_files)
endif
libeglib_la_SOURCES = \
eglib-remap.h \
sort.frag.h \
glib.h \
garray.c \
gbytearray.c \
gerror.c \
ghashtable.c \
giconv.c \
gmem.c \
gmodule.h \
goutput.c \
gqsort.c \
gstr.c \
gslist.c \
gstring.c \
gptrarray.c \
glist.c \
gqueue.c \
gpath.c \
gshell.c \
gfile.c \
gfile-posix.c \
gpattern.c \
gmarkup.c \
gutf8.c \
gunicode.c \
unicode-data.h \
$(os_files)
endif # !ENABLE_MSVC_ONLY
CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@
if !ENABLE_MSVC_ONLY
eglibdir=$(datadir)/mono-$(API_VER)/mono/eglib
eglib_DATA = eglib-config.h
libeglib_la_CFLAGS = -g -Wall -D_GNU_SOURCE
if !HOST_WIN32
libeglib_la_CFLAGS += -D_FORTIFY_SOURCE=2
endif
AM_CPPFLAGS = -I$(srcdir)
if HOST_ANDROID
libeglib_la_LIBADD = -lm -llog
else
if HOST_WIN32
libeglib_la_LIBADD = -lm -lpsapi $(LTLIBICONV)
else
libeglib_la_LIBADD = -lm $(LTLIBICONV)
endif
endif
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files)
endif # !ENABLE_MSVC_ONLY
if ENABLE_MSVC_ONLY
all-local:
make -C $(top_srcdir)/msvc eglib
clean-local:
make -C $(top_srcdir)/msvc clean-eglib
endif # ENABLE_MSVC_ONLY
/Makefile
/Makefile.in
/.libs
/.deps
/*.lo
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
EXTRA_DIST = UTF-8.txt UTF-16BE.txt UTF-16LE.txt UTF-32BE.txt UTF-32LE.txt test-eglib.exp
SOURCES = \
enum.cpp \
test.c \
test.h \
tests.h \
driver.c \
hashtable.c \
string-util.c \
string.c \
slist.c \
sizes.c \
ptrarray.c \
list.c \
array.c \
fake.c \
path.c \
queue.c \
shell.c \
spawn.c \
timer.c \
file.c \
pattern.c \
dir.c \
markup.c \
unicode.c \
utf8.c \
endian.c \
module.c \
memory.c
test_eglib_SOURCES = $(SOURCES)
GLIB_TEST_FLAGS_COMMON = -Wall -DEGLIB_TESTS=1 -I$(srcdir)/.. -I.. -DDRIVER_NAME=\"EGlib\"
if !HOST_WIN32
GLIB_TEST_FLAGS_COMMON += -D_FORTIFY_SOURCE=2
endif
CFLAGS += $(GLIB_TEST_FLAGS_COMMON)
CXXFLAGS += $(GLIB_TEST_FLAGS_COMMON) @CXXFLAGS_COMMON@
if HOST_AIX
# This export file is required so test symbols are visible.
LDFLAGS += -Wl,-bE:test-eglib.exp
endif
test_eglib_LDADD = ../libeglib.la $(LTLIBICONV)
assertf_LDADD = ../libeglib.la $(LTLIBICONV)
abs_srcdir = $(abspath $(srcdir))
if DISABLE_EXECUTABLES
run-eglib:
else
# FIXME: Various unit tests are broken on Win32, see https://github.com/mono/mono/issues/16576
if HOST_WIN32
run-eglib:
else
run-eglib:
srcdir="$(abs_srcdir)" ./test-eglib
noinst_PROGRAMS = test-eglib assertf
endif # !HOST_WIN32
endif # DISABLE_EXECUTABLES
run-both: run-eglib
check-local: run-both
MAINTAINERCLEANFILES = Makefile.in
/Makefile
/Makefile.in
/monosn
/monodiet
/.libs
......
MAKEFLAGS := $(MAKEFLAGS) --no-builtin-rules
if !ENABLE_MSVC_ONLY
if HOST_WIN32
win32_sources = \
console-win32.c \
w32file-win32.c \
icall-windows.c \
marshal-windows.c \
mono-security-windows.c \
w32mutex-win32.c \
w32semaphore-win32.c \
w32event-win32.c \
w32process-win32.c \
w32socket-win32.c \
w32error-win32.c
platform_sources = $(win32_sources)
# Use -m here. This will use / as directory separator (C:/WINNT).
# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
# / by \ if running under WIN32.
if CROSS_COMPILING
assembliesdir = ${libdir}
confdir = ${sysconfdir}
else
assembliesdir = `cygpath -m "${libdir}"`
confdir = `cygpath -m "${sysconfdir}"`
endif
export HOST_CC
# The mingw math.h has "extern inline" functions that dont appear in libs, so
# optimisation is required to actually inline them
AM_CFLAGS = -O
else
assembliesdir = $(exec_prefix)/lib
confdir = $(sysconfdir)
unix_sources = \
console-unix.c \
w32mutex-unix.c \
w32semaphore-unix.c \
w32event-unix.c \
w32process-unix.c \
w32process-unix-internals.h \
w32process-unix-osx.c \
w32process-unix-bsd.c \
w32process-unix-haiku.c \
w32process-unix-default.c \
w32socket-unix.c \
w32file-unix.c \
w32file-unix-glob.c \
w32file-unix-glob.h \
w32error-unix.c
platform_sources = $(unix_sources)
endif
glib_libs = $(top_builddir)/mono/eglib/libeglib.la
if HOST_WASM
platform_sources += threadpool-worker-wasm.c
else
platform_sources += threadpool-worker-default.c
endif
if BITCODE
libmonoldflags = -no-undefined
endif
if SUPPORT_SGEN
sgen_libraries = libmonoruntimesgen.la
endif
if SUPPORT_BOEHM
boehm_libraries = libmonoruntime.la
endif
if DISABLE_ICALL_TABLES
icall_table_libraries = libmono-icall-table.la
endif
if !ENABLE_ILGEN
ilgen_libraries = libmono-ilgen.la
endif
BUNDLE_ZLIB_PATH=$(top_builddir)/mono/zlib/libz.la
if HAVE_STATIC_ZLIB
Z_LIBS=$(STATIC_ZLIB_PATH)
else
if HAVE_SYS_ZLIB
Z_LIBS=-lz
else
Z_LIBS=$(BUNDLE_ZLIB_PATH)
endif
endif
noinst_LTLIBRARIES = libmonoruntime-config.la $(support_libraries) $(boehm_libraries) $(sgen_libraries) $(shim_libraries)
lib_LTLIBRARIES = $(icall_table_libraries) $(ilgen_libraries)
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS) $(METADATA_CFLAGS)
#
# Make sure any prefix changes are updated in the binaries too.
#
# This won't result in many more false positives than AC_DEFINEing them
# in configure.ac.
#
mono-config-dirs.lo: Makefile
#
# This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
# ccache to work even if the value of these defines change. We need to use a convenience library since automake
# doesn't support per file cflags.
#
libmonoruntime_config_la_SOURCES = \
mono-config-dirs.h \
mono-config-dirs.c
libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\" @CXX_ADD_CFLAGS@
#
# Support is a separate library because it is not valid C++.
#
support_libraries = libmonoruntime-support.la
libmonoruntime_support_la_SOURCES = support.c
libmonoruntime_support_la_LDFLAGS = $(Z_LIBS)
libmonoruntime_support_la_CFLAGS = $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @ZLIB_CFLAGS@
if ENABLE_NETCORE
if HAVE_SYS_ICU
# symlink ICU sources to a local dir so automake puts intermediates into the target-specific folder
icushim/%.c: @ICU_SHIM_PATH@/%.c
$(LN_S) $^ $@
shim_libraries = libmonoruntime-shimglobalization.la
nodist_libmonoruntime_shimglobalization_la_SOURCES = \
icushim/pal_calendarData.c \
icushim/pal_casing.c \
icushim/pal_collation.c \
icushim/pal_idna.c \
icushim/pal_locale.c \
icushim/pal_localeNumberData.c \
icushim/pal_localeStringData.c \
icushim/pal_normalization.c \
icushim/pal_timeZoneInfo.c \
icushim/entrypoints.c
libmonoruntime_shimglobalization_la_CFLAGS = @ICU_CFLAGS@ -I$(top_srcdir)/../libraries/Native/Unix/System.Globalization.Native/ -I$(top_srcdir)/../libraries/Native/Unix/Common/
if STATIC_ICU
nodist_libmonoruntime_shimglobalization_la_SOURCES += icushim/pal_icushim_static.c
else
nodist_libmonoruntime_shimglobalization_la_SOURCES += icushim/pal_icushim.c
endif # STATIC_ICU
endif # HAVE_SYS_ICU
endif # ENABLE_NETCORE
if !ENABLE_NETCORE
culture_libraries = ../culture/libmono-culture.la
endif
#
# This library contains the icall tables if the runtime was configured with --disable-icall-tables
#
if DISABLE_ICALL_TABLES
libmono_icall_table_la_SOURCES = \
icall-table.c
# Add CXX_ADD_CFLAGS per-library until/unless https://github.com/dotnet/corefx/pull/31342.
libmono_icall_table_la_CFLAGS = $(SGEN_DEFINES) @CXX_ADD_CFLAGS@
libmono_icall_table_la_LDFLAGS = $(libmonoldflags)
if BITCODE
if WASM
libmono_icall_table_la_LIBADD = # empty to avoid duplicate symbols when enabling dynamic linking
else
libmono_icall_table_la_LIBADD = $(glib_libs) ../utils/libmonoutils.la ../sgen/libmonosgen.la libmonoruntimesgen.la
endif
endif
endif
#
# This library contains code to generate IL at runtime
#
if !ENABLE_ILGEN
libmono_ilgen_la_SOURCES = \
method-builder-ilgen.c \
method-builder-ilgen.h \
method-builder-ilgen-internals.h \
marshal-ilgen.c \
marshal-ilgen.h \
sgen-mono-ilgen.c \
sgen-mono-ilgen.h
# Add CXX_ADD_CFLAGS per-library until/unless https://github.com/dotnet/corefx/pull/31342.
libmono_ilgen_la_CFLAGS = $(SGEN_DEFINES) @CXX_ADD_CFLAGS@
libmono_ilgen_la_LDFLAGS = $(libmonoldflags)
if BITCODE
if WASM
libmono_ilgen_la_LIBADD = # empty to avoid duplicate symbols when enabling dynamic linking
else
libmono_ilgen_la_LIBADD = $(glib_libs) ../utils/libmonoutils.la ../sgen/libmonosgen.la libmonoruntimesgen.la
endif
endif
endif
CLEANFILES = mono-bundle.stamp
null_sources = \
console-null.c
null_gc_sources = \
null-gc.c \
null-gc-handles.h \
null-gc-handles.c
if !DISABLE_ICALL_TABLES
icall_tables_sources = \
icall-table.c
endif
if ENABLE_ILGEN
ilgen_sources = \
method-builder-ilgen.c \
method-builder-ilgen.h \
method-builder-ilgen-internals.h \
marshal-ilgen.c \
marshal-ilgen.h \
sgen-mono-ilgen.c \
sgen-mono-ilgen.h
endif
common_sources = \
$(platform_sources) \
appdomain.c \
assembly-load-context.c \
domain.c \
appdomain-icalls.h \
assembly.c \
assembly-internals.h \
attach.h \
attach.c \
cil-coff.h \
class.c \
class-getters.h \
class-init.h \
class-init.c \
class-init-internals.h \
class-internals.h \
class-inlines.h \
class-private-definition.h \
class-setup-vtable.c \
class-accessors.c \
cominterop.c \
cominterop.h \
console-io.h \
coree.c \
coree.h \
coree-internals.h \
debug-helpers.c \
debug-mono-symfile.h \
debug-mono-symfile.c \
debug-mono-ppdb.h \
debug-mono-ppdb.c \
domain-internals.h \
environment.c \
environment.h \
environment-internals.h \
icall-eventpipe.c \
exception.c \
exception.h \
exception-internals.h \
external-only.h \
w32file.c \
w32file.h \
w32file-internals.h \
filewatcher.c \
filewatcher.h \
gc-internals.h \
icall.c \
icalls.h \
icall-decl.h \
icall-def.h \
icall-internals.h \
icall-signatures.h \
icall-table.h \
image.c \
image-internals.h \
jit-icall-reg.h \
jit-info.c \
loader.c \
loader-internals.h \
loaded-images-internals.h \
loaded-images.c \
loaded-images-global.c \
loaded-images-netcore.c \
locales.h \
lock-tracer.c \
lock-tracer.h \
marshal.c \
marshal.h \
marshal-internals.h \
marshal-noilgen.c \
mempool.c \
mempool.h \
mempool-internals.h \
metadata.c \
metadata-verify.c \
metadata-internals.h \
metadata-update.h \
metadata-update.c \
method-builder.h \
method-builder-internals.h \
method-builder.c \
mono-basic-block.c \
mono-basic-block.h \
mono-config-internals.h \
mono-config.c \
mono-debug.h \
mono-debug.c \
debug-internals.h \
mono-endian.c \
mono-endian.h \
mono-hash-internals.h \
mono-hash.c \
mono-hash.h \
mono-conc-hash.c \
mono-conc-hash.h \
mono-mlist.c \
mono-mlist.h \
mono-perfcounters.c \
mono-perfcounters.h \
mono-perfcounters-def.h \
mono-ptr-array.h \
mono-route.c \
monitor.h \
normalization-tables.h \
number-formatter.h \
number-ms.h \
object.c \
object-forward.h \
object-internals.h \
opcodes.c \
property-bag.h \
property-bag.c \
w32socket.c \
w32socket.h \
w32socket-internals.h \
w32process.c \
w32process.h \
w32process-internals.h \
profiler.c \
profiler-private.h \
profiler-legacy.h \
rand.h \
rand.c \
remoting.h \
remoting.c \
runtime.c \
runtime.h \
mono-security.c \
security.h \
security-core-clr.c \
security-core-clr.h \
security-manager.c \
security-manager.h \
string-icalls.c \
string-icalls.h \
sysmath.c \
tabledefs.h \
threads.c \
threads-types.h \
threadpool.c \
threadpool.h \
threadpool-worker.h \
threadpool-io.c \
threadpool-io.h \
verify.c \
verify-internals.h \
wrapper-types.h \
dynamic-image-internals.h \
dynamic-stream.c \
dynamic-stream-internals.h \
reflection-cache.h \
custom-attrs-internals.h \
sre-internals.h \
reflection-internals.h \
file-mmap-posix.c \
file-mmap-windows.c \
file-mmap.h \
object-offsets.h \
abi-details.h \
class-abi-details.h \
metadata-cross-helpers.c \
seq-points-data.h \
seq-points-data.c \
handle.c \
handle-decl.h \
handle.h \
w32mutex.h \
w32semaphore.h \
w32event.h \
w32handle-namespace.h \
w32handle-namespace.c \
w32handle.h \
w32handle.c \
w32error.h \
reflection.c \
dynamic-image.c \
sre.c \
sre-encode.c \
sre-save.c \
custom-attrs.c \
fdhandle.h \
fdhandle.c \
callspec.h \
callspec.c \
abi.c \
memory-manager.c \
native-library.c \
native-library.h \
native-library-qcall.c \
qcall-def.h
# These source files have compile time dependencies on GC code
gc_dependent_sources = \
gc-stats.c \
gc.c \
monitor.c
boehm_sources = \
boehm-gc.c
sgen_sources = \
sgen-bridge.c \
sgen-bridge.h \
sgen-bridge-internals.h \
sgen-dynarray.h \
sgen-old-bridge.c \
sgen-new-bridge.c \
sgen-tarjan-bridge.c \
sgen-toggleref.c \
sgen-toggleref.h \
sgen-stw.c \
sgen-mono.c \
sgen-mono.h \
sgen-client-mono.h
endif # !ENABLE_MSVC_ONLY
# Per-library to workaround CoreFX/native until/unless https://github.com/dotnet/corefx/pull/31342.
#CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@) @CXX_ADD_CFLAGS@
CFLAGS := $(filter-out @CXX_REMOVE_CFLAGS@, @CFLAGS@)
if !ENABLE_MSVC_ONLY
libmonoruntime_la_SOURCES = $(common_sources) $(icall_tables_sources) $(ilgen_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
# Add CXX_ADD_CFLAGS per-library until/unless https://github.com/dotnet/corefx/pull/31342.
libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES) $(GLOBALIZATION_SHIM_DEFINES) @CXX_ADD_CFLAGS@
libmonoruntime_la_LIBADD = libmonoruntime-config.la $(culture_libraries) $(support_libraries) $(shim_libraries)
libmonoruntimesgen_la_SOURCES = $(common_sources) $(icall_tables_sources) $(ilgen_sources) $(gc_dependent_sources) $(sgen_sources)
# Add CXX_ADD_CFLAGS per-library until/unless https://github.com/dotnet/corefx/pull/31342.
libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES) $(GLOBALIZATION_SHIM_DEFINES) @CXX_ADD_CFLAGS@
libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la $(culture_libraries) $(support_libraries) $(shim_libraries)
endif # !ENABLE_MSVC_ONLY
libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
# This list is sorted for easier searching.
# These are public headers.
# They may not use G_BEGIN_DECLS, guint, glib.h, etc.
# debug-mono-symfile.h is an exception. It is only semi-public.
libmonoruntimeinclude_HEADERS = \
appdomain.h \
assembly.h \
attrdefs.h \
blob.h \
class.h \
debug-helpers.h \
debug-mono-symfile.h \
environment.h \
exception.h \
image.h \
loader.h \
metadata.h \
mono-config.h \
mono-debug.h \
mono-gc.h \
mono-private-unstable.h \
object.h \
object-forward.h \
opcodes.h \
profiler.h \
profiler-events.h \
reflection.h \
row-indexes.h \
sgen-bridge.h \
threads.h \
tokentype.h \
verify.h
if !ENABLE_MSVC_ONLY
EXTRA_DIST = $(null_sources) \
external-only.c \
threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c
endif # !ENABLE_MSVC_ONLY
if ENABLE_MSVC_ONLY
all-local:
make -C $(top_srcdir)/msvc libmonoruntime
clean-local:
make -C $(top_srcdir)/msvc clean-libmonoruntime
endif # ENABLE_MSVC_ONLY
/Makefile
/Makefile.in
/Makefile.am
/*.o
/*.g.c
/*.so
......
此差异已折叠。
/Makefile
/Makefile.in
/Makefile.am
/.libs
/.deps
/*.lo
/*.la
/*.o
/*.a
/platform-type.c
/platform-type-compat.c
/platform-type-unified.c
if !ENABLE_MSVC_ONLY
if MONO_NATIVE_COMPAT
lib_LTLIBRARIES = libmono-native-compat.la libmono-native-unified.la
else
lib_LTLIBRARIES = libmono-native.la
endif
endif # !ENABLE_MSVC_ONLY
CC = $(MONO_NATIVE_CC)
CCLD = $(MONO_NATIVE_CC)
CCAS = $(MONO_NATIVE_CC)
CPP = $(MONO_NATIVE_CC) -E
CXX = $(MONO_NATIVE_CXX)
CXXCPP = $(MONO_NATIVE_CXX) -E
CC_FOR_BUILD = $(MONO_NATIVE_CC)
if !ENABLE_MSVC_ONLY
common_sources = \
pal_config.h \
mono-native-platform.h \
mono-native-platform.c \
../../external/corefx/src/Native/Unix/Common/pal_compiler.h \
../../external/corefx/src/Native/Unix/Common/pal_safecrt.h \
../../external/corefx/src/Native/Unix/Common/pal_types.h \
../../external/corefx/src/Native/Unix/Common/pal_utilities.h \
../../external/corefx/src/Native/Unix/System.Native/pal_errno.c \
../../external/corefx/src/Native/Unix/System.Native/pal_errno.h \
../../external/corefx/src/Native/Unix/System.Native/pal_maphardwaretype.c \
../../external/corefx/src/Native/Unix/System.Native/pal_maphardwaretype.h \
../../external/corefx/src/Native/Unix/System.Native/pal_memory.c \
../../external/corefx/src/Native/Unix/System.Native/pal_memory.h \
../../external/corefx/src/Native/Unix/System.Native/pal_uid.c \
../../external/corefx/src/Native/Unix/System.Native/pal_uid.h \
../../external/corefx/src/Native/Unix/System.Native/pal_time.c \
../../external/corefx/src/Native/Unix/System.Native/pal_time.h \
../../external/corefx/src/Native/AnyOS/brotli/enc/dictionary_hash.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/backward_references_hq.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/histogram.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/memory.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/entropy_encode.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/block_splitter.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/encode.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/cluster.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/backward_references.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/utf8_util.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/compress_fragment.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/brotli_bit_stream.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/bit_cost.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/static_dict.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/literal_cost.c \
../../external/corefx/src/Native/AnyOS/brotli/enc/metablock.c \
../../external/corefx/src/Native/AnyOS/brotli/dec/state.c \
../../external/corefx/src/Native/AnyOS/brotli/dec/decode.c \
../../external/corefx/src/Native/AnyOS/brotli/dec/huffman.c \
../../external/corefx/src/Native/AnyOS/brotli/dec/bit_reader.c \
../../external/corefx/src/Native/AnyOS/brotli/common/dictionary.c
macos_sources = $(unix_sources)
ios_sources = \
pal-icalls.h \
pal-icalls.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
../../external/corefx/src/Native/Unix/System.Native/pal_networking.c \
../../external/corefx/src/Native/Unix/System.Native/pal_networking.h \
../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.c \
../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.h \
../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
../../external/corefx/src/Native/Unix/System.Native/pal_random.h
linux_sources = $(unix_sources)
aix_sources = $(unix_sources)
freebsd_sources = $(unix_sources)
netbsd_sources = $(unix_sources)
haiku_sources = $(unix_sources)
android_sources = \
pal-android.h \
pal-android.c \
pal-icalls.h \
pal-icalls.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.c \
../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.h \
../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
../../external/corefx/src/Native/Unix/System.Native/pal_random.h
unix_sources = \
pal-icalls.h \
pal-icalls.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.c \
../../external/corefx/src/Native/Unix/System.Native/pal_io.h \
../../external/corefx/src/Native/Unix/System.Native/pal_networking.c \
../../external/corefx/src/Native/Unix/System.Native/pal_networking.h \
../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.c \
../../external/corefx/src/Native/Unix/System.Native/pal_networkstatistics.h \
../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.c \
../../external/corefx/src/Native/Unix/System.Native/pal_tcpstate.h \
../../external/corefx/src/Native/Unix/System.Native/pal_random.c \
../../external/corefx/src/Native/Unix/System.Native/pal_random.h
gss_sources = \
../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.c \
../../external/corefx/src/Native/Unix/System.Net.Security.Native/pal_gssapi.h
if ENABLE_GSS
macos_sources += $(gss_sources)
linux_sources += $(gss_sources)
ios_sources += $(gss_sources)
android_sources += $(gss_sources)
endif
EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(freebsd_sources) $(netbsd_sources) $(haiku_sources) $(unix_sources) $(gss_sources)
if MONO_NATIVE_PLATFORM_MACOS
platform_sources = $(macos_sources)
else
if MONO_NATIVE_PLATFORM_IOS
platform_sources = $(ios_sources)
else
if MONO_NATIVE_PLATFORM_LINUX
platform_sources = $(linux_sources)
else
if MONO_NATIVE_PLATFORM_AIX
platform_sources = $(aix_sources)
else
if MONO_NATIVE_PLATFORM_ANDROID
platform_sources = $(android_sources)
else
if MONO_NATIVE_PLATFORM_FREEBSD
platform_sources = $(freebsd_sources)
else
if MONO_NATIVE_PLATFORM_NETBSD
platform_sources = $(netbsd_sources)
else
if MONO_NATIVE_PLATFORM_HAIKU
platform_sources = $(haiku_sources)
endif
endif
endif
endif
endif
endif
endif
endif
common_cppflags = -I$(top_srcdir) -I$(top_srcdir)/mono
common_cflags = \
-I$(abs_top_srcdir)/external/corefx/src/Native/Unix/Common \
-I$(abs_top_srcdir)/external/corefx/src/Native/Unix/System.Native \
-I$(abs_top_srcdir)/external/corefx/src/Native/AnyOS/brotli/include \
$(GLIB_CFLAGS) \
$(SHARED_CFLAGS) \
-DBROTLI_BUILD_NO_RBIT \
-Wno-typedef-redefinition
endif # !ENABLE_MSVC_ONLY
# clear these flags as we set values for each target separately and automake always appends CFLAGS
CFLAGS=
CPPFLAGS=
CXXFLAGS=
LDFLAGS=
CCASFLAGS=
if !ENABLE_MSVC_ONLY
libmono_native_la_SOURCES = $(common_sources) $(platform_sources) platform-type.c
libmono_native_la_CFLAGS = $(MONO_NATIVE_CFLAGS) $(common_cflags)
libmono_native_la_CPPFLAGS = $(MONO_NATIVE_CPPFLAGS) $(common_cppflags)
libmono_native_la_CXXFLAGS = $(MONO_NATIVE_CXXFLAGS)
libmono_native_la_LDFLAGS = $(MONO_NATIVE_LDFLAGS)
libmono_native_la_CCASFLAGS = $(MONO_NATIVE_CCASFLAGS)
libmono_native_la_LIBADD = $(MONO_NATIVE_LIBADD)
libmono_native_compat_la_SOURCES = $(common_sources) $(platform_sources) platform-type-compat.c
libmono_native_compat_la_CFLAGS = $(MONO_NATIVE_COMPAT_CFLAGS) $(common_cflags)
libmono_native_compat_la_CPPFLAGS = $(MONO_NATIVE_COMPAT_CPPFLAGS) $(common_cppflags)
libmono_native_compat_la_CXXFLAGS = $(MONO_NATIVE_COMPAT_CXXFLAGS)
libmono_native_compat_la_LDFLAGS = $(MONO_NATIVE_COMPAT_LDFLAGS)
libmono_native_compat_la_CCASFLAGS = $(MONO_NATIVE_COMPAT_CCASFLAGS)
libmono_native_compat_la_LIBADD = $(MONO_NATIVE_LIBADD)
libmono_native_unified_la_SOURCES = $(common_sources) $(platform_sources) platform-type-unified.c
libmono_native_unified_la_CFLAGS = $(MONO_NATIVE_UNIFIED_CFLAGS) $(common_cflags)
libmono_native_unified_la_CPPFLAGS = $(MONO_NATIVE_UNIFIED_CPPFLAGS) $(common_cppflags)
libmono_native_unified_la_CXXFLAGS = $(MONO_NATIVE_UNIFIED_CXXFLAGS)
libmono_native_unified_la_LDFLAGS = $(MONO_NATIVE_UNIFIED_LDFLAGS)
libmono_native_unified_la_CCASFLAGS = $(MONO_NATIVE_UNIFIED_CCASFLAGS)
libmono_native_unified_la_LIBADD = $(MONO_NATIVE_LIBADD)
test-bundle-local:
mkdir -p $(TEST_BUNDLE_PATH)
cp -L .libs/libmono-native$(libsuffix) $(TEST_BUNDLE_PATH)/
endif # !ENABLE_MSVC_ONLY
#include <config.h>
#include <glib.h>
#include "mono/utils/mono-threads-api.h"
#include "mono/utils/atomic.h"
#include "mono/metadata/icall-internals.h"
#include "mono-native-platform.h"
extern MonoNativePlatformType mono_native_platform_type;
volatile static gboolean module_initialized;
volatile static gint32 module_counter;
int32_t
mono_native_get_platform_type (void)
{
return mono_native_platform_type;
}
static int32_t
ves_icall_MonoNativePlatform_IncrementInternalCounter (void)
{
return mono_atomic_inc_i32 (&module_counter);
}
int32_t
mono_native_is_initialized (void)
{
return module_initialized;
}
void
mono_native_initialize (void)
{
if (mono_atomic_cas_i32 (&module_initialized, TRUE, FALSE) != FALSE)
return;
mono_add_internal_call_with_flags ("Mono.MonoNativePlatform::IncrementInternalCounter", ves_icall_MonoNativePlatform_IncrementInternalCounter, TRUE);
}
#pragma once
#include "mono/utils/mono-publib.h"
// Keep in sync with mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs
typedef enum {
MONO_NATIVE_PLATFORM_TYPE_UNKNOWN = 0,
MONO_NATIVE_PLATFORM_TYPE_MACOS = 1,
MONO_NATIVE_PLATFORM_TYPE_IOS = 2,
MONO_NATIVE_PLATFORM_TYPE_LINUX = 3,
MONO_NATIVE_PLATFORM_TYPE_AIX = 4,
MONO_NATIVE_PLATFORM_TYPE_ANDROID = 5,
MONO_NATIVE_PLATFORM_TYPE_FREEBSD = 6,
MONO_NATIVE_PLATFORM_TYPE_HAIKU = 7,
MONO_NATIVE_PLATFORM_TYPE_NETBSD = 8,
MONO_NATIVE_PLATFORM_TYPE_IPHONE = 0x100,
MONO_NATIVE_PLATFORM_TYPE_TV = 0x200,
MONO_NATIVE_PLATFORM_TYPE_WATCH = 0x400,
MONO_NATIVE_PLATFORM_TYPE_COMPAT = 0x1000,
MONO_NATIVE_PLATFORM_TYPE_UNIFIED = 0x2000,
MONO_NATIVE_PLATFORM_TYPE_SIMULATOR = 0x4000,
MONO_NATIVE_PLATFORM_TYPE_DEVICE = 0x8000
} MonoNativePlatformType;
MONO_API int32_t
mono_native_get_platform_type (void);
MONO_API int32_t
mono_native_is_initialized (void);
MONO_API void
mono_native_initialize (void);
/**
* \file
* System.Native PAL internal calls (Android)
* Adapter code between the Mono runtime and the CoreFX Platform Abstraction Layer (PAL)
* Copyright 2018 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
此差异已折叠。
此差异已折叠。
此差异已折叠。
#include <config.h>
#define MONO 1
/* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */
#if defined (TARGET_WASM) || defined (TARGET_IOS) || defined (TARGET_OSX) || defined (TARGET_WATCHOS) || defined (TARGET_TVOS)
#undef HAVE_CLOCK_MONOTONIC
#undef HAVE_CLOCK_MONOTONIC_COARSE
#endif
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册