File: configure.in

package info (click to toggle)
grisbi 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 22,604 kB
  • ctags: 6,257
  • sloc: ansic: 117,322; sh: 11,246; makefile: 785; perl: 370; xml: 11
file content (354 lines) | stat: -rw-r--r-- 11,155 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
dnl Process this file with autoconf to produce a configure script.

m4_define(grisbi_major_version, 1)
m4_define(grisbi_minor_version, 0)
m4_define(grisbi_micro_version, 0)
m4_define(grisbi_version, grisbi_major_version.grisbi_minor_version.grisbi_micro_version)

AC_INIT([grisbi],[grisbi_version],[http://www.grisbi.org/mantis/login_select_proj_page.php?ref=bug_report_page.php],[grisbi],[http://www.grisbi.org/index.php])

AC_CONFIG_SRCDIR(src/main.c)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AC_DEFINE(GRISBI_MAJOR_VERSION, grisbi_major_version, [grisbi major version])
AC_SUBST(GRISBI_MAJOR_VERSION, grisbi_major_version)
AC_DEFINE(GRISBI_MINOR_VERSION, grisbi_minor_version, [grisbi minor version])
AC_SUBST(GRISBI_MINOR_VERSION, grisbi_minor_version)
AC_DEFINE(GRISBI_MICRO_VERSION, grisbi_micro_version, [grisbi micro version])
AC_SUBST(GRISBI_MICRO_VERSION, grisbi_micro_version)

dnl ================================================================
dnl Standard checks.
dnl ================================================================

AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_HEADER_STDC
AC_PROG_LIBTOOL

dnl needed on osx
AC_PROG_OBJC

dnl Check if we have backtrace support
AC_CHECK_FUNCS(backtrace)

AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2 no-dist-gzip])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl Initialize libtool
LT_INIT

dnl ================================================================
dnl Check for NLS support.
dnl ================================================================

AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.40.0])

GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package.])

dnl ================================================================
dnl Main Grisbi libraries
dnl ================================================================

LT_LIB_M

#PKG_CHECK_MODULES(GRISBI, [gtk+-2.0 >= 2.2.0 glib-2.0 >= 2.2 gmodule-2.0 >= 2.2 zlib])
# Temporary hack until Mandriva ships zlib.pc
PKG_CHECK_MODULES(GRISBI, [gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.18.0])
GRISBI_LIBS="$LIBM $GRISBI_LIBS -lz"
AC_SUBST(GRISBI_LIBS)
# </hack>

dnl ================================================================
dnl XML2
dnl ================================================================

AC_ARG_WITH(libxml2,
	AS_HELP_STRING([--with-libxml2],[libxml2 support for the GnuCash plugin (default=auto)]),
	[build_libxml2=$withval],
	[build_libxml2=auto])

PKG_CHECK_MODULES(XML2, [libxml-2.0 >= 2.0], have_libxml2=yes, have_libxml2=no)
if test "$build_libxml2" = yes -a "$have_libxml2" = no; then
	AC_MSG_ERROR([Libxml2/GnuCash support was requested but libxml2 could not be found.])
fi
if test "$build_libxml2" != no; then
	build_libxml2=$have_libxml2
else
	build_libxml2=no
fi
if test "$build_libxml2" = yes; then
	AC_DEFINE(HAVE_XML2, 1, [Define if libxml2 support is enabled])
fi
AM_CONDITIONAL(HAVE_XML2, [test "$build_libxml2" = yes])

dnl ================================================================
dnl OpenSSL Check
dnl ================================================================

AC_ARG_WITH(openssl,
	AS_HELP_STRING([--with-openssl],[OpenSSL support for file encryption support (default=auto)]),
	[build_openssl=$withval],
	[build_openssl=auto])

PKG_CHECK_MODULES(OPENSSL, [libcrypto >= 0.9.7], have_openssl=yes, have_openssl=no)
if test "$build_openssl" = yes -a "$have_openssl" = no; then
	AC_MSG_ERROR([OpenSSL support was requested but libssl could not be found.])
fi
if test "$build_openssl" != no; then
	build_openssl=$have_openssl
else
	build_openssl=no
fi
if test "$build_openssl" = yes; then
	AC_DEFINE(HAVE_SSL, 1, [Define if OpenSSL support is enabled])
