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 | 6b4a2cb | 2013-01-17 14:02:35 +0100 | [diff] [blame] | 16 | m4_define([libnl_micro_version], [19]) |
Thomas Graf | ad5d2b7 | 2012-04-26 11:22:49 +0200 | [diff] [blame] | 17 | |
| 18 | |
| 19 | # If either revision or age are omitted, they default to 0. Also note that age |
| 20 | # must be less than or equal to the current interface number. |
| 21 | # |
| 22 | # Here are a set of rules to help you update your library version information: |
| 23 | # |
| 24 | # 1. Start with version information of `0:0:0' for each libtool library. |
| 25 | # 2. Update the version information only immediately before a public release |
| 26 | # of your software. More frequent updates are unnecessary, and only |
| 27 | # guarantee that the current interface number gets larger faster. |
| 28 | # 3. If the library source code has changed at all since the last update, then |
| 29 | # increment revision (`c:r:a' becomes `c:r+1:a'). |
| 30 | # 4. If any interfaces have been added, removed, or changed since the last |
| 31 | # update, increment current, and set revision to 0. |
| 32 | # 5. If any interfaces have been added since the last public release, then |
| 33 | # increment age. |
| 34 | # 6. If any interfaces have been removed since the last public release, then |
| 35 | # set age to 0. |
| 36 | |
Thomas Graf | 7559157 | 2013-01-22 19:07:09 +0100 | [diff] [blame] | 37 | m4_define([libnl_lt_current], [216]) |
Thomas Graf | 6b4a2cb | 2013-01-17 14:02:35 +0100 | [diff] [blame] | 38 | m4_define([libnl_lt_revision], [0]) |
Thomas Graf | 7559157 | 2013-01-22 19:07:09 +0100 | [diff] [blame] | 39 | m4_define([libnl_lt_age], [16]) |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 40 | |
| 41 | m4_define([libnl_version], |
| 42 | [libnl_major_version.libnl_minor_version.libnl_micro_version]) |
| 43 | |
Rich Fought | a8ef352 | 2012-10-26 12:19:26 -0700 | [diff] [blame] | 44 | AC_INIT(libnl, [libnl_version], [], [], [http://www.infradead.org/~tgr/libnl/]) |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 45 | AC_CONFIG_HEADERS([lib/defs.h]) |
Jan Engelhardt | f3cd3fe | 2012-11-26 20:51:51 +0100 | [diff] [blame] | 46 | AC_CONFIG_AUX_DIR([build-aux]) |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 47 | AC_CONFIG_MACRO_DIR([m4]) |
| 48 | AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) |
Reuben Hawkins | b5c474e | 2011-02-17 21:28:50 -0800 | [diff] [blame] | 49 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], []) |
Jan Engelhardt | 9d92564 | 2012-11-26 20:49:02 +0100 | [diff] [blame] | 50 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 51 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 52 | MAJ_VERSION=libnl_major_version |
| 53 | AC_SUBST(MAJ_VERSION) |
| 54 | MIN_VERSION=libnl_minor_version |
| 55 | AC_SUBST(MIN_VERSION) |
| 56 | MIC_VERSION=libnl_micro_version |
| 57 | AC_SUBST(MIC_VERSION) |
| 58 | LIBNL_VERSION=libnl_version |
| 59 | AC_SUBST(LIBNL_VERSION) |
| 60 | |
| 61 | LT_CURRENT=libnl_lt_current |
| 62 | AC_SUBST(LT_CURRENT) |
| 63 | LT_REVISION=libnl_lt_revision |
| 64 | AC_SUBST(LT_REVISION) |
| 65 | LT_AGE=libnl_lt_age |
| 66 | AC_SUBST(LT_AGE) |
Thomas Graf | d8d67c0 | 2011-03-16 13:46:41 +0100 | [diff] [blame] | 67 | |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 68 | AC_PROG_CC |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 69 | AM_PROG_CC_C_O |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 70 | AC_PROG_INSTALL |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 71 | AM_PROG_LIBTOOL |
Thomas Graf | 0a9d5fc | 2012-11-23 16:40:14 +0100 | [diff] [blame] | 72 | AC_CHECK_PROGS(FLEX, 'flex') |
Richard Marshall | a2c4bd8 | 2012-11-19 20:20:22 -0800 | [diff] [blame] | 73 | AC_CHECK_PROGS(YACC, 'bison -y') |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 74 | |
| 75 | AC_C_CONST |
| 76 | AC_C_INLINE |
| 77 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 78 | AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], |
| 79 | [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), |
| 80 | [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) |
| 81 | AC_SUBST([pkgconfigdir]) |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 82 | |
Karl Hiramoto | 018c297 | 2010-06-16 16:33:51 +0200 | [diff] [blame] | 83 | AC_ARG_ENABLE([cli], |
| 84 | AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]), |
| 85 | [enable_cli="$enableval"], [enable_cli="yes"]) |
| 86 | AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"]) |
| 87 | |
Rich Fought | a8ef352 | 2012-10-26 12:19:26 -0700 | [diff] [blame] | 88 | AC_ARG_ENABLE([pthreads], |
| 89 | AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]), |
| 90 | [enable_pthreads="$enableval"], [enable_pthreads="yes"]) |
| 91 | AM_CONDITIONAL([DISABLE_PTHREADS], [test "$enable_pthreads" = "no"]) |
| 92 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 93 | AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required])) |
Rich Fought | a8ef352 | 2012-10-26 12:19:26 -0700 | [diff] [blame] | 94 | |
| 95 | if test "x$enable_pthreads" = "xno"; then |
| 96 | AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads]) |
| 97 | else |
| 98 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required])) |
| 99 | fi |
Thomas Graf | 44d3624 | 2007-09-15 01:28:01 +0200 | [diff] [blame] | 100 | |
Thomas Graf | db13843 | 2012-10-19 16:16:06 +0200 | [diff] [blame] | 101 | AC_CONFIG_SUBDIRS([doc]) |
| 102 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 103 | AC_CONFIG_FILES([ |
| 104 | Makefile |
| 105 | libnl-3.0.pc |
| 106 | libnl-route-3.0.pc |
| 107 | libnl-genl-3.0.pc |
| 108 | libnl-nf-3.0.pc |
Jiří Župka | f90dc63 | 2011-10-04 16:06:22 +0200 | [diff] [blame] | 109 | libnl-cli-3.0.pc |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 110 | lib/Makefile |
| 111 | include/Makefile |
| 112 | src/Makefile |
| 113 | src/lib/Makefile |
Thomas Graf | 9af5469 | 2012-04-21 10:34:43 +0200 | [diff] [blame] | 114 | tests/Makefile |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 115 | man/Makefile |
| 116 | python/Makefile |
| 117 | python/setup.py |
| 118 | python/netlink/Makefile |
| 119 | python/netlink/route/Makefile |
| 120 | include/netlink/version.h |
| 121 | ]) |
| 122 | |
Richard Marshall | a2c4bd8 | 2012-11-19 20:20:22 -0800 | [diff] [blame] | 123 | ac_errcount=0 |
| 124 | if test -z "$YACC"; then |
| 125 | AC_MSG_WARN(bison not found. Please install before continuing.) |
| 126 | ac_errcount=$((ac_errcount + 1)) |
| 127 | fi |
Thomas Graf | 0a9d5fc | 2012-11-23 16:40:14 +0100 | [diff] [blame] | 128 | if test -z "$FLEX"; then |
| 129 | AC_MSG_WARN(flex not found. Please install before continuing.) |
Richard Marshall | a2c4bd8 | 2012-11-19 20:20:22 -0800 | [diff] [blame] | 130 | ac_errcount=$((ac_errcount + 1)) |
| 131 | fi |
| 132 | if test $ac_errcount -gt 0; then |
| 133 | AC_MSG_ERROR(Required packages are missing. Please install them and rerun ./configure) |
| 134 | fi |
| 135 | |
Jan Engelhardt | bf4fd3a | 2009-06-23 01:12:53 +0200 | [diff] [blame] | 136 | AC_OUTPUT |
Thomas Graf | 6e5332b | 2011-09-13 11:49:41 +0200 | [diff] [blame] | 137 | |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 138 | echo "-------------------------------------------------------------------------------" |
| 139 | echo " NOTE" |
| 140 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 141 | echo " There have been some changes starting with 3.2 regarding where and how libnl" |
| 142 | echo " is being installed on the system in order to allow multiple libnl versions" |
| 143 | echo " to be installed in parallel:" |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 144 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 145 | echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore" |
| 146 | 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] | 147 | echo "" |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 148 | echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become" |
| 149 | echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc." |
| 150 | echo "" |
| 151 | echo " - libtool versioning was assumed, to ease detection of compatible library" |
Thomas Graf | 2b96c33 | 2013-01-22 19:15:34 +0100 | [diff] [blame^] | 152 | echo " versions." |
Thomas Graf | d3bb7c9 | 2011-09-19 11:47:49 +0200 | [diff] [blame] | 153 | echo "" |
| 154 | echo " If you are using pkg-config for detecting and linking against the library " |
| 155 | echo " things will continue magically as if nothing every happened. If you are " |
| 156 | echo " linking manually you need to adapt your Makefiles or switch to using " |
| 157 | echo " pkg-config files." |
Thomas Graf | 4c210ad | 2011-09-13 22:58:08 +0200 | [diff] [blame] | 158 | echo "" |
| 159 | echo "-------------------------------------------------------------------------------" |
Thomas Graf | 6e5332b | 2011-09-13 11:49:41 +0200 | [diff] [blame] | 160 | |