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
RevLine 
[7d4fbcd]1dnl Process this file with autoconf to produce a configure script.
[ecc958e]2AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu])
[37f27bc]3AM_INIT_AUTOMAKE([-Wall foreign])
[636de2a]4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
[7d4fbcd]5
[37f27bc]6AC_CONFIG_HEADER([config.h])
[7d4fbcd]7
8AC_PROG_CC
9
[4097723]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],
[ce27cc1]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    ])])
[87afe92]23
[d54035d]24AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
[7d4fbcd]25AC_CHECK_LIB(nsl, gethostbyname)
26AC_CHECK_LIB(socket, socket)
[d09e5a1]27AC_CHECK_LIB(resolv, res_search)
[2c270e6]28
29AC_ARG_WITH([zephyr],
30  [AS_HELP_STRING([--with-libzephyr],
[ec21c62]31    [Enable Zephyr support])],
[2c270e6]32  [],
33  [with_zephyr=check])
34
35AS_IF([test "x$with_zephyr" != xno],
[806f769]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],
[16c0416]49   [LIBS="$LIBS -lzephyr"
50    AC_DEFINE([HAVE_LIBZEPHYR], [1],
[2c270e6]51                [Define if you have libzephyr])
52    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
53      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
54                [Have ZInitLocationInfo]),)
[cc1eeac]55    AC_CHECK_LIB([com_err], [com_err])
56    AC_CHECK_HEADERS([com_err.h])
[2c270e6]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   ])])
[ac70242]63
[dc2ad79]64AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
[b5fe6d2]65AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
[e51b410]66
[7d4fbcd]67dnl Checks for header files.
68AC_HEADER_STDC
69AC_HEADER_SYS_WAIT
[cc1eeac]70AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
[7d4fbcd]71
72dnl Add CFLAGS for embeded perl
73FOO=`perl -MExtUtils::Embed -e ccopts`
[7c09b21]74AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
[7d4fbcd]75CFLAGS=${CFLAGS}\ ${FOO}
76
[e51b410]77dnl Find the location of perl XSUBPP
[8ee73f8d]78AC_MSG_CHECKING(for the perl xsubpp precompiler)
[6794f72]79XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
[8ee73f8d]80if test -n "${XSUBPPDIR}"; then
81   AC_MSG_RESULT(${XSUBPPDIR})
82else
83   AC_MSG_ERROR(not found)
84fi
85
[4ad3480]86if test -f "${XSUBPPDIR}/typemap"; then
87   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
88else
89   XSUBPPFLAGS=""
90fi
91
[18e28a4]92dnl Add LDFLAGS for embedded perl
[3f21b8e]93FOO=`perl -MExtUtils::Embed -e ldopts`
[c08a725]94AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
95LIBS=${LIBS}\ ${FOO}
[7d4fbcd]96
[34509d5]97dnl Add CFLAGS and LDFLAGS for glib-2.0
98PKG_CHECK_MODULES(GLIB,glib-2.0)
99
[7c09b21]100AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
[d9337637]101CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
[7c09b21]102AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
[d9337637]103LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
[34509d5]104
[37f27bc]105if test "x${prefix}" = "xNONE"; then
106   prefix="${ac_default_prefix}"
107fi
[7d4fbcd]108
[37f27bc]109AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
110                   [Package data directory])
[7d4fbcd]111
[37f27bc]112dnl Checks for typedefs, structures, and compiler characteristics.
[c50f589]113
[79245bc]114AX_CFLAGS_WARN_ALL
115
[215c119]116AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
117  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
118
119AC_SUBST([LIBFAIM_CFLAGS])
120
[15bd5ef]121AC_SUBST(XSUBPPDIR)
[4ad3480]122AC_SUBST(XSUBPPFLAGS)
[8ee73f8d]123
[ac70242]124AC_PROG_INSTALL
[37f27bc]125AC_PROG_RANLIB
[ac70242]126
[b9c8d28]127AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
128AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.