blob: b6060c78e4d8b7fa37f12afe8dac9a3601e9bd3a [file] [log] [blame]
Thomas Graf44d36242007-09-15 01:28:01 +02001#
2# configure.in
3#
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
7# of the License.
8#
Thomas Grafd7222e52012-01-11 12:51:03 +01009# Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
Thomas Graf44d36242007-09-15 01:28:01 +020010#
11
Thomas Graf4c210ad2011-09-13 22:58:08 +020012
13# copied from glib
14m4_define([libnl_major_version], [3])
15m4_define([libnl_minor_version], [2])
Thomas Graf9cbcbca2012-01-25 17:03:37 +010016m4_define([libnl_micro_version], [7]) # bump for every release unless minor was bumped
17m4_define([libnl_lt_revision], [2]) # bump or reset to 0 if interfaces were added
18m4_define([libnl_backwards_age], [7]) # bump whenever a release is backwards compatible
Thomas Graf4c210ad2011-09-13 22:58:08 +020019 # bump with +100 if a minor release is compatible
20 # reset to 0 if interfaces were removed
21
22m4_define([libnl_version],
23 [libnl_major_version.libnl_minor_version.libnl_micro_version])
24
Thomas Graf9cbcbca2012-01-25 17:03:37 +010025m4_define([libnl_lt_age], [m4_eval(libnl_backwards_age - libnl_lt_revision)])
Thomas Graf4c210ad2011-09-13 22:58:08 +020026m4_define([libnl_lt_current],
27 [m4_eval(100 * libnl_minor_version + libnl_micro_version - libnl_lt_revision)])
28
29AC_INIT(libnl, [libnl_version], [http://www.infradead.org/~tgr/libnl/])
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020030AC_CONFIG_HEADERS([lib/defs.h])
31AC_CONFIG_MACRO_DIR([m4])
32AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
Reuben Hawkinsb5c474e2011-02-17 21:28:50 -080033m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
Thomas Graf44d36242007-09-15 01:28:01 +020034
Thomas Graf4c210ad2011-09-13 22:58:08 +020035MAJ_VERSION=libnl_major_version
36AC_SUBST(MAJ_VERSION)
37MIN_VERSION=libnl_minor_version
38AC_SUBST(MIN_VERSION)
39MIC_VERSION=libnl_micro_version
40AC_SUBST(MIC_VERSION)
41LIBNL_VERSION=libnl_version
42AC_SUBST(LIBNL_VERSION)
43
44LT_CURRENT=libnl_lt_current
45AC_SUBST(LT_CURRENT)
46LT_REVISION=libnl_lt_revision
47AC_SUBST(LT_REVISION)
48LT_AGE=libnl_lt_age
49AC_SUBST(LT_AGE)
Thomas Grafd8d67c02011-03-16 13:46:41 +010050
Thomas Graf44d36242007-09-15 01:28:01 +020051AC_PROG_CC
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020052AM_PROG_CC_C_O
Thomas Graf44d36242007-09-15 01:28:01 +020053AC_PROG_INSTALL
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020054AM_PROG_LIBTOOL
Thomas Grafdb5bd572010-07-02 14:06:59 +020055AM_PROG_LEX
56AC_PROG_YACC
Thomas Graf44d36242007-09-15 01:28:01 +020057
58AC_C_CONST
59AC_C_INLINE
60
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020061AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
62 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
63 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
64AC_SUBST([pkgconfigdir])
Thomas Graf44d36242007-09-15 01:28:01 +020065
Karl Hiramoto018c2972010-06-16 16:33:51 +020066AC_ARG_ENABLE([cli],
67 AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]),
68 [enable_cli="$enableval"], [enable_cli="yes"])
69AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"])
70
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020071AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))
Thomas Graf569bec52011-08-11 15:17:56 +020072AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
Thomas Graf44d36242007-09-15 01:28:01 +020073
Thomas Graf4c210ad2011-09-13 22:58:08 +020074AC_CONFIG_FILES([
75Makefile
76libnl-3.0.pc
77libnl-route-3.0.pc
78libnl-genl-3.0.pc
79libnl-nf-3.0.pc
Jiří Župkaf90dc632011-10-04 16:06:22 +020080libnl-cli-3.0.pc
Thomas Graf4c210ad2011-09-13 22:58:08 +020081doc/Doxyfile
82doc/Makefile
83lib/Makefile
84include/Makefile
85src/Makefile
86src/lib/Makefile
87man/Makefile
88python/Makefile
89python/setup.py
90python/netlink/Makefile
91python/netlink/route/Makefile
92include/netlink/version.h
93])
94
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020095AC_OUTPUT
Thomas Graf6e5332b2011-09-13 11:49:41 +020096
Thomas Graf4c210ad2011-09-13 22:58:08 +020097echo "-------------------------------------------------------------------------------"
98echo " NOTE"
99echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +0200100echo " There have been some changes starting with 3.2 regarding where and how libnl"
101echo " is being installed on the system in order to allow multiple libnl versions"
102echo " to be installed in parallel:"
Thomas Graf4c210ad2011-09-13 22:58:08 +0200103echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +0200104echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore"
105echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS"
Thomas Graf4c210ad2011-09-13 22:58:08 +0200106echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +0200107echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become"
108echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc."
109echo ""
110echo " - libtool versioning was assumed, to ease detection of compatible library"
111echo " versions. libnl-${MAJ_VERSION}.so.CURRENT.REVISION.AGE where."
112echo " CURRENT := 100 * \$MINOR_VERSION + \$MICRO_VERSION"
113echo " REVISION := nth revision if API was unchanged"
114echo " AGE := nth revision that is backwards compatible."
115echo ""
116echo " If you are using pkg-config for detecting and linking against the library "
117echo " things will continue magically as if nothing every happened. If you are "
118echo " linking manually you need to adapt your Makefiles or switch to using "
119echo " pkg-config files."
Thomas Graf4c210ad2011-09-13 22:58:08 +0200120echo ""
121echo "-------------------------------------------------------------------------------"
Thomas Graf6e5332b2011-09-13 11:49:41 +0200122