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