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