source: configure.ac @ 37f27bc

release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 37f27bc was 37f27bc, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
Switch the build system to using automake. Use automake for the build system, which lets us clean a bunch of cruft out of Makefile.in.
  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[1aee7d9]1dnl $Id$
[7d4fbcd]2dnl Process this file with autoconf to produce a configure script.
[37f27bc]3AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu])
4AM_INIT_AUTOMAKE([-Wall foreign])
[7d4fbcd]5
[37f27bc]6AC_CONFIG_HEADER([config.h])
[7d4fbcd]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
[e6449bc]14        CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
[7d4fbcd]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
[1d7e094]21        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
[7d4fbcd]22        AC_MSG_RESULT(yes)
23else
24        AC_MSG_RESULT(no)
25fi
26
[fe39450]27dnl Check for kerberosIV include
[18e28a4]28AC_MSG_CHECKING(for kerberosIV)
[fe39450]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)
[18e28a4]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)
[b5fe6d2]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)
[fe39450]41else
42        AC_MSG_RESULT(no)
43fi
[87afe92]44PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"}
45SAVE_CFLAGS=$CFLAGS
46CFLAGS="$CFLAGS $PROTECT_CFLAGS"
47AC_MSG_CHECKING(whether protection cflags work)
48AC_COMPILE_IFELSE(int i;,
49    [AC_MSG_RESULT(yes)],
50    [AC_MSG_RESULT(no)
51    CFLAGS=$SAVE_CFLAGS])
[fe39450]52
[87afe92]53
54AC_CHECK_LIB(ssp, __stack_chk_guard)
[d54035d]55AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
[7d4fbcd]56AC_CHECK_LIB(com_err, com_err)
57AC_CHECK_LIB(nsl, gethostbyname)
58AC_CHECK_LIB(socket, socket)
[8298425]59dnl AC_CHECK_LIB(des425, req_act_vno)
[b5fe6d2]60AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
[d09e5a1]61AC_CHECK_LIB(resolv, res_search)
[09489b89]62dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
63AC_CHECK_LIB(zephyr, ZGetSender)
[ac70242]64AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
65
[7ccc780]66AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
67                                          [Statically link libraries in /usr/athena/lib]),
68                                          [ATHSTATIC=./athstatic],
69                                          [ATHSTATIC=])
70
[dc2ad79]71AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
[b5fe6d2]72AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
[e51b410]73
[ac70242]74AC_MSG_CHECKING(for des_ecb_encrypt prototype)
75AC_TRY_COMPILE([#include <des.h>
76int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
77[int foo = des_ecb_encrypt(0,0,0,0);],
78ac_cv_des_ecb_encrypt_proto=no,
79ac_cv_des_ecb_encrypt_proto=yes)
80AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
81if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
82        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
83fi
[7d4fbcd]84
85dnl Checks for header files.
86AC_HEADER_STDC
87AC_HEADER_SYS_WAIT
[e8b95f8]88AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
[7d4fbcd]89
90dnl Add CFLAGS for embeded perl
91FOO=`perl -MExtUtils::Embed -e ccopts`
[7c09b21]92AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
[7d4fbcd]93CFLAGS=${CFLAGS}\ ${FOO}
94
[e51b410]95dnl Find the location of perl XSUBPP
[8ee73f8d]96AC_MSG_CHECKING(for the perl xsubpp precompiler)
[6794f72]97XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
[8ee73f8d]98if test -n "${XSUBPPDIR}"; then
99   AC_MSG_RESULT(${XSUBPPDIR})
100else
101   AC_MSG_ERROR(not found)
102fi
103
[4ad3480]104if test -f "${XSUBPPDIR}/typemap"; then
105   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
106else
107   XSUBPPFLAGS=""
108fi
109
[18e28a4]110dnl Add LDFLAGS for embedded perl
[3f21b8e]111FOO=`perl -MExtUtils::Embed -e ldopts`
[7c09b21]112AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
[7d4fbcd]113LDFLAGS=${LDFLAGS}\ ${FOO}
114
[34509d5]115dnl Add CFLAGS and LDFLAGS for glib-2.0
116PKG_CHECK_MODULES(GLIB,glib-2.0)
117
[7c09b21]118AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
[d9337637]119CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
[7c09b21]120AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
[d9337637]121LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
[34509d5]122
[37f27bc]123if test "x${prefix}" = "xNONE"; then
124   prefix="${ac_default_prefix}"
125fi
[7d4fbcd]126
[37f27bc]127AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
128                   [Package data directory])
129
130dnl Checks for typedefs, structures, and compiler characteristics.
[c50f589]131
[15bd5ef]132AC_SUBST(XSUBPPDIR)
[4ad3480]133AC_SUBST(XSUBPPFLAGS)
[7ccc780]134AC_SUBST(ATHSTATIC)
[8ee73f8d]135
[ac70242]136AC_PROG_INSTALL
[37f27bc]137AC_PROG_RANLIB
[ac70242]138
[37f27bc]139AC_CONFIG_FILES([Makefile libfaim/Makefile])
140AC_OUTPUT([perl/modules/Makefile])
Note: See TracBrowser for help on using the repository browser.