configure.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-2008 Thomas Graf <tgraf@suug.ch>
  10. #
  11. AC_INIT(libnl, 1.1.4, tgraf@suug.ch)
  12. AC_CONFIG_HEADER(lib/defs.h)
  13. save_CFLAGS="${CFLAGS}"
  14. save_LDFLAGS="${LDFLAGS}"
  15. save_CPPFLAGS="${CPPFLAGS}"
  16. AC_PROG_CC
  17. AC_PROG_INSTALL
  18. AC_C_CONST
  19. AC_C_INLINE
  20. #####################################################################
  21. ##
  22. ## libm check
  23. ##
  24. #####################################################################
  25. M="No "
  26. AC_CHECK_LIB(m, pow,
  27. [
  28. LIBM="-lm"
  29. M="Yes"
  30. ],[
  31. echo
  32. echo "*** Error: libm required ***"
  33. echo
  34. exit
  35. ])
  36. #####################################################################
  37. ##
  38. ## verbose error strings
  39. ##
  40. #####################################################################
  41. AC_ARG_ENABLE(verbose-errors,
  42. [ --enable-verbose-errors enable verbose errors (debugging)],[
  43. if test x$enableval = xyes; then
  44. AC_DEFINE_UNQUOTED(VERBOSE_ERRORS,"1",[verbose errors])
  45. fi
  46. ])
  47. AC_ARG_ENABLE([pthreads],
  48. AS_HELP_STRING([--disable-pthreads], [Disable pthreads support]),
  49. [enable_pthreads="$enableval"], [enable_pthreads="yes"])
  50. if test "x$enable_pthreads" = "xno"; then
  51. AC_DEFINE([DISABLE_PTHREADS], [1], [Define to 1 to disable pthreads])
  52. else
  53. # libpthread
  54. AC_CHECK_LIB([pthread], [pthread_mutex_lock],
  55. [
  56. LIBPTHREAD="-lpthread"
  57. PTHREAD="Yes"
  58. ], AC_MSG_ERROR([libpthread is required]))
  59. fi
  60. #####################################################################
  61. ##
  62. ## compile decisions
  63. ##
  64. #####################################################################
  65. COMPILE_LIBNL="Yes "
  66. LIBNL_LIB="$LIBM $LIBPTHREAD"
  67. AC_SUBST(LIBNL_LIB)
  68. AC_OUTPUT([Makefile.opts libnl-1.pc doc/Doxyfile])
  69. #####################################################################
  70. ##
  71. ## status report
  72. ##
  73. #####################################################################
  74. echo "
  75. ----------------------------------------------------------------------
  76. SUMMARY:
  77. Included in Compilation:
  78. libnl: $COMPILE_LIBNL $LIBNL_LIB
  79. Dependencies:
  80. libm $M (required)"