source: configure.ac @ 1373d35

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 1373d35 was de8945b, checked in by Anders Kaseorg <andersk@mit.edu>, 15 years ago
Require strict prototypes. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 3.9 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu])
3AM_INIT_AUTOMAKE([-Wall foreign])
4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
5
6AC_CONFIG_MACRO_DIR([m4])
7AC_CONFIG_HEADER([config.h])
8
9AC_PROG_CC
10
11AC_ARG_WITH([stack-protector],
12  [AS_HELP_STRING([--with-stack-protector],
13    [Enable gcc -fstack-protector])],
14  [],
15  [with_stack_protector=check])
16
17AS_IF([test "x$with_stack_protector" != xno],
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    ])])
24
25AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
26AC_SEARCH_LIBS([gethostbyname], [nsl])
27AC_SEARCH_LIBS([socket], [socket])
28AC_SEARCH_LIBS([res_search], [resolv])
29
30AC_ARG_WITH([zephyr],
31  [AS_HELP_STRING([--with-libzephyr],
32    [Enable Zephyr support])],
33  [],
34  [with_zephyr=check])
35
36AS_IF([test "x$with_zephyr" != xno],
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],
50   [LIBS="$LIBS -lzephyr"
51    AC_DEFINE([HAVE_LIBZEPHYR], [1],
52                [Define if you have libzephyr])
53    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
54      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
55                [Have ZInitLocationInfo]),)
56    AC_CHECK_LIB([com_err], [com_err])
57    AC_CHECK_HEADERS([com_err.h])
58   ],
59   [if test "x$with_zephyr" != xcheck; then
60      AC_MSG_FAILURE(
61        [--with-libzephyr was given, but libzephyr does not seem to be available.])
62    fi
63   ])])
64
65AC_CHECK_FUNCS([use_default_colors resizeterm])
66AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt])
67AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched])
68
69dnl Checks for header files.
70AC_HEADER_STDC
71AC_HEADER_SYS_WAIT
72AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
73
74dnl Add CFLAGS for embeded perl
75PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
76AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
77CFLAGS="${CFLAGS} ${PERL_CFLAGS}"
78
79dnl Find the location of perl XSUBPP
80AC_MSG_CHECKING(for the perl xsubpp precompiler)
81XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
82if test -n "${XSUBPPDIR}"; then
83   AC_MSG_RESULT(${XSUBPPDIR})
84else
85   AC_MSG_ERROR(not found)
86fi
87
88if test -f "${XSUBPPDIR}/typemap"; then
89   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
90else
91   XSUBPPFLAGS=""
92fi
93
94dnl Add LDFLAGS for embedded perl
95FOO=`perl -MExtUtils::Embed -e ldopts`
96AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
97LIBS=${LIBS}\ ${FOO}
98
99dnl Add CFLAGS and LDFLAGS for glib-2.0
100PKG_CHECK_MODULES(GLIB,glib-2.0)
101
102AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
103CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
104AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
105LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
106
107if test "x${prefix}" = "xNONE"; then
108   prefix="${ac_default_prefix}"
109fi
110
111AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
112                   [Package data directory])
113
114dnl Checks for typedefs, structures, and compiler characteristics.
115
116AX_CFLAGS_WARN_ALL
117AX_CFLAGS_STRICT_PROTOTYPES
118
119AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
120  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
121
122AC_SUBST([LIBFAIM_CFLAGS])
123
124AC_SUBST(XSUBPPDIR)
125AC_SUBST(XSUBPPFLAGS)
126
127AC_PROG_INSTALL
128AC_PROG_RANLIB
129
130AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
131AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.