-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac.local
100 lines (96 loc) · 3.25 KB
/
configure.ac.local
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
dnl -- include additional autoconf commands here
dnl -- do not include AC_OUTPUT, this is called for you
dnl Checks for programs.
AC_PROG_YACC
AM_PROG_LEX
dnl ------------------------------------------------------
dnl libevent detection. swiped from memcached. modified a bit.
dnl
AC_SEARCH_LIBS(clock_gettime, rt)
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
dnl trylibeventdir=""
dnl AC_ARG_WITH(libevent,
dnl [ --with-libevent=PATH Specify path to libevent installation ],
dnl [
dnl if test "x$withval" != "xno" ; then
dnl trylibeventdir=$withval
dnl fi
dnl ]
dnl )
dnl
dnl dnl ------------------------------------------------------
dnl dnl libevent detection. swiped from Tor. modified a bit.
dnl dnl
dnl
dnl LIBEVENT_URL=http://www.monkey.org/~provos/libevent/
dnl AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [
dnl saved_LIBS="$LIBS"
dnl saved_LDFLAGS="$LDFLAGS"
dnl saved_CPPFLAGS="$CPPFLAGS"
dnl le_found=no
dnl for ledir in $trylibeventdir "" $prefix /usr/local ; do
dnl LDFLAGS="$saved_LDFLAGS"
dnl LIBS="-levent $saved_LIBS"
dnl
dnl # Skip the directory if it isn't there.
dnl if test ! -z "$ledir" -a ! -d "$ledir" ; then
dnl continue;
dnl fi
dnl if test ! -z "$ledir" ; then
dnl if test -d "$ledir/lib" ; then
dnl LDFLAGS="-L$ledir/lib $LDFLAGS"
dnl else
dnl LDFLAGS="-L$ledir $LDFLAGS"
dnl fi
dnl if test -d "$ledir/include" ; then
dnl CPPFLAGS="-I$ledir/include $CPPFLAGS"
dnl else
dnl CPPFLAGS="-I$ledir $CPPFLAGS"
dnl fi
dnl fi
dnl # Can I compile and link it?
dnl AC_TRY_LINK([#include <sys/time.h>
dnl #include <sys/types.h>
dnl #include <event.h>], [ event_init(); ],
dnl [ libevent_linked=yes ], [ libevent_linked=no ])
dnl if test $libevent_linked = yes; then
dnl if test ! -z "$ledir" ; then
dnl ac_cv_libevent_dir=$ledir
dnl _myos=`echo $target_os | cut -f 1 -d .`
dnl AS_IF(test "$SUNCC" = "yes" -o "x$_myos" = "xsolaris2",
dnl [saved_LDFLAGS="$saved_LDFLAGS -Wl,-R$ledir/lib"],
dnl [AS_IF(test "$GCC" = "yes",
dnl [saved_LDFLAGS="$saved_LDFLAGS -Wl,-rpath,$ledir/lib"])])
dnl else
dnl ac_cv_libevent_dir="(system)"
dnl fi
dnl le_found=yes
dnl break
dnl fi
dnl done
dnl LIBS="$saved_LIBS"
dnl LDFLAGS="$saved_LDFLAGS"
dnl CPPFLAGS="$saved_CPPFLAGS"
dnl if test $le_found = no ; then
dnl AC_MSG_ERROR([libevent is required. You can get it from $LIBEVENT_URL
dnl
dnl If it's already installed, specify its path using --with-libevent=/dir/
dnl ])
dnl fi
dnl ])
dnl LIBS="-levent $LIBS"
dnl if test $ac_cv_libevent_dir != "(system)"; then
dnl if test -d "$ac_cv_libevent_dir/lib" ; then
dnl LDFLAGS="-L$ac_cv_libevent_dir/lib $LDFLAGS"
dnl le_libdir="$ac_cv_libevent_dir/lib"
dnl else
dnl LDFLAGS="-L$ac_cv_libevent_dir $LDFLAGS"
dnl le_libdir="$ac_cv_libevent_dir"
dnl fi
dnl if test -d "$ac_cv_libevent_dir/include" ; then
dnl CPPFLAGS="-I$ac_cv_libevent_dir/include $CPPFLAGS"
dnl else
dnl CPPFLAGS="-I$ac_cv_libevent_dir $CPPFLAGS"
dnl fi
dnl fi