4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation version 2.1
9 # Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
14 m4_define([libnl_major_version], [3])
15 m4_define([libnl_minor_version], [2])
16 m4_define([libnl_micro_version], [22])
19 # The following explanation may help to understand the above rules a bit
20 # better: consider that there are three possible kinds of reactions from
21 # users of your library to changes in a shared library:
23 # 1. Programs using the previous version may use the new version as drop-in
24 # replacement, and programs using the new version can also work with the
25 # previous one. In other words, no recompiling nor relinking is needed.
26 # In this case, bump revision only, don't touch current nor age.
28 # 2. Programs using the previous version may use the new version as drop-in
29 # replacement, but programs using the new version may use APIs not
30 # present in the previous one. In other words, a program linking against
31 # the new version may fail with “unresolved symbols” if linking against
32 # the old version at runtime: set revision to 0, bump current and age.
34 # 3. Programs may need to be changed, recompiled, relinked in order to use
35 # the new version. Bump current, set revision and age to 0.
37 m4_define([libnl_lt_current], [217])
38 m4_define([libnl_lt_revision], [0])
39 m4_define([libnl_lt_age], [17])
41 m4_define([libnl_version],
42 [libnl_major_version.libnl_minor_version.libnl_micro_version])
44 AC_INIT(libnl, [libnl_version], [], [], [http://www.infradead.org/~tgr/libnl/])
45 AC_CONFIG_HEADERS([lib/defs.h])
46 AC_CONFIG_AUX_DIR([build-aux])
47 AC_CONFIG_MACRO_DIR([m4])
48 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
49 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
50 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
52 MAJ_VERSION=libnl_major_version
54 MIN_VERSION=libnl_minor_version
56 MIC_VERSION=libnl_micro_version
58 LIBNL_VERSION=libnl_version
59 AC_SUBST(LIBNL_VERSION)
61 LT_CURRENT=libnl_lt_current
63 LT_REVISION=libnl_lt_revision
72 AC_CHECK_PROGS(FLEX, 'flex')
73 AC_CHECK_PROGS(YACC, 'bison -y')
78 PKG_CHECK_MODULES([CHECK], [check >= 0.9.0],
79 [enable_unit_tests="yes"],
80 [AC_MSG_WARN([*** Disabling building of unit tests])
81 enable_unit_tests="no"])
83 AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "$enable_unit_tests" = "yes"])
85 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
86 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
87 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
88 AC_SUBST([pkgconfigdir])
91 AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]),
92 [enable_cli="$enableval"], [enable_cli="yes"])
93 AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"])
95 AC_ARG_ENABLE([pthreads],
96 AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]),
97 [enable_pthreads="$enableval"], [enable_pthreads="yes"])
98 AM_CONDITIONAL([DISABLE_PTHREADS], [test "$enable_pthreads" = "no"])
100 AC_ARG_ENABLE([debug],
101 AS_HELP_STRING([--disable-debug], [Do not include debugging statements]),
102 [enable_debug="$enableval"], [enable_debug="yes"])
103 AM_CONDITIONAL([ENABLE_DEBUG], [test "$enable_debug" = "no" ])
105 AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))
107 if test "x$enable_pthreads" = "xno"; then
108 AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads])
110 AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
113 if test "x$enable_debug" = "xyes"; then
114 AC_DEFINE([NL_DEBUG], [1], [Define to 1 to enable debugging])
117 AC_CONFIG_SUBDIRS([doc])
134 python/netlink/Makefile
135 python/netlink/route/Makefile
136 include/netlink/version.h
140 if test -z "$YACC"; then
141 AC_MSG_WARN(bison not found. Please install before continuing.)
142 ac_errcount=$((ac_errcount + 1))
144 if test -z "$FLEX"; then
145 AC_MSG_WARN(flex not found. Please install before continuing.)
146 ac_errcount=$((ac_errcount + 1))
148 if test $ac_errcount -gt 0; then
149 AC_MSG_ERROR(Required packages are missing. Please install them and rerun ./configure)
154 echo "-------------------------------------------------------------------------------"
157 echo " There have been some changes starting with 3.2 regarding where and how libnl"
158 echo " is being installed on the system in order to allow multiple libnl versions"
159 echo " to be installed in parallel:"
161 echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore"
162 echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS"
164 echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become"
165 echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc."
167 echo " - libtool versioning was assumed, to ease detection of compatible library"
170 echo " If you are using pkg-config for detecting and linking against the library "
171 echo " things will continue magically as if nothing every happened. If you are "
172 echo " linking manually you need to adapt your Makefiles or switch to using "
173 echo " pkg-config files."
175 echo "-------------------------------------------------------------------------------"