Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 1 | # |
| 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 Graf | d7222e5 | 2012-01-11 12:51:03 +0100 | [diff] [blame] | 9 | # Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch> |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 10 | # |
| 11 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 12 | |
| 13 | # copied from glib |
| 14 | m4_define([libnl_major_version], [3]) |
| 15 | m4_define([libnl_minor_version], [2]) |
Thomas Graf | 9cbcbca | 2012-01-25 17:03:37 +0100 | [diff] [blame] | 16 | m4_define([libnl_micro_version], [7]) # bump for every release unless minor was bumped |
| 17 | m4_define([libnl_lt_revision], [2]) # bump or reset to 0 if interfaces were added |
| 18 | m4_define([libnl_backwards_age], [7]) # bump whenever a release is backwards compatible |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 19 | # bump with +100 if a minor release is compatible |
| 20 | # reset to 0 if interfaces were removed |
| 21 | |
| 22 | m4_define([libnl_version], |
| 23 | [libnl_major_version.libnl_minor_version.libnl_micro_version]) |
| 24 | |
Thomas Graf | 9cbcbca | 2012-01-25 17:03:37 +0100 | [diff] [blame] | 25 | m4_define([libnl_lt_age], [m4_eval(libnl_backwards_age - libnl_lt_revision)]) |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 26 | m4_define([libnl_lt_current], |
| 27 | [m4_eval(100 * libnl_minor_version + libnl_micro_version - libnl_lt_revision)]) |
| 28 | |
| 29 | AC_INIT(libnl, [libnl_version], [http://www.infradead.org/~tgr/libnl/]) |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 30 | AC_CONFIG_HEADERS([lib/defs.h]) |
| 31 | AC_CONFIG_MACRO_DIR([m4]) |
| 32 | AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) |
Reuben Hawkins | b5c474e | 2011-02-17 21:28:50 -0800 | [diff] [blame] | 33 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], []) |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 34 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 35 | MAJ_VERSION=libnl_major_version |
| 36 | AC_SUBST(MAJ_VERSION) |
| 37 | MIN_VERSION=libnl_minor_version |
| 38 | AC_SUBST(MIN_VERSION) |
| 39 | MIC_VERSION=libnl_micro_version |
| 40 | AC_SUBST(MIC_VERSION) |
| 41 | LIBNL_VERSION=libnl_version |
| 42 | AC_SUBST(LIBNL_VERSION) |
| 43 | |
| 44 | LT_CURRENT=libnl_lt_current |
| 45 | AC_SUBST(LT_CURRENT) |
| 46 | LT_REVISION=libnl_lt_revision |
| 47 | AC_SUBST(LT_REVISION) |
| 48 | LT_AGE=libnl_lt_age |
| 49 | AC_SUBST(LT_AGE) |
Thomas Graf | d8d67c0 | 2011-03-16 13:46:41 +0100 | [diff] [blame] | 50 | |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 51 | AC_PROG_CC |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 52 | AM_PROG_CC_C_O |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 53 | AC_PROG_INSTALL |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 54 | AM_PROG_LIBTOOL |
Thomas Graf | db5bd57 | 2010-07-02 14:06:59 +0200 | [diff] [blame] | 55 | AM_PROG_LEX |
| 56 | AC_PROG_YACC |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 57 | |
| 58 | AC_C_CONST |
| 59 | AC_C_INLINE |
| 60 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 61 | AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], |
| 62 | [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), |
| 63 | [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) |
| 64 | AC_SUBST([pkgconfigdir]) |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 65 | |
Karl Hiramoto | 018c297 | 2010-06-16 16:33:51 +0200 | [diff] [blame] | 66 | AC_ARG_ENABLE([cli], |
| 67 | AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]), |
| 68 | [enable_cli="$enableval"], [enable_cli="yes"]) |
| 69 | AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"]) |
| 70 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 71 | AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required])) |
Thomas Graf | 569bec5 | 2011-08-11 15:17:56 +0200 | [diff] [blame] | 72 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required])) |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 73 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 74 | AC_CONFIG_FILES([ |
| 75 | Makefile |
| 76 | libnl-3.0.pc |
| 77 | libnl-route-3.0.pc |
| 78 | libnl-genl-3.0.pc |
| 79 | libnl-nf-3.0.pc |
Jiří Župka | f90dc63 | 2011-10-04 16:06:22 +0200 | [diff] [blame] | 80 | libnl-cli-3.0.pc |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 81 | doc/Doxyfile |
| 82 | doc/Makefile |
| 83 | lib/Makefile |
| 84 | include/Makefile |
| 85 | src/Makefile |
| 86 | src/lib/Makefile |
Thomas Graf | 9af5469 | 2012-04-21 10:34:43 +0200 | [diff] [blame] | 87 | tests/Makefile |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 88 | man/Makefile |
| 89 | python/Makefile |
| 90 | python/setup.py |
| 91 | python/netlink/Makefile |
| 92 | python/netlink/route/Makefile |
| 93 | include/netlink/version.h |
| 94 | ]) |
| 95 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 96 | AC_OUTPUT |
Thomas Graf | 6e5332b | 2011-09-13 11:49:41 +0200 | [diff] [blame] | 97 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 98 | echo "-------------------------------------------------------------------------------" |
| 99 | echo " NOTE" |
| 100 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 101 | echo " There have been some changes starting with 3.2 regarding where and how libnl" |
| 102 | echo " is being installed on the system in order to allow multiple libnl versions" |
| 103 | echo " to be installed in parallel:" |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 104 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 105 | echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore" |
| 106 | echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS" |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 107 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 108 | echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become" |
| 109 | echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc." |
| 110 | echo "" |
| 111 | echo " - libtool versioning was assumed, to ease detection of compatible library" |
| 112 | echo " versions. libnl-${MAJ_VERSION}.so.CURRENT.REVISION.AGE where." |
| 113 | echo " CURRENT := 100 * \$MINOR_VERSION + \$MICRO_VERSION" |
| 114 | echo " REVISION := nth revision if API was unchanged" |
| 115 | echo " AGE := nth revision that is backwards compatible." |
| 116 | echo "" |
| 117 | echo " If you are using pkg-config for detecting and linking against the library " |
| 118 | echo " things will continue magically as if nothing every happened. If you are " |
| 119 | echo " linking manually you need to adapt your Makefiles or switch to using " |
| 120 | echo " pkg-config files." |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 121 | echo "" |
| 122 | echo "-------------------------------------------------------------------------------" |
Thomas Graf | 6e5332b | 2011-09-13 11:49:41 +0200 | [diff] [blame] | 123 | |