source: configure.ac @ d193e28

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since d193e28 was d193e28, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
Clean up AC_CHECK_FUNCS call. Signed-off-by: Nelson Elhage <nelhage@mit.edu>
  • Property mode set to 100644
File size: 3.8 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_HEADER([config.h])
7
8AC_PROG_CC
9
10AC_ARG_WITH([stack-protector],
11  [AS_HELP_STRING([--with-stack-protector],
12    [Enable gcc -fstack-protector])],
13  [],
14  [with_stack_protector=check])
15
16AS_IF([test "x$with_stack_protector" != xno],
17  [AX_C_CHECK_FLAG([-fstack-protector],[],[],
18    [CFLAGS="$CFLAGS -fstack-protector"],
19    [if test "x$with_stack_protector" != xcheck; then
20       AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
21     fi
22    ])])
23
24AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
25AC_SEARCH_LIBS([gethostbyname], [nsl])
26AC_SEARCH_LIBS([socket], [socket])
27AC_SEARCH_LIBS([res_search], [resolv])
28
29AC_ARG_WITH([zephyr],
30  [AS_HELP_STRING([--with-libzephyr],
31    [Enable Zephyr support])],
32  [],
33  [with_zephyr=check])
34
35AS_IF([test "x$with_zephyr" != xno],
36  [AC_MSG_CHECKING([for Kerberos IV])
37   AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
38     [AC_MSG_RESULT([yes])
39      AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
40      CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`"
41      LIBS="${LIBS} `krb5-config krb4 --libs`"
42     ],
43     [AC_MSG_RESULT([no])
44      PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
45      CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}"
46      LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
47     ])
48   AC_CHECK_LIB([zephyr], [ZGetSender],
49   [LIBS="$LIBS -lzephyr"
50    AC_DEFINE([HAVE_LIBZEPHYR], [1],
51                [Define if you have libzephyr])
52    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
53      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
54                [Have ZInitLocationInfo]),)
55    AC_CHECK_LIB([com_err], [com_err])
56    AC_CHECK_HEADERS([com_err.h])
57   ],
58   [if test "x$with_zephyr" != xcheck; then
59      AC_MSG_FAILURE(
60        [--with-libzephyr was given, but libzephyr does not seem to be available.])
61    fi
62   ])])
63
64AC_CHECK_FUNCS([use_default_colors resizeterm])
65AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt])
66AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched])
67
68dnl Checks for header files.
69AC_HEADER_STDC
70AC_HEADER_SYS_WAIT
71AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
72
73dnl Add CFLAGS for embeded perl
74FOO=`perl -MExtUtils::Embed -e ccopts`
75AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
76CFLAGS=${CFLAGS}\ ${FOO}
77
78dnl Find the location of perl XSUBPP
79AC_MSG_CHECKING(for the perl xsubpp precompiler)
80XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
81if test -n "${XSUBPPDIR}"; then
82   AC_MSG_RESULT(${XSUBPPDIR})
83else
84   AC_MSG_ERROR(not found)
85fi
86
87if test -f "${XSUBPPDIR}/typemap"; then
88   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
89else
90   XSUBPPFLAGS=""
91fi
92
93dnl Add LDFLAGS for embedded perl
94FOO=`perl -MExtUtils::Embed -e ldopts`
95AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
96LIBS=${LIBS}\ ${FOO}
97
98dnl Add CFLAGS and LDFLAGS for glib-2.0
99PKG_CHECK_MODULES(GLIB,glib-2.0)
100
101AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
102CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
103AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
104LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
105
106if test "x${prefix}" = "xNONE"; then
107   prefix="${ac_default_prefix}"
108fi
109
110AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
111                   [Package data directory])
112
113dnl Checks for typedefs, structures, and compiler characteristics.
114
115AX_CFLAGS_WARN_ALL
116
117AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
118  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
119
120AC_SUBST([LIBFAIM_CFLAGS])
121
122AC_SUBST(XSUBPPDIR)
123AC_SUBST(XSUBPPFLAGS)
124
125AC_PROG_INSTALL
126AC_PROG_RANLIB
127
128AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
129AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.