libnet4r 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. data/CHANGELOG +15 -0
  2. data/LICENSE +28 -0
  3. data/README +187 -0
  4. data/Rakefile +110 -0
  5. data/ext/extconf.rb +60 -0
  6. data/ext/libnet.c +705 -0
  7. data/ext/libnet_arp.c +152 -0
  8. data/ext/libnet_ethernet.c +115 -0
  9. data/ext/libnet_ipv4.c +140 -0
  10. data/ext/libnet_ipv6.c +138 -0
  11. data/ext/libnet_udp.c +112 -0
  12. data/ext/libnet_vlan.c +131 -0
  13. data/lib/libnet4r/header.rb +609 -0
  14. data/lib/libnet4r/helpers.rb +19 -0
  15. data/lib/libnet4r/libnet.rb +39 -0
  16. data/libnet/CVS/Entries +24 -0
  17. data/libnet/CVS/Repository +1 -0
  18. data/libnet/CVS/Root +1 -0
  19. data/libnet/Makefile.am +15 -0
  20. data/libnet/Makefile.am.common +10 -0
  21. data/libnet/Makefile.in +443 -0
  22. data/libnet/README +21 -0
  23. data/libnet/VERSION +1 -0
  24. data/libnet/acconfig.h +36 -0
  25. data/libnet/acinclude.m4 +463 -0
  26. data/libnet/aclocal.m4 +1337 -0
  27. data/libnet/autom4te.cache/CVS/Entries +1 -0
  28. data/libnet/autom4te.cache/CVS/Repository +1 -0
  29. data/libnet/autom4te.cache/CVS/Root +1 -0
  30. data/libnet/autom4te.cache/output.0 +6225 -0
  31. data/libnet/autom4te.cache/requests +111 -0
  32. data/libnet/autom4te.cache/traces.0 +272 -0
  33. data/libnet/config.guess +1314 -0
  34. data/libnet/config.sub +1410 -0
  35. data/libnet/configure +6225 -0
  36. data/libnet/configure.in +235 -0
  37. data/libnet/doc/BUGS +19 -0
  38. data/libnet/doc/CHANGELOG +527 -0
  39. data/libnet/doc/CONTRIB +53 -0
  40. data/libnet/doc/COPYING +31 -0
  41. data/libnet/doc/CVS/Entries +12 -0
  42. data/libnet/doc/CVS/Repository +1 -0
  43. data/libnet/doc/CVS/Root +1 -0
  44. data/libnet/doc/DESIGN_NOTES +134 -0
  45. data/libnet/doc/MIGRATION +172 -0
  46. data/libnet/doc/PACKET_BUILDING +161 -0
  47. data/libnet/doc/PORTED +45 -0
  48. data/libnet/doc/RAWSOCKET_NON_SEQUITUR +41 -0
  49. data/libnet/doc/TODO +96 -0
  50. data/libnet/doc/html/acconfig_8h-source.html +49 -0
  51. data/libnet/doc/html/annotated.html +17 -0
  52. data/libnet/doc/html/bpf_8h-source.html +277 -0
  53. data/libnet/doc/html/config_8h-source.html +125 -0
  54. data/libnet/doc/html/doxygen.css +169 -0
  55. data/libnet/doc/html/doxygen.png +0 -0
  56. data/libnet/doc/html/files.html +29 -0
  57. data/libnet/doc/html/functions.html +26 -0
  58. data/libnet/doc/html/functions_vars.html +26 -0
  59. data/libnet/doc/html/getopt_8h-source.html +97 -0
  60. data/libnet/doc/html/globals.html +219 -0
  61. data/libnet/doc/html/globals_defs.html +104 -0
  62. data/libnet/doc/html/globals_func.html +136 -0
  63. data/libnet/doc/html/gnuc_8h-source.html +56 -0
  64. data/libnet/doc/html/graph_legend.dot +22 -0
  65. data/libnet/doc/html/graph_legend.html +75 -0
  66. data/libnet/doc/html/ifaddrlist_8h-source.html +65 -0
  67. data/libnet/doc/html/in__systm_8h-source.html +90 -0
  68. data/libnet/doc/html/index.html +17 -0
  69. data/libnet/doc/html/libnet-asn1_8h-source.html +268 -0
  70. data/libnet/doc/html/libnet-functions_8h-source.html +742 -0
  71. data/libnet/doc/html/libnet-functions_8h.html +8844 -0
  72. data/libnet/doc/html/libnet-headers_8h-source.html +1655 -0
  73. data/libnet/doc/html/libnet-headers_8h.html +3053 -0
  74. data/libnet/doc/html/libnet-macros_8h-source.html +161 -0
  75. data/libnet/doc/html/libnet-macros_8h.html +358 -0
  76. data/libnet/doc/html/libnet-structures_8h-source.html +233 -0
  77. data/libnet/doc/html/libnet-types_8h-source.html +58 -0
  78. data/libnet/doc/html/libnet_8h-source.html +119 -0
  79. data/libnet/doc/html/libnet_8h.html +24 -0
  80. data/libnet/doc/html/structlibnet__802__1q__hdr.html +145 -0
  81. data/libnet/doc/html/structlibnet__802__1x__hdr.html +97 -0
  82. data/libnet/doc/libnet.doxygen.conf +1102 -0
  83. data/libnet/doc/man/CVS/Entries +1 -0
  84. data/libnet/doc/man/CVS/Repository +1 -0
  85. data/libnet/doc/man/CVS/Root +1 -0
  86. data/libnet/doc/man/man3/libnet-functions.h.3 +3136 -0
  87. data/libnet/doc/man/man3/libnet-headers.h.3 +1872 -0
  88. data/libnet/doc/man/man3/libnet-macros.h.3 +172 -0
  89. data/libnet/doc/man/man3/libnet.h.3 +17 -0
  90. data/libnet/doc/man/man3/libnet_802_1q_hdr.3 +53 -0
  91. data/libnet/doc/man/man3/libnet_802_1x_hdr.3 +41 -0
  92. data/libnet/include/CVS/Entries +10 -0
  93. data/libnet/include/CVS/Repository +1 -0
  94. data/libnet/include/CVS/Root +1 -0
  95. data/libnet/include/Makefile.am +7 -0
  96. data/libnet/include/Makefile.in +395 -0
  97. data/libnet/include/bpf.h +264 -0
  98. data/libnet/include/config.h.in +118 -0
  99. data/libnet/include/gnuc.h +43 -0
  100. data/libnet/include/ifaddrlist.h +52 -0
  101. data/libnet/include/libnet/CVS/Entries +9 -0
  102. data/libnet/include/libnet/CVS/Repository +1 -0
  103. data/libnet/include/libnet/CVS/Root +1 -0
  104. data/libnet/include/libnet/Makefile.am +12 -0
  105. data/libnet/include/libnet/Makefile.in +294 -0
  106. data/libnet/include/libnet/libnet-asn1.h +255 -0
  107. data/libnet/include/libnet/libnet-functions.h +2157 -0
  108. data/libnet/include/libnet/libnet-headers.h +1662 -0
  109. data/libnet/include/libnet/libnet-macros.h +186 -0
  110. data/libnet/include/libnet/libnet-structures.h +222 -0
  111. data/libnet/include/libnet/libnet-types.h +45 -0
  112. data/libnet/include/libnet.h.in +132 -0
  113. data/libnet/include/stamp-h.in +1 -0
  114. data/libnet/include/win32/CVS/Entries +5 -0
  115. data/libnet/include/win32/CVS/Repository +1 -0
  116. data/libnet/include/win32/CVS/Root +1 -0
  117. data/libnet/include/win32/config.h +112 -0
  118. data/libnet/include/win32/getopt.h +84 -0
  119. data/libnet/include/win32/in_systm.h +77 -0
  120. data/libnet/include/win32/libnet.h +106 -0
  121. data/libnet/install-sh +250 -0
  122. data/libnet/libnet-config.in +62 -0
  123. data/libnet/libnet.doxygen.conf +1102 -0
  124. data/libnet/man/CVS/Entries +1 -0
  125. data/libnet/man/CVS/Repository +1 -0
  126. data/libnet/man/CVS/Root +1 -0
  127. data/libnet/missing +283 -0
  128. data/libnet/mkinstalldirs +40 -0
  129. data/libnet/sample/CVS/Entries +47 -0
  130. data/libnet/sample/CVS/Repository +1 -0
  131. data/libnet/sample/CVS/Root +1 -0
  132. data/libnet/sample/Makefile.am +63 -0
  133. data/libnet/sample/Makefile.in +729 -0
  134. data/libnet/sample/arp-new.c +144 -0
  135. data/libnet/sample/arp.c +151 -0
  136. data/libnet/sample/bgp4_hdr.c +225 -0
  137. data/libnet/sample/bgp4_notification.c +242 -0
  138. data/libnet/sample/bgp4_open.c +266 -0
  139. data/libnet/sample/bgp4_update.c +337 -0
  140. data/libnet/sample/cdp.c +187 -0
  141. data/libnet/sample/dhcp_discover.c +257 -0
  142. data/libnet/sample/dns.c +260 -0
  143. data/libnet/sample/dot1x.c +113 -0
  144. data/libnet/sample/fddi_tcp1.c +213 -0
  145. data/libnet/sample/fddi_tcp2.c +209 -0
  146. data/libnet/sample/get_addr.c +112 -0
  147. data/libnet/sample/gre.c +410 -0
  148. data/libnet/sample/icmp6_echoreq.c +184 -0
  149. data/libnet/sample/icmp_echo_cq.c +201 -0
  150. data/libnet/sample/icmp_redirect.c +200 -0
  151. data/libnet/sample/icmp_timeexceed.c +190 -0
  152. data/libnet/sample/icmp_timestamp.c +157 -0
  153. data/libnet/sample/icmp_unreach.c +204 -0
  154. data/libnet/sample/ieee.c +177 -0
  155. data/libnet/sample/ip_link.c +201 -0
  156. data/libnet/sample/ip_raw.c +180 -0
  157. data/libnet/sample/isl.c +167 -0
  158. data/libnet/sample/libnet_test.h +60 -0
  159. data/libnet/sample/mpls.c +251 -0
  160. data/libnet/sample/ntp.c +193 -0
  161. data/libnet/sample/ospf_hello.c +179 -0
  162. data/libnet/sample/ospf_lsa.c +190 -0
  163. data/libnet/sample/ping_of_death.c +171 -0
  164. data/libnet/sample/rpc_tcp.c +214 -0
  165. data/libnet/sample/rpc_udp.c +213 -0
  166. data/libnet/sample/sebek.c +299 -0
  167. data/libnet/sample/smurf.c +194 -0
  168. data/libnet/sample/stp.c +227 -0
  169. data/libnet/sample/synflood.c +200 -0
  170. data/libnet/sample/synflood6.c +209 -0
  171. data/libnet/sample/synflood6_frag.c +234 -0
  172. data/libnet/sample/tcp1.c +227 -0
  173. data/libnet/sample/tcp2.c +192 -0
  174. data/libnet/sample/tftp.c +207 -0
  175. data/libnet/sample/tring_tcp1.c +214 -0
  176. data/libnet/sample/tring_tcp2.c +210 -0
  177. data/libnet/sample/udp1.c +223 -0
  178. data/libnet/sample/udp2.c +232 -0
  179. data/libnet/sample/win32/CVS/Entries +9 -0
  180. data/libnet/sample/win32/CVS/Repository +1 -0
  181. data/libnet/sample/win32/CVS/Root +1 -0
  182. data/libnet/sample/win32/arp/CVS/Entries +2 -0
  183. data/libnet/sample/win32/arp/CVS/Repository +1 -0
  184. data/libnet/sample/win32/arp/CVS/Root +1 -0
  185. data/libnet/sample/win32/arp/arp.vcproj +136 -0
  186. data/libnet/sample/win32/cdp/CVS/Entries +2 -0
  187. data/libnet/sample/win32/cdp/CVS/Repository +1 -0
  188. data/libnet/sample/win32/cdp/CVS/Root +1 -0
  189. data/libnet/sample/win32/cdp/cdp.vcproj +136 -0
  190. data/libnet/sample/win32/dhcp_discover/CVS/Entries +2 -0
  191. data/libnet/sample/win32/dhcp_discover/CVS/Repository +1 -0
  192. data/libnet/sample/win32/dhcp_discover/CVS/Root +1 -0
  193. data/libnet/sample/win32/dhcp_discover/dhcp_discover.vcproj +139 -0
  194. data/libnet/sample/win32/dns/CVS/Entries +2 -0
  195. data/libnet/sample/win32/dns/CVS/Repository +1 -0
  196. data/libnet/sample/win32/dns/CVS/Root +1 -0
  197. data/libnet/sample/win32/dns/dns.vcproj +139 -0
  198. data/libnet/sample/win32/get_addr/CVS/Entries +2 -0
  199. data/libnet/sample/win32/get_addr/CVS/Repository +1 -0
  200. data/libnet/sample/win32/get_addr/CVS/Root +1 -0
  201. data/libnet/sample/win32/get_addr/get_addr.vcproj +139 -0
  202. data/libnet/sample/win32/getopt.c +121 -0
  203. data/libnet/sample/win32/icmp_echo_cq/CVS/Entries +2 -0
  204. data/libnet/sample/win32/icmp_echo_cq/CVS/Repository +1 -0
  205. data/libnet/sample/win32/icmp_echo_cq/CVS/Root +1 -0
  206. data/libnet/sample/win32/icmp_echo_cq/icmp_echo_cq.vcproj +139 -0
  207. data/libnet/sample/win32/tcp1/CVS/Entries +2 -0
  208. data/libnet/sample/win32/tcp1/CVS/Repository +1 -0
  209. data/libnet/sample/win32/tcp1/CVS/Root +1 -0
  210. data/libnet/sample/win32/tcp1/tcp1.vcproj +142 -0
  211. data/libnet/sample/win32/udp1/CVS/Entries +3 -0
  212. data/libnet/sample/win32/udp1/CVS/Repository +1 -0
  213. data/libnet/sample/win32/udp1/CVS/Root +1 -0
  214. data/libnet/sample/win32/udp1/dns.vcproj +125 -0
  215. data/libnet/sample/win32/udp1/udp1.vcproj +139 -0
  216. data/libnet/src/CVS/Entries +60 -0
  217. data/libnet/src/CVS/Repository +1 -0
  218. data/libnet/src/CVS/Root +1 -0
  219. data/libnet/src/Makefile.am +71 -0
  220. data/libnet/src/Makefile.in +428 -0
  221. data/libnet/src/libnet_advanced.c +136 -0
  222. data/libnet/src/libnet_asn1.c +436 -0
  223. data/libnet/src/libnet_build_802.1q.c +115 -0
  224. data/libnet/src/libnet_build_802.1x.c +103 -0
  225. data/libnet/src/libnet_build_802.2.c +167 -0
  226. data/libnet/src/libnet_build_802.3.c +101 -0
  227. data/libnet/src/libnet_build_arp.c +169 -0
  228. data/libnet/src/libnet_build_bgp.c +350 -0
  229. data/libnet/src/libnet_build_cdp.c +191 -0
  230. data/libnet/src/libnet_build_data.c +90 -0
  231. data/libnet/src/libnet_build_dhcp.c +156 -0
  232. data/libnet/src/libnet_build_dns.c +129 -0
  233. data/libnet/src/libnet_build_ethernet.c +173 -0
  234. data/libnet/src/libnet_build_fddi.c +191 -0
  235. data/libnet/src/libnet_build_gre.c +427 -0
  236. data/libnet/src/libnet_build_icmp.c +437 -0
  237. data/libnet/src/libnet_build_igmp.c +112 -0
  238. data/libnet/src/libnet_build_ip.c +892 -0
  239. data/libnet/src/libnet_build_ipsec.c +232 -0
  240. data/libnet/src/libnet_build_isl.c +113 -0
  241. data/libnet/src/libnet_build_link.c +90 -0
  242. data/libnet/src/libnet_build_mpls.c +112 -0
  243. data/libnet/src/libnet_build_ntp.c +121 -0
  244. data/libnet/src/libnet_build_ospf.c +699 -0
  245. data/libnet/src/libnet_build_rip.c +108 -0
  246. data/libnet/src/libnet_build_rpc.c +138 -0
  247. data/libnet/src/libnet_build_sebek.c +108 -0
  248. data/libnet/src/libnet_build_snmp.c +52 -0
  249. data/libnet/src/libnet_build_stp.c +222 -0
  250. data/libnet/src/libnet_build_tcp.c +365 -0
  251. data/libnet/src/libnet_build_token_ring.c +193 -0
  252. data/libnet/src/libnet_build_udp.c +111 -0
  253. data/libnet/src/libnet_build_vrrp.c +117 -0
  254. data/libnet/src/libnet_checksum.c +376 -0
  255. data/libnet/src/libnet_cq.c +395 -0
  256. data/libnet/src/libnet_crc.c +113 -0
  257. data/libnet/src/libnet_dll.c +47 -0
  258. data/libnet/src/libnet_error.c +55 -0
  259. data/libnet/src/libnet_if_addr.c +415 -0
  260. data/libnet/src/libnet_init.c +234 -0
  261. data/libnet/src/libnet_internal.c +310 -0
  262. data/libnet/src/libnet_link_bpf.c +348 -0
  263. data/libnet/src/libnet_link_dlpi.c +785 -0
  264. data/libnet/src/libnet_link_linux.c +310 -0
  265. data/libnet/src/libnet_link_nit.c +125 -0
  266. data/libnet/src/libnet_link_none.c +66 -0
  267. data/libnet/src/libnet_link_pf.c +179 -0
  268. data/libnet/src/libnet_link_snit.c +149 -0
  269. data/libnet/src/libnet_link_snoop.c +166 -0
  270. data/libnet/src/libnet_link_win32.c +346 -0
  271. data/libnet/src/libnet_pblock.c +511 -0
  272. data/libnet/src/libnet_port_list.c +295 -0
  273. data/libnet/src/libnet_prand.c +106 -0
  274. data/libnet/src/libnet_raw.c +257 -0
  275. data/libnet/src/libnet_resolve.c +414 -0
  276. data/libnet/src/libnet_version.c +54 -0
  277. data/libnet/src/libnet_write.c +502 -0
  278. data/libnet/version.h.in +6 -0
  279. data/libnet/win32/CVS/Entries +15 -0
  280. data/libnet/win32/CVS/Repository +1 -0
  281. data/libnet/win32/CVS/Root +1 -0
  282. data/libnet/win32/Libnet-1.1.1-2002.sln +77 -0
  283. data/libnet/win32/Libnet-1.1.1-2003.ncb +0 -0
  284. data/libnet/win32/Libnet-1.1.1-2003.sln +84 -0
  285. data/libnet/win32/Libnet-1.1.1-2003.suo +0 -0
  286. data/libnet/win32/Libnet-1.1.1.vcproj +311 -0
  287. data/libnet/win32/Libnet-latest.ncb +0 -0
  288. data/libnet/win32/Libnet-latest.opt +0 -0
  289. data/libnet/win32/Libnet-latest.sln +77 -0
  290. data/libnet/win32/Libnet-latest.suo +0 -0
  291. data/libnet/win32/Libnet-latest.vcproj +311 -0
  292. data/libnet/win32/Libnet.dsp +337 -0
  293. data/libnet/win32/Libnet.dsw +32 -0
  294. data/libnet/win32/README.txt +57 -0
  295. data/libnet/win32/libnet_dll.def +164 -0
  296. data/test/tc_arp.rb +169 -0
  297. data/test/tc_class.rb +219 -0
  298. data/test/tc_ethernet.rb +97 -0
  299. data/test/tc_header.rb +163 -0
  300. data/test/tc_init.rb +25 -0
  301. data/test/tc_ipv4.rb +219 -0
  302. data/test/tc_ipv6.rb +235 -0
  303. data/test/tc_udp.rb +229 -0
  304. data/test/tc_vlan.rb +118 -0
  305. data/test/ts_all.rb +15 -0
  306. metadata +401 -0
