source: configure.ac @ 215c119

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 215c119 was 215c119, checked in by Anders Kaseorg <andersk@mit.edu>, 15 years ago
Compile libfaim with -Wno-pointer-sign if the compiler supports it. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 4.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu])
3AM_INIT_AUTOMAKE([-Wall foreign])
4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
5
6AC_CONFIG_HEADER([config.h])
7
8AC_PROG_CC
9
10dnl Check for Athena
11AC_MSG_CHECKING(for /usr/athena/include)
12if test -d /usr/athena/include; then
13        CFLAGS=${CFLAGS}\ -I/usr/athena/include
14        CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
15        AC_MSG_RESULT(yes)
16else
17        AC_MSG_RESULT(no)
18fi
19AC_MSG_CHECKING(for /usr/athena/lib)
20if test -d /usr/athena/lib; then
21        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
22        AC_MSG_RESULT(yes)
23else
24        AC_MSG_RESULT(no)
25fi
26
27dnl Check for kerberosIV include
28AC_MSG_CHECKING(for kerberosIV)
29if test -d /usr/include/kerberosIV; then
30        CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV
31        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV
32        AC_MSG_RESULT(yes)
33elif test -d /usr/local/include/kerberosIV; then
34        CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV
35        CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV
36        AC_MSG_RESULT(yes)
37elif test -d /usr/include/openssl; then
38        CFLAGS=${CFLAGS}\ -I/usr/include/openssl
39        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl
40        AC_MSG_RESULT(OpenSSL DES found instead)
41else
42        AC_MSG_RESULT(no)
43fi
44
45AC_ARG_WITH([stack-protector],
46  [AS_HELP_STRING([--with-stack-protector],
47    [Enable gcc -fstack-protector])],
48  [],
49  [with_stack_protector=check])
50
51AS_IF([test "x$with_stack_protector" != xno],
52  [AX_C_CHECK_FLAG([-fstack-protector],[],[],
53    [CFLAGS="$CFLAGS -fstack-protector"],
54    [if test "x$with_stack_protector" != xcheck; then
55       AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
56     fi
57    ])])
58
59AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
60AC_CHECK_LIB(com_err, com_err)
61AC_CHECK_LIB(nsl, gethostbyname)
62AC_CHECK_LIB(socket, socket)
63dnl AC_CHECK_LIB(des425, req_act_vno)
64AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
65AC_CHECK_LIB(resolv, res_search)
66
67AC_ARG_WITH([zephyr],
68  [AS_HELP_STRING([--with-libzephyr],
69    [Enable Zephyr support])],
70  [],
71  [with_zephyr=check])
72
73AS_IF([test "x$with_zephyr" != xno],
74  [AC_CHECK_LIB([zephyr], [ZGetSender],
75   [LIBS="$LIBS -lzephyr"
76    AC_DEFINE([HAVE_LIBZEPHYR], [1],
77                [Define if you have libzephyr])
78    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
79      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
80                [Have ZInitLocationInfo]),)
81   ],
82   [if test "x$with_zephyr" != xcheck; then
83      AC_MSG_FAILURE(
84        [--with-libzephyr was given, but libzephyr does not seem to be available.])
85    fi
86   ])])
87
88AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
89AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
90
91dnl Checks for header files.
92AC_HEADER_STDC
93AC_HEADER_SYS_WAIT
94AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
95
96dnl Add CFLAGS for embeded perl
97FOO=`perl -MExtUtils::Embed -e ccopts`
98AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
99CFLAGS=${CFLAGS}\ ${FOO}
100
101dnl Find the location of perl XSUBPP
102AC_MSG_CHECKING(for the perl xsubpp precompiler)
103XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
104if test -n "${XSUBPPDIR}"; then
105   AC_MSG_RESULT(${XSUBPPDIR})
106else
107   AC_MSG_ERROR(not found)
108fi
109
110if test -f "${XSUBPPDIR}/typemap"; then
111   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
112else
113   XSUBPPFLAGS=""
114fi
115
116dnl Add LDFLAGS for embedded perl
117FOO=`perl -MExtUtils::Embed -e ldopts`
118AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
119LIBS=${LIBS}\ ${FOO}
120
121dnl Add CFLAGS and LDFLAGS for glib-2.0
122PKG_CHECK_MODULES(GLIB,glib-2.0)
123
124AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
125CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
126AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
127LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
128
129if test "x${prefix}" = "xNONE"; then
130   prefix="${ac_default_prefix}"
131fi
132
133AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
134                   [Package data directory])
135
136dnl Checks for typedefs, structures, and compiler characteristics.
137
138AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
139  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
140
141AC_SUBST([LIBFAIM_CFLAGS])
142
143AC_SUBST(XSUBPPDIR)
144AC_SUBST(XSUBPPFLAGS)
145
146AC_PROG_INSTALL
147AC_PROG_RANLIB
148
149AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
150AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.