2015-07-10 13:18:01 +02:00
|
|
|
AC_PREREQ([2.69])
|
2021-10-11 18:14:37 +02:00
|
|
|
AC_INIT([Bip IRC Proxy],[0.9.1],[http://bip.milkypond.org/projects/bip/activity],[bip],[http://bip.milkypond.org/])
|
2018-11-18 20:23:06 +01:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
|
2011-10-04 04:15:12 +02:00
|
|
|
AM_MAINTAINER_MODE
|
2018-11-18 15:10:16 +01:00
|
|
|
|
2009-08-24 21:26:46 +02:00
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
|
|
|
|
|
|
|
# Checks for programs
|
|
|
|
AC_PROG_CC
|
2018-11-18 15:10:16 +01:00
|
|
|
AM_PROG_AR
|
2018-11-12 00:16:14 +01:00
|
|
|
AC_PROG_RANLIB
|
2009-08-24 21:26:46 +02:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AM_PROG_LEX
|
|
|
|
AC_PROG_YACC
|
2018-11-18 20:23:06 +01:00
|
|
|
m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Please install pkg-config.])])
|
|
|
|
PKG_PROG_PKG_CONFIG
|
2009-08-24 21:26:46 +02:00
|
|
|
|
2018-11-18 21:37:46 +01:00
|
|
|
PKG_CHECK_MODULES(OPENSSL, [libssl >= 0.9.8 libcrypto >= 0.9.8], [
|
|
|
|
with_openssl=yes
|
|
|
|
AC_DEFINE([HAVE_LIBSSL], [1],
|
|
|
|
[Build SSL support])
|
|
|
|
], [ with_openssl=no ])
|
2010-08-07 13:10:32 +02:00
|
|
|
|
2018-11-18 20:23:06 +01:00
|
|
|
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; }]])],
|
|
|
|
[ap_cv_cc_pie=yes],
|
|
|
|
[ap_cv_cc_pie=no],
|
|
|
|
[ap_cv_cc_pie=yes]
|
|
|
|
)
|
|
|
|
CFLAGS=$save_CFLAGS
|
|
|
|
LDFLAGS=$save_LDFLAGS
|
2009-08-24 21:26:46 +02:00
|
|
|
])
|
2018-11-18 20:23:06 +01:00
|
|
|
if test "$ap_cv_cc_pie" = "yes"; then
|
|
|
|
CFLAGS="$CFLAGS -fPIE"
|
|
|
|
LDFLAGS="$LDFLAGS -pie"
|
|
|
|
enable_pie=yes
|
|
|
|
fi
|
2009-08-24 21:26:46 +02:00
|
|
|
|
2018-12-09 22:06:18 +01:00
|
|
|
PKG_CHECK_MODULES([CHECK], [check >= 0.9.6], [enable_tests=yes], [enable_tests=no])
|
2018-12-09 21:08:58 +01:00
|
|
|
AM_CONDITIONAL([COND_WANT_TESTS], [test "$enable_tests" = yes])
|
2018-11-13 04:55:58 +01:00
|
|
|
|
2018-11-18 20:30:17 +01:00
|
|
|
AC_CHECK_FUNC(backtrace_symbols_fd, [
|
|
|
|
AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()])
|
|
|
|
LDFLAGS="-rdynamic $LDFLAGS"
|
|
|
|
backtrace="(with backtrace)"
|
|
|
|
])
|
|
|
|
|
2018-11-13 04:55:58 +01:00
|
|
|
|
2018-12-09 22:06:18 +01:00
|
|
|
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
|
2009-08-24 21:26:46 +02:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2018-11-18 20:30:17 +01:00
|
|
|
echo OPENSSL: $with_openssl
|
2010-08-07 13:10:32 +02:00
|
|
|
echo PIE: $enable_pie
|
2018-11-13 04:55:58 +01:00
|
|
|
echo TESTS: $enable_tests
|