blob: 16158b95f92d4016d6f04bce84932135a93c7820 [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 Graf4cc1daa2012-01-17 12:51:15 +010016m4_define([libnl_micro_version], [6]) # bump for every release unless minor was bumped
Thomas Graf9015d112012-01-12 13:17:32 +010017m4_define([libnl_lt_revision], [1]) # bump or reset to 0 if interfaces were added
Thomas Graf4cc1daa2012-01-17 12:51:15 +010018m4_define([libnl_lt_age], [6]) # 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
25m4_define([libnl_lt_current],
26 [m4_eval(100 * libnl_minor_version + libnl_micro_version - libnl_lt_revision)])
27
28AC_INIT(libnl, [libnl_version], [http://www.infradead.org/~tgr/libnl/])
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020029AC_CONFIG_HEADERS([lib/defs.h])
30AC_CONFIG_MACRO_DIR([m4])
31AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
Reuben Hawkinsb5c474e2011-02-17 21:28:50 -080032m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
Thomas Graf44d36242007-09-15 01:28:01 +020033
Thomas Graf4c210ad2011-09-13 22:58:08 +020034MAJ_VERSION=libnl_major_version
35AC_SUBST(MAJ_VERSION)
36MIN_VERSION=libnl_minor_version
37AC_SUBST(MIN_VERSION)
38MIC_VERSION=libnl_micro_version
39AC_SUBST(MIC_VERSION)
40LIBNL_VERSION=libnl_version
41AC_SUBST(LIBNL_VERSION)
42
43LT_CURRENT=libnl_lt_current
44AC_SUBST(LT_CURRENT)
45LT_REVISION=libnl_lt_revision
46AC_SUBST(LT_REVISION)
47LT_AGE=libnl_lt_age
48AC_SUBST(LT_AGE)
Thomas Grafd8d67c02011-03-16 13:46:41 +010049
Thomas Graf44d36242007-09-15 01:28:01 +020050AC_PROG_CC
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020051AM_PROG_CC_C_O
Thomas Graf44d36242007-09-15 01:28:01 +020052AC_PROG_INSTALL
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020053AM_PROG_LIBTOOL
Thomas Grafdb5bd572010-07-02 14:06:59 +020054AM_PROG_LEX
55AC_PROG_YACC
Thomas Graf44d36242007-09-15 01:28:01 +020056
57AC_C_CONST
58AC_C_INLINE
59
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020060AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
61 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
62 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
63AC_SUBST([pkgconfigdir])
Thomas Graf44d36242007-09-15 01:28:01 +020064
Karl Hiramoto018c2972010-06-16 16:33:51 +020065AC_ARG_ENABLE([cli],
66 AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]),
67 [enable_cli="$enableval"], [enable_cli="yes"])
68AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"])
69
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020070AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))
Thomas Graf569bec52011-08-11 15:17:56 +020071AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
Thomas Graf44d36242007-09-15 01:28:01 +020072
Thomas Graf4c210ad2011-09-13 22:58:08 +020073AC_CONFIG_FILES([
74Makefile
75libnl-3.0.pc
76libnl-route-3.0.pc
77libnl-genl-3.0.pc
78libnl-nf-3.0.pc
Jiří Župkaf90dc632011-10-04 16:06:22 +020079libnl-cli-3.0.pc
Thomas Graf4c210ad2011-09-13 22:58:08 +020080doc/Doxyfile
81doc/Makefile
82lib/Makefile
83include/Makefile
84src/Makefile
85src/lib/Makefile
86man/Makefile
87python/Makefile
88python/setup.py
89python/netlink/Makefile
90python/netlink/route/Makefile
91include/netlink/version.h
92])
93
Jan Engelhardtbf4fd3a2009-06-23 01:12:53 +020094AC_OUTPUT
Thomas Graf6e5332b2011-09-13 11:49:41 +020095
Thomas Graf4c210ad2011-09-13 22:58:08 +020096echo "-------------------------------------------------------------------------------"
97echo " NOTE"
98echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +020099echo " There have been some changes starting with 3.2 regarding where and how libnl"
100echo " is being installed on the system in order to allow multiple libnl versions"
101echo " to be installed in parallel:"
Thomas Graf4c210ad2011-09-13 22:58:08 +0200102echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +0200103echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore"
104echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS"
Thomas Graf4c210ad2011-09-13 22:58:08 +0200105echo ""
Thomas Grafd3bb7c92011-09-19 11:47:49 +0200106echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become"
107echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc."
108echo ""
109echo " - libtool versioning was assumed, to ease detection of compatible library"
110echo " versions. libnl-${MAJ_VERSION}.so.CURRENT.REVISION.AGE where."
111echo " CURRENT := 100 * \$MINOR_VERSION + \$MICRO_VERSION"
112echo " REVISION := nth revision if API was unchanged"
113echo " AGE := nth revision that is backwards compatible."
114echo ""
115echo " If you are using pkg-config for detecting and linking against the library "
116echo " things will continue magically as if nothing every happened. If you are "
117echo " linking manually you need to adapt your Makefiles or switch to using "
118echo " pkg-config files."
Thomas Graf4c210ad2011-09-13 22:58:08 +0200119echo ""
120echo "-------------------------------------------------------------------------------"
Thomas Graf6e5332b2011-09-13 11:49:41 +0200121