fi
AM_CONDITIONAL(HAVE_SSL, [test "$build_openssl" = yes])

dnl ================================================================
dnl Check for cunit
dnl ================================================================

AC_ARG_WITH(cunit,
	AS_HELP_STRING([--with-cunit],[CUnit support for unit tests (default=auto)]),
	[build_cunit=$withval],
	[build_cunit=auto])

AC_CHECK_HEADER([CUnit/Basic.h], have_cunit=yes, have_cunit=no)
if test "$build_cunit" = yes -a "$have_cunit" = no; then
	AC_MSG_ERROR([CUnit support was requested but headers/library could not be found.])
fi
if test "$build_cunit" != no; then
	build_cunit=$have_cunit
else
	build_cunit=no
fi
if test "$build_cunit" = yes; then
	CUNIT_CFLAGS="-DHAVE_CUNIT"
	CUNIT_LIBS="-lcunit"
fi
AC_SUBST(CUNIT_CFLAGS)
AC_SUBST(CUNIT_LIBS)
AM_CONDITIONAL(HAVE_CUNIT, [test "$build_cunit" = yes])

dnl ================================================================
dnl Check for libofx
dnl ================================================================

AC_ARG_WITH(ofx,
	AS_HELP_STRING([--with-ofx],[build grisbi with ofx support (default=auto)]),
	[build_ofx=$withval],
	[build_ofx=auto])

PKG_CHECK_MODULES(LIBOFX, [libofx >= 0.7], have_ofx=yes, have_ofx=no)
if test "$build_ofx" = yes -a "$with_ofx" = no; then
	AC_MSG_ERROR([Ofx support was requested but libofx could not be found.])
fi
if test "$build_ofx" != no; then
	build_ofx=$have_ofx
else
	build_ofx=no
fi
if test "$build_ofx" = yes; then
	AC_DEFINE(HAVE_OFX, 1, [Build with ofx support])
fi
AM_CONDITIONAL(HAVE_OFX, [test "$build_ofx" = yes])

dnl ================================================================
dnl Check for libgoffice library
dnl ================================================================

AC_ARG_WITH(goffice,
	AS_HELP_STRING([--with-goffice],[GOffice support of graphics (default=auto)]),
	[build_goffice=$withval],
	[build_goffice=auto])

PKG_CHECK_MODULES(GOFFICE, [libgoffice-0.8 >= 0.8.0], have_goffice=yes, have_goffice=no)
if test "$build_goffice" = yes -a "$have_goffice" = no; then
	AC_MSG_ERROR([GOffice support was requested but goffice could not be found.])
fi
if test "$build_goffice" != no; then
	build_goffice=$have_goffice
else
	build_goffice=no
fi
if test "$build_goffice" = yes; then
	AC_DEFINE(HAVE_GOFFICE, 1, [Define if goffice support is enabled])
fi

AM_CONDITIONAL(HAVE_GOFFICE, [test "$build_goffice" = yes])

dnl ================================================================
dnl WError support
dnl ================================================================

AC_ARG_ENABLE(werror,
 	[AC_HELP_STRING([--enable-werror],
 	[Treates warning as errors (default=no)])],,
 	enable_werror=no)
if test "x$enable_werror" = xyes ; then
	if test "x$GCC" = "xyes" ; then
		CFLAGS="$CFLAGS -ansi -Wall -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-function -Wno-unused-result"
		AC_MSG_WARN([Wall and Wunused flags are enabled])
	else
		AC_MSG_WARN([Wall and Wunused can be enabled only with gcc])
	fi
fi

dnl ================================================================
dnl GMemProfile support
dnl ================================================================

AC_ARG_ENABLE(gmemprofile,
 	[AC_HELP_STRING([--enable-gmemprofile],
 	[Outputs a summary of memory usage when grisbi terminates (default=no)])],,
 	enable_gmemprofile=no)
if test "x$enable_gmemprofile" = xyes ; then
	GSB_GMEMPROFILE=1
	AC_MSG_WARN([g_mem_profile is enabled])
else
	GSB_GMEMPROFILE=0
fi
AC_DEFINE_UNQUOTED([GSB_GMEMPROFILE], [${GSB_GMEMPROFILE}],
	[define to 1 if g_mem_profile support is enabled])
AC_SUBST(GSB_GMEMPROFILE)

