source: configure.ac @ 22b54a7

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 22b54a7 was 4097723, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
configure: Support --with{out,}-stack-protector This is a cleaner way to disable -fstack-protector than asking the user to muck with PROTECT_CFLAGS, and lets the user not link libssp, even if present.
  • Property mode set to 100644
File size: 5.0 KB
RevLine 
[1aee7d9]1dnl $Id$
[7d4fbcd]2dnl Process this file with autoconf to produce a configure script.
3AC_INIT(owl.c)
4
5AC_CONFIG_HEADER(config.h)
6
7AC_PROG_CC
8
9dnl If we're using GCC, enable all warnings
10if test "$GCC" = yes; then
11     CFLAGS="$CFLAGS -Wall -g";
12fi
13
14dnl Check for Athena
15AC_MSG_CHECKING(for /usr/athena/include)
16if test -d /usr/athena/include; then
17        CFLAGS=${CFLAGS}\ -I/usr/athena/include
[e6449bc]18        CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
[7d4fbcd]19        AC_MSG_RESULT(yes)
20else
21        AC_MSG_RESULT(no)
22fi
23AC_MSG_CHECKING(for /usr/athena/lib)
24if test -d /usr/athena/lib; then
[1d7e094]25        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
[7d4fbcd]26        AC_MSG_RESULT(yes)
27else
28        AC_MSG_RESULT(no)
29fi
30
[fe39450]31dnl Check for kerberosIV include
[18e28a4]32AC_MSG_CHECKING(for kerberosIV)
[fe39450]33if test -d /usr/include/kerberosIV; then
34        CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV
35        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV
36        AC_MSG_RESULT(yes)
[18e28a4]37elif test -d /usr/local/include/kerberosIV; then
38        CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV
39        CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV
40        AC_MSG_RESULT(yes)
[b5fe6d2]41elif test -d /usr/include/openssl; then
42        CFLAGS=${CFLAGS}\ -I/usr/include/openssl
43        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl
44        AC_MSG_RESULT(OpenSSL DES found instead)
[fe39450]45else
46        AC_MSG_RESULT(no)
47fi
48
[4097723]49AC_ARG_WITH([stack-protector],
50  [AS_HELP_STRING([--with-stack-protector],
51    [Enable gcc -fstack-protector])],
52  [],
53  [with_stack_protector=check])
54
55AS_IF([test "x$with_stack_protector" != xno],
56  [
57    SAVE_CFLAGS=$CFLAGS
58    CFLAGS="$CFLAGS -fstack-protector"
59    AC_MSG_CHECKING(whether protection cflags work)
60    AC_COMPILE_IFELSE(int i;,
61        [AC_MSG_RESULT(yes)],
62        [AC_MSG_RESULT(no)
63        CFLAGS=$SAVE_CFLAGS
64        if test "x$with_stack_protector" != xcheck; then
65          AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
66        fi])
67    AC_CHECK_LIB(ssp, __stack_chk_guard)
68  ])
[87afe92]69
[d54035d]70AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
[7d4fbcd]71AC_CHECK_LIB(com_err, com_err)
72AC_CHECK_LIB(nsl, gethostbyname)
73AC_CHECK_LIB(socket, socket)
[8298425]74dnl AC_CHECK_LIB(des425, req_act_vno)
[b5fe6d2]75AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
[d09e5a1]76AC_CHECK_LIB(resolv, res_search)
[2c270e6]77
78AC_ARG_WITH([zephyr],
79  [AS_HELP_STRING([--with-libzephyr],
80    [Disable Zephyr support])],
81  [],
82  [with_zephyr=check])
83
84AS_IF([test "x$with_zephyr" != xno],
85  [AC_CHECK_LIB([zephyr], [ZGetSender],
[16c0416]86   [LIBS="$LIBS -lzephyr"
87    AC_DEFINE([HAVE_LIBZEPHYR], [1],
[2c270e6]88                [Define if you have libzephyr])
89    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
90      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
91                [Have ZInitLocationInfo]),)
92   ],
93   [if test "x$with_zephyr" != xcheck; then
94      AC_MSG_FAILURE(
95        [--with-libzephyr was given, but libzephyr does not seem to be available.])
96    fi
97   ])])
[ac70242]98
[7ccc780]99AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
100                                          [Statically link libraries in /usr/athena/lib]),
101                                          [ATHSTATIC=./athstatic],
102                                          [ATHSTATIC=])
103
[dc2ad79]104AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
[b5fe6d2]105AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
[e51b410]106
[ac70242]107AC_MSG_CHECKING(for des_ecb_encrypt prototype)
108AC_TRY_COMPILE([#include <des.h>
109int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
110[int foo = des_ecb_encrypt(0,0,0,0);],
111ac_cv_des_ecb_encrypt_proto=no,
112ac_cv_des_ecb_encrypt_proto=yes)
113AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
114if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
115        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
116fi
[7d4fbcd]117
118dnl Checks for header files.
119AC_HEADER_STDC
120AC_HEADER_SYS_WAIT
[e8b95f8]121AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
[7d4fbcd]122
123dnl Add CFLAGS for embeded perl
124FOO=`perl -MExtUtils::Embed -e ccopts`
[7c09b21]125AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
[7d4fbcd]126CFLAGS=${CFLAGS}\ ${FOO}
127
[e51b410]128dnl Find the location of perl XSUBPP
[8ee73f8d]129AC_MSG_CHECKING(for the perl xsubpp precompiler)
[6794f72]130XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
[8ee73f8d]131if test -n "${XSUBPPDIR}"; then
132   AC_MSG_RESULT(${XSUBPPDIR})
133else
134   AC_MSG_ERROR(not found)
135fi
136
[4ad3480]137if test -f "${XSUBPPDIR}/typemap"; then
138   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
139else
140   XSUBPPFLAGS=""
141fi
142
[18e28a4]143dnl Add LDFLAGS for embedded perl
[3f21b8e]144FOO=`perl -MExtUtils::Embed -e ldopts`
[7c09b21]145AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
[7d4fbcd]146LDFLAGS=${LDFLAGS}\ ${FOO}
147
[34509d5]148dnl Add CFLAGS and LDFLAGS for glib-2.0
149PKG_CHECK_MODULES(GLIB,glib-2.0)
150
[7c09b21]151AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
[d9337637]152CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
[7c09b21]153AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
[d9337637]154LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
[34509d5]155
[7d4fbcd]156dnl Checks for typedefs, structures, and compiler characteristics.
157
[c50f589]158dnl Support --program-{prefix,suffix,transform}
159AC_ARG_PROGRAM
160
[15bd5ef]161AC_SUBST(XSUBPPDIR)
[4ad3480]162AC_SUBST(XSUBPPFLAGS)
[7ccc780]163AC_SUBST(ATHSTATIC)
[8ee73f8d]164
[ac70242]165AC_PROG_INSTALL
166
[d09e5a1]167AC_CONFIG_SUBDIRS(libfaim)
168
[7d4fbcd]169AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.