source: configure.ac @ 2d3ed95

release-1.6release-1.7release-1.8release-1.9
Last change on this file since 2d3ed95 was 2d3ed95, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
Check for some perl modules. These are the modules needed by the core barnowl. We should probably eventually check for the ones Jabber and IRC need, too. Reviewed-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[7d4fbcd]1dnl Process this file with autoconf to produce a configure script.
[ec5d1a2]2AC_INIT([BarnOwl],[1.6dev],[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
10
[4097723]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],
[ce27cc1]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    ])])
[87afe92]24
[d54035d]25AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
[59077f9]26AC_CHECK_LIB(panelw, update_panels,, AC_MSG_ERROR(No libpanelw found.))
[363eb9d]27AC_SEARCH_LIBS([gethostbyname], [nsl])
28AC_SEARCH_LIBS([socket], [socket])
29AC_SEARCH_LIBS([res_search], [resolv])
[2c270e6]30
31AC_ARG_WITH([zephyr],
[438009c]32  [AS_HELP_STRING([--with-zephyr],
[ec21c62]33    [Enable Zephyr support])],
[2c270e6]34  [],
35  [with_zephyr=check])
36
37AS_IF([test "x$with_zephyr" != xno],
[806f769]38  [AC_MSG_CHECKING([for Kerberos IV])
39   AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
40     [AC_MSG_RESULT([yes])
41      AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
42      CFLAGS="${CFLAGS} `krb5-config krb4 --cflags`"
43      LIBS="${LIBS} `krb5-config krb4 --libs`"
44     ],
45     [AC_MSG_RESULT([no])
46      PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
47      CFLAGS="${CFLAGS} ${LIBCRYPTO_CFLAGS}"
48      LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
49     ])
50   AC_CHECK_LIB([zephyr], [ZGetSender],
[16c0416]51   [LIBS="$LIBS -lzephyr"
52    AC_DEFINE([HAVE_LIBZEPHYR], [1],
[2c270e6]53                [Define if you have libzephyr])
54    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
55      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
56                [Have ZInitLocationInfo]),)
[cc1eeac]57    AC_CHECK_LIB([com_err], [com_err])
58    AC_CHECK_HEADERS([com_err.h])
[2c270e6]59   ],
60   [if test "x$with_zephyr" != xcheck; then
61      AC_MSG_FAILURE(
[438009c]62        [--with-zephyr was given, but libzephyr does not seem to be available.])
[2c270e6]63    fi
64   ])])
[ac70242]65
[d193e28]66AC_CHECK_FUNCS([use_default_colors resizeterm])
67AC_CHECK_FUNCS([des_string_to_key des_key_sched des_ecb_encrypt])
68AC_CHECK_FUNCS([DES_string_to_key DES_ecb_encrypt DES_key_sched])
[e51b410]69
[7d4fbcd]70dnl Checks for header files.
71AC_HEADER_STDC
72AC_HEADER_SYS_WAIT
[cc1eeac]73AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
[7d4fbcd]74
75dnl Add CFLAGS for embeded perl
[1c89df8]76PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
77AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
78CFLAGS="${CFLAGS} ${PERL_CFLAGS}"
[7d4fbcd]79
[e51b410]80dnl Find the location of perl XSUBPP
[8ee73f8d]81AC_MSG_CHECKING(for the perl xsubpp precompiler)
[6794f72]82XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
[8ee73f8d]83if test -n "${XSUBPPDIR}"; then
84   AC_MSG_RESULT(${XSUBPPDIR})
85else
86   AC_MSG_ERROR(not found)
87fi
88
[4ad3480]89if test -f "${XSUBPPDIR}/typemap"; then
90   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
91else
92   XSUBPPFLAGS=""
93fi
94
[18e28a4]95dnl Add LDFLAGS for embedded perl
[3f21b8e]96FOO=`perl -MExtUtils::Embed -e ldopts`
[c08a725]97AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
98LIBS=${LIBS}\ ${FOO}
[4c97193]99AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
[7d4fbcd]100
[2d3ed95]101AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
102                     [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
103AX_PROG_PERL_MODULES([PAR],,
104                     [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
105
[34509d5]106dnl Add CFLAGS and LDFLAGS for glib-2.0
107PKG_CHECK_MODULES(GLIB,glib-2.0)
108
[7c09b21]109AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
[d9337637]110CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
[7c09b21]111AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
[d9337637]112LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
[34509d5]113
[37f27bc]114if test "x${prefix}" = "xNONE"; then
115   prefix="${ac_default_prefix}"
116fi
[7d4fbcd]117
[37f27bc]118AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
119                   [Package data directory])
[7d4fbcd]120
[37f27bc]121dnl Checks for typedefs, structures, and compiler characteristics.
[c50f589]122
[79245bc]123AX_CFLAGS_WARN_ALL
[de8945b]124AX_CFLAGS_STRICT_PROTOTYPES
[79245bc]125
[215c119]126AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
127  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
128
129AC_SUBST([LIBFAIM_CFLAGS])
130
[15bd5ef]131AC_SUBST(XSUBPPDIR)
[4ad3480]132AC_SUBST(XSUBPPFLAGS)
[8ee73f8d]133
[ac70242]134AC_PROG_INSTALL
[37f27bc]135AC_PROG_RANLIB
[db4b293]136AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
137if test "x${HAVE_ZIP}" = "xno"; then
138   AC_MSG_ERROR([cannot find a 'zip' binary.])
139fi
[ac70242]140
[10557e6]141AC_CONFIG_FILES([Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
[b9c8d28]142AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.