source: configure.ac @ 24a791f

release-1.8release-1.9
Last change on this file since 24a791f was fe73d0c, checked in by David Benjamin <davidben@mit.edu>, 11 years ago
Just require stdbool.h and tell ncurses to use it Now that Solaris' stdbool.h works for us, we may as well just require it. The preamble is repetitive and didn't actually work anyway. (It conflicts with ncurses' attempts to redefine bool when stdbool.h is unavailable or disabled.) We may need to add a different preamble later if we care about including these headers in C++ (Solaris has a C++-incompatible stdbool.h), but we can deal with that later.
  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[7d4fbcd]1dnl Process this file with autoconf to produce a configure script.
[e974152]2AC_INIT([BarnOwl],[1.8dev],[bug-barnowl@mit.edu])
[cecb125]3AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability foreign])
[636de2a]4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
[7d4fbcd]5
[8073852]6AC_CONFIG_MACRO_DIR([m4])
[37f27bc]7AC_CONFIG_HEADER([config.h])
[7d4fbcd]8
9AC_PROG_CC
[d1d68e0]10AC_PROG_CC_C99
[7d4fbcd]11
[4097723]12AC_ARG_WITH([stack-protector],
13  [AS_HELP_STRING([--with-stack-protector],
14    [Enable gcc -fstack-protector])],
15  [],
16  [with_stack_protector=check])
17
18AS_IF([test "x$with_stack_protector" != xno],
[ce27cc1]19  [AX_C_CHECK_FLAG([-fstack-protector],[],[],
[ce35060]20    [AM_CFLAGS="$AM_CFLAGS -fstack-protector"],
[ce27cc1]21    [if test "x$with_stack_protector" != xcheck; then
22       AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
23     fi
24    ])])
[87afe92]25
[d54035d]26AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
[59077f9]27AC_CHECK_LIB(panelw, update_panels,, AC_MSG_ERROR(No libpanelw found.))
[363eb9d]28AC_SEARCH_LIBS([gethostbyname], [nsl])
29AC_SEARCH_LIBS([socket], [socket])
30AC_SEARCH_LIBS([res_search], [resolv])
[2c270e6]31
32AC_ARG_WITH([zephyr],
[438009c]33  [AS_HELP_STRING([--with-zephyr],
[ec21c62]34    [Enable Zephyr support])],
[2c270e6]35  [],
36  [with_zephyr=check])
37
[ddbb43ad]38AC_ARG_WITH([krb4],
39  AS_HELP_STRING([--with-krb4],
40                 [Build with kerberos IV]))
41
[2c270e6]42AS_IF([test "x$with_zephyr" != xno],
[ddbb43ad]43  [AS_IF([test "x$with_krb4" != "xno"],
44   [AC_MSG_CHECKING([for Kerberos IV])
45    AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
46      [AC_MSG_RESULT([yes])
47       AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
[ce35060]48       AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`"
[ddbb43ad]49       LIBS="${LIBS} `krb5-config krb4 --libs`"
50      ],
51      [AC_MSG_RESULT([no])
52       AS_IF([test "x$with_krb4" = "xyes"],
53             [AC_MSG_ERROR([Kerberos IV requested but not found])])
54       PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
[ce35060]55       AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
[ddbb43ad]56       LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
57     ])])
[806f769]58   AC_CHECK_LIB([zephyr], [ZGetSender],
[16c0416]59   [LIBS="$LIBS -lzephyr"
60    AC_DEFINE([HAVE_LIBZEPHYR], [1],
[2c270e6]61                [Define if you have libzephyr])
62    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
63      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
64                [Have ZInitLocationInfo]),)
[cc1eeac]65    AC_CHECK_LIB([com_err], [com_err])
66    AC_CHECK_HEADERS([com_err.h])
[2c270e6]67   ],
68   [if test "x$with_zephyr" != xcheck; then
69      AC_MSG_FAILURE(
[438009c]70        [--with-zephyr was given, but libzephyr does not seem to be available.])
[2c270e6]71    fi
72   ])])
[ac70242]73
[263320f]74AC_CHECK_FUNCS([use_default_colors])
75AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])])
[7d03c8d]76AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
77AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
78AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1])
[e51b410]79
[7d4fbcd]80dnl Checks for header files.
81AC_HEADER_STDC
82AC_HEADER_SYS_WAIT
[fe73d0c]83AC_CHECK_HEADERS(stdbool.h strings.h sys/ioctl.h sys/filio.h unistd.h)
[7d4fbcd]84
85dnl Add CFLAGS for embeded perl
[1c89df8]86PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
87AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
[ce35060]88AM_CFLAGS="${AM_CFLAGS} ${PERL_CFLAGS}"
[7d4fbcd]89
[e51b410]90dnl Find the location of perl XSUBPP
[8ee73f8d]91AC_MSG_CHECKING(for the perl xsubpp precompiler)
[6794f72]92XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
[8ee73f8d]93if test -n "${XSUBPPDIR}"; then
94   AC_MSG_RESULT(${XSUBPPDIR})
95else
96   AC_MSG_ERROR(not found)
97fi
98
[4ad3480]99if test -f "${XSUBPPDIR}/typemap"; then
100   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
101else
102   XSUBPPFLAGS=""
103fi
104
[8061a6a]105dnl Add LIBS for embedded perl
[3f21b8e]106FOO=`perl -MExtUtils::Embed -e ldopts`
[c08a725]107AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
108LIBS=${LIBS}\ ${FOO}
[4c97193]109AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
[7d4fbcd]110
[2d3ed95]111AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
112                     [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
113AX_PROG_PERL_MODULES([PAR],,
114                     [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
115
[8061a6a]116dnl Add CFLAGS and LIBS for glib-2.0
[f97c1a6]117PKG_CHECK_MODULES(GLIB,[glib-2.0 >= 2.12 gobject-2.0 gthread-2.0])
[34509d5]118
[7c09b21]119AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
[ce35060]120AM_CFLAGS="${GLIB_CFLAGS} ${AM_CFLAGS}"
[8061a6a]121AC_MSG_NOTICE([Adding glib-2.0 LIBS ${GLIB_LIBS}])
122LIBS="${GLIB_LIBS} ${LIBS}"
[34509d5]123
[37f27bc]124if test "x${prefix}" = "xNONE"; then
125   prefix="${ac_default_prefix}"
126fi
[7d4fbcd]127
[37f27bc]128dnl Checks for typedefs, structures, and compiler characteristics.
[c50f589]129
[ce35060]130AX_CFLAGS_WARN_ALL([AM_CFLAGS])
[4e118a0]131AX_C_CHECK_FLAG([-Wstrict-prototypes],[],[],[AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"])
[79245bc]132
[4479497]133dnl Shut gcc up about zero-length format strings; the warning's apparently for
134dnl efficiency reasons, which is bogus for custom functions.
135AX_C_CHECK_FLAG([-Wno-format-zero-length],[],[],[AM_CFLAGS="$AM_CFLAGS -Wno-format-zero-length"])
136
[9fc473a]137m4_foreach([myflag],
138  [[-Wno-pointer-sign],[-Wno-empty-body],[-Wno-unused-value]],
139  [AX_C_CHECK_FLAG([myflag],[],[],[LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS myflag"])])
[215c119]140
[7d03c8d]141AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
142                                 test "$HAVE_DES_KEY_SCHED" && dnl
143                                 test "$HAVE_DES_ECB_ENCRYPT"])
144
[d1d68e0]145AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600"
[569f0bd]146dnl Define _BSD_SOURCE because zephyr needs caddr_t.
147AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE"
148dnl Define __EXTENSIONS__ for strcasecmp on Solaris.
[ce35060]149AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__"
[04af908]150
[ce35060]151AC_SUBST([AM_CFLAGS])
[215c119]152AC_SUBST([LIBFAIM_CFLAGS])
153
[15bd5ef]154AC_SUBST(XSUBPPDIR)
[4ad3480]155AC_SUBST(XSUBPPFLAGS)
[8ee73f8d]156
[ac70242]157AC_PROG_INSTALL
[37f27bc]158AC_PROG_RANLIB
[db4b293]159AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
160if test "x${HAVE_ZIP}" = "xno"; then
161   AC_MSG_ERROR([cannot find a 'zip' binary.])
162fi
[ac70242]163
[12a6616]164AC_CONFIG_LIBOBJ_DIR([compat])
[2cbe7c3]165AC_CHECK_DECLS([memrchr])
[12a6616]166AC_REPLACE_FUNCS([memrchr])
167
168AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
[b9c8d28]169AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.