1
0
forked from bip/bip
bip/configure.ac

95 lines
2.5 KiB
Plaintext
Raw Normal View History

2015-07-10 13:18:01 +02:00
AC_PREREQ([2.69])
2018-11-18 15:10:16 +01:00
AC_INIT([Bip IRC Proxy],[0.9.0-rc3-git],[http://bip.milkypond.org/projects/bip/activity],[bip],[http://bip.milkypond.org/])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
2011-10-04 04:15:12 +02:00
AM_MAINTAINER_MODE
2018-11-18 15:10:16 +01:00
AC_CONFIG_HEADERS([src/config.h])
# Checks for programs
AC_PROG_CC
2018-11-18 15:10:16 +01:00
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_INSTALL
AM_PROG_LEX
AC_PROG_YACC
# Deal with parameters
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug build]))
2015-07-10 11:49:30 +02:00
AC_ARG_WITH([openssl], AS_HELP_STRING([--without-openssl],
[Disable SSL using OpenSSL]))
AC_ARG_ENABLE([oidentd], AS_HELP_STRING([--enable-oidentd],
[Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)]))
AC_ARG_ENABLE([pie], AS_HELP_STRING([--disable-pie],
[Do not build a position independent executable]))
AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [Build tests]))
AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
AS_IF([test "x$enable_debug" = "xyes"], [
AC_CHECK_FUNC(backtrace_symbols_fd, [
AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()])
LDFLAGS="-rdynamic $LDFLAGS"
backtrace="(with backtrace)"
])
], [
2010-08-07 13:10:32 +02:00
enable_debug=no
])
2010-08-07 13:10:32 +02:00
AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes)
2010-02-17 13:33:05 +01:00
AS_IF([test "x$enable_oidentd" = "xyes"], [
AC_DEFINE([HAVE_OIDENTD], [], [Have bip edit ~/.oidentd.conf])
2010-08-07 13:10:32 +02:00
], [
enable_oidentd=no
])
2010-08-07 13:10:32 +02:00
AS_IF([test "x$with_openssl" != "xno"], [
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [
AC_MSG_ERROR([library 'crypto' is required for OpenSSL support])
2009-11-15 21:40:17 +01:00
with_openssl=no
2015-07-10 11:49:30 +02:00
], -lcrypto)
2009-11-15 21:40:17 +01:00
AC_CHECK_LIB(ssl, SSL_read, [], [
AC_MSG_ERROR([library 'ssl' is required for OpenSSL support])
with_openssl=no
], -lssl)
2010-08-07 13:10:32 +02:00
], [
with_openssl=no
])
AS_IF([test "x$enable_pie" != "xno"], [
AC_CACHE_CHECK([whether $CC accepts PIE flags], [ap_cv_cc_pie], [
save_CFLAGS=$CFLAGS
save_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS -fPIE"
LDFLAGS="$LDFLAGS -pie"
AC_RUN_IFELSE([AC_LANG_SOURCE([[static int foo[30000]; int main () { return 0; }]])],
2010-08-07 13:10:32 +02:00
[ap_cv_cc_pie=yes],
[ap_cv_cc_pie=no],
[ap_cv_cc_pie=yes]
2015-07-10 11:49:30 +02:00
)
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
])
if test "$ap_cv_cc_pie" = "yes"; then
CFLAGS="$CFLAGS -fPIE"
LDFLAGS="$LDFLAGS -pie"
2010-08-07 13:10:32 +02:00
enable_pie=yes
2015-07-10 11:49:30 +02:00
fi
])
AS_IF([test "x$enable_tests" != "xno"], [
PKG_CHECK_MODULES([CHECK], [check >= 0.9.6])
])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
AC_OUTPUT
2009-11-15 21:40:17 +01:00
AS_IF([test "x$with_openssl" != "xno"], [
echo OPENSSL: yes
])
echo DEBUG: $enable_debug $backtrace
echo OIDENTD: $enable_oidentd
2010-08-07 13:10:32 +02:00
echo PIE: $enable_pie
AS_IF([test "x$enable_tests" != "xno"], [
echo TESTS: $enable_tests
])