[7d4fbcd] | 1 | dnl Process this file with autoconf to produce a configure script. |
---|
[07f655b] | 2 | AC_INIT([BarnOwl],[1.7dev],[bug-barnowl@mit.edu]) |
---|
[cecb125] | 3 | AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability 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.)) |
---|
[59077f9] | 26 | AC_CHECK_LIB(panelw, update_panels,, AC_MSG_ERROR(No libpanelw found.)) |
---|
[363eb9d] | 27 | AC_SEARCH_LIBS([gethostbyname], [nsl]) |
---|
| 28 | AC_SEARCH_LIBS([socket], [socket]) |
---|
| 29 | AC_SEARCH_LIBS([res_search], [resolv]) |
---|
[2c270e6] | 30 | |
---|
| 31 | AC_ARG_WITH([zephyr], |
---|
[438009c] | 32 | [AS_HELP_STRING([--with-zephyr], |
---|
[ec21c62] | 33 | [Enable Zephyr support])], |
---|
[2c270e6] | 34 | [], |
---|
| 35 | [with_zephyr=check]) |
---|
| 36 | |
---|
[ddbb43ad] | 37 | AC_ARG_WITH([krb4], |
---|
| 38 | AS_HELP_STRING([--with-krb4], |
---|
| 39 | [Build with kerberos IV])) |
---|
| 40 | |
---|
[2c270e6] | 41 | AS_IF([test "x$with_zephyr" != xno], |
---|
[ddbb43ad] | 42 | [AS_IF([test "x$with_krb4" != "xno"], |
---|
| 43 | [AC_MSG_CHECKING([for Kerberos IV]) |
---|
| 44 | AS_IF([krb5-config krb4 --libs >/dev/null 2>&1], |
---|
| 45 | [AC_MSG_RESULT([yes]) |
---|
| 46 | AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV]) |
---|
| 47 | CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`" |
---|
| 48 | LIBS="${LIBS} `krb5-config krb4 --libs`" |
---|
| 49 | ], |
---|
| 50 | [AC_MSG_RESULT([no]) |
---|
| 51 | AS_IF([test "x$with_krb4" = "xyes"], |
---|
| 52 | [AC_MSG_ERROR([Kerberos IV requested but not found])]) |
---|
| 53 | PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto]) |
---|
| 54 | CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}" |
---|
| 55 | LIBS="${LIBS} ${LIBCRYPTO_LIBS}" |
---|
| 56 | ])]) |
---|
[806f769] | 57 | AC_CHECK_LIB([zephyr], [ZGetSender], |
---|
[16c0416] | 58 | [LIBS="$LIBS -lzephyr" |
---|
| 59 | AC_DEFINE([HAVE_LIBZEPHYR], [1], |
---|
[2c270e6] | 60 | [Define if you have libzephyr]) |
---|
| 61 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
---|
| 62 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
---|
| 63 | [Have ZInitLocationInfo]),) |
---|
[cc1eeac] | 64 | AC_CHECK_LIB([com_err], [com_err]) |
---|
| 65 | AC_CHECK_HEADERS([com_err.h]) |
---|
[2c270e6] | 66 | ], |
---|
| 67 | [if test "x$with_zephyr" != xcheck; then |
---|
| 68 | AC_MSG_FAILURE( |
---|
[438009c] | 69 | [--with-zephyr was given, but libzephyr does not seem to be available.]) |
---|
[2c270e6] | 70 | fi |
---|
| 71 | ])]) |
---|
[ac70242] | 72 | |
---|
[263320f] | 73 | AC_CHECK_FUNCS([use_default_colors]) |
---|
| 74 | AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])]) |
---|
[7d03c8d] | 75 | AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1]) |
---|
| 76 | AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1]) |
---|
| 77 | AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1]) |
---|
[e51b410] | 78 | |
---|
[7d4fbcd] | 79 | dnl Checks for header files. |
---|
| 80 | AC_HEADER_STDC |
---|
| 81 | AC_HEADER_SYS_WAIT |
---|
[75b0adb] | 82 | AC_HEADER_STDBOOL |
---|
[cc1eeac] | 83 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h) |
---|
[7d4fbcd] | 84 | |
---|
| 85 | dnl Add CFLAGS for embeded perl |
---|
[1c89df8] | 86 | PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts` |
---|
| 87 | AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}]) |
---|
| 88 | CFLAGS="${CFLAGS} ${PERL_CFLAGS}" |
---|
[7d4fbcd] | 89 | |
---|
[e51b410] | 90 | dnl Find the location of perl XSUBPP |
---|
[8ee73f8d] | 91 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
[6794f72] | 92 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
[8ee73f8d] | 93 | if test -n "${XSUBPPDIR}"; then |
---|
| 94 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
| 95 | else |
---|
| 96 | AC_MSG_ERROR(not found) |
---|
| 97 | fi |
---|
| 98 | |
---|
[4ad3480] | 99 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
| 100 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
| 101 | else |
---|
| 102 | XSUBPPFLAGS="" |
---|
| 103 | fi |
---|
| 104 | |
---|
[18e28a4] | 105 | dnl Add LDFLAGS for embedded perl |
---|
[3f21b8e] | 106 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
[c08a725] | 107 | AC_MSG_NOTICE([Adding perl LIBS ${FOO}]) |
---|
| 108 | LIBS=${LIBS}\ ${FOO} |
---|
[4c97193] | 109 | AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found])) |
---|
[7d4fbcd] | 110 | |
---|
[2d3ed95] | 111 | AX_PROG_PERL_MODULES([Class::Accessor::Fast],, |
---|
| 112 | [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])]) |
---|
| 113 | AX_PROG_PERL_MODULES([PAR],, |
---|
| 114 | [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])]) |
---|
| 115 | |
---|
[34509d5] | 116 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
[4751077a] | 117 | PKG_CHECK_MODULES(GLIB,[glib-2.0 gobject-2.0]) |
---|
[34509d5] | 118 | |
---|
[7c09b21] | 119 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
---|
[d9337637] | 120 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
[7c09b21] | 121 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
---|
[d9337637] | 122 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
[34509d5] | 123 | |
---|
[37f27bc] | 124 | if test "x${prefix}" = "xNONE"; then |
---|
| 125 | prefix="${ac_default_prefix}" |
---|
| 126 | fi |
---|
[7d4fbcd] | 127 | |
---|
[37f27bc] | 128 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
[c50f589] | 129 | |
---|
[79245bc] | 130 | AX_CFLAGS_WARN_ALL |
---|
[de8945b] | 131 | AX_CFLAGS_STRICT_PROTOTYPES |
---|
[79245bc] | 132 | |
---|
[215c119] | 133 | AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[], |
---|
| 134 | [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"]) |
---|
| 135 | |
---|
[7d03c8d] | 136 | AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl |
---|
| 137 | test "$HAVE_DES_KEY_SCHED" && dnl |
---|
| 138 | test "$HAVE_DES_ECB_ENCRYPT"]) |
---|
| 139 | |
---|
[04af908] | 140 | CFLAGS="$CFLAGS -D_XOPEN_SOURCE" |
---|
[8b2789c] | 141 | dnl __EXTENSIONS__ is needed for struct timeval on Solaris when |
---|
| 142 | dnl _XOPEN_SOURCE is defined. |
---|
| 143 | CFLAGS="$CFLAGS -D__EXTENSIONS__" |
---|
[04af908] | 144 | |
---|
[215c119] | 145 | AC_SUBST([LIBFAIM_CFLAGS]) |
---|
| 146 | |
---|
[15bd5ef] | 147 | AC_SUBST(XSUBPPDIR) |
---|
[4ad3480] | 148 | AC_SUBST(XSUBPPFLAGS) |
---|
[8ee73f8d] | 149 | |
---|
[ac70242] | 150 | AC_PROG_INSTALL |
---|
[37f27bc] | 151 | AC_PROG_RANLIB |
---|
[db4b293] | 152 | AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no]) |
---|
| 153 | if test "x${HAVE_ZIP}" = "xno"; then |
---|
| 154 | AC_MSG_ERROR([cannot find a 'zip' binary.]) |
---|
| 155 | fi |
---|
[ac70242] | 156 | |
---|
[12a6616] | 157 | AC_CONFIG_LIBOBJ_DIR([compat]) |
---|
| 158 | AC_REPLACE_FUNCS([memrchr]) |
---|
| 159 | |
---|
| 160 | AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile]) |
---|
[b9c8d28] | 161 | AC_OUTPUT |
---|