about summary refs log tree commit diff
path: root/configure.ac
blob: aef2fedf97530d0653559423187bdf2947269c61 (plain)
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
AC_INIT(btpd, 0.13, btpd@murmeldjur.se)

AM_INIT_AUTOMAKE([foreign])

AC_CONFIG_FILES([Makefile btpd/Makefile misc/Makefile cli/Makefile])

AC_PROG_CC
AC_PROG_RANLIB

CFLAGS="$CFLAGS -std=c99"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64"

AC_ARG_WITH(openssl,
[  --with-openssl=dir      use openssl installed in dir],
[
        AC_SUBST(openssl_LDFLAGS,["-L${withval}/lib -Wl,-rpath=${withval}/lib"])
        AC_SUBST(openssl_CPPFLAGS,"-I${withval}/include")
],
[])

AC_ARG_WITH(warn,
[  --with-warn=level       select warning preset (no,all,allerr)],
[
    case $withval in
    no)
	;;
    all)
	CFLAGS="$CFLAGS -Wall"
	;;
    allerr)
	CFLAGS="$CFLAGS -Wall -Werror"
	;;
    *)
	echo "Warning preset \"$withval\" not recognized. See --help."
	exit 1
	;;
    esac
],
[])

old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $openssl_LDFLAGS"
AC_CHECK_LIB(crypto, SHA1_Final, :, echo Must have openssl; exit 1)
LDFLAGS=$old_LDFLAGS

AC_CONFIG_SUBDIRS([libevent])

AC_OUTPUT