source: configure.ac @ 2cbe7c3

release-1.8release-1.9
Last change on this file since 2cbe7c3 was 2cbe7c3, checked in by Anders Kaseorg <andersk@mit.edu>, 10 years ago
Protect memrchr prototype by !HAVE_DECL_MEMCHR instead of !HAVE_MEMCHR This fixes viewwin.c:393:7: warning: implicit declaration of function ‘memrchr’ on platforms where PERL_CFLAGS doesn’t contain -D_GNU_SOURCE. !HAVE_MEMRCHR means that memrchr is undefined at link time, so we need to provide our own implementation; but !HAVE_DECL_MEMRCHR means that memrchr is not declared at compile time, so we need to provide our own prototype. http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00037.html Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 5.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.8dev],[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    [AM_CFLAGS="$AM_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
37AC_ARG_WITH([krb4],
38  AS_HELP_STRING([--with-krb4],
39                 [Build with kerberos IV]))
40
41AS_IF([test "x$with_zephyr" != xno],
42  [AS_IF([test "x$with_krb4" != "xno"],
43   [AC_MSG_CHECKING([for Kerberos IV])
44    AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
45      [AC_MSG_RESULT([yes])
46       AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV])
47       AM_CFLAGS="${AM_CFLAGS} `krb5-config krb4 --cflags`"
48       LIBS="${LIBS} `krb5-config krb4 --libs`"
49      ],
50      [AC_MSG_RESULT([no])
51       AS_IF([test "x$with_krb4" = "xyes"],
52             [AC_MSG_ERROR([Kerberos IV requested but not found])])
53       PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
54       AM_CFLAGS="${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
55       LIBS="${LIBS} ${LIBCRYPTO_LIBS}"
56     ])])
57   AC_CHECK_LIB([zephyr], [ZGetSender],
58   [LIBS="$LIBS -lzephyr"
59    AC_DEFINE([HAVE_LIBZEPHYR], [1],
60                [Define if you have libzephyr])
61    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
62      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
63                [Have ZInitLocationInfo]),)
64    AC_CHECK_LIB([com_err], [com_err])
65    AC_CHECK_HEADERS([com_err.h])
66   ],
67   [if test "x$with_zephyr" != xcheck; then
68      AC_MSG_FAILURE(
69        [--with-zephyr was given, but libzephyr does not seem to be available.])
70    fi
71   ])])
72
73AC_CHECK_FUNCS([use_default_colors])
74AC_CHECK_FUNCS([resizeterm], [], [AC_MSG_ERROR([No resizeterm found])])
75AC_CHECK_FUNCS([des_string_to_key DES_string_to_key], [HAVE_DES_STRING_TO_KEY=1])
76AC_CHECK_FUNCS([des_ecb_encrypt DES_ecb_encrypt], [HAVE_DES_ECB_ENCRYPT=1])
77AC_CHECK_FUNCS([des_key_sched DES_key_sched], [HAVE_DES_KEY_SCHED=1])
78
79dnl Checks for header files.
80AC_HEADER_STDC
81AC_HEADER_SYS_WAIT
82AC_HEADER_STDBOOL
83AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
84
85dnl Add CFLAGS for embeded perl
86PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
87AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
88AM_CFLAGS="${AM_CFLAGS} ${PERL_CFLAGS}"
89
90dnl Find the location of perl XSUBPP
91AC_MSG_CHECKING(for the perl xsubpp precompiler)
92XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
93if test -n "${XSUBPPDIR}"; then
94   AC_MSG_RESULT(${XSUBPPDIR})
95else
96   AC_MSG_ERROR(not found)
97fi
98
99if test -f "${XSUBPPDIR}/typemap"; then
100   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
101else
102   XSUBPPFLAGS=""
103fi
104
105dnl Add LIBS for embedded perl
106FOO=`perl -MExtUtils::Embed -e ldopts`
107AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
108LIBS=${LIBS}\ ${FOO}
109AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
110
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
116dnl Add CFLAGS and LIBS for glib-2.0
117PKG_CHECK_MODULES(GLIB,[glib-2.0 gobject-2.0])
118
119AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
120AM_CFLAGS="${GLIB_CFLAGS} ${AM_CFLAGS}"
121AC_MSG_NOTICE([Adding glib-2.0 LIBS ${GLIB_LIBS}])
122LIBS="${GLIB_LIBS} ${LIBS}"
123
124if test "x${prefix}" = "xNONE"; then
125   prefix="${ac_default_prefix}"
126fi
127
128dnl Checks for typedefs, structures, and compiler characteristics.
129
130AX_CFLAGS_WARN_ALL([AM_CFLAGS])
131AX_C_CHECK_FLAG([-Wstrict-prototypes],[],[],[AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"])
132
133m4_foreach([myflag],
134  [[-Wno-pointer-sign],[-Wno-empty-body],[-Wno-unused-value]],
135  [AX_C_CHECK_FLAG([myflag],[],[],[LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS myflag"])])
136
137AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
138                                 test "$HAVE_DES_KEY_SCHED" && dnl
139                                 test "$HAVE_DES_ECB_ENCRYPT"])
140
141AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=500"
142dnl Define _BSD_SOURCE because zephyr needs caddr_t.
143AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE"
144dnl Define __EXTENSIONS__ for strcasecmp on Solaris.
145AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__"
146
147AC_SUBST([AM_CFLAGS])
148AC_SUBST([LIBFAIM_CFLAGS])
149
150AC_SUBST(XSUBPPDIR)
151AC_SUBST(XSUBPPFLAGS)
152
153AC_PROG_INSTALL
154AC_PROG_RANLIB
155AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
156if test "x${HAVE_ZIP}" = "xno"; then
157   AC_MSG_ERROR([cannot find a 'zip' binary.])
158fi
159
160AC_CONFIG_LIBOBJ_DIR([compat])
161AC_CHECK_DECLS([memrchr])
162AC_REPLACE_FUNCS([memrchr])
163
164AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
165AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.