Check for mallinfo in common AC_CHECK_FUNCS
[pazpar2-moved-to-github.git] / configure.ac
1 ## -*- Autoconf -*-
2 ## This file is part of Pazpar2.
3 ## Copyright (C) 2006-2011 Index Data
4 ## Process this file with autoconf to produce a configure script.
5
6 # Autoconf and automake setup
7 AC_PREREQ(2.60)
8 AC_INIT([pazpar2],[1.5.6],[pazpar2-help@indexdata.dk])
9
10 AC_CONFIG_HEADERS(src/config.h)
11
12 AC_CONFIG_SRCDIR([configure.ac]) 
13 AC_CONFIG_AUX_DIR([config])
14 AC_CANONICAL_SYSTEM
15
16 AM_INIT_AUTOMAKE([1.9])
17
18 AC_PROG_CC
19 AC_PROG_RANLIB
20
21 AC_LANG(C)
22
23 AC_C_INLINE
24
25 YAZ_INIT([static icu],[4.1.0])
26 if test -z "$YAZLIB"; then
27         AC_MSG_ERROR([YAZ development libraries missing])
28 fi
29 YAZ_DOC
30
31 AC_CHECK_HEADERS([sys/time.h sys/socket.h unistd.h netinet/in.h netdb.h arpa/inet.h])
32 checkBoth=0
33 AC_CHECK_FUNC([connect])
34 if test "$ac_cv_func_connect" = "no"; then
35     AC_CHECK_LIB([socket],[main], LIBS="$LIBS -lsocket", checkBoth=1)
36 fi
37 if test "$checkBoth" = "1"; then
38     oldLibs=$LIBS
39     LIBS="$LIBS -lsocket -lnsl"
40     AC_CHECK_FUNC([accept], , [LIBS=$oldLibs])
41 fi
42 AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
43 AC_CHECK_FUNCS([getaddrinfo mallinfo])
44
45 if test -d ${srcdir}/.git; then
46         sha=`git show --pretty=format:%H|head -1`
47 else
48         sha=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
49 fi
50 AC_DEFINE_UNQUOTED([PAZPAR2_VERSION_SHA1], ["$sha"], [Git SHA1])
51
52 AC_CONFIG_FILES([
53         Doxyfile
54         Makefile
55         src/Makefile
56         test/Makefile
57         js/Makefile
58         doc/Makefile
59         doc/local.ent
60         doc/common/Makefile
61         doc/common/print.dsl
62         win/version.nsi
63 ])
64
65 AC_OUTPUT
66
67
68 echo \
69 "------------------------------------------------------------------------
70
71   Package:                    ${PACKAGE}
72   Version:                    ${VERSION}
73   Source code location:       ${srcdir}
74   C Preprocessor:             ${CPP}
75   C Preprocessor flags:       ${CPPFLAGS}
76   C Compiler:                 ${CC}
77   C Compiler flags:           ${CFLAGS}
78   Linker flags:               ${LDFLAGS}
79   Linked libs:                ${LIBS}
80   Host System Type:           ${host}
81   Install path:               ${prefix}
82   Automake:                   ${AUTOMAKE}
83   Archiver:                   ${AR}
84   Ranlib:                     ${RANLIB}
85   YAZ Version:                ${YAZVERSION}
86   YAZ Include:                ${YAZINC}
87   YAZ La Lib:                 ${YAZLALIB}
88   YAZ Lib:                    ${YAZLIB}
89   Bugreport:                  ${PACKAGE_BUGREPORT}
90
91 ------------------------------------------------------------------------"
92
93 dnl Local Variables:
94 dnl mode:shell-script
95 dnl sh-indentation:2
96 dnl sh-basic-offset: 4
97 dnl End: