51d188c2666500cd80600334c928611b7ba2365e
[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.2.1],[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 threads],[3.0.46])
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 glob.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         src/Makefile
55         test/Makefile
56         js/Makefile
57         doc/Makefile
58         doc/local.ent
59         doc/common/Makefile
60         doc/common/print.dsl
61         win/version.nsi
62 ])
63
64 AC_OUTPUT
65
66
67 echo \
68 "------------------------------------------------------------------------
69
70   Package:                    ${PACKAGE}
71   Version:                    ${VERSION}
72   Source code location:       ${srcdir}
73   C Preprocessor:             ${CPP}
74   C Preprocessor flags:       ${CPPFLAGS}
75   C Compiler:                 ${CC}
76   C Compiler flags:           ${CFLAGS}
77   Linker flags:               ${LDFLAGS}
78   Linked libs:                ${LIBS}
79   Host System Type:           ${host}
80   Install path:               ${prefix}
81   Automake:                   ${AUTOMAKE}
82   Archiver:                   ${AR}
83   Ranlib:                     ${RANLIB}
84   YAZ Version:                ${YAZVERSION}
85   YAZ Include:                ${YAZINC}
86   YAZ La Lib:                 ${YAZLALIB}
87   YAZ Lib:                    ${YAZLIB}
88   Bugreport:                  ${PACKAGE_BUGREPORT}
89
90 ------------------------------------------------------------------------"
91
92 dnl Local Variables:
93 dnl mode:shell-script
94 dnl sh-indentation:2
95 dnl sh-basic-offset: 4
96 dnl End: