2 AC_CONFIG_SRCDIR([src/main.c])
3 AM_INIT_AUTOMAKE(nova, 0.1)
5 # Is the system sane for build
11 dnl AC_LIB_LIBNOVA (MINIMUM-VERSION)
13 dnl Check for availability of libnova.
14 dnl Abort if not found or if current version is not up to par.
17 AC_DEFUN([AC_LIB_LIBNOVA],[
18 min_libnova_version=ifelse([$1], ,0.1,$1)
19 AC_CHECK_LIB(nova, ln_get_version, , AC_MSG_ERROR([libnova is required to compile Nova. Please check config.log.]), )
20 AC_MSG_CHECKING(for libnova - version >= $min_libnova_version)
26 #include <libnova/libnova.h>
35 new_str = (char*) malloc ((strlen (str) + 1) * sizeof(char));
36 strcpy (new_str, str);
57 ln_version = my_strdup(ln_get_version());
58 if (sscanf(ln_version, "%d.%d.%d", &ln_major, &ln_minor, &ln_micro) != 3) {
59 printf ("%s, bad version string\n", ln_version);
63 /* HP/UX 9 (%@#!) writes to sscanf strings */
64 tmp_version = my_strdup("$min_libnova_version");
65 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
66 printf ("%s, bad version string\n", "$min_libnova_version");
70 if ((ln_major > major) ||
71 ((ln_major == major) && (ln_minor > minor)) ||
72 ((ln_major == major) && (ln_minor == minor)) && (ln_micro >= micro)) {
76 printf ("*** An old version of libnova (%s) was found.\n", ln_version);
77 printf ("*** You need a version of libnova newer than or equal to %d.%d.%d. The latest version of\n",
79 printf ("*** libnova is always available from http://libnova.sf.net.\n");
84 ],,no_libnova=yes,[/bin/true])
85 if test "x$no_libnova" = x ; then
89 AC_MSG_ERROR([libnova is required to compile Nova. Please check config.log.])
94 AC_LIB_LIBNOVA(0.12.2)
96 # check for libastrodb
98 dnl AC_LIB_LIBNASTRODB (MINIMUM-VERSION)
100 dnl Check for availability of libastrodb.
101 dnl Abort if not found or if current version is not up to par.
104 AC_DEFUN([AC_LIB_LIBNASTRODB],[
105 min_libastrodb_version=ifelse([$1], ,0.1,$1)
106 AC_CHECK_LIB(astrodb, astrodb_get_version, , AC_MSG_ERROR([libastrodb is required to compile Nova. Please check config.log.]), )
107 AC_MSG_CHECKING(for libastrodb - version >= $min_libastrodb_version)
113 #include <libastrodb/astrodb.h>
116 my_strdup (char *str)
122 new_str = (char*) malloc ((strlen (str) + 1) * sizeof(char));
123 strcpy (new_str, str);
135 char *astrodb_version;
144 astrodb_version = my_strdup(astrodb_get_version());
145 if (sscanf(astrodb_version, "%d.%d.%d", &astrodb_major, &astrodb_minor, &astrodb_micro) != 3) {
146 printf ("%s, bad version string\n", astrodb_version);
150 /* HP/UX 9 (%@#!) writes to sscanf strings */
151 tmp_version = my_strdup("$min_libastrodb_version");
152 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
153 printf ("%s, bad version string\n", "$min_libastrodb_version");
157 if ((astrodb_major > major) ||
158 ((astrodb_major == major) && (astrodb_minor > minor)) ||
159 ((astrodb_major == major) && (astrodb_minor == minor)) && (astrodb_micro >= micro)) {
163 printf ("*** An old version of libastrodb (%s) was found.\n", astrodb_version);
164 printf ("*** You need a version of libastrodb newer than or equal to %d.%d.%d. The latest version of\n",
165 major, minor, micro);
166 printf ("*** libastrodb is always available from http://libnovacat.sf.net.\n");
171 ],,no_libastrodb=yes,[/bin/true])
172 if test "x$no_libastrodb" = x ; then
176 AC_MSG_ERROR([libastrodb is required to compile Nova. Please check config.log.])
181 AC_LIB_LIBNASTRODB(0.1.0)
183 # Check for GNOME libs
184 GTK_VERSION_NEEDED=2.12.0
185 AC_SUBST(GTK_VERSION_NEEDED)
186 LIBXML_VERSION_NEEDED=2.6.0
187 AC_SUBST(LIBXML_VERSION_NEEDED)
188 LIBGLADE_VERSION_NEEDED=1.2.0
189 AC_SUBST(LIBGLADE_VERSION_NEEDED)
190 GCONF_VERSION_NEEDED=2.22.0
191 AC_SUBST(GCONF_VERSION_NEEDED)
193 PKG_CHECK_MODULES(NOVA,
194 gtk+-2.0 >= $GTK_VERSION_NEEDED
195 libxml-2.0 >= $LIBXML_VERSION_NEEDED
196 libglade-2.0 >= $LIBGLADE_VERSION_NEEDED
197 gconf-2.0 >= $GCONF_VERSION_NEEDED
200 AC_SUBST(NOVA_CFLAGS)
203 AC_CHECK_FUNCS([sqrt])
204 AC_CHECK_FUNCS([strtol])
205 AC_CHECK_FUNCS([ceil])
206 AC_CHECK_FUNCS([strdup])
207 AC_CHECK_FUNCS([atan2])
215 # Add the languages which your application supports here.
219 # Set NOVA_PIXMAP_DIR in config.h.
220 if test "x${prefix}" = "xNONE"; then
221 AC_DEFINE_UNQUOTED(NOVA_PIXMAP_DIR, "${ac_default_prefix}/nova/pixmaps",[pixmaps])
222 NOVA_PIXMAP_DIR=${ac_default_prefix}/nova/pixmaps
223 AC_SUBST(NOVA_PIXMAP_DIR)
225 AC_DEFINE_UNQUOTED(NOVA_PIXMAP_DIR, "${prefix}/nova/pixmaps",[pixmaps])
226 NOVA_PIXMAP_DIR=${prefix}/nova/pixmaps
227 AC_SUBST(NOVA_PIXMAP_DIR)
230 # Set NOVA_CATALOG_DIR in config.h.
231 if test "x${prefix}" = "xNONE"; then
232 AC_DEFINE_UNQUOTED(NOVA_CATALOG_DIR, "${ac_default_prefix}/nova/catalogs",[catalog])
233 NOVA_CATALOG_DIR=${ac_default_prefix}/nova/catalogs
234 AC_SUBST(NOVA_CATALOG_DIR)
236 AC_DEFINE_UNQUOTED(NOVA_CATALOG_DIR, "${prefix}/nova/catalogs",[catalog])
237 NOVA_CATALOG_DIR=${prefix}/nova/catalogs
238 AC_SUBST(NOVA_CATALOG_DIR)
241 # Set NOVA_GLADE_DIR in config.h.
242 if test "x${prefix}" = "xNONE"; then
243 AC_DEFINE_UNQUOTED(NOVA_GLADE_DIR, "${ac_default_prefix}/nova/glade",[glade])
244 NOVA_GLADE_DIR=${ac_default_prefix}/nova/glade
245 AC_SUBST(NOVA_GLADE_DIR)
247 AC_DEFINE_UNQUOTED(NOVA_GLADE_DIR, "${prefix}/nova/glade",[glade])
248 NOVA_GLADE_DIR=${prefix}/nova/glade
249 AC_SUBST(NOVA_GLADE_DIR)
252 # Set PACKAGE_DATA_DIR in config.h.
253 if test "x${prefix}" = "xNONE"; then
254 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/",[data])
256 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/",[data])