source: configure.ac @ 35a9ec7

Last change on this file since 35a9ec7 was 35a9ec7, checked in by Anders Kaseorg <andersk@mit.edu>, 9 years ago
configure: Look for libcrypto even when configuring --without-krb4 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 5.9 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.10dev],[bug-barnowl@mit.edu])
3AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability foreign])
4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
5
6AC_CONFIG_MACRO_DIR([m4])
7AC_CONFIG_HEADER([config.h])
8
9AC_PROG_CC
10AC_PROG_CC_C99
11
12AC_ARG_WITH([stack-protector],
13  [AS_HELP_STRING([--with-stack-protector],
14    [Enable gcc -fstack-protector])],
15  [],
16  [with_stack_protector=check])
17
18AS_IF([test "x$with_stack_protector" != xno],
19  [AX_CHECK_COMPILE_FLAG([-fstack-protector],
20    [AM_CFLAGS="$AM_CFLAGS -fstack-protector"],
21    [if test "x$with_stack_protector" != xcheck; then
22       AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
23     fi
24    ])])
25
26AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
27AC_CHECK_LIB(panelw, update_panels,, AC_MSG_ERROR(No libpanelw found.))
28AC_SEARCH_LIBS([gethostbyname], [nsl])
29AC_SEARCH_LIBS([socket], [socket])
30AC_SEARCH_LIBS([res_search], [resolv])
31
32AC_ARG_WITH([zephyr],
33  [AS_HELP_STRING([--with-zephyr],
34    [Enable Zephyr support])],
35  [],
36  [with_zephyr=check])
37
38AC_ARG_WITH([krb4],
39  AS_HELP_STRING([--with-krb4],
40                 [Build with kerberos IV]))
41
42AS_IF([test "x$with_zephyr" != xno],
43  [have_krb4=no
44
45   AS_IF([test "x$with_krb4" != "xno"],
46   [AC_MSG_CHECKING([for Kerberos IV])
47    AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
48      [AC_MSG_RESULT([yes])
49       have_krb4=yes
50       AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
51       AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`"
52       LIBS="${LIBS} `krb5-config krb4 --libs`"
53      ],
54      [AC_MSG_RESULT([no])
55       AS_IF([test "x$with_krb4" = "xyes"],
56             [AC_MSG_ERROR([Kerberos IV requested but not found])])])])
57
58   AS_IF([test "x$have_krb4" != xyes],
59     [PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
60      AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
61      LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
62     ])
63
64   AC_CHECK_LIB([zephyr], [ZGetSender],
65   [LIBS="$LIBS -lzephyr"
66    AC_DEFINE([HAVE_LIBZEPHYR], [1],
67                [Define if you have libzephyr])
68    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
69      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
70                [Have ZInitLocationInfo]),)
71    AC_CHECK_LIB([com_err], [com_err])
72    AC_CHECK_HEADERS([com_err.h])
73   ],
74   [if test "x$with_zephyr" != xcheck; then
75      AC_MSG_FAILURE(
76        [--with-zephyr was given, but libzephyr does not seem to be available.])
77    fi
78   ])])
79
80AC_CHECK_FUNCS([use_default_colors])
81AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])])
82AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
83AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
84AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1])
85
86dnl Checks for header files.
87AC_HEADER_STDC
88AC_HEADER_SYS_WAIT
89AC_CHECK_HEADERS(stdbool.h strings.h sys/ioctl.h sys/filio.h unistd.h)
90
91dnl Add CFLAGS for embeded perl
92PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
93AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
94AM_CFLAGS="${AM_CFLAGS} ${PERL_CFLAGS}"
95
96dnl Find the location of perl XSUBPP
97AC_MSG_CHECKING(for the perl xsubpp precompiler)
98XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
99if test -n "${XSUBPPDIR}"; then
100   AC_MSG_RESULT(${XSUBPPDIR})
101else
102   AC_MSG_ERROR(not found)
103fi
104
105if test -f "${XSUBPPDIR}/typemap"; then
106   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
107else
108   XSUBPPFLAGS=""
109fi
110
111dnl Add LIBS for embedded perl
112FOO=`perl -MExtUtils::Embed -e ldopts`
113AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
114LIBS=${LIBS}\ ${FOO}
115AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
116
117AX_PROG_PERL_MODULES([AnyEvent],,
118                     [AC_MSG_ERROR([cannot find perl module AnyEvent.])])
119AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
120                     [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
121AX_PROG_PERL_MODULES([Glib],,
122                     [AC_MSG_ERROR([cannot find perl module Glib.])])
123AX_PROG_PERL_MODULES([PAR],,
124                     [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
125
126dnl Add CFLAGS and LIBS for glib-2.0
127PKG_CHECK_MODULES(GLIB,[glib-2.0 >= 2.16 gobject-2.0 gthread-2.0])
128
129AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
130AM_CFLAGS="${GLIB_CFLAGS} ${AM_CFLAGS}"
131AC_MSG_NOTICE([Adding glib-2.0 LIBS ${GLIB_LIBS}])
132LIBS="${GLIB_LIBS} ${LIBS}"
133
134if test "x${prefix}" = "xNONE"; then
135   prefix="${ac_default_prefix}"
136fi
137
138dnl Checks for typedefs, structures, and compiler characteristics.
139
140AX_CFLAGS_WARN_ALL([AM_CFLAGS])
141AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes -Wwrite-strings],[AM_CFLAGS])
142
143dnl Shut gcc up about zero-length format strings; the warning's apparently for
144dnl efficiency reasons, which is bogus for custom functions.
145AX_APPEND_COMPILE_FLAGS([-Wno-format-zero-length],[AM_CFLAGS])
146
147AX_APPEND_COMPILE_FLAGS([-Wno-pointer-sign -Wno-empty-body -Wno-unused-value],[LIBFAIM_CFLAGS])
148
149AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
150                                 test "$HAVE_DES_KEY_SCHED" && dnl
151                                 test "$HAVE_DES_ECB_ENCRYPT"])
152
153AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600"
154dnl Define _BSD_SOURCE because zephyr needs caddr_t.
155AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE"
156dnl Define __EXTENSIONS__ for strcasecmp on Solaris.
157AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__"
158
159AC_SUBST([AM_CFLAGS])
160AC_SUBST([LIBFAIM_CFLAGS])
161
162AC_SUBST(XSUBPPDIR)
163AC_SUBST(XSUBPPFLAGS)
164
165AC_PROG_INSTALL
166AC_PROG_RANLIB
167AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
168if test "x${HAVE_ZIP}" = "xno"; then
169   AC_MSG_ERROR([cannot find a 'zip' binary.])
170fi
171
172AC_CONFIG_LIBOBJ_DIR([compat])
173AC_CHECK_DECLS([memrchr])
174AC_REPLACE_FUNCS([memrchr])
175
176AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
177AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.