1 # init autoconf (and check for presence of libnova.h)
2 AC_INIT(src/libastrodb/catalog.h)
3 AC_CONFIG_SRCDIR([src/db.c])
5 # Save this value here, since automake will set cflags later
6 cflags_set=${CFLAGS+set}
9 LIBASTRODB_MAJOR_VERSION=0
10 LIBASTRODB_MINOR_VERSION=1
11 LIBASTRODB_MICRO_VERSION=0
12 LIBASTRODB_VERSION=$LIBASTRODB_MAJOR_VERSION.$LIBASTRODB_MINOR_VERSION.$LIBASTRODB_MICRO_VERSION
13 AC_SUBST(LIBASTRODB_MAJOR_VERSION)
14 AC_SUBST(LIBASTRODB_MINOR_VERSION)
15 AC_SUBST(LIBASTRODB_MICRO_VERSION)
16 AC_SUBST(LIBASTRODB_VERSION)
18 LT_VERSION=$LIBASTRODB_MICRO_VERSION
19 LT_RELEASE=$LIBASTRODB_MAJOR_VERSION.$LIBASTRODB_MINOR_VERSION
23 VERSION=$LIBASTRODB_VERSION
26 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
28 dnl Initialize libtool
33 dnl AC_LIB_LIBNOVA (MINIMUM-VERSION)
35 dnl Check for availability of libnova.
36 dnl Abort if not found or if current version is not up to par.
39 AC_DEFUN([AC_LIB_LIBNOVA],[
40 min_libnova_version=ifelse([$1], ,0.1,$1)
41 AC_CHECK_LIB(nova, ln_get_version, , AC_MSG_ERROR([libnova is required to compile Nova. Please check config.log.]), )
42 AC_MSG_CHECKING(for libnova - version >= $min_libnova_version)
48 #include <libnova/libnova.h>
57 new_str = (char*) malloc ((strlen (str) + 1) * sizeof(char));
58 strcpy (new_str, str);
79 ln_version = my_strdup(ln_get_version());
80 if (sscanf(ln_version, "%d.%d.%d", &ln_major, &ln_minor, &ln_micro) != 3) {
81 printf ("%s, bad version string\n", ln_version);
85 /* HP/UX 9 (%@#!) writes to sscanf strings */
86 tmp_version = my_strdup("$min_libnova_version");
87 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
88 printf ("%s, bad version string\n", "$min_libnova_version");
92 if ((ln_major > major) ||
93 ((ln_major == major) && (ln_minor > minor)) ||
94 ((ln_major == major) && (ln_minor == minor)) && (ln_micro >= micro)) {
98 printf ("*** An old version of libnova (%s) was found.\n", ln_version);
99 printf ("*** You need a version of libnova newer than or equal to %d.%d.%d. The latest version of\n",
100 major, minor, micro);
101 printf ("*** libnova is always available from http://libnova.sf.net.\n");
106 ],,no_libnova=yes,[/bin/true])
107 if test "x$no_libnova" = x ; then
111 AC_MSG_ERROR([libnova is required to compile Nova. Please check config.log.])
116 AC_LIB_LIBNOVA(0.12.2)
118 # Checks for programs.
123 # Check C environment
124 AC_CHECK_FUNCS([bzero])
125 AC_CHECK_FUNCS([strdup])
126 AC_CHECK_FUNCS([strtol])
127 AC_CHECK_FUNCS([dup2])
128 AC_CHECK_FUNCS([gettimeofday])
129 AC_CHECK_FUNCS([mkdir])
130 AC_CHECK_FUNCS([strndup])
131 AC_CHECK_FUNCS([strstr])
132 AC_CHECK_HEADERS([stdlib.h])
133 AC_CHECK_HEADERS([sys/time.h])
138 AC_FUNC_CLOSEDIR_VOID
151 src/libastrodb/Makefile