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