forked from axel-download-accelerator/axel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
143 lines (120 loc) · 2.6 KB
/
configure.ac
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
# Autoconf for axel
# Copyright 2016 Joao Eriberto Mota Filho
# Copyright 2016 Stephen Thirlwall
# Copyright 2017 Antonio Quartulli
# Copyright 2017 Ismael Luceno
# Copyright 2017 Vlad Glagolev
# This file is under same license of Axel
AC_PREREQ([2.69])
PKG_PREREQ([0.29])
AXEL_PKG([axel], [https://github.com/axel-download-accelerator/axel/issues])
AXEL_VER_READ([VERSION])
AC_INIT
AC_CONFIG_SRCDIR([src/conf.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
PKG_PROG_PKG_CONFIG
AM_SILENT_RULES([yes])
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
AC_MSG_ERROR([C99 compiler required])
])
AC_PROG_INSTALL
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([ \
arpa/inet.h \
fcntl.h \
libintl.h \
limits.h \
locale.h \
netdb.h \
netinet/in.h \
stdlib.h \
string.h \
sys/ioctl.h \
sys/socket.h \
sys/time.h \
unistd.h \
])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
# Checks for library functions.
AC_CHECK_FUNCS([ \
getaddrinfo \
gettimeofday \
inet_ntoa \
malloc \
memset \
nanosleep \
realloc \
select \
setlocale \
socket \
strcasecmp \
strchr \
strerror \
strncasecmp \
strpbrk \
strrchr \
strstr \
strtoul \
])
# Optional (but included-by-default) ssl support
AC_ARG_WITH([ssl],
AC_HELP_STRING([--without-ssl],[disable TLS support]), [], [with_ssl=yes])
AS_IF([test "x$with_ssl" != xno], [
PKG_CHECK_MODULES([SSL], [openssl])
AC_DEFINE([HAVE_SSL], [1], [SSL])
], AC_MSG_NOTICE([SSL support disabled]))
# Add Gettext
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18])
# Large file support
AC_SYS_LARGEFILE
#### Definitions ####
# OS
arch=$(uname -s)
AC_DEFINE_UNQUOTED([ARCH], ["$arch"], ["Define architecture"])
# Flags
CFLAGS="$CFLAGS -Wall"
LDFLAGS="$LDFLAGS $LIBINTL"
case "$arch" in
Darwin )
;;
SunOS )
LDFLAGS="$LDFLAGS -pthread -lsocket -lnsl"
;;
HP-UX )
if [ -d /usr/local/lib/hpux32 ]; then
AXEL_EXTRA_FLAGS="-L/usr/local/lib/hpux32"
fi
LDFLAGS="$LDFLAGS $AXEL_EXTRA_FLAGS -lpthread"
;;
* )
LDFLAGS="$LDFLAGS -pthread"
;;
esac
# ---> WARNING: NetBSD not tested! Using OpenBSD settings.
# etc path
AC_DEFINE_UNQUOTED([ETCDIR], ["/etc"], ["Define /etc directory path"])
# Other
AH_TEMPLATE([_REENTRANT], [Local definition])
AC_DEFINE_UNQUOTED([_REENTRANT])
AH_TEMPLATE([_THREAD_SAFE], [Local definition])
AC_DEFINE_UNQUOTED([_THREAD_SAFE])
#####################
AC_CONFIG_FILES([
Makefile
src/Makefile
po/Makefile.in
])
AC_OUTPUT