moving generated config.h to src to allow 'make dist'
[viking.git] / configure.ac
blobac6cdcb0e3a3bb042d793ae51b1ae3a631975e88
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT(viking, 0.1.1pre2)
6 AM_INIT_AUTOMAKE()
7 dnl AC_CONFIG_SRCDIR([src/main.c])
8 AC_CONFIG_HEADERS([src/config.h])
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_MAKE_SET
14 AC_CHECK_PROG([GDK_PIXBUF_CSOURCE],gdk-pixbuf-csource,[yes])
15 if test $GDK_PIXBUF_CSOURCE != "yes"
16 then
17   AC_MSG_ERROR([gdk-pixbuf-csource is needed but not found])
20 # Checks for libraries.
21 AM_PATH_GTK_2_0(2.2.0,,AC_MSG_ERROR(needs GTK+ 2.2.0),gthread)
23 # Checks for header files.
24 AC_HEADER_STDC
25 AC_CHECK_HEADERS([malloc.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h])
27 # Checks for typedefs, structures, and compiler characteristics.
28 AC_C_CONST
29 AC_TYPE_MODE_T
31 # Checks for library functions.
32 AC_FUNC_STAT
33 AC_FUNC_STRTOD
34 AC_CHECK_FUNCS([bzero floor gethostbyname memset mkdir pow realpath socket sqrt strcasecmp strchr strdup strncasecmp strtol strtoul])
36 # Expat
38 # Options
39 AC_ARG_ENABLE(alphabetized-trw, AC_HELP_STRING([--enable-alphabetized-trw],
40               [enable alphabetized track & waypoints (default is enable)]),
41               [ac_cv_enable_alpha_trw=$enableval],
42               [ac_cv_enable_alpha_trw=yes])
43 AC_CACHE_CHECK([whether to enable alphabetized track & waypoint],
44                [ac_cv_enable_alpha_trw], [ac_cv_enable_alpha_trw=yes])
45 case $ac_cv_enable_alpha_trw in
46   yes)
47     AC_DEFINE(VIK_CONFIG_ALPHABETIZED_TRW, [], [NO ALPHABETIZED TRW])
48     ;;
49 esac
51 AC_ARG_WITH(mapcache,
52             [AC_HELP_STRING([--with-mapcache],
53                             [specify the size of the map cache (default is 50331648)])],
54             [if test "x$withval" = "xno"; then
55                 VIK_CONFIG_MAPCACHE_SIZE=0;
56              elif test "x$withval" = "xyes"; then
57                 AC_MSG_ERROR([Please, set a value for size of the map cache])
58              else
59                 VIK_CONFIG_MAPCACHE_SIZE=${withval}
60              fi],
61              [VIK_CONFIG_MAPCACHE_SIZE=50331648])
62 AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPCACHE_SIZE, ${VIK_CONFIG_MAPCACHE_SIZE},
63                    [Size of the map cache])
65 # Configuration
66 AC_CONFIG_FILES([Makefile
67                  src/Makefile
68                  src/icons/Makefile
69                  doc/Makefile
70                  doc/dev/Makefile])
71 AC_OUTPUT