configure.ac 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. #
  9. # Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
  10. #
  11. # copied from glib
  12. m4_define([libnl_major_version], [3])
  13. m4_define([libnl_minor_version], [2])
  14. m4_define([libnl_micro_version], [21])
  15. # The following explanation may help to understand the above rules a bit
  16. # better: consider that there are three possible kinds of reactions from
  17. # users of your library to changes in a shared library:
  18. #
  19. # 1. Programs using the previous version may use the new version as drop-in
  20. # replacement, and programs using the new version can also work with the
  21. # previous one. In other words, no recompiling nor relinking is needed.
  22. # In this case, bump revision only, don't touch current nor age.
  23. #
  24. # 2. Programs using the previous version may use the new version as drop-in
  25. # replacement, but programs using the new version may use APIs not
  26. # present in the previous one. In other words, a program linking against
  27. # the new version may fail with “unresolved symbols” if linking against
  28. # the old version at runtime: set revision to 0, bump current and age.
  29. #
  30. # 3. Programs may need to be changed, recompiled, relinked in order to use
  31. # the new version. Bump current, set revision and age to 0.
  32. m4_define([libnl_lt_current], [216])
  33. m4_define([libnl_lt_revision], [1])
  34. m4_define([libnl_lt_age], [16])
  35. m4_define([libnl_version],
  36. [libnl_major_version.libnl_minor_version.libnl_micro_version])
  37. AC_INIT(libnl, [libnl_version], [], [], [http://www.infradead.org/~tgr/libnl/])
  38. AC_CONFIG_HEADERS([lib/defs.h])
  39. AC_CONFIG_AUX_DIR([build-aux])
  40. AC_CONFIG_MACRO_DIR([m4])
  41. AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
  42. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
  43. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  44. MAJ_VERSION=libnl_major_version
  45. AC_SUBST(MAJ_VERSION)
  46. MIN_VERSION=libnl_minor_version
  47. AC_SUBST(MIN_VERSION)
  48. MIC_VERSION=libnl_micro_version
  49. AC_SUBST(MIC_VERSION)
  50. LIBNL_VERSION=libnl_version
  51. AC_SUBST(LIBNL_VERSION)
  52. LT_CURRENT=libnl_lt_current
  53. AC_SUBST(LT_CURRENT)
  54. LT_REVISION=libnl_lt_revision
  55. AC_SUBST(LT_REVISION)
  56. LT_AGE=libnl_lt_age
  57. AC_SUBST(LT_AGE)
  58. AC_PROG_CC
  59. AM_PROG_CC_C_O
  60. AC_PROG_INSTALL
  61. AM_PROG_LIBTOOL
  62. AC_CHECK_PROGS(FLEX, 'flex')
  63. AC_CHECK_PROGS(YACC, 'bison -y')
  64. AC_C_CONST
  65. AC_C_INLINE
  66. AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
  67. [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
  68. [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
  69. AC_SUBST([pkgconfigdir])
  70. AC_ARG_ENABLE([cli],
  71. AS_HELP_STRING([--disable-cli], [Do not build command line interface utils]),
  72. [enable_cli="$enableval"], [enable_cli="yes"])
  73. AM_CONDITIONAL([ENABLE_CLI], [test "$enable_cli" = "yes"])
  74. AC_ARG_ENABLE([pthreads],
  75. AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]),
  76. [enable_pthreads="$enableval"], [enable_pthreads="yes"])
  77. AM_CONDITIONAL([DISABLE_PTHREADS], [test "$enable_pthreads" = "no"])
  78. AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required]))
  79. if test "x$enable_pthreads" = "xno"; then
  80. AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads])
  81. else
  82. AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], AC_MSG_ERROR([libpthread is required]))
  83. fi
  84. AC_CONFIG_SUBDIRS([doc])
  85. AC_CONFIG_FILES([
  86. Makefile
  87. libnl-3.0.pc
  88. libnl-route-3.0.pc
  89. libnl-genl-3.0.pc
  90. libnl-nf-3.0.pc
  91. libnl-cli-3.0.pc
  92. lib/Makefile
  93. include/Makefile
  94. src/Makefile
  95. src/lib/Makefile
  96. tests/Makefile
  97. man/Makefile
  98. python/Makefile
  99. python/setup.py
  100. python/netlink/Makefile
  101. python/netlink/route/Makefile
  102. include/netlink/version.h
  103. ])
  104. ac_errcount=0
  105. if test -z "$YACC"; then
  106. AC_MSG_WARN(bison not found. Please install before continuing.)
  107. ac_errcount=$((ac_errcount + 1))
  108. fi
  109. if test -z "$FLEX"; then
  110. AC_MSG_WARN(flex not found. Please install before continuing.)
  111. ac_errcount=$((ac_errcount + 1))
  112. fi
  113. if test $ac_errcount -gt 0; then
  114. AC_MSG_ERROR(Required packages are missing. Please install them and rerun ./configure)
  115. fi
  116. AC_OUTPUT
  117. echo "-------------------------------------------------------------------------------"
  118. echo " NOTE"
  119. echo ""
  120. echo " There have been some changes starting with 3.2 regarding where and how libnl"
  121. echo " is being installed on the system in order to allow multiple libnl versions"
  122. echo " to be installed in parallel:"
  123. echo ""
  124. echo " - Headers will be installed in ${includedir}/libnl${MAJ_VERSION}, therefore"
  125. echo " you will need to add \"-I/usr/include/libnl${MAJ_VERSION}\" to CFLAGS"
  126. echo ""
  127. echo " - The library basename was renamed to libnl-${MAJ_VERSION}, i.e. the SO names become"
  128. echo " libnl-${MAJ_VERSION}.so., libnl-route-${MAJ_VERSION}.so, etc."
  129. echo ""
  130. echo " - libtool versioning was assumed, to ease detection of compatible library"
  131. echo " versions."
  132. echo ""
  133. echo " If you are using pkg-config for detecting and linking against the library "
  134. echo " things will continue magically as if nothing every happened. If you are "
  135. echo " linking manually you need to adapt your Makefiles or switch to using "
  136. echo " pkg-config files."
  137. echo ""
  138. echo "-------------------------------------------------------------------------------"