data/libnet/aclocal.m4 ADDED
@@ -0,0 +1,1337 @@
1
+ # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
+
3
+ # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4
+ # Free Software Foundation, Inc.
5
+ # This file is free software; the Free Software Foundation
6
+ # gives unlimited permission to copy and/or distribute it,
7
+ # with or without modifications, as long as this notice is preserved.
8
+
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
+ # PARTICULAR PURPOSE.
13
+
14
+ dnl $Id: aclocal.m4,v 1.9 2004/03/01 20:26:11 mike Exp $
15
+ dnl
16
+ dnl Libnet specific autoconf macros
17
+ dnl Copyright (c) 1998 - 2004 Mike D. Schiffman <mike@infonexus.com>
18
+ dnl All rights reserved.
19
+ dnl
20
+
21
+ dnl
22
+ dnl Check for the Linux /proc filesystem
23
+ dnl
24
+ dnl usage: AC_LIBNET_LINUX_PROCFS
25
+ dnl results: HAVE_LINUX_PROCFS
26
+ dnl
27
+ AC_DEFUN(AC_LIBNET_LINUX_PROCFS,
28
+ [AC_MSG_CHECKING(for Linux proc filesystem)
29
+ AC_CACHE_VAL(ac_cv_libnet_linux_procfs,
30
+ if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then
31
+ ac_cv_libnet_linux_procfs=yes
32
+ else
33
+ ac_cv_libnet_linux_procfs=no
34
+ fi)
35
+ AC_MSG_RESULT($ac_cv_libnet_linux_procfs)
36
+ if test $ac_cv_libnet_linux_procfs = yes ; then
37
+ AC_DEFINE(HAVE_LINUX_PROCFS, 1,
38
+ [Define if you have the Linux /proc filesystem.])
39
+ fi])
40
+
41
+ dnl
42
+ dnl Checks to see if this linux kernel has a working PF_PACKET
43
+ dnl
44
+ dnl usage:
45
+ dnl
46
+ dnl AC_LIBNET_CHECK_PF_PACKET
47
+ dnl
48
+ dnl results:
49
+ dnl
50
+ dnl HAVE_PACKET_SOCKET (DEFINED)
51
+ dnl
52
+
53
+ AC_DEFUN(AC_LIBNET_CHECK_PF_PACKET,
54
+ [
55
+ AC_MSG_CHECKING(for packet socket (PF_SOCKET))
56
+ AC_CACHE_VAL(ac_libnet_have_packet_socket,
57
+
58
+ [case "$target_os" in
59
+
60
+ linux)
61
+ ac_libnet_have_packet_socket = no
62
+ ;;
63
+ *)
64
+
65
+ cat > pf_packet-test.c << EOF
66
+ #include <stdio.h>
67
+ #include <errno.h>
68
+ #include <stdlib.h>
69
+ #include <netinet/in.h>
70
+ #include <sys/socket.h>
71
+ #include <features.h> /* for the glibc version number */
72
+ #if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
73
+ #include <netpacket/packet.h>
74
+ #include <net/ethernet.h> /* the L2 protocols */
75
+ #else
76
+ #include <asm/types.h>
77
+ #include <linux/if_packet.h>
78
+ #include <linux/if_ether.h> /* The L2 protocols */
79
+ #endif
80
+
81
+ #ifndef SOL_PACKET
82
+ #define SOL_PACKET 263
83
+ #endif /* SOL_PACKET */
84
+
85
+ int
86
+ main(int argc, char **argv)
87
+ {
88
+ int fd;
89
+
90
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
91
+ if (fd == -1)
92
+ {
93
+ if (errno == EPERM)
94
+ {
95
+ /* user's UID != 0 */
96
+ printf("probably");
97
+ exit (EXIT_FAILURE);
98
+ }
99
+ printf("no");
100
+ exit (EXIT_FAILURE);
101
+ }
102
+ printf("yes");
103
+ exit (EXIT_SUCCESS);
104
+ }
105
+ EOF
106
+ ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
107
+
108
+ # Oopz 4.3 BSD doesn't have this. Sorry.
109
+ if test ! -x ./pf_packet-test ; then
110
+ ac_libnet_have_packet_socket=choked
111
+ else
112
+ ac_libnet_have_packet_socket=`./pf_packet-test`;
113
+ fi
114
+ if test $ac_libnet_have_packet_socket = choked; then
115
+ AC_MSG_RESULT(test program compile choked... assuming no)
116
+ elif test $ac_libnet_have_packet_socket = yes; then
117
+ AC_MSG_RESULT(yes)
118
+ elif test $ac_libnet_have_packet_socket = probably; then
119
+ AC_MSG_RESULT(test program got EPERM... assuming yes)
120
+ elif test $ac_libnet_have_packet_socket = no; then
121
+ AC_MSG_RESULT(no)
122
+ fi
123
+
124
+ rm -f pf_packet-test* core core.pf_packet-test
125
+ ;;
126
+ esac])
127
+
128
+ if test $ac_libnet_have_packet_socket = yes -o $ac_libnet_have_packet_socket = probably; then
129
+ AC_DEFINE(HAVE_PACKET_SOCKET)
130
+ fi
131
+ ])
132
+
133
+ dnl
134
+ dnl Looks for a previous libnet version and attempts to determine which verion
135
+ dnl it is. Version 0.8 was the first version that actually knew internally
136
+ dnl what version it was.
137
+ dnl
138
+ dnl usage:
139
+ dnl
140
+ dnl AC_LIBNET_CHECK_LIBNET_VERSION
141
+ dnl
142
+ dnl results:
143
+ dnl
144
+ dnl
145
+ dnl
146
+
147
+ AC_DEFUN(AC_LIBNET_CHECK_LIBNET_VER,
148
+ [
149
+ AC_CHECK_LIB(net, libnet_build_ip, AC_MSG_CHECKING(version) \
150
+
151
+ changequote(<<, >>)dnl
152
+ if [[ ! -f $LIB_PREFIX/libnet.a ]] ; then
153
+ changequote([, ])dnl
154
+ AC_MSG_RESULT($LIB_PREFIX/libnet.a doesn't exist)
155
+ AC_MSG_RESULT(previous libnet install lives elsewhere, you should probably find it)
156
+ else
157
+ __LIBNET_VERSION=`strings $LIB_PREFIX/libnet.a | grep "libnet version"\
158
+ | cut -f3 -d" "`;\
159
+ if test -z "$__LIBNET_VERSION"; then
160
+ AC_MSG_RESULT(<0.8)
161
+ else
162
+ AC_MSG_RESULT($__LIBNET_VERSION)
163
+ fi
164
+ fi\
165
+ )
166
+ ])
167
+
168
+
169
+ dnl
170
+ dnl Checks to see if this linux kernel uses ip_sum or ip_csum
171
+ dnl (Pulled from queso)
172
+ dnl
173
+ dnl usage:
174
+ dnl
175
+ dnl AC_LIBNET_CHECK_IP_CSUM
176
+ dnl
177
+ dnl results:
178
+ dnl
179
+ dnl HAVE_STRUCT_IP_CSUM (DEFINED)
180
+ dnl
181
+
182
+ AC_DEFUN(AC_LIBNET_CHECK_IP_CSUM,
183
+ [
184
+ AC_MSG_CHECKING([struct ip contains ip_csum])
185
+ AC_TRY_COMPILE([
186
+ #define __BSD_SOURCE
187
+ #define _BSD_SOURCE
188
+ #include <sys/types.h>
189
+ #include <netinet/in.h>
190
+ #include <netinet/in_systm.h>
191
+ #include <netinet/ip.h>],
192
+ [
193
+ struct ip ip;
194
+ ip.ip_csum = 0;
195
+ ],
196
+ [AC_MSG_RESULT(yes);
197
+ AC_DEFINE(HAVE_STRUCT_IP_CSUM)],
198
+ [AC_MSG_RESULT(no);
199
+ ])
200
+ ])
201
+
202
+ dnl
203
+ dnl Checks to see if unaligned memory accesses fail
204
+ dnl (Pulled from libpcap)
205
+ dnl
206
+ dnl usage:
207
+ dnl
208
+ dnl AC_LBL_UNALIGNED_ACCESS
209
+ dnl
210
+ dnl results:
211
+ dnl
212
+ dnl LBL_ALIGN (DEFINED)
213
+ dnl
214
+
215
+ AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
216
+ [AC_MSG_CHECKING(if unaligned accesses fail)
217
+ AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
218
+ [case "$target_cpu" in
219
+
220
+ alpha|hp*|mips|sparc)
221
+ ac_cv_lbl_unaligned_fail=yes
222
+ ;;
223
+
224
+ *)
225
+ cat >conftest.c <<EOF
226
+ # include <sys/types.h>
227
+ # include <sys/wait.h>
228
+ # include <stdio.h>
229
+ unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
230
+ main()
231
+ {
232
+ unsigned int i;
233
+ pid_t pid;
234
+ int status;
235
+ /* avoid "core dumped" message */
236
+ pid = fork();
237
+ if (pid < 0)
238
+ {
239
+ exit(2);
240
+ }
241
+ if (pid > 0)
242
+ {
243
+ /* parent */
244
+ pid = waitpid(pid, &status, 0);
245
+ if (pid < 0)
246
+ {
247
+ exit(3);
248
+ }
249
+ exit(!WIFEXITED(status));
250
+ }
251
+ /* child */
252
+ i = *(unsigned int *)&a[[1]];
253
+ printf("%d\n", i);
254
+ exit(0);
255
+ }
256
+ EOF
257
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
258
+ conftest.c $LIBS > /dev/null 2>&1
259
+ # Oopz 4.3 BSD doesn't have this. Sorry.
260
+ if test ! -x conftest ; then
261
+ dnl failed to compile for some reason
262
+ ac_cv_lbl_unaligned_fail=yes
263
+ else
264
+ ./conftest > conftest.out
265
+ if test ! -s conftest.out ; then
266
+ ac_cv_lbl_unaligned_fail=yes
267
+ else
268
+ ac_cv_lbl_unaligned_fail=no
269
+ fi
270
+ fi
271
+ rm -f conftest* core core.conftest
272
+ ;;
273
+ esac])
274
+ AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
275
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
276
+ AC_DEFINE(LBL_ALIGN)
277
+ fi
278
+ ])
279
+
280
+
281
+ dnl
282
+ dnl Checks endianess
283
+ dnl
284
+ dnl usage:
285
+ dnl
286
+ dnl AC_LIBNET_ENDIAN_CHECK
287
+ dnl
288
+ dnl results:
289
+ dnl
290
+ dnl LIBNET_BIG_ENDIAN = 1 or
291
+ dnl LIBNET_LIL_ENDIAN = 1
292
+ dnl
293
+
294
+ AC_DEFUN(AC_LIBNET_ENDIAN_CHECK,
295
+ [AC_MSG_CHECKING(machine endianess)
296
+
297
+ cat > conftest.c << EOF
298
+ # include <stdio.h>
299
+ # include <stdlib.h>
300
+
301
+ int main()
302
+ {
303
+ union
304
+ {
305
+ short s;
306
+ char c[[sizeof(short)]];
307
+ } un;
308
+
309
+ un.s = 0x0102;
310
+ if (sizeof (short) == 2)
311
+ {
312
+ if (un.c [[0]] == 1 && un.c [[1]] == 2)
313
+ {
314
+ printf("B\n");
315
+ }
316
+ else
317
+ {
318
+ if (un.c [[0]] == 2 && un.c [[1]] == 1)
319
+ {
320
+ printf("L\n");
321
+ }
322
+ }
323
+ }
324
+ else
325
+ {
326
+ printf("?\n");
327
+ }
328
+ return (EXIT_SUCCESS);
329
+ }
330
+ EOF
331
+ ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
332
+ # Oopz 4.3 BSD doesn't have this. Sorry.
333
+ if test ! -x conftest ; then
334
+ dnl failed to compile for some reason
335
+ ac_cv_libnet_endianess=unknown
336
+ else
337
+ ./conftest > conftest.out
338
+ result=`cat conftest.out`
339
+ if test $result = "B"; then
340
+ ac_cv_libnet_endianess=big
341
+ elif test $result = "L"; then
342
+ ac_cv_libnet_endianess=lil
343
+ else
344
+ ac_cv_libnet_endianess=unknown
345
+ fi
346
+ fi
347
+ rm -f conftest* core core.conftest
348
+
349
+ AC_MSG_RESULT($ac_cv_libnet_endianess)
350
+
351
+ if test $ac_cv_libnet_endianess = big ; then
352
+ AC_DEFINE(LIBNET_BIG_ENDIAN)
353
+ ENDIANESS="LIBNET_BIG_ENDIAN"
354
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
355
+ elif test $ac_cv_libnet_endianess = lil ; then
356
+ AC_DEFINE(LIBNET_LIL_ENDIAN)
357
+ ENDIANESS="LIBNET_LIL_ENDIAN"
358
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
359
+ fi
360
+ ])
361
+
362
+ dnl
363
+ dnl Improved version of AC_CHECK_LIB
364
+ dnl
365
+ dnl Thanks to John Hawkinson (jhawk@mit.edu)
366
+ dnl
367
+ dnl usage:
368
+ dnl
369
+ dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
370
+ dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
371
+ dnl
372
+ dnl results:
373
+ dnl
374
+ dnl LIBS
375
+ dnl
376
+
377
+ define(AC_LBL_CHECK_LIB,
378
+ [AC_MSG_CHECKING([for $2 in -l$1])
379
+ dnl Use a cache variable name containing both the library and function name,
380
+ dnl because the test really is for library $1 defining function $2, not
381
+ dnl just for library $1. Separate tests with the same $1 and different $2's
382
+ dnl may have different results.
383
+ ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
384
+ AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
385
+ [ac_save_LIBS="$LIBS"
386
+ LIBS="-l$1 $5 $LIBS"
387
+ AC_TRY_LINK(dnl
388
+ ifelse([$2], [main], , dnl Avoid conflicting decl of main.
389
+ [/* Override any gcc2 internal prototype to avoid an error. */
390
+ ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
391
+ extern "C"
392
+ #endif
393
+ ])dnl
394
+ [/* We use char because int might match the return type of a gcc2
395
+ builtin and then its argument prototype would still apply. */
396
+ char $2();
397
+ ]),
398
+ [$2()],
399
+ eval "ac_cv_lbl_lib_$ac_lib_var=yes",
400
+ eval "ac_cv_lbl_lib_$ac_lib_var=no")
401
+ LIBS="$ac_save_LIBS"
402
+ ])dnl
403
+ if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
404
+ AC_MSG_RESULT(yes)
405
+ ifelse([$3], ,
406
+ [changequote(, )dnl
407
+ ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
408
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
409
+ changequote([, ])dnl
410
+ AC_DEFINE_UNQUOTED($ac_tr_lib)
411
+ LIBS="-l$1 $LIBS"
412
+ ], [$3])
413
+ else
414
+ AC_MSG_RESULT(no)
415
+ ifelse([$4], , , [$4
416
+ ])dnl
417
+ fi
418
+ ])
419
+
420
+ dnl
421
+ dnl AC_LBL_LIBRARY_NET
422
+ dnl
423
+ dnl This test is for network applications that need socket() and
424
+ dnl gethostbyname() -ish functions. Under Solaris, those applications
425
+ dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
426
+ dnl with "-lnsl" but should *not* link with "-lsocket" because
427
+ dnl libsocket.a breaks a number of things (for instance:
428
+ dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
429
+ dnl versions of IRIX).
430
+ dnl
431
+ dnl Unfortunately, many application developers are not aware of this,
432
+ dnl and mistakenly write tests that cause -lsocket to be used under
433
+ dnl IRIX. It is also easy to write tests that cause -lnsl to be used
434
+ dnl under operating systems where neither are necessary (or useful),
435
+ dnl such as SunOS 4.1.4, which uses -lnsl for TLI.
436
+ dnl
437
+ dnl This test exists so that every application developer does not test
438
+ dnl this in a different, and subtly broken fashion.
439
+
440
+ dnl It has been argued that this test should be broken up into two
441
+ dnl seperate tests, one for the resolver libraries, and one for the
442
+ dnl libraries necessary for using Sockets API. Unfortunately, the two
443
+ dnl are carefully intertwined and allowing the autoconf user to use
444
+ dnl them independantly potentially results in unfortunate ordering
445
+ dnl dependancies -- as such, such component macros would have to
446
+ dnl carefully use indirection and be aware if the other components were
447
+ dnl executed. Since other autoconf macros do not go to this trouble,
448
+ dnl and almost no applications use sockets without the resolver, this
449
+ dnl complexity has not been implemented.
450
+ dnl
451
+ dnl The check for libresolv is in case you are attempting to link
452
+ dnl statically and happen to have a libresolv.a lying around (and no
453
+ dnl libnsl.a).
454
+ dnl
455
+ AC_DEFUN(AC_LBL_LIBRARY_NET, [
456
+ # Most operating systems have gethostbyname() in the default searched
457
+ # libraries (i.e. libc):
458
+ AC_CHECK_FUNC(gethostbyname, ,
459
+ # Some OSes (eg. Solaris) place it in libnsl:
460
+ AC_LBL_CHECK_LIB(nsl, gethostbyname, ,
461
+ # Some strange OSes (SINIX) have it in libsocket:
462
+ AC_LBL_CHECK_LIB(socket, gethostbyname, ,
463
+ # Unfortunately libsocket sometimes depends on libnsl.
464
+ # AC_CHECK_LIB's API is essentially broken so the
465
+ # following ugliness is necessary:
466
+ AC_LBL_CHECK_LIB(socket, gethostbyname,
467
+ LIBS="-lsocket -lnsl $LIBS",
468
+ AC_CHECK_LIB(resolv, gethostbyname),
469
+ -lnsl))))
470
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
471
+ AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
472
+ -lnsl)))
473
+ # DLPI needs putmsg under HPUX so test for -lstr while we're at it
474
+ AC_CHECK_LIB(str, putmsg)
475
+ ])
476
+
477
+
478
+ # Do all the work for Automake. -*- Autoconf -*-
479
+
480
+ # This macro actually does too much some checks are only needed if
481
+ # your package does certain things. But this isn't really a big deal.
482
+
483
+ # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
484
+ # Free Software Foundation, Inc.
485
+
486
+ # This program is free software; you can redistribute it and/or modify
487
+ # it under the terms of the GNU General Public License as published by
488
+ # the Free Software Foundation; either version 2, or (at your option)
489
+ # any later version.
490
+
491
+ # This program is distributed in the hope that it will be useful,
492
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
493
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
494
+ # GNU General Public License for more details.
495
+
496
+ # You should have received a copy of the GNU General Public License
497
+ # along with this program; if not, write to the Free Software
498
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
499
+ # 02111-1307, USA.
500
+
501
+ # serial 8
502
+
503
+ # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
504
+ # written in clear, in which case automake, when reading aclocal.m4,
505
+ # will think it sees a *use*, and therefore will trigger all it's
506
+ # C support machinery. Also note that it means that autoscan, seeing
507
+ # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
508
+
509
+
510
+ AC_PREREQ([2.52])
511
+
512
+ # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
513
+ # the ones we care about.
514
+ m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
515
+
516
+ # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
517
+ # AM_INIT_AUTOMAKE([OPTIONS])
518
+ # -----------------------------------------------
519
+ # The call with PACKAGE and VERSION arguments is the old style
520
+ # call (pre autoconf-2.50), which is being phased out. PACKAGE
521
+ # and VERSION should now be passed to AC_INIT and removed from
522
+ # the call to AM_INIT_AUTOMAKE.
523
+ # We support both call styles for the transition. After
524
+ # the next Automake release, Autoconf can make the AC_INIT
525
+ # arguments mandatory, and then we can depend on a new Autoconf
526
+ # release and drop the old call support.
527
+ AC_DEFUN([AM_INIT_AUTOMAKE],
528
+ [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
529
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
530
+ # test to see if srcdir already configured
531
+ if test "`cd $srcdir && pwd`" != "`pwd`" &&
532
+ test -f $srcdir/config.status; then
533
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
534
+ fi
535
+
536
+ # Define the identity of the package.
537
+ dnl Distinguish between old-style and new-style calls.
538
+ m4_ifval([$2],
539
+ [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
540
+ AC_SUBST([PACKAGE], [$1])dnl
541
+ AC_SUBST([VERSION], [$2])],
542
+ [_AM_SET_OPTIONS([$1])dnl
543
+ AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
544
+ AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
545
+
546
+ _AM_IF_OPTION([no-define],,
547
+ [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
548
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
549
+
550
+ # Some tools Automake needs.
551
+ AC_REQUIRE([AM_SANITY_CHECK])dnl
552
+ AC_REQUIRE([AC_ARG_PROGRAM])dnl
553
+ AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
554
+ AM_MISSING_PROG(AUTOCONF, autoconf)
555
+ AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
556
+ AM_MISSING_PROG(AUTOHEADER, autoheader)
557
+ AM_MISSING_PROG(MAKEINFO, makeinfo)
558
+ AM_MISSING_PROG(AMTAR, tar)
559
+ AM_PROG_INSTALL_SH
560
+ AM_PROG_INSTALL_STRIP
561
+ # We need awk for the "check" target. The system "awk" is bad on
562
+ # some platforms.
563
+ AC_REQUIRE([AC_PROG_AWK])dnl
564
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
565
+
566
+ _AM_IF_OPTION([no-dependencies],,
567
+ [AC_PROVIDE_IFELSE([AC_PROG_][CC],
568
+ [_AM_DEPENDENCIES(CC)],
569
+ [define([AC_PROG_][CC],
570
+ defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
571
+ AC_PROVIDE_IFELSE([AC_PROG_][CXX],
572
+ [_AM_DEPENDENCIES(CXX)],
573
+ [define([AC_PROG_][CXX],
574
+ defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
575
+ ])
576
+ ])
577
+
578
+ # Copyright 2002 Free Software Foundation, Inc.
579
+
580
+ # This program is free software; you can redistribute it and/or modify
581
+ # it under the terms of the GNU General Public License as published by
582
+ # the Free Software Foundation; either version 2, or (at your option)
583
+ # any later version.
584
+
585
+ # This program is distributed in the hope that it will be useful,
586
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
587
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
588
+ # GNU General Public License for more details.
589
+
590
+ # You should have received a copy of the GNU General Public License
591
+ # along with this program; if not, write to the Free Software
592
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
593
+
594
+ # AM_AUTOMAKE_VERSION(VERSION)
595
+ # ----------------------------
596
+ # Automake X.Y traces this macro to ensure aclocal.m4 has been
597
+ # generated from the m4 files accompanying Automake X.Y.
598
+ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
599
+
600
+ # AM_SET_CURRENT_AUTOMAKE_VERSION
601
+ # -------------------------------
602
+ # Call AM_AUTOMAKE_VERSION so it can be traced.
603
+ # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
604
+ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
605
+ [AM_AUTOMAKE_VERSION([1.6.3])])
606
+
607
+ # Helper functions for option handling. -*- Autoconf -*-
608
+
609
+ # Copyright 2001, 2002 Free Software Foundation, Inc.
610
+
611
+ # This program is free software; you can redistribute it and/or modify
612
+ # it under the terms of the GNU General Public License as published by
613
+ # the Free Software Foundation; either version 2, or (at your option)
614
+ # any later version.
615
+
616
+ # This program is distributed in the hope that it will be useful,
617
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
618
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
619
+ # GNU General Public License for more details.
620
+
621
+ # You should have received a copy of the GNU General Public License
622
+ # along with this program; if not, write to the Free Software
623
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
624
+ # 02111-1307, USA.
625
+
626
+ # serial 2
627
+
628
+ # _AM_MANGLE_OPTION(NAME)
629
+ # -----------------------
630
+ AC_DEFUN([_AM_MANGLE_OPTION],
631
+ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
632
+
633
+ # _AM_SET_OPTION(NAME)
634
+ # ------------------------------
635
+ # Set option NAME. Presently that only means defining a flag for this option.
636
+ AC_DEFUN([_AM_SET_OPTION],
637
+ [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
638
+
639
+ # _AM_SET_OPTIONS(OPTIONS)
640
+ # ----------------------------------
641
+ # OPTIONS is a space-separated list of Automake options.
642
+ AC_DEFUN([_AM_SET_OPTIONS],
643
+ [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
644
+
645
+ # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
646
+ # -------------------------------------------
647
+ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
648
+ AC_DEFUN([_AM_IF_OPTION],
649
+ [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
650
+
651
+ #
652
+ # Check to make sure that the build environment is sane.
653
+ #
654
+
655
+ # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
656
+
657
+ # This program is free software; you can redistribute it and/or modify
658
+ # it under the terms of the GNU General Public License as published by
659
+ # the Free Software Foundation; either version 2, or (at your option)
660
+ # any later version.
661
+
662
+ # This program is distributed in the hope that it will be useful,
663
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
664
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
665
+ # GNU General Public License for more details.
666
+
667
+ # You should have received a copy of the GNU General Public License
668
+ # along with this program; if not, write to the Free Software
669
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
670
+ # 02111-1307, USA.
671
+
672
+ # serial 3
673
+
674
+ # AM_SANITY_CHECK
675
+ # ---------------
676
+ AC_DEFUN([AM_SANITY_CHECK],
677
+ [AC_MSG_CHECKING([whether build environment is sane])
678
+ # Just in case
679
+ sleep 1
680
+ echo timestamp > conftest.file
681
+ # Do `set' in a subshell so we don't clobber the current shell's
682
+ # arguments. Must try -L first in case configure is actually a
683
+ # symlink; some systems play weird games with the mod time of symlinks
684
+ # (eg FreeBSD returns the mod time of the symlink's containing
685
+ # directory).
686
+ if (
687
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
688
+ if test "$[*]" = "X"; then
689
+ # -L didn't work.
690
+ set X `ls -t $srcdir/configure conftest.file`
691
+ fi
692
+ rm -f conftest.file
693
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
694
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
695
+
696
+ # If neither matched, then we have a broken ls. This can happen
697
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
698
+ # broken ls alias from the environment. This has actually
699
+ # happened. Such a system could not be considered "sane".
700
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
701
+ alias in your environment])
702
+ fi
703
+
704
+ test "$[2]" = conftest.file
705
+ )
706
+ then
707
+ # Ok.
708
+ :
709
+ else
710
+ AC_MSG_ERROR([newly created file is older than distributed files!
711
+ Check your system clock])
712
+ fi
713
+ AC_MSG_RESULT(yes)])
714
+
715
+ # -*- Autoconf -*-
716
+
717
+
718
+ # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
719
+
720
+ # This program is free software; you can redistribute it and/or modify
721
+ # it under the terms of the GNU General Public License as published by
722
+ # the Free Software Foundation; either version 2, or (at your option)
723
+ # any later version.
724
+
725
+ # This program is distributed in the hope that it will be useful,
726
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
727
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
728
+ # GNU General Public License for more details.
729
+
730
+ # You should have received a copy of the GNU General Public License
731
+ # along with this program; if not, write to the Free Software
732
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
733
+ # 02111-1307, USA.
734
+
735
+ # serial 3
736
+
737
+ # AM_MISSING_PROG(NAME, PROGRAM)
738
+ # ------------------------------
739
+ AC_DEFUN([AM_MISSING_PROG],
740
+ [AC_REQUIRE([AM_MISSING_HAS_RUN])
741
+ $1=${$1-"${am_missing_run}$2"}
742
+ AC_SUBST($1)])
743
+
744
+
745
+ # AM_MISSING_HAS_RUN
746
+ # ------------------
747
+ # Define MISSING if not defined so far and test if it supports --run.
748
+ # If it does, set am_missing_run to use it, otherwise, to nothing.
749
+ AC_DEFUN([AM_MISSING_HAS_RUN],
750
+ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
751
+ test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
752
+ # Use eval to expand $SHELL
753
+ if eval "$MISSING --run true"; then
754
+ am_missing_run="$MISSING --run "
755
+ else
756
+ am_missing_run=
757
+ AC_MSG_WARN([`missing' script is too old or missing])
758
+ fi
759
+ ])
760
+
761
+ # AM_AUX_DIR_EXPAND
762
+
763
+ # Copyright 2001 Free Software Foundation, Inc.
764
+
765
+ # This program is free software; you can redistribute it and/or modify
766
+ # it under the terms of the GNU General Public License as published by
767
+ # the Free Software Foundation; either version 2, or (at your option)
768
+ # any later version.
769
+
770
+ # This program is distributed in the hope that it will be useful,
771
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
772
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
773
+ # GNU General Public License for more details.
774
+
775
+ # You should have received a copy of the GNU General Public License
776
+ # along with this program; if not, write to the Free Software
777
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
778
+ # 02111-1307, USA.
779
+
780
+ # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
781
+ # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
782
+ # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
783
+ #
784
+ # Of course, Automake must honor this variable whenever it calls a
785
+ # tool from the auxiliary directory. The problem is that $srcdir (and
786
+ # therefore $ac_aux_dir as well) can be either absolute or relative,
787
+ # depending on how configure is run. This is pretty annoying, since
788
+ # it makes $ac_aux_dir quite unusable in subdirectories: in the top
789
+ # source directory, any form will work fine, but in subdirectories a
790
+ # relative path needs to be adjusted first.
791
+ #
792
+ # $ac_aux_dir/missing
793
+ # fails when called from a subdirectory if $ac_aux_dir is relative
794
+ # $top_srcdir/$ac_aux_dir/missing
795
+ # fails if $ac_aux_dir is absolute,
796
+ # fails when called from a subdirectory in a VPATH build with
797
+ # a relative $ac_aux_dir
798
+ #
799
+ # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
800
+ # are both prefixed by $srcdir. In an in-source build this is usually
801
+ # harmless because $srcdir is `.', but things will broke when you
802
+ # start a VPATH build or use an absolute $srcdir.
803
+ #
804
+ # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
805
+ # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
806
+ # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
807
+ # and then we would define $MISSING as
808
+ # MISSING="\${SHELL} $am_aux_dir/missing"
809
+ # This will work as long as MISSING is not called from configure, because
810
+ # unfortunately $(top_srcdir) has no meaning in configure.
811
+ # However there are other variables, like CC, which are often used in
812
+ # configure, and could therefore not use this "fixed" $ac_aux_dir.
813
+ #
814
+ # Another solution, used here, is to always expand $ac_aux_dir to an
815
+ # absolute PATH. The drawback is that using absolute paths prevent a
816
+ # configured tree to be moved without reconfiguration.
817
+
818
+ # Rely on autoconf to set up CDPATH properly.
819
+ AC_PREREQ([2.50])
820
+
821
+ AC_DEFUN([AM_AUX_DIR_EXPAND], [
822
+ # expand $ac_aux_dir to an absolute path
823
+ am_aux_dir=`cd $ac_aux_dir && pwd`
824
+ ])
825
+
826
+ # AM_PROG_INSTALL_SH
827
+ # ------------------
828
+ # Define $install_sh.
829
+
830
+ # Copyright 2001 Free Software Foundation, Inc.
831
+
832
+ # This program is free software; you can redistribute it and/or modify
833
+ # it under the terms of the GNU General Public License as published by
834
+ # the Free Software Foundation; either version 2, or (at your option)
835
+ # any later version.
836
+
837
+ # This program is distributed in the hope that it will be useful,
838
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
839
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
840
+ # GNU General Public License for more details.
841
+
842
+ # You should have received a copy of the GNU General Public License
843
+ # along with this program; if not, write to the Free Software
844
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
845
+ # 02111-1307, USA.
846
+
847
+ AC_DEFUN([AM_PROG_INSTALL_SH],
848
+ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
849
+ install_sh=${install_sh-"$am_aux_dir/install-sh"}
850
+ AC_SUBST(install_sh)])
851
+
852
+ # AM_PROG_INSTALL_STRIP
853
+
854
+ # Copyright 2001 Free Software Foundation, Inc.
855
+
856
+ # This program is free software; you can redistribute it and/or modify
857
+ # it under the terms of the GNU General Public License as published by
858
+ # the Free Software Foundation; either version 2, or (at your option)
859
+ # any later version.
860
+
861
+ # This program is distributed in the hope that it will be useful,
862
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
863
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
864
+ # GNU General Public License for more details.
865
+
866
+ # You should have received a copy of the GNU General Public License
867
+ # along with this program; if not, write to the Free Software
868
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
869
+ # 02111-1307, USA.
870
+
871
+ # One issue with vendor `install' (even GNU) is that you can't
872
+ # specify the program used to strip binaries. This is especially
873
+ # annoying in cross-compiling environments, where the build's strip
874
+ # is unlikely to handle the host's binaries.
875
+ # Fortunately install-sh will honor a STRIPPROG variable, so we
876
+ # always use install-sh in `make install-strip', and initialize
877
+ # STRIPPROG with the value of the STRIP variable (set by the user).
878
+ AC_DEFUN([AM_PROG_INSTALL_STRIP],
879
+ [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
880
+ # Installed binaries are usually stripped using `strip' when the user
881
+ # run `make install-strip'. However `strip' might not be the right
882
+ # tool to use in cross-compilation environments, therefore Automake
883
+ # will honor the `STRIP' environment variable to overrule this program.
884
+ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
885
+ if test "$cross_compiling" != no; then
886
+ AC_CHECK_TOOL([STRIP], [strip], :)
887
+ fi
888
+ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
889
+ AC_SUBST([INSTALL_STRIP_PROGRAM])])
890
+
891
+ # serial 4 -*- Autoconf -*-
892
+
893
+ # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
894
+
895
+ # This program is free software; you can redistribute it and/or modify
896
+ # it under the terms of the GNU General Public License as published by
897
+ # the Free Software Foundation; either version 2, or (at your option)
898
+ # any later version.
899
+
900
+ # This program is distributed in the hope that it will be useful,
901
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
902
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
903
+ # GNU General Public License for more details.
904
+
905
+ # You should have received a copy of the GNU General Public License
906
+ # along with this program; if not, write to the Free Software
907
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
908
+ # 02111-1307, USA.
909
+
910
+
911
+ # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
912
+ # written in clear, in which case automake, when reading aclocal.m4,
913
+ # will think it sees a *use*, and therefore will trigger all it's
914
+ # C support machinery. Also note that it means that autoscan, seeing
915
+ # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
916
+
917
+
918
+
919
+ # _AM_DEPENDENCIES(NAME)
920
+ # ----------------------
921
+ # See how the compiler implements dependency checking.
922
+ # NAME is "CC", "CXX", "GCJ", or "OBJC".
923
+ # We try a few techniques and use that to set a single cache variable.
924
+ #
925
+ # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
926
+ # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
927
+ # dependency, and given that the user is not expected to run this macro,
928
+ # just rely on AC_PROG_CC.
929
+ AC_DEFUN([_AM_DEPENDENCIES],
930
+ [AC_REQUIRE([AM_SET_DEPDIR])dnl
931
+ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
932
+ AC_REQUIRE([AM_MAKE_INCLUDE])dnl
933
+ AC_REQUIRE([AM_DEP_TRACK])dnl
934
+
935
+ ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
936
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
937
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
938
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
939
+ [depcc="$$1" am_compiler_list=])
940
+
941
+ AC_CACHE_CHECK([dependency style of $depcc],
942
+ [am_cv_$1_dependencies_compiler_type],
943
+ [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
944
+ # We make a subdir and do the tests there. Otherwise we can end up
945
+ # making bogus files that we don't know about and never remove. For
946
+ # instance it was reported that on HP-UX the gcc test will end up
947
+ # making a dummy file named `D' -- because `-MD' means `put the output
948
+ # in D'.
949
+ mkdir conftest.dir
950
+ # Copy depcomp to subdir because otherwise we won't find it if we're
951
+ # using a relative directory.
952
+ cp "$am_depcomp" conftest.dir
953
+ cd conftest.dir
954
+
955
+ am_cv_$1_dependencies_compiler_type=none
956
+ if test "$am_compiler_list" = ""; then
957
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
958
+ fi
959
+ for depmode in $am_compiler_list; do
960
+ # We need to recreate these files for each test, as the compiler may
961
+ # overwrite some of them when testing with obscure command lines.
962
+ # This happens at least with the AIX C compiler.
963
+ echo '#include "conftest.h"' > conftest.c
964
+ echo 'int i;' > conftest.h
965
+ echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
966
+
967
+ case $depmode in
968
+ nosideeffect)
969
+ # after this tag, mechanisms are not by side-effect, so they'll
970
+ # only be used when explicitly requested
971
+ if test "x$enable_dependency_tracking" = xyes; then
972
+ continue
973
+ else
974
+ break
975
+ fi
976
+ ;;
977
+ none) break ;;
978
+ esac
979
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
980
+ # mode. It turns out that the SunPro C++ compiler does not properly
981
+ # handle `-M -o', and we need to detect this.
982
+ if depmode=$depmode \
983
+ source=conftest.c object=conftest.o \
984
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
985
+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
986
+ grep conftest.h conftest.Po > /dev/null 2>&1 &&
987
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
988
+ am_cv_$1_dependencies_compiler_type=$depmode
989
+ break
990
+ fi
991
+ done
992
+
993
+ cd ..
994
+ rm -rf conftest.dir
995
+ else
996
+ am_cv_$1_dependencies_compiler_type=none
997
+ fi
998
+ ])
999
+ AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1000
+ ])
1001
+
1002
+
1003
+ # AM_SET_DEPDIR
1004
+ # -------------
1005
+ # Choose a directory name for dependency files.
1006
+ # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1007
+ AC_DEFUN([AM_SET_DEPDIR],
1008
+ [rm -f .deps 2>/dev/null
1009
+ mkdir .deps 2>/dev/null
1010
+ if test -d .deps; then
1011
+ DEPDIR=.deps
1012
+ else
1013
+ # MS-DOS does not allow filenames that begin with a dot.
1014
+ DEPDIR=_deps
1015
+ fi
1016
+ rmdir .deps 2>/dev/null
1017
+ AC_SUBST([DEPDIR])
1018
+ ])
1019
+
1020
+
1021
+ # AM_DEP_TRACK
1022
+ # ------------
1023
+ AC_DEFUN([AM_DEP_TRACK],
1024
+ [AC_ARG_ENABLE(dependency-tracking,
1025
+ [ --disable-dependency-tracking Speeds up one-time builds
1026
+ --enable-dependency-tracking Do not reject slow dependency extractors])
1027
+ if test "x$enable_dependency_tracking" != xno; then
1028
+ am_depcomp="$ac_aux_dir/depcomp"
1029
+ AMDEPBACKSLASH='\'
1030
+ fi
1031
+ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1032
+ AC_SUBST([AMDEPBACKSLASH])
1033
+ ])
1034
+
1035
+ # Generate code to set up dependency tracking. -*- Autoconf -*-
1036
+
1037
+ # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1038
+
1039
+ # This program is free software; you can redistribute it and/or modify
1040
+ # it under the terms of the GNU General Public License as published by
1041
+ # the Free Software Foundation; either version 2, or (at your option)
1042
+ # any later version.
1043
+
1044
+ # This program is distributed in the hope that it will be useful,
1045
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
1046
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1047
+ # GNU General Public License for more details.
1048
+
1049
+ # You should have received a copy of the GNU General Public License
1050
+ # along with this program; if not, write to the Free Software
1051
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1052
+ # 02111-1307, USA.
1053
+
1054
+ #serial 2
1055
+
1056
+ # _AM_OUTPUT_DEPENDENCY_COMMANDS
1057
+ # ------------------------------
1058
+ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1059
+ [for mf in $CONFIG_FILES; do
1060
+ # Strip MF so we end up with the name of the file.
1061
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
1062
+ # Check whether this is an Automake generated Makefile or not.
1063
+ # We used to match only the files named `Makefile.in', but
1064
+ # some people rename them; so instead we look at the file content.
1065
+ # Grep'ing the first line is not enough: some people post-process
1066
+ # each Makefile.in and add a new line on top of each file to say so.
1067
+ # So let's grep whole file.
1068
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
1069
+ dirpart=`AS_DIRNAME("$mf")`
1070
+ else
1071
+ continue
1072
+ fi
1073
+ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
1074
+ # Extract the definition of DEP_FILES from the Makefile without
1075
+ # running `make'.
1076
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
1077
+ test -z "$DEPDIR" && continue
1078
+ # When using ansi2knr, U may be empty or an underscore; expand it
1079
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
1080
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
1081
+ # We invoke sed twice because it is the simplest approach to
1082
+ # changing $(DEPDIR) to its actual value in the expansion.
1083
+ for file in `sed -n -e '
1084
+ /^DEP_FILES = .*\\\\$/ {
1085
+ s/^DEP_FILES = //
1086
+ :loop
1087
+ s/\\\\$//
1088
+ p
1089
+ n
1090
+ /\\\\$/ b loop
1091
+ p
1092
+ }
1093
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
1094
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1095
+ # Make sure the directory exists.
1096
+ test -f "$dirpart/$file" && continue
1097
+ fdir=`AS_DIRNAME(["$file"])`
1098
+ AS_MKDIR_P([$dirpart/$fdir])
1099
+ # echo "creating $dirpart/$file"
1100
+ echo '# dummy' > "$dirpart/$file"
1101
+ done
1102
+ done
1103
+ ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1104
+
1105
+
1106
+ # AM_OUTPUT_DEPENDENCY_COMMANDS
1107
+ # -----------------------------
1108
+ # This macro should only be invoked once -- use via AC_REQUIRE.
1109
+ #
1110
+ # This code is only required when automatic dependency tracking
1111
+ # is enabled. FIXME. This creates each `.P' file that we will
1112
+ # need in order to bootstrap the dependency handling code.
1113
+ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1114
+ [AC_CONFIG_COMMANDS([depfiles],
1115
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1116
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1117
+ ])
1118
+
1119
+ # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
1120
+
1121
+ # This program is free software; you can redistribute it and/or modify
1122
+ # it under the terms of the GNU General Public License as published by
1123
+ # the Free Software Foundation; either version 2, or (at your option)
1124
+ # any later version.
1125
+
1126
+ # This program is distributed in the hope that it will be useful,
1127
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
1128
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1129
+ # GNU General Public License for more details.
1130
+
1131
+ # You should have received a copy of the GNU General Public License
1132
+ # along with this program; if not, write to the Free Software
1133
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1134
+ # 02111-1307, USA.
1135
+
1136
+ # serial 2
1137
+
1138
+ # AM_MAKE_INCLUDE()
1139
+ # -----------------
1140
+ # Check to see how make treats includes.
1141
+ AC_DEFUN([AM_MAKE_INCLUDE],
1142
+ [am_make=${MAKE-make}
1143
+ cat > confinc << 'END'
1144
+ doit:
1145
+ @echo done
1146
+ END
1147
+ # If we don't find an include directive, just comment out the code.
1148
+ AC_MSG_CHECKING([for style of include used by $am_make])
1149
+ am__include="#"
1150
+ am__quote=
1151
+ _am_result=none
1152
+ # First try GNU make style include.
1153
+ echo "include confinc" > confmf
1154
+ # We grep out `Entering directory' and `Leaving directory'
1155
+ # messages which can occur if `w' ends up in MAKEFLAGS.
1156
+ # In particular we don't look at `^make:' because GNU make might
1157
+ # be invoked under some other name (usually "gmake"), in which
1158
+ # case it prints its new name instead of `make'.
1159
+ if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
1160
+ am__include=include
1161
+ am__quote=
1162
+ _am_result=GNU
1163
+ fi
1164
+ # Now try BSD make style include.
1165
+ if test "$am__include" = "#"; then
1166
+ echo '.include "confinc"' > confmf
1167
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1168
+ am__include=.include
1169
+ am__quote="\""
1170
+ _am_result=BSD
1171
+ fi
1172
+ fi
1173
+ AC_SUBST(am__include)
1174
+ AC_SUBST(am__quote)
1175
+ AC_MSG_RESULT($_am_result)
1176
+ rm -f confinc confmf
1177
+ ])
1178
+
1179
+ # AM_CONDITIONAL -*- Autoconf -*-
1180
+
1181
+ # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
1182
+
1183
+ # This program is free software; you can redistribute it and/or modify
1184
+ # it under the terms of the GNU General Public License as published by
1185
+ # the Free Software Foundation; either version 2, or (at your option)
1186
+ # any later version.
1187
+
1188
+ # This program is distributed in the hope that it will be useful,
1189
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
1190
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1191
+ # GNU General Public License for more details.
1192
+
1193
+ # You should have received a copy of the GNU General Public License
1194
+ # along with this program; if not, write to the Free Software
1195
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1196
+ # 02111-1307, USA.
1197
+
1198
+ # serial 5
1199
+
1200
+ AC_PREREQ(2.52)
1201
+
1202
+ # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1203
+ # -------------------------------------
1204
+ # Define a conditional.
1205
+ AC_DEFUN([AM_CONDITIONAL],
1206
+ [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1207
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1208
+ AC_SUBST([$1_TRUE])
1209
+ AC_SUBST([$1_FALSE])
1210
+ if $2; then
1211
+ $1_TRUE=
1212
+ $1_FALSE='#'
1213
+ else
1214
+ $1_TRUE='#'
1215
+ $1_FALSE=
1216
+ fi
1217
+ AC_CONFIG_COMMANDS_PRE(
1218
+ [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1219
+ AC_MSG_ERROR([conditional \"$1\" was never defined.
1220
+ Usually this means the macro was only invoked conditionally.])
1221
+ fi])])
1222
+
1223
+ # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
1224
+
1225
+ # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1226
+
1227
+ # This program is free software; you can redistribute it and/or modify
1228
+ # it under the terms of the GNU General Public License as published by
1229
+ # the Free Software Foundation; either version 2, or (at your option)
1230
+ # any later version.
1231
+
1232
+ # This program is distributed in the hope that it will be useful,
1233
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
1234
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1235
+ # GNU General Public License for more details.
1236
+
1237
+ # You should have received a copy of the GNU General Public License
1238
+ # along with this program; if not, write to the Free Software
1239
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1240
+ # 02111-1307, USA.
1241
+
1242
+ AC_PREREQ([2.52])
1243
+
1244
+ # serial 6
1245
+
1246
+ # When config.status generates a header, we must update the stamp-h file.
1247
+ # This file resides in the same directory as the config header
1248
+ # that is generated. We must strip everything past the first ":",
1249
+ # and everything past the last "/".
1250
+
1251
+ # _AM_DIRNAME(PATH)
1252
+ # -----------------
1253
+ # Like AS_DIRNAME, only do it during macro expansion
1254
+ AC_DEFUN([_AM_DIRNAME],
1255
+ [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
1256
+ m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
1257
+ m4_if(regexp([$1], [^/.*]), -1,
1258
+ [.],
1259
+ patsubst([$1], [^\(/\).*], [\1])),
1260
+ patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
1261
+ patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
1262
+ ])# _AM_DIRNAME
1263
+
1264
+
1265
+ # The stamp files are numbered to have different names.
1266
+ # We could number them on a directory basis, but that's additional
1267
+ # complications, let's have a unique counter.
1268
+ m4_define([_AM_STAMP_Count], [0])
1269
+
1270
+
1271
+ # _AM_STAMP(HEADER)
1272
+ # -----------------
1273
+ # The name of the stamp file for HEADER.
1274
+ AC_DEFUN([_AM_STAMP],
1275
+ [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
1276
+ AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
1277
+ [:.*])))/stamp-h[]_AM_STAMP_Count])
1278
+
1279
+
1280
+ # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
1281
+ # ------------------------------------------------------------
1282
+ # We used to try to get a real timestamp in stamp-h. But the fear is that
1283
+ # that will cause unnecessary cvs conflicts.
1284
+ AC_DEFUN([_AM_CONFIG_HEADER],
1285
+ [# Add the stamp file to the list of files AC keeps track of,
1286
+ # along with our hook.
1287
+ AC_CONFIG_HEADERS([$1],
1288
+ [# update the timestamp
1289
+ echo 'timestamp for $1' >"_AM_STAMP([$1])"
1290
+ $2],
1291
+ [$3])
1292
+ ])# _AM_CONFIG_HEADER
1293
+
1294
+
1295
+ # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
1296
+ # --------------------------------------------------------------
1297
+ AC_DEFUN([AM_CONFIG_HEADER],
1298
+ [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
1299
+ ])# AM_CONFIG_HEADER
1300
+
1301
+ # Add --enable-maintainer-mode option to configure.
1302
+ # From Jim Meyering
1303
+
1304
+ # Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
1305
+
1306
+ # This program is free software; you can redistribute it and/or modify
1307
+ # it under the terms of the GNU General Public License as published by
1308
+ # the Free Software Foundation; either version 2, or (at your option)
1309
+ # any later version.
1310
+
1311
+ # This program is distributed in the hope that it will be useful,
1312
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
1313
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1314
+ # GNU General Public License for more details.
1315
+
1316
+ # You should have received a copy of the GNU General Public License
1317
+ # along with this program; if not, write to the Free Software
1318
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1319
+ # 02111-1307, USA.
1320
+
1321
+ # serial 1
1322
+
1323
+ AC_DEFUN([AM_MAINTAINER_MODE],
1324
+ [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1325
+ dnl maintainer-mode is disabled by default
1326
+ AC_ARG_ENABLE(maintainer-mode,
1327
+ [ --enable-maintainer-mode enable make rules and dependencies not useful
1328
+ (and sometimes confusing) to the casual installer],
1329
+ USE_MAINTAINER_MODE=$enableval,
1330
+ USE_MAINTAINER_MODE=no)
1331
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1332
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1333
+ MAINT=$MAINTAINER_MODE_TRUE
1334
+ AC_SUBST(MAINT)dnl
1335
+ ]
1336
+ )
1337
+