File: configure.ac

package info (click to toggle)
gbrainy 1:2.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 14,372 kB
  • sloc: cs: 18,019; sh: 3,662; xml: 1,421; makefile: 558
file content (213 lines) | stat: -rw-r--r-- 5,369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Define gbrainy version
m4_define([gbrainy_version_major], [2])
m4_define([gbrainy_version_minor], [3])
m4_define([gbrainy_version_revision], [9])

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],
	[https://bugzilla.gnome.org/enter_bug.cgi?product=gbrainy])

AC_CONFIG_SRCDIR(src/Core/)

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

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE([tar-ustar])

AM_MAINTAINER_MODE

IT_PROG_INTLTOOL([0.35.0])

AM_PROG_LIBTOOL

AM_PATH_GLIB_2_0

dnl --- Check for mono and mcs

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

CSC_DEFINES=""
CS="C#"
if test ! -x "$CSC"; then
	AC_MSG_ERROR([No $CS compiler found])
fi

dnl -- Initialize docs

YELP_HELP_INIT

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


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

needed_assemblies="Mono.Posix Mono.CSharp"
for i in $needed_assemblies; do
  AC_MSG_CHECKING([for $i.dll])
  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])
  else
    AC_MSG_RESULT([found])
  fi
done

dnl --- Required libraries

GTKSHARP_REQUIRED=2.99.1
MONO_REQUIRED=4.0.0
MONO_ADDINS=0.2.0
CANBERRA_GTK_REQUIRED=0.26

PKG_CHECK_MODULES(GBRAINY_CORE, mono >= $MONO_REQUIRED)

PKG_CHECK_MODULES(GBRAINY, gtk-sharp-3.0 >= $GTKSHARP_REQUIRED)
PKG_CHECK_MODULES(GBRAINY, libcanberra-gtk-3-0  >= $CANBERRA_GTK_REQUIRED)
AC_SUBST(GBRAINY_LIBS)

AC_ARG_ENABLE(addins, AC_HELP_STRING([--disable-addins], [Disable mono-addins support]), , enable_addins="no")

enable_addins_sharp="${enable_addins}"

 PKG_CHECK_MODULES(MONO_ADDINS,
	mono-addins0.2 >= $MONO_ADDINS
	mono-addins0.2-setup >= $MONO_ADDINS
	mono-addins0.2-gui >= $MONO_ADDINS,
	enable_addins_sharp="$enable_addins_sharp", enable_addins_sharp=no)

if test "x$enable_addins" = "xyes" -a "x$enable_addins_sharp" = "xno"; then
	AC_MSG_ERROR([mono-addins was not found or is not up to date. Please install mono-addins of at least version $MONO_ADDINS, or disable mono-addins support by --disable-addins])
fi

if test "x$enable_addins" = "xyes"; then
	AC_SUBST(MONO_ADDINS_LIBS)
	CSC_DEFINES="$CSC_DEFINES -d:MONO_ADDINS"
fi

AM_CONDITIONAL(ENABLE_ADDINS, test "x$enable_addins_sharp" = "xyes")

PKG_CHECK_MODULES(GBRAINY_CHECK, librsvg-2.0)

dnl -- Intl

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


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_SUBST(NUNIT_LIBS)
	AC_PATH_PROG(NUNIT, nunit-console)

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

	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")

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

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

dnl --- Debugging support

AC_ARG_ENABLE(debug,
	AC_HELP_STRING([--enable-debug],
		[Use 'Debug' Configuration [default=no]]),
		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

dnl --- Assembly information

BUILD_TIME=`date +"%F %T %Z"`
AC_SUBST(BUILD_TIME)

COPYRIGHT="(c) 2007-2018 Jordi Mas i Hernandez"
AC_SUBST(COPYRIGHT)

dnl --- Prologue

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

AC_SUBST(CSC)
AC_SUBST(CSC_DEFINES)

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)

AC_CONFIG_FILES([src/Clients/Classical/gbrainy],[chmod +x src/Clients/Classical/gbrainy])

GNOME_ICON_THEME_PREFIX=`$PKG_CONFIG --variable=prefix gnome-icon-theme`
AC_SUBST(GNOME_ICON_THEME_PREFIX)

AC_OUTPUT([
src/Core/Main/Defines.cs
src/Clients/Classical/Defines.cs
src/Clients/Classical/AssemblyInfo.cs
src/Clients/WebForms/AssemblyInfo.cs
src/Core/AssemblyInfo.cs
src/Games/AssemblyInfo.cs
Makefile
po/Makefile.in
src/Makefile
tools/Makefile
src/Core/Makefile
src/Games/Makefile
src/Clients/Classical/Makefile
tests/Makefile
data/Makefile
data/gbrainy.pc
help/Makefile
tools/Defines.cs
])

echo "Mono-addins:		${enable_addins_sharp}"
echo "NUnit:			${enable_tests}"
echo "Debug enabled:		${enable_debug}"