3 AC_INIT([gnome-chemistry-utils], [0.15.2], [http://savannah.nongnu.org/bugs/?group=gchemutils],[gnome-chemistry-utils],[http://gchemutils.nongnu.org/])
4 AC_CONFIG_SRCDIR([libs/gcugtk/gcuperiodic.c])
5 AM_INIT_AUTOMAKE([1.11.1 tar-ustar no-dist-gzip dist-bzip2 dist-xz])
6 AM_MAINTAINER_MODE([enable])
8 AC_CONFIG_MACRO_DIR([m4])
11 AM_SILENT_RULES([yes])
13 AC_CONFIG_HEADERS([config.h])
25 LT_INIT([disable-static])
29 IT_PROG_INTLTOOL([0.40.6])
32 GNOME_COMPILE_WARNINGS([maximum])
33 GNOME_CXX_WARNINGS([yes])
34 GNOME_MAINTAINER_MODE_DEFINES
36 AC_ARG_VAR(GLIB_GENMARSHAL, [The glib-genmarshal executable.])
37 AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal, glib-genmarshal)
39 GCU_VERSION_INFO=`echo $GCU_VERSION | awk -F . '{ print $1+$2":"$3":"$2 }'`
40 AC_SUBST([GCU_VERSION_INFO])
42 GCU_MAJOR_VERSION=`echo $GCU_VERSION | awk -F . '{ print $1}'`
43 GCU_MINOR_VERSION=`echo $GCU_VERSION | awk -F . '{ print $2}'`
44 GCU_MICRO_VERSION=`echo $GCU_VERSION | awk -F . '{ print $3}'`
45 GCU_API_MINOR_VERSION=$(((GCU_MINOR_VERSION+1)/2*2))
47 GCU_API_VER="$GCU_MAJOR_VERSION.$GCU_API_MINOR_VERSION"
48 AC_SUBST([GCU_API_VER])
49 AC_DEFINE_UNQUOTED([API_VERSION], ["$GCU_API_VER"], [API version])
51 if test "$GCU_API_MINOR_VERSION" = "$GCU_MINOR_VERSION" -o $GCU_MICRO_VERSION -ge 90; then
57 STABILITY_POSTFIX=" ($GCU_API_VER unstable)"
61 AC_SUBST([STABILITY_POSTFIX])
62 AM_CONDITIONAL([GCU_IS_STABLE], [test "x$gcu_is_stable" = "xyes"])
65 GETTEXT_PACKAGE="gchemutils-$GCU_API_VER"
66 AC_SUBST([GETTEXT_PACKAGE])
67 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Package name for internationalization])
72 [--enable-update-databases],
74 enable (or disable) the running of the update-desktop-database and update-mime-database
75 utilities (mostly useful for package maintainers) @<:@default=yes@:>@
79 if test "x$enableval" != "xno"; then
80 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
81 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
83 UPDATE_DESKTOP_DATABASE=no
84 UPDATE_MIME_DATABASE=no
88 AC_PATH_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database], [no])
89 AC_PATH_PROG([UPDATE_MIME_DATABASE], [update-mime-database], [no])
93 AM_CONDITIONAL([WITH_UPDATE_DESKTOP], [test "x$UPDATE_DESKTOP_DATABASE" != "xno"])
94 AM_CONDITIONAL([WITH_UPDATE_MIME], [test "x$UPDATE_MIME_DATABASE" != "xno"])
96 dnl install desktop files for kde if needed
100 [--with-kde-mime-dir],
102 path to KDE's directory containing MIME .desktop files
103 (automatically detected via kde-config) @<:@default=auto or ${datadir}/mimelnk@:>@
106 [KDEMIMEDIR=$withval],
108 AC_PATH_PROG([KDECONFIG], [kde-config], [no])
109 if test "x$KDECONFIG" != "xno"; then
110 KDEMIMEDIR="`$KDECONFIG --install mime`"
112 KDEMIMEDIR="${datadir}/mimelnk"
116 AC_MSG_CHECKING([for KDE MIME files (.desktop) installation location])
117 AC_MSG_RESULT([$KDEMIMEDIR])
118 AM_CONDITIONAL([WITH_KDE_MIME], [test "x$KDEMIMEDIR" != "xno"])
119 AC_SUBST([KDEMIMEDIR])
121 AC_PATH_PROG([DOXYGEN], [doxygen], [no])
122 AM_CONDITIONAL([DOXYGEN_AVAILABLE], [test "x$DOXYGEN" != "xno"])
125 for ver in 0.6 0.4 ; do
126 if test "x$lasem" = x; then
127 if pkg-config --exists lasem-$ver; then
132 if test "x$lasem" = x; then
133 # Not important. Things will fail below.
138 dnl Only 0.10.0, or later will work
140 if test "x$libgoffice" = x; then
141 if pkg-config --exists libgoffice-$ver; then
142 libgoffice=libgoffice-$ver
146 if test "x$libgoffice" = x; then
147 # Not important. Things will fail below.
148 libgoffice=libgoffice-0.10
151 PKG_CHECK_MODULES(shared_mime_info, [shared-mime-info >= 0.12])
152 PKG_CHECK_MODULES(cairo, [cairo >= 1.6.0])
153 PKG_CHECK_MODULES(glib, [glib-2.0 >= 2.36.0])
154 PKG_CHECK_MODULES(gio, [gio-2.0 >= 2.36.0])
155 PKG_CHECK_MODULES(gdk_pixbuf, [gdk-pixbuf-2.0 >= 2.22.0])
156 PKG_CHECK_MODULES(gtk, [gtk+-3.0 >= 3.4.0])
157 PKG_CHECK_MODULES(xml, [libxml-2.0 >= 2.4.16])
158 PKG_CHECK_MODULES(lasem, $lasem >= 0.4.1,)
159 PKG_CHECK_MODULES(gsf, [libgsf-1 >= 1.14.9])
160 PKG_CHECK_MODULES(goffice, [$libgoffice >= 0.10.12])
161 PKG_CHECK_MODULES(chemical_mime_data, [chemical-mime-data >= 0.1.94])
162 PKG_CHECK_MODULES(bodr, [bodr >= 5])
163 PKG_CHECK_MODULES(openbabel, [openbabel-2.0 >= 2.3.0])
164 PKG_CHECK_MODULES(x11, [x11 >= 1.0.0])
166 dnl Not sure we need to test for glu.h and glx.h
167 AC_CHECK_HEADER(GL/glu.h,,[AC_MSG_ERROR([Error, GL/glu.h not found.])])
168 AC_CHECK_HEADER(GL/glx.h,,[AC_MSG_ERROR([Error, GL/glx.h not found.])])
170 dnl check if OpenGL rendering to memory should be direct
172 [opengl-direct-rendering],
174 [--enable-opengl-direct-rendering],
175 [ask if OpenGL rendering to memory (when exporting an image or for printing) should be direct @<:@default=yes@:>@]
179 if test "x$enableval" = "xyes"; then
180 DIRECT_RENDERING="true"
182 DIRECT_RENDERING="false"
184 AC_SUBST([DIRECT_RENDERING])
186 dnl check for lsm_itex_to_mathml
188 LIBS="$LIBS $lasem_LIBS"
189 AC_CHECK_FUNCS(lsm_itex_to_mathml)
192 dnl GSettings related stuff
195 dnl retrieve BODR data directory
196 bodr_pkgdatadir=`pkg-config --variable=pkgdatadir bodr`
197 AC_DEFINE_UNQUOTED([BODR_PKGDATADIR], ["$bodr_pkgdatadir"], [Path to Blue Obelisk Data Repository])
199 if test "x$gcu_is_stable" = "xyes"; then
200 GCU_CFLAGS="-Wall -Wextra -Werror=format-security"
202 GCU_CFLAGS="-DG_DISABLE_DEPRECATED -Wall -Wextra -Werror=format-security"
204 AC_SUBST([GCU_CFLAGS])
206 dnl --without is not handled
207 GOFFICE_PLUGINS_DIR=`pkg-config --variable=PluginDir $libgoffice`
209 [goffice-plugins-dir],
211 [--with-goffice-plugins-dir],
212 [path to GOffice plugins directory [default=auto]]
215 if test "x$withval" != "xyes" -a "x$withval" != "xno" ; then
216 GOFFICE_PLUGINS_DIR=$withval
221 dnl test some functions if needed
223 AC_SUBST([GOFFICE_PLUGINS_DIR])
225 ##################################################
226 # Check for xulrunner plugin
227 ##################################################
229 for pack in npapi-sdk xulrunner seamonkey iceape firefox mozilla; do
230 if test "x$xulclient" = x; then
231 if pkg-config --exists $pack-plugin; then
232 xulclient=$pack-plugin
236 if test "x$xulclient" = x; then
237 # Not important. Things will fail below.
238 xulclient=mozilla-plugin
241 build_mozilla_plugin=no
243 test_mozilla_plugin=true
247 [--enable-mozilla-plugin],
248 [build a Mozilla/Firefox chemistry files viewing plugin @<:@default=auto@:>@]
250 [test_mozilla_plugin="$enableval"]
253 if test "x$test_mozilla_plugin" != "xno"; then
254 if test -z "$MOZILLA_CONFIG"; then
255 AC_PATH_PROG([MOZILLA_CONFIG], [mozilla-config], [no])
258 if test "x$MOZILLA_CONFIG" != "xno"; then
259 MOZILLA_CFLAGS=`mozilla-config --cflags`
260 mozlibdir=`mozilla-config --libs | sed 's/-L//'`
265 [build_mozilla_plugin=yes],
266 [AC_MSG_WARN([mozilla-config not found. Mozilla/Netscape plugin will not be built])]
268 mozlibdir=`pkg-config --variable=libdir $xulclient`
271 if test "x$MOZILLA_CFLAGS" != "x"; then
272 build_mozilla_plugin=yes
274 dnl test for npfunctions.h
275 saved_CPPFLAGS=$CPPFLAGS
276 CPPFLAGS=$MOZILLA_CFLAGS
277 AC_CHECK_HEADERS([npfunctions.h])
278 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <npfunctions.h>], [char const *NP_GetMIMEDescription (void);])],
279 [ac_moz_mime_const_char=yes], [ac_moz_mime_const_char=no])
280 CPPFLAGS=$saved_CPPFLAGS
287 [--with-mozilla-libdir],
288 [path to mozilla/firefox/... libdir @<:@default=auto@:>@]
293 if test -z "$mozlibdir"; then
294 build_mozilla_plugin=no
295 AS_WARN([Mozilla plugins directory has not been set, the plugin will not be built])
297 AM_CONDITIONAL([WITH_MOZILLA], [test "x$build_mozilla_plugin" = "xyes"])
298 AC_SUBST([MOZILLA_CFLAGS])
299 AC_SUBST([mozlibdir])
300 if test "x$ac_moz_mime_const_char" = "xyes"; then
301 AC_DEFINE_UNQUOTED([MOZILLA_USES_CONST_CHAR], [1], [Whether NP_GetMIMEDescription returns const char*])
305 ##################################################
307 ##################################################
311 if test "x$libspreadsheet" = x; then
312 if pkg-config --exists libspreadsheet-$ver; then
313 libspreadsheet=libspreadsheet-$ver
317 if test "x$libspreadsheet" = x; then
318 # Not important. Things will fail below.
319 libspreadsheet=libspreadsheet-1.12
322 PKG_CHECK_MODULES(gnumeric, [$libspreadsheet >= 1.12.42], [build_gnumeric_plugin=yes],
323 [build_gnumeric_plugin=no])
324 dnl --without is not handled
326 if test "x$build_gnumeric_plugin" = "xyes"; then
327 GNUMERIC_PLUGINS_DIR=`pkg-config --variable=PluginDir $libspreadsheet`
328 gnm_version=`pkg-config --modversion $libspreadsheet`
330 [gnumeric-plugins-dir],
332 [--with-gnumeric-plugins-dir],
333 [path to Gnumeric plugins directory [default=auto]]
336 if test "x$withval" != "xyes" -a "x$withval" != "xno" ; then
337 GNUMERIC_PLUGINS_DIR=$withval
343 AM_CONDITIONAL([WITH_GNUMERIC], [test "x$build_gnumeric_plugin" = "xyes"])
344 AC_SUBST([GNUMERIC_PLUGINS_DIR])
345 AC_SUBST([gnm_version])
348 ##################################################
349 # Check for various functions
350 ##################################################
353 AC_CHECK_FUNCS(exp10)
356 ##################################################
357 # Check for manpage target applications
358 ##################################################
364 AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
365 AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, gdk-pixbuf-csource)
367 ##################################################
369 ##################################################
373 TESTSSRCDIR="$srcdir/tests"
376 TESTSSRCDIR=`pwd`"/$srcdir/tests"
380 AC_SUBST([TESTSSRCDIR])
387 docs/help/3d/Makefile
388 docs/help/calc/Makefile
389 docs/help/crystal/Makefile
390 docs/help/paint/Makefile
391 docs/help/spectra/Makefile
392 docs/help/table/Makefile
393 docs/man/gcu_entities.dtd
395 docs/reference/Makefile
396 docs/reference/Doxyfile
405 plugins/loaders/Makefile
406 plugins/loaders/cdx/Makefile
407 plugins/loaders/cdxml/Makefile
408 plugins/loaders/cif/Makefile
409 plugins/loaders/cml/Makefile
410 plugins/loaders/ctfiles/Makefile
411 plugins/loaders/nuts/Makefile
412 plugins/paint/Makefile
413 plugins/paint/arrows/Makefile
414 plugins/paint/arrows/org.gnome.gchemutils.paint.plugins.arrows.gschema.xml.in
415 plugins/paint/atoms/Makefile
416 plugins/paint/bonds/Makefile
417 plugins/paint/cycles/Makefile
418 plugins/paint/residues/Makefile
419 plugins/paint/selection/Makefile
420 plugins/paint/templates/Makefile
421 plugins/paint/text/Makefile
422 mozilla-plugin/Makefile
424 gnumeric/plugin.xml.in
431 schemas/org.gnome.gchemutils.gschema.xml.in
432 schemas/org.gnome.gchemutils.crystal.gschema.xml.in
433 schemas/org.gnome.gchemutils.paint.gschema.xml.in
436 programs/3d/gchem3d.desktop.in
437 programs/calc/Makefile
438 programs/calc/gchemcalc.desktop.in
439 programs/crystal/Makefile
440 programs/crystal/gcrystal.desktop.in
441 programs/paint/Makefile
442 programs/paint/gchempaint.desktop.in
443 programs/spectra/Makefile
444 programs/spectra/gspectrum.desktop.in
445 programs/table/Makefile
446 programs/table/gchemtable.desktop.in
448 templates/paint/Makefile
450 themes/paint/Makefile