2007-09-15 01:28:01 +02:00
#
# configure.in
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation version 2.1
# of the License.
#
2013-01-24 15:00:26 +01:00
# Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
2007-09-15 01:28:01 +02:00
#
2011-09-13 22:58:08 +02:00
# copied from glib
m4_define([libnl_major_version], [3])
2019-09-01 16:19:02 +02:00
m4_define([libnl_minor_version], [5])
2017-03-06 21:28:49 +01:00
m4_define([libnl_micro_version], [0])
2014-07-04 19:58:04 +02:00
m4_define([libnl_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
2012-04-26 11:22:49 +02:00
2013-01-24 14:34:22 +01:00
# The following explanation may help to understand the above rules a bit
# better: consider that there are three possible kinds of reactions from
# users of your library to changes in a shared library:
2012-04-26 11:22:49 +02:00
#
2013-01-24 14:34:22 +01:00
# 1. Programs using the previous version may use the new version as drop-in
# replacement, and programs using the new version can also work with the
# previous one. In other words, no recompiling nor relinking is needed.
# In this case, bump revision only, don't touch current nor age.
2012-04-26 11:22:49 +02:00
#
2013-01-24 14:34:22 +01:00
# 2. Programs using the previous version may use the new version as drop-in
# replacement, but programs using the new version may use APIs not
# present in the previous one. In other words, a program linking against
# the new version may fail with “unresolved symbols” if linking against
# the old version at runtime: set revision to 0, bump current and age.
#
# 3. Programs may need to be changed, recompiled, relinked in order to use
# the new version. Bump current, set revision and age to 0.
2012-04-26 11:22:49 +02:00
2017-09-20 10:58:20 +02:00
m4_define([libnl_lt_current], [226])
2016-12-12 15:10:21 +01:00
m4_define([libnl_lt_revision], [0])
2017-09-20 10:58:20 +02:00
m4_define([libnl_lt_age], [26])
2011-09-13 22:58:08 +02:00
m4_define([libnl_version],
2017-10-09 13:14:55 +02:00
[libnl_major_version.libnl_minor_version.libnl_micro_version])
2011-09-13 22:58:08 +02:00
2012-10-26 12:19:26 -07:00
AC_INIT(libnl, [libnl_version], [], [], [http://www.infradead.org/~tgr/libnl/])
2009-06-23 01:12:53 +02:00
AC_CONFIG_HEADERS([lib/defs.h])
2012-11-26 20:51:51 +01:00
AC_CONFIG_AUX_DIR([build-aux])
2009-06-23 01:12:53 +02:00
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
2011-02-17 21:28:50 -08:00
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
2012-11-26 20:49:02 +01:00
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
2007-09-15 01:28:01 +02:00
2011-09-13 22:58:08 +02:00
MAJ_VERSION=libnl_major_version
AC_SUBST(MAJ_VERSION)
MIN_VERSION=libnl_minor_version
AC_SUBST(MIN_VERSION)
MIC_VERSION=libnl_micro_version
AC_SUBST(MIC_VERSION)
2014-07-04 19:58:04 +02:00
LIBNL_GIT_SHA=libnl_git_sha
2011-09-13 22:58:08 +02:00
LIBNL_VERSION=libnl_version
AC_SUBST(LIBNL_VERSION)
LT_CURRENT=libnl_lt_current
AC_SUBST(LT_CURRENT)
LT_REVISION=libnl_lt_revision
AC_SUBST(LT_REVISION)
LT_AGE=libnl_lt_age
AC_SUBST(LT_AGE)
2011-03-16 13:46:41 +01:00
2007-09-15 01:28:01 +02:00
AC_PROG_CC
2009-06-23 01:12:53 +02:00
AM_PROG_CC_C_O
2007-09-15 01:28:01 +02:00
AC_PROG_INSTALL
2009-06-23 01:12:53 +02:00
AM_PROG_LIBTOOL
2014-05-25 11:49:19 +02:00
AC_PROG_MKDIR_P
2012-11-23 16:40:14 +01:00
AC_CHECK_PROGS(FLEX, 'flex')
2012-11-19 20:20:22 -08:00
AC_CHECK_PROGS(YACC, 'bison -y')
2007-09-15 01:28:01 +02:00
AC_C_CONST
AC_C_INLINE
2013-04-27 14:27:10 +02:00
PKG_CHECK_MODULES([CHECK], [check >= 0.9.0],
2017-02-26 21:25:28 +01:00
[has_check="yes"],
2013-04-27 14:27:10 +02:00
[AC_MSG_WARN([*** Disabling building of unit tests])
2017-02-26 21:25:28 +01:00
has_check="no"])
AM_CONDITIONAL(WITH_CHECK, [test "$has_check" = 'yes'])
2013-03-14 16:25:17 +01:00
2009-06-23 01:12:53 +02:00
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
2007-09-15 01:28:01 +02:00
2010-06-16 16:33:51 +02:00
AC_ARG_ENABLE([cli],
2015-03-18 15:20:28 +01:00
AS_HELP_STRING([--enable-cli=yes|no|no-inst|bin|sbin], [Whether to build command line interface utils. Defaults to 'yes' which is a synonym for 'bin'. 'no-inst' means only build, not installing. 'bin'/'sbin' means installing to bin/sbin directory]),
2010-06-16 16:33:51 +02:00
[enable_cli="$enableval"], [enable_cli="yes"])
2015-03-18 15:20:28 +01:00
if test "$enable_cli" != "no" &&
test "$enable_cli" != "no-inst" &&
test "$enable_cli" != "sbin"; then
enable_cli="bin"
fi
AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" != "no"])
AM_CONDITIONAL([ENABLE_CLI_INSTALL_BIN], [test "$enable_cli" = "bin"])
AM_CONDITIONAL([ENABLE_CLI_INSTALL_SBIN], [test "$enable_cli" = "sbin"])
2010-06-16 16:33:51 +02:00
2017-05-12 12:47:19 +02:00
AC_CHECK_HEADERS(dlfcn.h, [], [])
2012-10-26 12:19:26 -07:00
AC_ARG_ENABLE([pthreads],
AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]),
[enable_pthreads="$enableval"], [enable_pthreads="yes"])
AM_CONDITIONAL([DISABLE_PTHREADS], [test "$enable_pthreads" = "no"])
if test "x$enable_pthreads" = "xno"; then
AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads])
else
AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
fi
2007-09-15 01:28:01 +02:00
2017-02-28 00:34:46 +01:00
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--disable-debug], [Do not include debugging statements]),
[enable_debug="$enableval"], [enable_debug="yes"])
2013-04-02 11:39:30 +02:00
if test "x$enable_debug" = "xyes"; then
AC_DEFINE([NL_DEBUG], [1], [Define to 1 to enable debugging])
fi
2012-10-19 16:16:06 +02:00
AC_CONFIG_SUBDIRS([doc])
2017-03-10 17:44:22 +03:00
AC_CHECK_FUNCS([strerror_l])
2011-09-13 22:58:08 +02:00
AC_CONFIG_FILES([
Makefile
libnl-3.0.pc
libnl-route-3.0.pc
libnl-genl-3.0.pc
libnl-nf-3.0.pc
2011-10-04 16:06:22 +02:00
libnl-cli-3.0.pc
2014-07-20 15:57:33 +02:00
libnl-xfrm-3.0.pc
2014-09-18 12:17:39 +02:00
libnl-idiag-3.0.pc
2011-09-13 22:58:08 +02:00
python/setup.py
include/netlink/version.h
])
2012-11-19 20:20:22 -08:00
ac_errcount=0
if test -z "$YACC"; then
AC_MSG_WARN(bison not found. Please install before continuing.)
ac_errcount=$((ac_errcount + 1))
fi
2012-11-23 16:40:14 +01:00
if test -z "$FLEX"; then
AC_MSG_WARN(flex not found. Please install before continuing.)
2012-11-19 20:20:22 -08:00
ac_errcount=$((ac_errcount + 1))
fi
if test $ac_errcount -gt 0; then
AC_MSG_ERROR(Required packages are missing. Please install them and rerun ./configure)
fi
2009-06-23 01:12:53 +02:00
AC_OUTPUT
2011-09-13 11:49:41 +02:00
2011-09-13 22:58:08 +02:00
echo "-------------------------------------------------------------------------------"
echo " NOTE"
echo ""
2011-09-19 11:47:49 +02:00
echo " There have been some changes starting with 3.2 regarding where and how libnl"
echo " is being installed on the system in order to allow multiple libnl versions"
echo " to be installed in parallel:"
2011-09-13 22:58:08 +02:00
echo ""
2011-09-19 11:47:49 +02:00
echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore"
echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS"
2011-09-13 22:58:08 +02:00
echo ""
2011-09-19 11:47:49 +02:00
echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become"
echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc."
echo ""
echo " - libtool versioning was assumed, to ease detection of compatible library"
2013-01-22 19:15:34 +01:00
echo " versions."
2011-09-19 11:47:49 +02:00
echo ""
echo " If you are using pkg-config for detecting and linking against the library "
echo " things will continue magically as if nothing every happened. If you are "
echo " linking manually you need to adapt your Makefiles or switch to using "
echo " pkg-config files."
2011-09-13 22:58:08 +02:00
echo ""
echo "-------------------------------------------------------------------------------"
2011-09-13 11:49:41 +02:00