File: configure.ac

package info (click to toggle)
libtorrent 0.13.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,956 kB
  • sloc: cpp: 32,196; makefile: 520; xml: 163; ansic: 153; sh: 45
file content (148 lines) | stat: -rw-r--r-- 3,730 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
AC_INIT(libtorrent, 0.13.7, sundell.software@gmail.com)

LT_INIT([disable-static])

dnl Find a better way to do this
AC_DEFINE(PEER_NAME, "-lt0D70-", Identifier that is part of the default peer id)
AC_DEFINE(PEER_VERSION, "lt\x0D\x70", 4 byte client and version identifier for DHT)

LIBTORRENT_CURRENT=20
LIBTORRENT_REVISION=0
LIBTORRENT_AGE=0

LIBTORRENT_INTERFACE_VERSION_INFO=$LIBTORRENT_CURRENT:$LIBTORRENT_REVISION:$LIBTORRENT_AGE
LIBTORRENT_INTERFACE_VERSION_NO=$LIBTORRENT_CURRENT.$LIBTORRENT_AGE.$LIBTORRENT_REVISION

AC_SUBST(LIBTORRENT_CURRENT)
AC_SUBST(LIBTORRENT_INTERFACE_VERSION_INFO)
AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO)

AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)

AC_PROG_CXX

AC_C_BIGENDIAN(
    AC_DEFINE(IS_BIG_ENDIAN, 1, Big endian),
    AC_DEFINE(IS_LITTLE_ENDIAN, 1, Little endian),
    AC_MSG_ERROR([Could not determine endianness])
)

RAK_CHECK_CFLAGS
RAK_CHECK_CXXFLAGS
RAK_ENABLE_DEBUG
RAK_ENABLE_EXTRA_DEBUG
RAK_ENABLE_WERROR

RAK_CHECK_CXX11
RAK_CHECK_TR1_LIB

AC_SYS_LARGEFILE

TORRENT_ENABLE_ALIGNED
TORRENT_ENABLE_INTERRUPT_SOCKET

TORRENT_ENABLE_ARCH
TORRENT_WITH_SYSROOT

dnl TORRENT_WITH_XFS
TORRENT_WITHOUT_KQUEUE
TORRENT_WITHOUT_EPOLL
TORRENT_CHECK_FALLOCATE
TORRENT_WITH_POSIX_FALLOCATE
TORRENT_WITH_ADDRESS_SPACE

TORRENT_WITHOUT_STATVFS
TORRENT_WITHOUT_STATFS
TORRENT_WITH_INOTIFY

CC_ATTRIBUTE_VISIBILITY

AX_PTHREAD
AX_CHECK_ZLIB

PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])

CFLAGS="$PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CFLAGS"
CXXFLAGS="$PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CXXFLAGS"
LIBS="$PTHREAD_LIBS $CPPUNIT_LIBS $LIBS"

AC_ARG_ENABLE(openssl,
  [  --disable-openssl       Don't use OpenSSL's SHA1 implementation.],
  [
    if test "$enableval" = "yes"; then
dnl move to scripts.
      PKG_CHECK_MODULES(OPENSSL, libcrypto,
        CXXFLAGS="$CXXFLAGS $OPENSSL_CFLAGS";
        LIBS="$LIBS $OPENSSL_LIBS")

      AC_DEFINE(USE_OPENSSL, 1, Using OpenSSL.)
      AC_DEFINE(USE_OPENSSL_SHA, 1, Using OpenSSL's SHA1 implementation.)
      AC_CHECK_LIB([crypto], [DH_set0_pqg], [AC_DEFINE(USE_OPENSSL_1_1, 1, Using OpenSSL 1.1.)])

    else
      AC_DEFINE(USE_NSS_SHA, 1, Using Mozilla's SHA1 implementation.)
    fi
  ],[
    PKG_CHECK_MODULES(OPENSSL, libcrypto,
      CXXFLAGS="$CXXFLAGS $OPENSSL_CFLAGS";
      LIBS="$LIBS $OPENSSL_LIBS")

    AC_DEFINE(USE_OPENSSL, 1, Using OpenSSL.)
    AC_DEFINE(USE_OPENSSL_SHA, 1, Using OpenSSL's SHA1 implementation.)
    AC_CHECK_LIB([crypto], [DH_set0_pqg], [AC_DEFINE(USE_OPENSSL_1_1, 1, Using OpenSSL 1.1.)])
  ]
)

AC_ARG_ENABLE(cyrus-rc4,
  [  --enable-cyrus-rc4=PFX  Use Cyrus RC4 implementation.],
  [
    CXXFLAGS="$CXXFLAGS -I${enableval}/include";
    LIBS="$LIBS -lrc4 -L${enableval}/lib"
    AC_DEFINE(USE_CYRUS_RC4, 1, Using Cyrus RC4 implementation.)
  ]
)

AC_CHECK_FUNCS(posix_memalign)

TORRENT_CHECK_MADVISE()
TORRENT_CHECK_CACHELINE()
TORRENT_CHECK_POPCOUNT()
TORRENT_CHECK_EXECINFO()
TORRENT_CHECK_PTHREAD_SETNAME_NP()
TORRENT_MINCORE()

TORRENT_DISABLE_INSTRUMENTATION

LIBTORRENT_LIBS="-ltorrent"
AC_SUBST(LIBTORRENT_LIBS)

LIBTORRENT_CFLAGS=""
AC_SUBST(LIBTORRENT_CFLAGS)

AC_DEFINE(HAVE_CONFIG_H, 1, true if config.h was included)

CC_ATTRIBUTE_UNUSED(
	AC_DEFINE([__UNUSED], [__attribute__((unused))], [Wrapper around unused attribute]),
	AC_DEFINE([__UNUSED], [], [Null-wrapper if unused attribute is unsupported])
)

AC_OUTPUT([
	libtorrent.pc
	Makefile
	src/Makefile
	src/torrent/Makefile
	src/torrent/data/Makefile
	src/torrent/download/Makefile
	src/torrent/net/Makefile
	src/torrent/peer/Makefile
	src/torrent/utils/Makefile
	src/data/Makefile
	src/dht/Makefile
	src/download/Makefile
	src/net/Makefile
	src/protocol/Makefile
	src/tracker/Makefile
	src/utils/Makefile
        test/Makefile
])