-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.in
81 lines (64 loc) · 1.99 KB
/
configure.in
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
AC_INIT(esniper, 2.33.0, [email protected])
AM_INIT_AUTOMAKE(-Wall subdir-objects)
AC_PROG_CC
AC_PROG_MAKE_SET
#magic for conditional check in Makefile:
MK=''; AC_SUBST(MK)
SED=sed
AC_ARG_WITH(curl-config, [ --with-curl-config=PATH Location of libcurl curl-config []], curl_config="$withval", curl_config="curl-config")
if test -f $curl_config ; then
CURL_CONFIG=$curl_config
AC_MSG_RESULT(yes)
else dnl check in path
AC_CHECK_PROGS(CURL_CONFIG, curl-config)
fi
if test "X$CURL_CONFIG" = "X"; then
AC_MSG_ERROR($curl_config not found.
cURL is available from http://curl.haxx.se/)
fi
CURLCFLAGS="`$CURL_CONFIG --cflags`"
CURLLIBS=`$CURL_CONFIG --libs`
AC_SUBST(CURLCFLAGS)
AC_SUBST(CURLLIBS)
CFLAGS="$CURLCFLAGS $CFLAGS"
LIBS="$CURLLIBS $LIBS"
dnl check version curl_easy were added in 7.1.1
check_min=7.1.1
AC_CHECK_FUNC(curl_easy_setopt,
[],
AC_MSG_ERROR([cURL $check_min or newer required \
(cURL is available from http://curl.haxx.se/)]))
AC_CHECK_FUNC(curl_easy_strerror,
[],
CURLCFLAGS="$CURLCFLAGS -D NEED_CURL_EASY_STRERROR")
dnl check for curl SSL support
AC_MSG_CHECKING(for cURL SSL support)
if test XSSL != X`$CURL_CONFIG --feature|grep SSL`; then
AC_MSG_ERROR([no SSL
cURL is available from http://curl.haxx.se/])
else
AC_MSG_RESULT(yes)
fi
# debug
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Compile the debug version (default: disabled)]),
[enable_debug=$enableval],
[enable_debug=no])
AM_CONDITIONAL([DEBUG], [test $enable_debug = "yes"])
if test "x$enable_debug" = "xyes"; then
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
changequote([,])
dnl add -O0 only if GCC or ICC is used
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
CFLAGS="$CFLAGS -g -O0 -Wall"
CXXFLAGS="$CXXFLAGS -g -O0 -Wall"
fi
else
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-g//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-g//g'`
changequote([,])
fi
AC_OUTPUT(Makefile)