configure.in 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. AC_INIT(pptpmanager.c)
  2. AM_CONFIG_HEADER(config.h)
  3. AM_INIT_AUTOMAKE(pptpd,1.3.4)
  4. # check common command line options early
  5. AC_DEFINE(PPP_BINARY, "/usr/sbin/pppd")
  6. AC_MSG_CHECKING(command line for use of BSD PPP)
  7. AC_ARG_WITH(bsdppp,
  8. [ --with-bsdppp Use BSD user-space ppp ],
  9. [
  10. case "$withval" in
  11. yes)
  12. AC_MSG_RESULT(BSD user-space ppp)
  13. AC_DEFINE(BSDUSER_PPP)
  14. BSDUSER_PPP=$with_bsdppp
  15. AC_DEFINE(PPP_BINARY, "/usr/sbin/ppp")
  16. break;
  17. ;;
  18. no)
  19. AC_MSG_RESULT(explicit standard pppd)
  20. ;;
  21. *)
  22. # only yes or no are expected for this option
  23. AC_MSG_RESULT(unrecognised... terminating)
  24. exit 1
  25. ;;
  26. esac
  27. ], [AC_MSG_RESULT(default standard pppd)])
  28. AC_MSG_CHECKING(command line for use of SLIRP)
  29. AC_ARG_WITH(slirp,
  30. [ --with-slirp Use SLIRP instead of pppd ],
  31. [
  32. case "$withval" in
  33. yes)
  34. AC_MSG_RESULT(yes)
  35. AC_DEFINE(SLIRP)
  36. SLIRP=$with_slirp
  37. AC_DEFINE(PPP_BINARY, "/bin/slirp")
  38. break;
  39. ;;
  40. no)
  41. AC_MSG_RESULT(explicit no)
  42. ;;
  43. *)
  44. # only yes or no are expected for this option
  45. AC_MSG_RESULT(unrecognised... terminating)
  46. exit 1
  47. ;;
  48. esac
  49. ], [AC_MSG_RESULT(default no)])
  50. AC_MSG_CHECKING(command line for syslog facility name)
  51. AC_ARG_ENABLE(facility,
  52. [ --enable-facility=name Use another syslog facility, default LOG_DAEMON ],
  53. [
  54. AC_MSG_RESULT($enableval)
  55. AC_DEFINE_UNQUOTED(PPTP_FACILITY, $enableval)
  56. ],
  57. [
  58. AC_MSG_RESULT(default LOG_DAEMON)
  59. AC_DEFINE_UNQUOTED(PPTP_FACILITY, LOG_DAEMON)
  60. ])
  61. AC_MSG_CHECKING(command line for bcrelay build)
  62. AC_ARG_ENABLE(bcrelay,
  63. [ --enable-bcrelay Enable broadcast relay function ],
  64. [
  65. case "$enableval" in
  66. yes)
  67. AC_MSG_RESULT(yes)
  68. AC_DEFINE(BCRELAY)
  69. BCRELAY=$enableval
  70. break;
  71. ;;
  72. no)
  73. AC_MSG_RESULT(explicit no)
  74. ;;
  75. *)
  76. # only yes or no are expected for this option
  77. AC_MSG_RESULT(unrecognised... terminating)
  78. exit 1
  79. ;;
  80. esac
  81. ], [AC_MSG_RESULT(default no)])
  82. AC_PROG_CC
  83. AC_PROG_RANLIB
  84. AC_PROG_INSTALL
  85. AC_PROG_LN_S
  86. AC_PROG_MAKE_SET
  87. AC_C_CONST
  88. AC_C_INLINE
  89. AC_EXEEXT
  90. AC_OBJEXT
  91. AC_SYS_INTERPRETER
  92. AC_CHECK_FUNCS(setsid daemon setproctitle getservbyname strlcpy fork memmove strerror writev)
  93. AC_CHECK_HEADERS(pty.h)
  94. AC_CHECK_HEADERS(string.h)
  95. AC_CHECK_HEADERS(syslog.h)
  96. AC_CHECK_HEADERS(libintl.h)
  97. AC_CHECK_HEADERS(libutil.h)
  98. AC_CHECK_HEADERS(sys/uio.h)
  99. AC_CHECK_TYPE(size_t, unsigned int)
  100. AC_CHECK_TYPE(ssize_t, int)
  101. AC_CHECK_TYPE(u_int8_t, unsigned char)
  102. AC_CHECK_TYPE(u_int16_t, unsigned short)
  103. AC_CHECK_TYPE(u_int32_t, unsigned int)
  104. dnl Check for type in sys/socket.h - from Squid source (GPL)
  105. AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
  106. AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
  107. #include <sys/socket.h>
  108. #if STDC_HEADERS
  109. #include <stdlib.h>
  110. #include <stddef.h>
  111. #endif],
  112. ac_cv_type_socklen_t=yes,
  113. ac_cv_type_socklen_t=no)
  114. ])
  115. if test $ac_cv_type_socklen_t = no; then
  116. AC_DEFINE(socklen_t, int)
  117. fi
  118. dnl Check for libwrap (black magic check)
  119. AC_ARG_WITH(libwrap,
  120. [ --with-libwrap Use libwrap (tcp wrappers) ],
  121. [
  122. if test "$with_libwrap" = "yes"; then
  123. XYZZY_LIBS="$LIBS"
  124. AC_MSG_CHECKING(for libwrap alone)
  125. LIBS="$XYZZY_LIBS -lwrap"
  126. AC_TRY_LINK([ int allow_severity, deny_severity; ],
  127. [ hosts_access(); ],
  128. [ AC_MSG_RESULT(yes)
  129. AC_DEFINE(HAVE_LIBWRAP)
  130. LIBWRAP="yes"
  131. XTRALIBS_MGR="-lwrap" ],
  132. [ AC_MSG_RESULT(no)
  133. LIBS="$XYZZY_LIBS -lwrap -lnsl"
  134. AC_MSG_CHECKING(for libwrap with libnsl)
  135. AC_TRY_LINK([ int allow_severity, deny_severity; ],
  136. [ hosts_access(); ],
  137. [ AC_MSG_RESULT(yes)
  138. AC_DEFINE(HAVE_LIBWRAP)
  139. LIBWRAP="yes"
  140. XTRALIBS_MGR="-lwrap -lnsl" ],
  141. [ AC_MSG_RESULT(no) ])
  142. ])
  143. LIBS="$XYZZY_LIBS"
  144. fi
  145. ])
  146. dnl More ugliness; -lnsl, -lutil and -lsocket
  147. XYZZY_LIBS="$LIBS"
  148. AC_CHECK_LIB(c, accept)
  149. AC_CHECK_LIB(c, gethostbyname)
  150. AC_CHECK_LIB(c, openpty)
  151. AC_CHECK_LIB(c, gettext)
  152. AC_CHECK_LIB(socket, accept)
  153. AC_CHECK_LIB(nsl, gethostbyname)
  154. AC_CHECK_LIB(util, openpty)
  155. AC_CHECK_LIB(intl, gettext)
  156. LIBS="$XYZZY_LIBS"
  157. if test "$ac_cv_lib_c_accept" = no; then
  158. if test "$ac_cv_lib_socket_accept" = yes; then
  159. LIBS="$LIBS -lsocket"
  160. else
  161. echo "Couldn't find a usable accept!" 1>&2
  162. exit 1
  163. fi
  164. fi
  165. if test "$ac_cv_lib_c_gethostbyname" = no; then
  166. if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
  167. LIBS="$LIBS -lnsl"
  168. if test "$XTRALIBS_MGR" = "-lwrap -lnsl"; then
  169. XTRALIBS_MGR="-lwrap"
  170. fi
  171. else
  172. echo "Couldn't find a usable gethostbyname!" 1>&2
  173. exit 1
  174. fi
  175. fi
  176. if test "$ac_cv_lib_c_openpty" = yes; then
  177. AC_DEFINE(HAVE_OPENPTY)
  178. else
  179. if test "$ac_cv_lib_util_openpty" = yes; then
  180. AC_DEFINE(HAVE_OPENPTY)
  181. XTRALIBS_CTRL="-lutil"
  182. fi
  183. fi
  184. if test "$ac_cv_header_libintl_h" = yes; then
  185. if test "$ac_cv_lib_c_gettext" = no; then
  186. if test "$ac_cv_lib_intl_gettext" = yes; then
  187. XTRALIBS_MGR = "$XTRALIBS_MGR -lintl"
  188. else
  189. echo "Have libintl.h but no usable gettext!" 1>&2
  190. exit 1
  191. fi
  192. fi
  193. fi
  194. AC_SUBST(XTRALIBS_CTRL)
  195. AC_SUBST(XTRALIBS_MGR)
  196. AC_SUBST(HAVE_OPENPTY)
  197. if test "$BCRELAY" = "yes"; then
  198. if test "$BCRELAY" = "yes"; then
  199. XTRA_PROG="bcrelay"
  200. true
  201. else
  202. echo "No BCrelay selected." 1>&2
  203. fi
  204. fi
  205. AC_SUBST(XTRA_PROG)
  206. echo '==============================================================================='
  207. echo 'Configuration chosen:'
  208. echo -n ' PPPd: '
  209. if test "$BSDUSER_PPP" = "yes"; then
  210. echo 'BSD user-space PPPd.'
  211. else
  212. if test "$SLIRP" = "yes"; then
  213. echo 'SLIRP.'
  214. else
  215. echo 'Standard.'
  216. fi
  217. fi
  218. echo -n ' LIBWRAP security: '
  219. if test "$LIBWRAP" = "yes"; then
  220. echo 'Yes.'
  221. else
  222. echo 'No.'
  223. fi
  224. echo -n ' Broadcast Relay: '
  225. if test "$BCRELAY" = "yes"; then
  226. echo 'Yes.'
  227. else
  228. echo 'No.'
  229. fi
  230. AC_CACHE_SAVE
  231. AC_OUTPUT(Makefile)