1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT([BarnOwl],[1.4rc2],[bug-barnowl@mit.edu]) |
---|
3 | AM_INIT_AUTOMAKE([-Wall foreign]) |
---|
4 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
---|
5 | |
---|
6 | AC_CONFIG_MACRO_DIR([m4]) |
---|
7 | AC_CONFIG_HEADER([config.h]) |
---|
8 | |
---|
9 | AC_PROG_CC |
---|
10 | |
---|
11 | AC_ARG_WITH([stack-protector], |
---|
12 | [AS_HELP_STRING([--with-stack-protector], |
---|
13 | [Enable gcc -fstack-protector])], |
---|
14 | [], |
---|
15 | [with_stack_protector=check]) |
---|
16 | |
---|
17 | AS_IF([test "x$with_stack_protector" != xno], |
---|
18 | [AX_C_CHECK_FLAG([-fstack-protector],[],[], |
---|
19 | [CFLAGS="$CFLAGS -fstack-protector"], |
---|
20 | [if test "x$with_stack_protector" != xcheck; then |
---|
21 | AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) |
---|
22 | fi |
---|
23 | ])]) |
---|
24 | |
---|
25 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
26 | AC_SEARCH_LIBS([gethostbyname], [nsl]) |
---|
27 | AC_SEARCH_LIBS([socket], [socket]) |
---|
28 | AC_SEARCH_LIBS([res_search], [resolv]) |
---|
29 | |
---|
30 | AC_ARG_WITH([zephyr], |
---|
31 | [AS_HELP_STRING([--with-libzephyr], |
---|
32 | [Enable Zephyr support])], |
---|
33 | [], |
---|
34 | [with_zephyr=check]) |
---|
35 | |
---|
36 | AS_IF([test "x$with_zephyr" != xno], |
---|
37 | [AC_MSG_CHECKING([for Kerberos IV]) |
---|
38 | AS_IF([krb5-config krb4 --libs >/dev/null 2>&1], |
---|
39 | [AC_MSG_RESULT([yes]) |
---|
40 | AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV]) |
---|
41 | CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`" |
---|
42 | LIBS="${LIBS} `krb5-config krb4 --libs`" |
---|
43 | ], |
---|
44 | [AC_MSG_RESULT([no]) |
---|
45 | PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto]) |
---|
46 | CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}" |
---|
47 | LIBS="${LIBS} ${LIBCRYPTO_LIBS}" |
---|
48 | ]) |
---|
49 | AC_CHECK_LIB([zephyr], [ZGetSender], |
---|
50 | [LIBS="$LIBS -lzephyr" |
---|
51 | AC_DEFINE([HAVE_LIBZEPHYR], [1], |
---|
52 | [Define if you have libzephyr]) |
---|
53 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
---|
54 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
---|
55 | [Have ZInitLocationInfo]),) |
---|
56 | AC_CHECK_LIB([com_err], [com_err]) |
---|
57 | AC_CHECK_HEADERS([com_err.h]) |
---|
58 | ], |
---|
59 | [if test "x$with_zephyr" != xcheck; then |
---|
60 | AC_MSG_FAILURE( |
---|
61 | [--with-libzephyr was given, but libzephyr does not seem to be available.]) |
---|
62 | fi |
---|
63 | ])]) |
---|
64 | |
---|
65 | AC_CHECK_FUNCS([use_default_colors resizeterm]) |
---|
66 | AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt]) |
---|
67 | AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched]) |
---|
68 | |
---|
69 | dnl Checks for header files. |
---|
70 | AC_HEADER_STDC |
---|
71 | AC_HEADER_SYS_WAIT |
---|
72 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h) |
---|
73 | |
---|
74 | dnl Add CFLAGS for embeded perl |
---|
75 | PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts` |
---|
76 | AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}]) |
---|
77 | CFLAGS="${CFLAGS} ${PERL_CFLAGS}" |
---|
78 | |
---|
79 | dnl Find the location of perl XSUBPP |
---|
80 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
81 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
82 | if test -n "${XSUBPPDIR}"; then |
---|
83 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
84 | else |
---|
85 | AC_MSG_ERROR(not found) |
---|
86 | fi |
---|
87 | |
---|
88 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
89 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
90 | else |
---|
91 | XSUBPPFLAGS="" |
---|
92 | fi |
---|
93 | |
---|
94 | dnl Add LDFLAGS for embedded perl |
---|
95 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
96 | AC_MSG_NOTICE([Adding perl LIBS ${FOO}]) |
---|
97 | LIBS=${LIBS}\ ${FOO} |
---|
98 | |
---|
99 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
100 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
101 | |
---|
102 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
---|
103 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
104 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
---|
105 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
106 | |
---|
107 | if test "x${prefix}" = "xNONE"; then |
---|
108 | prefix="${ac_default_prefix}" |
---|
109 | fi |
---|
110 | |
---|
111 | AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"], |
---|
112 | [Package data directory]) |
---|
113 | |
---|
114 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
115 | |
---|
116 | AX_CFLAGS_WARN_ALL |
---|
117 | AX_CFLAGS_STRICT_PROTOTYPES |
---|
118 | |
---|
119 | AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[], |
---|
120 | [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"]) |
---|
121 | |
---|
122 | AC_SUBST([LIBFAIM_CFLAGS]) |
---|
123 | |
---|
124 | AC_SUBST(XSUBPPDIR) |
---|
125 | AC_SUBST(XSUBPPFLAGS) |
---|
126 | |
---|
127 | AC_PROG_INSTALL |
---|
128 | AC_PROG_RANLIB |
---|
129 | |
---|
130 | AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile]) |
---|
131 | AC_OUTPUT |
---|