1 AC_INIT([CADS_zodiacal_model], [1.0], [cads@iiap.res.in])
2 AC_LANG_C
3 AM_INIT_AUTOMAKE([-Wall -Werror])
4 AC_CONFIG_SRCDIR([config.h.in])
5 AC_CONFIG_HEADERS([config.h])
7 # Checks for programs.
8 AC_PROG_CC
9 AC_PROG_INSTALL
10 AC_PROG_LN_S
11 AC_PROG_MAKE_SET
13 # Checks for libraries.
15 # Checks for header files.
16 AC_CHECK_HEADERS([stdio.h stdlib.h string.h math.h])
18 # Checks for typedefs, structures, and compiler characteristics.
20 # Checks for library functions.
21 AC_FUNC_MALLOC
23 #---------------------------------------------------------------------#
24 # Now we check for libnova headers and library #
25 #---------------------------------------------------------------------#
26 LIBS="$LIBS -L/usr/lib -L/usr/lib64 -L/usr/local/lib \
27 -L/usr/local/lib64 -lnova"
28 CFLAGS="$CFLAGS -I/usr/include -I/usr/include/libnova \
29 -I/usr/local/include -I/usr/local/include/libnova"
31 lnovaerror="
32 +------------------------------------------------------------------+
33 | Unable to find libnova distribution. You may need to get it from |
34 | http://libnova.sourceforge.net/ |
35 +------------------------------------------------------------------+
36 "
37 AC_ARG_WITH(libnova,
38 [ --with-libnova[=DIR] Location of the libnova distribution],
39 [LNOVA=$with_libnova]
40 )
42 if test x"$LNOVA" != 'x'; then
43 LIBS="-L$LNOVA/lib64 -L$LNOVA/lib -L$LNOVA $LIBS"
44 CFLAGS="$CFLAGS -I$LNOVA -I$LNOVA/include -I$LNOVA/include/libnova"
45 fi
47 AC_MSG_CHECKING(for libnova)
48 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
49 #include <stdio.h>
50 #include <stdlib.h>
51 #include <libnova/libnova.h>]],
52 [[ struct ln_lnlat_posn observer;]])],
53 [libnova=yes],[libnova=no])
54 AC_MSG_RESULT([$libnova])
56 if test "$libnova" != "yes"; then
57 AC_MSG_ERROR($lnovaerror)
58 fi
61 AC_OUTPUT(Makefile src/Makefile)
63 echo
64 echo " +------------------------------------------------------------------+"
65 echo " | Configuration complete |"
66 echo " | Type 'make' to compile the software, followed by 'make install' |"
67 echo " | All the very best! :-) |"
68 echo " | --CADS Software Team |"
69 echo " +------------------------------------------------------------------+"
70 echo