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