A clone of btpd with my configuration changes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
1.8 KiB

  1. AC_INIT(btpd, 0.8, btpd@murmeldjur.se)
  2. AM_INIT_AUTOMAKE([foreign])
  3. AC_CONFIG_FILES([Makefile btpd/Makefile misc/Makefile cli/Makefile])
  4. AC_PROG_CC
  5. AC_PROG_RANLIB
  6. CFLAGS="$CFLAGS -std=c99"
  7. CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64"
  8. AC_ARG_WITH(event,
  9. [ --with-event=dir use libevent installed in dir],
  10. [
  11. AC_SUBST(event_LDFLAGS,["-L${withval}/lib -Wl,-rpath=${withval}/lib"])
  12. AC_SUBST(event_CPPFLAGS,"-I${withval}/include")
  13. ],
  14. [])
  15. AC_ARG_WITH(ssl,
  16. [ --with-ssl=dir use openssl installed in dir],
  17. [
  18. AC_SUBST(openssl_LDFLAGS,["-L${withval}/lib -Wl,-rpath=${withval}/lib"])
  19. AC_SUBST(openssl_CPPFLAGS,"-I${withval}/include")
  20. ],
  21. [])
  22. AC_ARG_WITH(curlconf,
  23. [ --with-curlconf=prog use this curl-config],
  24. [
  25. CURLCONF=$withval
  26. ],
  27. [])
  28. AC_ARG_WITH(warn,
  29. [ --with-warn=level select warning preset (no,all,allerr)],
  30. [
  31. case $withval in
  32. no)
  33. ;;
  34. all)
  35. CFLAGS="$CFLAGS -Wall"
  36. ;;
  37. allerr)
  38. CFLAGS="$CFLAGS -Wall -Werror"
  39. ;;
  40. *)
  41. echo "Warning preset \"$withval\" not recognized. See --help."
  42. exit 1
  43. ;;
  44. esac
  45. ],
  46. [])
  47. old_LDFLAGS="$LDFLAGS"
  48. LDFLAGS="$LDFLAGS $event_LDFLAGS"
  49. AC_CHECK_LIB(event, event_init, :, echo Must have libevent; exit 1)
  50. LDFLAGS=$old_LDFLAGS
  51. old_LDFLAGS="$LDFLAGS"
  52. LDFLAGS="$LDFLAGS $openssl_LDFLAGS"
  53. AC_CHECK_LIB(crypto, SHA1_Final, :, echo Must have openssl; exit 1)
  54. LDFLAGS=$old_LDFLAGS
  55. if test x$CURLCONF = x; then
  56. AC_PATH_PROG(CURLCONF, curl-config)
  57. fi
  58. if test x$CURLCONF = x -o \! \( -r "$CURLCONF" -a -x "$CURLCONF" \); then
  59. echo Must have the curl-config script
  60. exit 1
  61. else
  62. AC_SUBST(CURL_CFLAGS, `$CURLCONF --cflags`)
  63. AC_SUBST(CURL_LDFLAGS, `$CURLCONF --libs`)
  64. fi
  65. old_LDFLAGS="$LDFLAGS"
  66. LDFLAGS="$LDFLAGS $CURL_LDFLAGS"
  67. AC_CHECK_LIB(curl, curl_easy_strerror, :, echo Must have recent curl; exit 1)
  68. LDFLAGS=$old_LDFLAGS
  69. AC_OUTPUT