source: configure.ac @ cc1eeac

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