File: configure.ac

package info (click to toggle)
zsync 0.6.2-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,396 kB
  • ctags: 1,052
  • sloc: ansic: 9,015; sh: 3,800; makefile: 42
file content (70 lines) | stat: -rw-r--r-- 1,949 bytes parent folder | download | duplicates (3)
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
# Process this file with autoconf to produce a configure script.

AC_INIT([zsync],[0.6.2],[http://zsync.moria.org.uk/])

AC_CONFIG_SRCDIR([client.c])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([autotools])

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign check-news -Woverride -Wobsolete -Wportability -Wsyntax -Wunsupported])
AM_MAINTAINER_MODE

dnl --- Check for programs
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_RANLIB

AC_ARG_ENABLE([profile],
   AS_HELP_STRING([--enable-profile],[Turns on profiling]))

AS_IF([test "x$enable_profile" = "xyes"], [
   ZS_CFLAGS="${ZS_CFLAGS} -pg" ])

dnl --- Header files, typedefs, structures, libraries
AC_C_CONST
AC_HEADER_STDC
# string.h, memory.h, stdlib.h both included in the default header checks
# but we do need to give at least one .h to test, or Solaris sh errors
AC_CHECK_HEADERS([string.h])
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(memcpy pwrite pread mkstemp)

X_TYPE_SOCKLEN_T
X_TYPE_IN_PORT_T
X_DECL_H_ERRNO

dnl Solaris needs -lsocket - and we need this for the getaddrinfo test
AC_CHECK_LIB(socket,socket)

AC_REPLACE_FUNCS(getaddrinfo)

dnl - Large file support if available
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(off_t)

AM_WITH_DMALLOC

case $host_os in
   mingw32)
       host_os_mingw32=yes
       LIBS="${LIBS} -lwsock32"
       ;;
   *)
       AC_DEFINE([_XOPEN_SOURCE], 600, [Enable POSIX extensions if present])
       AC_DEFINE([_BSD_SOURCE],1, [Enable BSD extensions if present])
       ;;
esac
AM_CONDITIONAL([MINGW32], test "x$host_os_mingw32" = "xyes")

X_C_COMPILE_FLAGS($ZS_CFLAGS -g -Wall -Wwrite-strings -Winline -Wextra -Winline -Wmissing-noreturn -Wredundant-decls -Wnested-externs -Wundef -Wbad-function-cast -Wcast-align -Wvolatile-register-var -ffast-math)

dnl --- output
AC_SUBST(ac_aux_dir)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile librcksum/Makefile zlib/Makefile libzsync/Makefile doc/Makefile])
AC_OUTPUT