~ubuntu-branches/ubuntu/trusty/bip/trusty-proposed

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
AC_INIT(src/bip.c)
AM_CONFIG_HEADER(src/config.h)
AM_INIT_AUTOMAKE(bip,0.8.0)
AC_PROG_CC
AC_PROG_INSTALL

AM_PROG_LEX
AC_PROG_YACC

AC_ARG_ENABLE(debug,
	[  --enable-debug                Turn on debugging],
	[ enable_debug=$enableval ],
	[ enable_debug=no ])

AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)

case $enable_debug in
yes)
	CFLAGS="-O0 -g  -W -Wall"
	;;
no)
	CFLAGS="-O2 -W -Wall"
	;;
*)
	AC_MSG_ERROR(bad value ${enable_debug} for --enable-debug)
esac

backtrace=
if test x$enable_debug = xyes ; then
	AC_CHECK_FUNC(backtrace_symbols_fd, [
		AC_DEFINE(HAVE_BACKTRACE, [], [Use Glibcs backtrace function on fatal()])
		LDFLAGS="-rdynamic $LDFLAGS"
		backtrace="(with backtrace)"
	])
fi

AC_ARG_ENABLE(oidentd,
	[  --enable-oidentd                Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)],
	enable_oidentd=yes
	AC_DEFINE([HAVE_OIDENTD], [], [Enable oidentd.conf management support]),
	[enable_oidentd=no]
	)

AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes)

AC_ARG_ENABLE(openssl,
	      [  --disable-openssl           Drop OpenSSL support],
	      [ enable_openssl=$enableval ],
	      [ enable_openssl=yes ])

if test "x$enable_openssl" = "xyes" ; then
	AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [
		AC_MSG_ERROR([library 'crypto' is required for OpenSSL support])
	], -lcrypto) 
    	AC_CHECK_LIB(ssl, SSL_read, [], [
		AC_MSG_ERROR([library 'ssl' is required for OpenSSL support])
	]) 
fi
AC_OUTPUT(Makefile src/Makefile samples/Makefile)

echo OPENSSL: $enable_openssl
echo DEBUG: $enable_debug $backtrace
echo OIDENTD: $enable_oidentd