summaryrefslogtreecommitdiffabout
path: root/configure.ac
blob: 6d5df5bd8504a3364a702132f89e9ee3ed5ef3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# This file is part of Eclat -*- autoconf -*-
# Copyright (C) 2012-2014 Sergey Poznyakoff
#
# Eclat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Eclat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Eclat.  If not, see <http://www.gnu.org/licenses/>.

AC_PREREQ(2.63)
AC_INIT([eclat], 1.0, [bug-eclat@gnu.org.ua],,
        [http://www.gnu.org.ua/software/eclat])
AC_CONFIG_SRCDIR([src/eclat.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-xz std-options silent-rules])
dnl AC_CONFIG_LIBOBJ_DIR([src])

# Enable silent rules by default:
AM_SILENT_RULES([yes])

# Checks for programs.
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([getopt.h])

# Check for libcurl
AC_ARG_VAR([CURL_CONFIG],[pathname of the curl-config binary])
AC_ARG_VAR([CURL_CFLAGS],[cc flags to use when compiling with libcurl])
AC_ARG_VAR([CURL_LIBS],[curl libraries to link with])

if test -z "$CURL_LIBS"; then
  if test -z "$CURL_CONFIG"; then
    AC_PATH_PROG(CURL_CONFIG, curl-config, none, $PATH)
  fi
  if test "$CURL_CONFIG" = "none"; then
    AC_MSG_ERROR([cannot find libcurl])
  fi
  CURL_CFLAGS=`$CURL_CONFIG --cflags`
  CURL_LIBS=`$CURL_CONFIG --libs`
  # FIXME: Check curl version?
fi

# Check for libexpat
AC_CHECK_HEADER([expat.h], [],
                [AC_MSG_ERROR([expat.h is not found])])
AC_CHECK_LIB([expat], [XML_Parse],[],
             [AC_MSG_ERROR([required library libexpat is not found])])

# MAPS
AC_SUBST([MAPLIBS])

AC_ARG_WITH([gdbm],
            [AC_HELP_STRING([--with-gdbm],
	                    [use GNU DBM])],
            [case "${withval}" in
	     yes|no) status_gdbm=${withval};;
             *)   AC_MSG_ERROR(bad value ${withval} for --with-gdbm) ;;
             esac],
	    [status_gdbm=auto])

if test $status_gdbm != "no"; then
  AC_CHECK_HEADERS(gdbm.h)
  AC_CHECK_LIB(gdbm, gdbm_open, [dbmlib=-lgdbm], [dbmlib=])
  if test "$ac_cv_header_gdbm_h" = yes && test -n "$dbmlib"; then
    MAPLIBS="$MAPLIBS $dbmlib"
    status_gdbm=yes
    AC_DEFINE(WITH_GDBM,1,[Use GDB GDBM])
  elif test $status_gdbm = yes; then
    AC_MSG_ERROR([required library libgdbm (or its header) is not found])
  else
    status_gdbm=no
  fi
fi  
AM_CONDITIONAL([COND_GDBM],[test $status_gdbm = yes])

# LDAP
AC_ARG_WITH(ldap,
 	    [AC_HELP_STRING([--with-ldap],
       	                    [use OpenLDAP])],
	    [case $withval in
	     yes|no)	status_ldap=$withval;;
             *)   AC_MSG_ERROR(bad value ${withval} for --with-ldap) ;;
             esac],
            [status_ldap=auto])

if test $status_ldap != no; then
  AC_CHECK_HEADERS(ldap.h)
  AC_CHECK_LIB(ldap, ldap_bind,[ldaplib=-lldap],[ldaplib=])
  AC_CHECK_LIB(lber, ber_set_option,[ldaplib="$ldaplib -llber"])
  if test "$ac_cv_header_ldap_h" = yes && test -n "$ldaplib"; then
    MAPLIBS="$MAPLIBS $ldaplib"
    status_ldap=yes
    AC_DEFINE(WITH_LDAP,1,[Use OpenLDAP])
  elif test $status_ldap = yes; then
    AC_MSG_ERROR([required library libldap (or its headers) is not found])
  else
    status_ldap=no
  fi
fi
AM_CONDITIONAL([COND_LDAP],[test $status_ldap = yes])

# Grecs subsystem

GRECS_SETUP([grecs],[tests getopt git2chg])

#
AC_ARG_ENABLE([split-format],
              [AC_HELP_STRING([--enable-split-format],
	                      [build split format files])],
              [split_fmt=$enableval],
	      [split_fmt=no])

AM_CONDITIONAL([SPLIT_FORMATS],[test $split_fmt = yes])	      

# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
AM_MISSING_PROG([AUTOM4TE], [autom4te])

AC_CONFIG_FILES([Makefile
                 lib/Makefile
		 src/Makefile
		 etc/Makefile
		 doc/Makefile])
		 
AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.