Version 1.5.6.
[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])
44
45 AC_CHECK_FUNCS([mallinfo])
46
47 if test -d ${srcdir}/.git; then
48         sha=`git show --pretty=format:%H|head -1`
49 else
50         sha=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
51 fi
52 AC_DEFINE_UNQUOTED([PAZPAR2_VERSION_SHA1], ["$sha"], [Git SHA1])
53
54 AC_CONFIG_FILES([
55         Doxyfile
56         Makefile
57         src/Makefile
58         test/Makefile
59         js/Makefile
60         doc/Makefile
61         doc/local.ent
62         doc/common/Makefile
63         doc/common/print.dsl
64         win/version.nsi
65 ])
66
67 AC_OUTPUT
68
69
70 echo \
71 "------------------------------------------------------------------------
72
73   Package:                    ${PACKAGE}
74   Version:                    ${VERSION}
75   Source code location:       ${srcdir}
76   C Preprocessor:             ${CPP}
77   C Preprocessor flags:       ${CPPFLAGS}
78   C Compiler:                 ${CC}
79   C Compiler flags:           ${CFLAGS}
80   Linker flags:               ${LDFLAGS}
81   Linked libs:                ${LIBS}
82   Host System Type:           ${host}
83   Install path:               ${prefix}
84   Automake:                   ${AUTOMAKE}
85   Archiver:                   ${AR}
86   Ranlib:                     ${RANLIB}
87   YAZ Version:                ${YAZVERSION}
88   YAZ Include:                ${YAZINC}
89   YAZ La Lib:                 ${YAZLALIB}
90   YAZ Lib:                    ${YAZLIB}
91   Bugreport:                  ${PACKAGE_BUGREPORT}
92
93 ------------------------------------------------------------------------"
94
95 dnl Local Variables:
96 dnl mode:shell-script
97 dnl sh-indentation:2
98 dnl sh-basic-offset: 4
99 dnl End: