Fix too funny startrecs description
[pazpar2-moved-to-github.git] / configure.ac
1 ## -*- Autoconf -*-
2 ## This file is part of Pazpar2.
3 ## Copyright (C) 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         etc/xsl/Makefile
67         doc/Makefile
68         doc/local0.ent
69         doc/common/Makefile
70         doc/common/print.dsl
71         win/version.nsi
72 ],[
73         diff doc/local.ent doc/local0.ent >/dev/null 2>/dev/null \
74         || cp doc/local0.ent doc/local.ent
75 ])
76
77 echo \
78 "------------------------------------------------------------------------
79
80   Package:                    ${PACKAGE}
81   Version:                    ${VERSION}
82   Source code location:       ${srcdir}
83   C Preprocessor:             ${CPP}
84   C Preprocessor flags:       ${CPPFLAGS}
85   C Compiler:                 ${CC}
86   C Compiler flags:           ${CFLAGS}
87   Linker flags:               ${LDFLAGS}
88   Linked libs:                ${LIBS}
89   Host System Type:           ${host}
90   Install path:               ${prefix}
91   YAZ Version:                ${YAZVERSION}
92   YAZ Include:                ${YAZINC}
93   YAZ Lib:                    ${YAZLIB}
94   Bugreport:                  ${PACKAGE_BUGREPORT}
95
96 ------------------------------------------------------------------------"
97
98 dnl Local Variables:
99 dnl mode:shell-script
100 dnl sh-indentation:2
101 dnl sh-basic-offset: 4
102 dnl End: