Version 1.6.4
[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.6.4],[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.2.17])
26 if test -z "$YAZLIB"; then
27         AC_MSG_ERROR([YAZ development libraries missing])
28 fi
29 YAZ_DOC
30
31 AC_SEARCH_LIBS([log],[m])
32 AC_CHECK_HEADERS([sys/time.h sys/socket.h unistd.h netinet/in.h netdb.h arpa/inet.h])
33 checkBoth=0
34 AC_CHECK_FUNC([connect])
35 if test "$ac_cv_func_connect" = "no"; then
36     AC_CHECK_LIB([socket],[main], LIBS="$LIBS -lsocket", checkBoth=1)
37 fi
38 if test "$checkBoth" = "1"; then
39     oldLibs=$LIBS
40     LIBS="$LIBS -lsocket -lnsl"
41     AC_CHECK_FUNC([accept], , [LIBS=$oldLibs])
42 fi
43 AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
44 AC_CHECK_FUNCS([getaddrinfo mallinfo])
45
46 if test -d ${srcdir}/.git; then
47         sha=`git show --pretty=format:%H|head -1`
48 else
49         sha=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
50 fi
51 AC_DEFINE_UNQUOTED([PAZPAR2_VERSION_SHA1], ["$sha"], [Git SHA1])
52
53 AC_CONFIG_FILES([
54         Doxyfile
55         Makefile
56         src/Makefile
57         test/Makefile
58         js/Makefile
59         doc/Makefile
60         doc/local.ent
61         doc/common/Makefile
62         doc/common/print.dsl
63         win/version.nsi
64 ])
65
66 AC_OUTPUT
67
68
69 echo \
70 "------------------------------------------------------------------------
71
72   Package:                    ${PACKAGE}
73   Version:                    ${VERSION}
74   Source code location:       ${srcdir}
75   C Preprocessor:             ${CPP}
76   C Preprocessor flags:       ${CPPFLAGS}
77   C Compiler:                 ${CC}
78   C Compiler flags:           ${CFLAGS}
79   Linker flags:               ${LDFLAGS}
80   Linked libs:                ${LIBS}
81   Host System Type:           ${host}
82   Install path:               ${prefix}
83   YAZ Version:                ${YAZVERSION}
84   YAZ Include:                ${YAZINC}
85   YAZ Lib:                    ${YAZLIB}
86   Bugreport:                  ${PACKAGE_BUGREPORT}
87
88 ------------------------------------------------------------------------"
89
90 dnl Local Variables:
91 dnl mode:shell-script
92 dnl sh-indentation:2
93 dnl sh-basic-offset: 4
94 dnl End: