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