dnl ================================================================
dnl NoOptim support
dnl ================================================================

AC_ARG_ENABLE(nooptim,
 	[AC_HELP_STRING([--enable-nooptim],
 	[Outputs a summary of memory usage when grisbi terminates (default=no)])],,
 	enable_nooptim=no)
if test "x$enable_nooptim" = xyes ; then
	CFLAGS="$CFLAGS -O0"
	AC_MSG_WARN([-O0 is enabled])
fi
AC_DEFINE_UNQUOTED([GSB_NOOPTIM], [${GSB_NOOPTIM}],
	[define to 1 if g_no_optim support is enabled])
AC_SUBST(GSB_NOOPTIM)

dnl ================================================================
dnl check for osx platform
dnl ================================================================

AC_MSG_CHECKING([for Mac OS X platform])
case "$host" in
  rhapsody* | darwin[1567].*)
    AC_MSG_RESULT([darwin, but too old])
    AC_MSG_ERROR([This platform is not supported, please update to latest  darwin])
    ;;
  *-*-darwin*)
    platform_osx=yes
    ;;
  *)
    platform_osx=no
    ;;
esac
AC_MSG_RESULT([$platform_osx])
AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
if test "x$platform_osx" = xyes; then
  AC_DEFINE([OS_OSX],[1],[Defined if system is Mac OS X])
  dnl check for native osx
  gdk_windowing=`$PKG_CONFIG --variable=target gdk-2.0`
  AC_MSG_CHECKING([for GDK-Quartz])

  if test "x$gdk_windowing" = xquartz; then
        platform=darwin/quartz
        AC_MSG_RESULT(yes)
        AC_DEFINE(GDK_QUARTZ,[1],[Using GDK Quartz (not X11)])
        PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration, [os_osx=yes], [os_osx=no])
        if test "x$os_osx" = xyes; then
	      AC_DEFINE([GTKOSXAPPLICATION],[1],[Defined if app is GtkOSXApplication])
	      AC_SUBST(GTK_MAC_LIBS)
	      AC_SUBST(GTK_MAC_CFLAGS)
        fi
  else
	AC_MSG_RESULT(no)
    os_osx=no
  fi
else
    os_osx=no
fi

dnl ================================================================
dnl french doc
dnl ================================================================

AC_ARG_ENABLE(frenchdoc,
  [AC_HELP_STRING([--disable-frenchdoc],
  [Install french user documentation (default=yes)])],,
  enable_frenchdoc=yes)
AM_CONDITIONAL(FRENCHDOC, test "$enable_frenchdoc" = "yes")


dnl ================================================================
dnl Makefiles
dnl ================================================================

AC_CONFIG_FILES([
Makefile
help/Makefile
help/C/Makefile
help/de/Makefile
help/en/Makefile
help/fr/Makefile
help/fr/image/Makefile
help/fr/image/icon/Makefile
help/fr/image/screenshot/Makefile
pixmaps/Makefile
pixmaps/flags/Makefile
po/Makefile.in
share/Makefile
share/categories/Makefile
share/categories/C/Makefile
share/categories/fr/Makefile
share/categories/fr_FR/Makefile
share/categories/de_DE/Makefile
share/categories/de_AT/Makefile
share/categories/it/Makefile
share/categories/ru/Makefile
src/Makefile
src/tests/Makefile
src/plugins/gnucash/Makefile
src/plugins/ofx/Makefile
src/plugins/openssl/Makefile
src/ui/Makefile
])

AC_OUTPUT

echo "

                Build with libxml2:        $build_libxml2
                Build with OpenSSL:        $build_openssl
                Build with OFX plugin:     $build_ofx
                Build with goffice:        $build_goffice
                Build gtk_mac_integration: $os_osx
                CUnit/unit tests support:  $build_cunit
                Install french user doc:   $enable_frenchdoc

"
if expr ${GRISBI_MINOR_VERSION} % 2 > /dev/null; then

cat << EOF
 *** IMPORTANT ***

This is an unstable version of grisbi. It is for test purposes only.
Please, DO NOT use it in a production environment. It will probably crash and you will lose your data.

If you are looking for a stable release of grisbi (0.8.x), either download it from:
http://sourceforge.net/projects/grisbi/files/grisbi%20stable/

Thanks,
The grisbi team

 *** END OF WARNING ***
EOF

fi