source: configure.ac @ e2cbbbe

release-1.10release-1.6release-1.7release-1.8release-1.9
Last change on this file since e2cbbbe was e2cbbbe, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
Merge branch 'refactor-zcrypt'
  • Property mode set to 100644
File size: 4.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.6dev],[bug-barnowl@mit.edu])
3AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability 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_CHECK_LIB(panelw, update_panels,, AC_MSG_ERROR(No libpanelw found.))
27AC_SEARCH_LIBS([gethostbyname], [nsl])
28AC_SEARCH_LIBS([socket], [socket])
29AC_SEARCH_LIBS([res_search], [resolv])
30
31AC_ARG_WITH([zephyr],
32  [AS_HELP_STRING([--with-zephyr],
33    [Enable Zephyr support])],
34  [],
35  [with_zephyr=check])
36
37AS_IF([test "x$with_zephyr" != xno],
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],
51   [LIBS="$LIBS -lzephyr"
52    AC_DEFINE([HAVE_LIBZEPHYR], [1],
53                [Define if you have libzephyr])
54    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
55      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
56                [Have ZInitLocationInfo]),)
57    AC_CHECK_LIB([com_err], [com_err])
58    AC_CHECK_HEADERS([com_err.h])
59   ],
60   [if test "x$with_zephyr" != xcheck; then
61      AC_MSG_FAILURE(
62        [--with-zephyr was given, but libzephyr does not seem to be available.])
63    fi
64   ])])
65
66AC_CHECK_FUNCS([use_default_colors resizeterm])
67AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
68AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
69AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1])
70
71dnl Checks for header files.
72AC_HEADER_STDC
73AC_HEADER_SYS_WAIT
74AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
75
76dnl Add CFLAGS for embeded perl
77PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
78AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
79CFLAGS="${CFLAGS} ${PERL_CFLAGS}"
80
81dnl Find the location of perl XSUBPP
82AC_MSG_CHECKING(for the perl xsubpp precompiler)
83XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
84if test -n "${XSUBPPDIR}"; then
85   AC_MSG_RESULT(${XSUBPPDIR})
86else
87   AC_MSG_ERROR(not found)
88fi
89
90if test -f "${XSUBPPDIR}/typemap"; then
91   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
92else
93   XSUBPPFLAGS=""
94fi
95
96dnl Add LDFLAGS for embedded perl
97FOO=`perl -MExtUtils::Embed -e ldopts`
98AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
99LIBS=${LIBS}\ ${FOO}
100AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
101
102AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
103                     [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
104AX_PROG_PERL_MODULES([PAR],,
105                     [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
106
107dnl Add CFLAGS and LDFLAGS for glib-2.0
108PKG_CHECK_MODULES(GLIB,glib-2.0)
109
110AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
111CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
112AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
113LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
114
115if test "x${prefix}" = "xNONE"; then
116   prefix="${ac_default_prefix}"
117fi
118
119AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
120                   [Package data directory])
121AC_DEFINE_UNQUOTED([BINDIR],["${prefix}/bin"],
122                   [Binary directory])
123
124dnl Checks for typedefs, structures, and compiler characteristics.
125
126AX_CFLAGS_WARN_ALL
127AX_CFLAGS_STRICT_PROTOTYPES
128
129AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
130  [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"])
131
132AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
133                                 test "$HAVE_DES_KEY_SCHED" && dnl
134                                 test "$HAVE_DES_ECB_ENCRYPT"])
135
136AC_SUBST([LIBFAIM_CFLAGS])
137
138AC_SUBST(XSUBPPDIR)
139AC_SUBST(XSUBPPFLAGS)
140
141AC_PROG_INSTALL
142AC_PROG_RANLIB
143AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
144if test "x${HAVE_ZIP}" = "xno"; then
145   AC_MSG_ERROR([cannot find a 'zip' binary.])
146fi
147
148AC_CONFIG_FILES([Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
149AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.