File: configure.ac

package info (click to toggle)
sipsak 0.9.6+git20170713-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 396 kB
  • ctags: 466
  • sloc: ansic: 5,910; makefile: 78
file content (106 lines) | stat: -rw-r--r-- 2,938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT([sipsak],[0.9.7pre],[nils@sipsak.org])
AM_INIT_AUTOMAKE([subdir-objects])
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([sipsak.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
# Add -Wall if we are using GCC
if test "x$GCC" = "xyes"; then
  CFLAGS="$CFLAGS -Wall"
fi
SIPSAK_GCC_STACK_PROTECT_CC
CHECK_PROG_DISTCC

AC_PROG_INSTALL

# Checks for libraries.
AC_CANONICAL_HOST

case "$host" in
  *-*-solaris*)
    LIBS="$LIBS -lposix4 -lsocket -lnsl"
    ;;
  *)
    LIBS="$LIBS"
    ;;
esac
AC_SUBST([LIBS])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([ctype.h errno.h arpa/inet.h netdb.h netinet/in.h netinet/in_systm.h limits.h sys/poll.h regex.h signal.h stdarg.h stdlib.h stdio.h string.h sys/param.h sys/socket.h sys/time.h unistd.h sys/utsname.h],,[AC_MSG_ERROR([missing required header (see above)])],)
AC_CHECK_HEADERS([getopt.h syslog.h])
AC_HEADER_SYS_WAIT
AC_HEADER_TIME

SIPSAK_IP_UDP
SIPSAK_ICMP
SIPSAK_RAW_SUPPORT

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([getchar gethostbyname gethostname getopt getpid gettimeofday memset ntohs regcomp select socket strchr strcmp strstr strtol uname],,[AC_MSG_ERROR([missing required function (see above)])])
AC_CHECK_FUNCS([calloc getdomainname getopt_long inet_ntop strncasecmp strcasestr syslog])

# Check if the check unit test framework is available
PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], [
    AC_DEFINE([HAVE_CHECK_H], [1], [Has check.h])
  ], []
)

PKG_CHECK_MODULES([GNUTLS], [gnutls >= 1.0.0], [
    AC_DEFINE([HAVE_GNUTLS], [1], [Has gnutls >= 1.0.0])
    LIBS="${LIBS} ${GNUTLS_LIBS}"
    CFLAGS="${CFLAGS} ${GNUTLS_CFLAGS}"
  ], [
    AC_CHECK_HEADERS([openssl/md5.h], [
      AC_SEARCH_LIBS([MD5_Init], [crypto], [
        AC_DEFINE([HAVE_CRYPTO_WITH_MD5], [1], [The crypto lib has MD5 functions])
      ])
    ])

    AC_CHECK_HEADERS([openssl/sha.h], [
      AC_SEARCH_LIBS([SHA1_Init], [crypto], [
        AC_DEFINE([HAVE_CRYPTO_WITH_SHA1], [1], [The crpyto lib has SHA1 functions])
      ])
    ])
])
PKG_CHECK_MODULES([GNUTLS319], [gnutls >= 3.1.9], [
    AC_DEFINE([HAVE_GNUTLS_319], [1], [Has gntuls >= 3.1.9])
  ], []
)

PKG_CHECK_MODULES([CARES], [libcares], [
  AC_DEFINE([HAVE_CARES_H], [1], [Has cares.h])
  LIBS="$LIBS $CARES_LIBS"
  CFLAGS="$CFLAGS $CARES_CFLAGS"
  AC_CHECK_HEADERS([arpa/nameser.h])
], [
  AC_CHECK_HEADERS([ruli.h], [
    AC_SEARCH_LIBS([ruli_sync_query], [ruli], [
      AC_DEFINE([HAVE_RULI_H], [1], [Has ruli.h])
    ])
  ])
])

# FIXME: this has to replaced with a real check
# LIBS="$LIBS -lssl"

SIPSAK_TIMER
SIPSAK_OLD_FQDN
SIPSAK_TLS
SIPSAK_DBG_PRINT

AC_CONFIG_FILES([Makefile
                 tests/Makefile])
AC_OUTPUT