configure.ac 4.22 KB
Newer Older
1 2
# Define gbrainy version
m4_define([gbrainy_version_major], [2])
Jordi Mas's avatar
Jordi Mas committed
3
m4_define([gbrainy_version_minor], [4])
Jordi Mas's avatar
Jordi Mas committed
4
m4_define([gbrainy_version_revision], [1])
5 6 7 8 9 10 11 12

m4_define([concat], $1$2$3$4)

m4_define([gbrainy_version], concat(gbrainy_version_major.gbrainy_version_minor.gbrainy_version_revision))

m4_define([gbrainy_asm_version], [gbrainy_version_major.gbrainy_version_minor.gbrainy_version_revision.0])

AC_INIT(gbrainy, [gbrainy_version],
Jordi Mas's avatar
Jordi Mas committed
13
	[https://gitlab.gnome.org/GNOME/gbrainy/issues/])
14

15
AC_CONFIG_SRCDIR(src/Core/)
16

17
# Version for assemblies: Major.Minor.Build.Revision
18
ASSEMBLY_VERSION=gbrainy_asm_version
19 20
AC_SUBST(ASSEMBLY_VERSION)

21 22 23 24 25 26
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE([tar-ustar])

AM_MAINTAINER_MODE

27
IT_PROG_INTLTOOL([0.35.0])
28 29 30 31 32

AM_PROG_LIBTOOL

AM_PATH_GLIB_2_0

33
dnl --- Check for mono and mcs
34 35

AC_PATH_PROG(MONO, mono)
36
AC_PATH_PROG(CSC, mcs)
37

Jordi Mas's avatar
Jordi Mas committed
38
CSC_DEFINES=""
39
CS="C#"
Jordi Mas's avatar
Jordi Mas committed
40
if test ! -x "$CSC"; then
41 42 43
	AC_MSG_ERROR([No $CS compiler found])
fi

44
dnl -- Initialize docs
45 46
enable_documentation=no
m4_ifdef([YELP_HELP_INIT],[
47
YELP_HELP_INIT
48 49 50
enable_documentation=yes
])
AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
51 52 53 54 55 56 57 58 59 60

dnl -- Check for mono pc file

AC_MSG_CHECKING([for mono.pc])
if test -z `$PKG_CONFIG --variable=prefix mono`; then
  AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
else
  AC_MSG_RESULT([found])
fi

61

62
dnl -- check for various mono assemblies that we need.
63

Jordi Mas's avatar
Jordi Mas committed
64
needed_assemblies="Mono.Posix Mono.CSharp"
65
for i in $needed_assemblies; do
66
  AC_MSG_CHECKING([for $i.dll])
67 68
  if test ! \( -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/4.5/$i.dll -o -e `$PKG_CONFIG --variable=prefix mono`/lib64/mono/4.5/$i.dll \); then
    AC_MSG_ERROR([missing required mono 4.5 DLL: $i.dll])
69
  else
70
    AC_MSG_RESULT([found])
71 72 73 74 75
  fi
done

dnl --- Required libraries

Jordi Mas's avatar
Jordi Mas committed
76
GTKSHARP_REQUIRED=2.99.1
Jordi Mas's avatar
Jordi Mas committed
77
MONO_REQUIRED=4.0.0
Jordi Mas's avatar
Jordi Mas committed
78
CANBERRA_GTK_REQUIRED=0.26
Jordi Mas's avatar
Jordi Mas committed
79 80 81

PKG_CHECK_MODULES(GBRAINY_CORE, mono >= $MONO_REQUIRED)

Jordi Mas's avatar
Jordi Mas committed
82
PKG_CHECK_MODULES(GBRAINY, gtk-sharp-3.0 >= $GTKSHARP_REQUIRED)
Jordi Mas's avatar
Jordi Mas committed
83
PKG_CHECK_MODULES(GBRAINY, libcanberra-gtk-3-0  >= $CANBERRA_GTK_REQUIRED)
Jordi Mas's avatar
Jordi Mas committed
84 85
PKG_CHECK_MODULES(GBRAINY_CHECK, librsvg-2.0)

86 87 88 89 90 91 92
dnl -- Intl

GETTEXT_PACKAGE=gbrainy
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
AM_GLIB_GNU_GETTEXT

93 94 95 96 97 98 99 100 101 102 103 104 105 106 107

dnl -- NUnit required for (optional) unit tests
NUNIT_REQUIRED=2.4.7

AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
	enable_tests=$enableval, enable_tests="no")

if test "x$enable_tests" = "xno"; then
	do_tests=no
	AM_CONDITIONAL(ENABLE_TESTS, false)
else
	PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
		do_tests="yes", do_tests="no")

	AC_PATH_PROG(NUNIT, nunit-console)
108 109 110 111 112

	if test ! -x "$NUNIT"; then
		AC_MSG_ERROR([Could not find nunit console binary])
	fi

113 114 115 116 117 118 119 120 121
	AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")

	if test "x$do_tests" = "xno"; then
		PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4,
			do_tests="yes", do_tests="no")

		AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")

		if test "x$do_tests" = "xno"; then
122
			AC_MSG_ERROR([Could not find nunit libraries])
123
		fi
124 125 126
	fi
fi

Jordi Mas's avatar
Jordi Mas committed
127 128 129 130
dnl --- Debugging support

AC_ARG_ENABLE(debug,
	AC_HELP_STRING([--enable-debug],
131
		[Use 'Debug' Configuration [default=no]]),
Jordi Mas's avatar
Jordi Mas committed
132 133 134 135 136 137 138
		enable_debug=$enableval, enable_debug=no)
AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" != "xno")

if test "x$enable_debug" != "xno" ; then
	CSC_DEFINES="$CSC_DEFINES -debug -d:DEBUG"
fi

Jordi Mas's avatar
Jordi Mas committed
139
dnl --- Assembly information
140

Jordi Mas's avatar
Jordi Mas committed
141
COPYRIGHT="(c) 2007-2019 Jordi Mas i Hernandez"
142 143
AC_SUBST(COPYRIGHT)

144 145 146 147 148 149 150
dnl --- Prologue

expanded_libdir=`( case $prefix in NONE) prefix=$ac_default_prefix ;; *) ;; esac
		   case $exec_prefix in NONE) exec_prefix=$prefix ;; *) ;; esac
		   eval echo $libdir )`
AC_SUBST(expanded_libdir)

Jordi Mas's avatar
Jordi Mas committed
151
AC_CONFIG_FILES([src/Clients/Classical/gbrainy],[chmod +x src/Clients/Classical/gbrainy])
152 153

AC_OUTPUT([
154 155 156
src/Core/Main/Defines.cs
src/Clients/Classical/Defines.cs
src/Clients/Classical/AssemblyInfo.cs
157
src/Clients/WebForms/AssemblyInfo.cs
Jordi Mas's avatar
Jordi Mas committed
158 159
src/Core/AssemblyInfo.cs
src/Games/AssemblyInfo.cs
160 161 162
Makefile
po/Makefile.in
src/Makefile
163
tools/Makefile
164 165 166
src/Core/Makefile
src/Games/Makefile
src/Clients/Classical/Makefile
167
tests/Makefile
168
data/Makefile
169
data/gbrainy.pc
170
help/Makefile
Jordi Mas's avatar
Jordi Mas committed
171
tools/Defines.cs
172
])
173

174
echo "NUnit:			${enable_tests}"
Jordi Mas's avatar
Jordi Mas committed
175
echo "Debug enabled:		${enable_debug}"
176

177