]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/nmap/nmap-3.81/autofoo.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / nmap / nmap-3.81 / autofoo.patch
1
2 #
3 # Patch managed by http://www.holgerschurig.de/patcher.html
4 #
5
6 --- /dev/null
7 +++ nmap-3.77/acinclude.m4
8 @@ -0,0 +1,27 @@
9 +dnl Type of 6th argument to recvfrom(). Usually int or socklen_t.
10 +AC_DEFUN([RECVFROM_ARG6_TYPE],
11 +[
12 +   AC_LANG_PUSH(C++)
13 +   AC_MSG_CHECKING([for type of 6th argument to recvfrom()])
14 +   recvfrom6_t=
15 +   for t in socklen_t int; do
16 +     AC_TRY_COMPILE([
17 +#include <stdio.h>
18 +#include <stdlib.h>
19 +#include <sys/types.h>
20 +#include <sys/socket.h>],[
21 +$t arg;
22 +recvfrom (0, NULL, 0, 0, NULL, &arg);],[
23 +      recvfrom6_t="$t"
24 +      break])
25 +   done
26 +
27 +   if test "x$recvfrom6_t" = x; then
28 +     AC_MSG_ERROR([Cannot find type for 6th argument to recvfrom()])
29 +   fi
30 +
31 +   AC_MSG_RESULT($recvfrom6_t)
32 +   AC_DEFINE_UNQUOTED(recvfrom6_t, $recvfrom6_t,
33 +     [Type of 6th argument to recvfrom()])
34 +   AC_LANG_POP(C++)
35 +])
36 --- nmap-3.77/configure.ac~autofoo.patch
37 +++ nmap-3.77/configure.ac
38 @@ -42,10 +42,6 @@
39   if test -n "$GXX"; then
40        CXXFLAGS="$CXXFLAGS -Wall "
41   fi
42 -AC_CHECK_PROG(CXXPROG, "$CXX", "AVAILABLE", "MISSING")
43 -if test $CXXPROG = "MISSING"; then
44 -  AC_MSG_ERROR([Could not locate a C++ compiler. If it exists, add it to your PATH or give configure the CXX=path_to_compiler argument.  Otherwise, install a C++ compiler such as g++ or install a binary package of Nmap (see http://www.insecure.org/nmap/nmap_download.html ))])
45 -fi
46  
47  dnl AC_PROG_INSTALL
48  dnl AC_PATH_PROG(MAKEDEPEND, makedepend)
49 @@ -65,7 +61,7 @@
50  dnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or ''
51  AC_C_INLINE
52  if test -n "$sgi_cc"; then
53 -   AC_DEFINE(inline, )
54 +   AC_DEFINE(inline, , [Define if we need to declare our own inline])
55  fi
56  
57  AC_SUBST(COMPAT_OBJS)
58 @@ -78,6 +74,19 @@
59  macosx=no
60  needs_cpp_precomp=no
61  
62 +AH_TEMPLATE([NETBSD], [Define if building for a netbsd host])
63 +AH_TEMPLATE([LINUX], [Define if building for a linux host])
64 +AH_TEMPLATE([OPENBSD], [Define if building for an openbsd host])
65 +AH_TEMPLATE([SOLARIS], [Define if building for a solaris host])
66 +AH_TEMPLATE([IRIX], [Define if building for an irix host])
67 +AH_TEMPLATE([BSDI], [Define if building for a bsdi host])
68 +AH_TEMPLATE([FREEBSD], [Define if building for a freebsd host])
69 +AH_TEMPLATE([SUNOS], [Define if building for a sunos host])
70 +AH_TEMPLATE([MACOSX], [Define if building for a macosx host])
71 +AH_TEMPLATE([DEC], [Define if building for a digital unix host])
72 +AH_TEMPLATE([SPRINTF_RETURNS_STRING], [Define if sprintf() returns char *])
73 +AH_TEMPLATE([STUPID_SOLARIS_CHECKSUM_BUG], [Define to handle the solaris checksum bug])
74 +AH_TEMPLATE([PCAP_TIMEOUT_IGNORED], [Does the pcap library obey the timeout])
75  case "$host" in
76    *alpha-dec-osf*)
77      AC_DEFINE(DEC)
78 @@ -273,7 +282,7 @@
79  
80  OPENSSL_LIBS=
81  if test "$use_openssl" = "yes"; then
82 -  AC_DEFINE(HAVE_OPENSSL)
83 +  AC_DEFINE(HAVE_OPENSSL, 1, [Define this if we have openssl])
84    OPENSSL_LIBS="-lssl -lcrypto"
85  fi
86  
87 @@ -312,9 +321,11 @@
88    esac]
89  )
90  
91 -if test $linux = yes; then
92 -  have_libpcap=no
93 -fi
94 +# If I say I have pcap, damnit, I mean it, even if I am using linux. --CL
95 +#
96 +# if test $linux = yes; then
97 +#   have_libpcap=no
98 +# fi
99  
100  if test $needs_cpp_precomp = yes; then
101    CXXFLAGS="-no-cpp-precomp $CXXFLAGS"
102 @@ -359,7 +370,7 @@
103  }],
104  [AC_MSG_RESULT(yes); have_libpcap=yes],
105  [AC_MSG_RESULT(no); have_libpcap=no],
106 -[AC_MSG_RESULT(no); have_libpcap=no])
107 +[AC_MSG_RESULT(crosscompiling, assuming yes); have_libpcap=yes])
108  LIBS="$LIBS_OLD"
109  fi
110  
111 @@ -369,7 +380,7 @@
112    PCAP_DEPENDS=""
113    PCAP_CLEAN=""
114    PCAP_DIST_CLEAN=""
115 -  AC_DEFINE(HAVE_LIBPCAP)
116 +  AC_DEFINE(HAVE_LIBPCAP, 1, [Define if we have libpcap])
117  else
118    if test "${LIBPCAP_INC+set}" = "set"; then
119      LDFLAGS="-L$libpcapdir $_ldflags"
120 @@ -453,7 +464,7 @@
121                 [AC_MSG_RESULT(no); bsd_networking=no]);
122  if test $bsd_networking = yes; then
123  
124 -  AC_DEFINE(BSD_NETWORKING)
125 +  AC_DEFINE(BSD_NETWORKING, 1, [Define if we have bsd networking])
126    AC_MSG_CHECKING([ip_v in struct ip])
127    AC_TRY_COMPILE([#include <sys/types.h>
128  #include <netinet/in.h>
129 @@ -501,13 +512,14 @@
130          ac_cv_sockaddr_has_sa_len=yes,
131          ac_cv_sockaddr_has_sa_len=no))
132  if test $ac_cv_sockaddr_has_sa_len = yes ; then
133 -        AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
134 +        AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has a sa_len member])
135  fi
136  
137  dnl check endedness
138  AC_C_BIGENDIAN
139  
140  AC_MSG_CHECKING([if struct in_addr is a wacky huge structure (some Sun boxes)])
141 +AH_TEMPLATE([IN_ADDR_DEEPSTRUCT], [Define if struct in_addr is a wacky huge structure])
142  
143  AC_TRY_COMPILE([#include <netinet/in.h>], struct in_addr i; i._S_un._S_addr;, \
144                AC_DEFINE(IN_ADDR_DEEPSTRUCT) \
145 @@ -533,7 +545,7 @@
146          ac_cv_struct_icmp_exists=yes,
147          ac_cv_struct_icmp_exists=no))
148  if test $ac_cv_struct_icmp_exists = yes ; then
149 -        AC_DEFINE(HAVE_STRUCT_ICMP)
150 +        AC_DEFINE(HAVE_STRUCT_ICMP, 1, [Define if struct icmp exists])
151  fi
152  
153  AC_CACHE_CHECK(if struct ip exists, ac_cv_struct_ip_exists,
154 @@ -550,7 +562,7 @@
155          ac_cv_struct_ip_exists=yes,
156          ac_cv_struct_ip_exists=no))
157  if test $ac_cv_struct_ip_exists = yes ; then
158 -        AC_DEFINE(HAVE_STRUCT_IP)
159 +        AC_DEFINE(HAVE_STRUCT_IP, 1, [Define if struct ip exists])
160  fi
161  
162  AC_CACHE_CHECK(if struct ip has ip_sum member, ac_cv_ip_has_ip_sum,
163 @@ -568,7 +580,7 @@
164          ac_cv_ip_has_ip_sum=yes,
165          ac_cv_ip_has_ip_sum=no))
166  if test $ac_cv_ip_has_ip_sum = yes ; then
167 -        AC_DEFINE(HAVE_IP_IP_SUM)
168 +        AC_DEFINE(HAVE_IP_IP_SUM, 1, [Define if struct ip has ip_sum member])
169  fi
170  
171  
172 @@ -589,7 +601,7 @@
173  extern "C" int usleep (unsigned int);],[
174  usleep (200);],[
175    AC_MSG_RESULT(yes)
176 -  AC_DEFINE(NEED_USLEEP_PROTO)],
177 +  AC_DEFINE(NEED_USLEEP_PROTO, 1, [Define if we need a usleep prototype])],
178    AC_MSG_RESULT(not found))])
179  AC_LANG_POP(C++)
180  
181 @@ -607,7 +619,7 @@
182  char buffer[200];
183  gethostname (buffer, 200);],[
184    AC_MSG_RESULT(yes)
185 -  AC_DEFINE(NEED_GETHOSTNAME_PROTO)],
186 +  AC_DEFINE(NEED_GETHOSTNAME_PROTO, 1, [Define if we need a gethostname prototype])],
187    AC_MSG_RESULT(not found))])
188  AC_LANG_POP(C++)
189  
190 @@ -615,6 +627,8 @@
191  
192  dnl AC_CHECK_FUNCS(gethostname gettimeofday select socket strdup strstr )
193  
194 +NBASEDIR="nbase"
195 +use_included_nbase=no
196  AC_ARG_WITH(libnbase,
197  [  --with-libnbase=DIR     Look for nbase include/libs in DIR],
198  [  case "$with_libnbase" in
199 @@ -624,7 +638,7 @@
200      NBASEDIR="$with_libnbase"
201      ;;
202    esac],
203 -NBASEDIR="nbase"
204 +  use_included_nbase=yes
205  )
206  
207  LDFLAGS="$LDFLAGS -L$NBASEDIR"
208 @@ -634,6 +648,7 @@
209  AC_SUBST(NBASEDIR)
210  AC_SUBST(LIBNBASE_LIBS)
211  
212 +use_included_nsock=no
213  NSOCKDIR="nsock"
214  AC_ARG_WITH(libnsock,
215  [  --with-libnsock=DIR     Compile and link to libnsock in DIR],
216 @@ -643,7 +658,8 @@
217    *)
218      NSOCKDIR="$with_nsock"
219      ;;
220 -  esac]
221 +  esac],
222 +    use_included_nsock=yes
223  )
224  
225  LDFLAGS="$LDFLAGS -L$NSOCKDIR/src/"
226 @@ -653,20 +669,11 @@
227  AC_SUBST(NSOCKDIR)
228  AC_SUBST(LIBNSOCK_LIBS)
229  
230 -nmap_cfg_subdirs="$nmap_cfg_subdirs $NSOCKDIR/src"
231 -
232  dnl I need to configure nmapfe and libpcap here since the user might
233  dnl have specified special options (such as --prefix )
234  dnl
235  dnl But I only have to configure libpcap if I am going to use it
236  
237 -if test $have_libpcap = yes ; then
238 -        nmap_cfg_subdirs="$NBASEDIR $nmap_cfg_subdirs"
239 -else
240 -        nmap_cfg_subdirs="$NBASEDIR $libpcapdir $nmap_cfg_subdirs"
241 -fi
242 -
243 -
244  if test "${with_nmapfe}" = "yes"; then
245  dnl Check for GTK+
246  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
247 @@ -692,7 +699,7 @@
248                   You need at least version $GTK_MINVERSION.\n Subdir X-windows \
249                   will not be made])
250    else
251 -    nmap_cfg_subdirs="$nmap_cfg_subdirs nmapfe"
252 +    AC_CONFIG_SUBDIRS(nmapfe)
253      dnl Maybe also define the flags to compile and link GTK+
254      dnl GTK_CXXFLAGS=`gtk-config --cflags`
255      dnl GTK_LIBS=`gtk-config --libs`
256 @@ -703,7 +710,17 @@
257  fi
258  
259  dnl all hell broke loose when the variable was named $subdirs
260 -AC_CONFIG_SUBDIRS( $nmap_cfg_subdirs )
261 +if test $have_libpcap != yes ; then
262 +  AC_CONFIG_SUBDIRS(libpcap-possiblymodified)
263 +fi
264 +
265 +if test "$use_included_nbase" = yes; then
266 +  AC_CONFIG_SUBDIRS(nbase)
267 +fi
268 +
269 +if test "$use_included_nsock" = "yes"; then
270 +  AC_CONFIG_SUBDIRS(nsock/src)
271 +fi
272  
273  dnl Configure libpcap if we need to since a lot of lamers don't
274  dnl already have it installed ...
275 --- /dev/null
276 +++ nmap-3.77/nbase/acinclude.m4
277 @@ -0,0 +1,223 @@
278 +dnl -----------------------------------------------------------------
279 +dnl Nbase local macros
280 +dnl $Id: configlocal.m4,v 1.3 2002/09/08 22:56:01 fyodor Exp $
281 +dnl -----------------------------------------------------------------
282 +
283 +dnl
284 +dnl check for working getaddrinfo().  This check is from 
285 +dnl Apache 2.0.40
286 +dnl
287 +dnl Note that if the system doesn't have gai_strerror(), we
288 +dnl can't use getaddrinfo() because we can't get strings
289 +dnl describing the error codes.
290 +dnl
291 +AC_DEFUN([APR_CHECK_WORKING_GETADDRINFO], [
292 +  AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
293 +  AC_TRY_RUN( [
294 +#ifdef HAVE_NETDB_H
295 +#include <netdb.h>
296 +#endif
297 +#ifdef HAVE_STRING_H
298 +#include <string.h>
299 +#endif
300 +#ifdef HAVE_SYS_TYPES_H
301 +#include <sys/types.h>
302 +#endif
303 +#ifdef HAVE_SYS_SOCKET_H
304 +#include <sys/socket.h>
305 +#endif
306 +
307 +void main(void) {
308 +    struct addrinfo hints, *ai;
309 +    int error;
310 +
311 +    memset(&hints, 0, sizeof(hints));
312 +    hints.ai_family = AF_UNSPEC;
313 +    hints.ai_socktype = SOCK_STREAM;
314 +    error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
315 +    if (error) {
316 +        exit(1);
317 +    }
318 +    if (ai->ai_addr->sa_family != AF_INET) {
319 +        exit(1);
320 +    }
321 +    exit(0);
322 +}
323 +],[
324 +  ac_cv_working_getaddrinfo="yes"
325 +],[
326 +  ac_cv_working_getaddrinfo="no"
327 +],[
328 +  ac_cv_working_getaddrinfo="yes"
329 +])])
330 +if test "$ac_cv_working_getaddrinfo" = "yes"; then
331 +  if test "$ac_cv_func_gai_strerror" != "yes"; then
332 +    ac_cv_working_getaddrinfo="no"
333 +  else
334 +    AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR])
335 +  fi
336 +fi
337 +])
338 +
339 +dnl
340 +dnl check for working getnameinfo() -- from Apache 2.0.40
341 +dnl
342 +AC_DEFUN([APR_CHECK_WORKING_GETNAMEINFO],[
343 +  AC_CACHE_CHECK(for working getnameinfo, ac_cv_working_getnameinfo,[
344 +  AC_TRY_RUN( [
345 +#ifdef HAVE_NETDB_H
346 +#include <netdb.h>
347 +#endif
348 +#ifdef HAVE_STRING_H
349 +#include <string.h>
350 +#endif
351 +#ifdef HAVE_SYS_TYPES_H
352 +#include <sys/types.h>
353 +#endif
354 +#ifdef HAVE_SYS_SOCKET_H
355 +#include <sys/socket.h>
356 +#endif
357 +#ifdef HAVE_NETINET_IN_H
358 +#include <netinet/in.h>
359 +#endif
360 +
361 +void main(void) {
362 +    struct sockaddr_in sa;
363 +    char hbuf[256];
364 +    int error;
365 +
366 +    sa.sin_family = AF_INET;
367 +    sa.sin_port = 0;
368 +    sa.sin_addr.s_addr = inet_addr("127.0.0.1");
369 +#ifdef SIN6_LEN
370 +    sa.sin_len = sizeof(sa);
371 +#endif
372 +
373 +    error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa),
374 +                        hbuf, 256, NULL, 0,
375 +                        NI_NUMERICHOST);
376 +    if (error) {
377 +        exit(1);
378 +    } else {
379 +        exit(0);
380 +    }
381 +}
382 +],[
383 +  ac_cv_working_getnameinfo="yes"
384 +],[
385 +  ac_cv_working_getnameinfo="no"
386 +],[
387 +  ac_cv_working_getnameinfo="yes"
388 +])])
389 +if test "$ac_cv_working_getnameinfo" = "yes"; then
390 +  AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo exists])
391 +fi
392 +])
393 +
394 +AC_DEFUN([APR_CHECK_SOCKADDR_IN6],[
395 +AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[
396 +AC_TRY_COMPILE([
397 +#ifdef HAVE_SYS_TYPES_H
398 +#include <sys/types.h>
399 +#endif
400 +#ifdef HAVE_NETINET_IN_H
401 +#include <netinet/in.h>
402 +#endif
403 +],[
404 +struct sockaddr_in6 sa;
405 +],[
406 +    ac_cv_define_sockaddr_in6=yes
407 +],[
408 +    ac_cv_define_sockaddr_in6=no
409 +])
410 +])
411 +
412 +if test "$ac_cv_define_sockaddr_in6" = "yes"; then
413 +  have_sockaddr_in6=1
414 +  AC_DEFINE(HAVE_SOCKADDR_IN6, 1, [Define if we have sockaddr_in6])
415 +else
416 +  have_sockaddr_in6=0
417 +fi
418 +])
419 +
420 +AC_DEFUN([CHECK_AF_INET6_DEFINE],[
421 +AC_CACHE_CHECK(for AF_INET6 definition, ac_cv_define_af_inet6,[
422 +AC_TRY_COMPILE([
423 +#ifdef HAVE_SYS_TYPES_H
424 +#include <sys/types.h>
425 +#endif
426 +#ifdef HAVE_NETINET_IN_H
427 +#include <netinet/in.h>
428 +#endif
429 +#ifdef HAVE_SYS_SOCKET_H
430 +#include <sys/socket.h>
431 +#endif
432 +],[
433 +int af = AF_INET6;
434 +],[
435 +    ac_cv_define_af_inet6=yes
436 +],[
437 +    ac_cv_define_af_inet6=no
438 +])
439 +])
440 +
441 +if test "$ac_cv_define_af_inet6" = "yes"; then
442 +  have_af_inet6=1
443 +  AC_DEFINE(HAVE_AF_INET6, 1, [Define if we have AF_INET6])
444 +else
445 +  have_af_inet6=0
446 +fi
447 +])
448 +
449 +AC_DEFUN([APR_CHECK_SOCKADDR_STORAGE],[
450 +AC_CACHE_CHECK(for sockaddr_storage, ac_cv_define_sockaddr_storage,[
451 +AC_TRY_COMPILE([
452 +#ifdef HAVE_SYS_TYPES_H
453 +#include <sys/types.h>
454 +#endif
455 +#ifdef HAVE_SYS_SOCKET_H
456 +#include <sys/socket.h>
457 +#endif
458 +#ifdef HAVE_NETINET_IN_H
459 +#include <netinet/in.h>
460 +#endif
461 +],[
462 +struct sockaddr_storage sa;
463 +],[
464 +    ac_cv_define_sockaddr_storage=yes
465 +],[
466 +    ac_cv_define_sockaddr_storage=no
467 +])
468 +])
469 +
470 +if test "$ac_cv_define_sockaddr_storage" = "yes"; then
471 +  have_sockaddr_storage=1
472 +  AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [Define if we have struct sockaddr_storage])
473 +else
474 +  have_sockaddr_storage=0
475 +fi
476 +])
477 +
478 +AC_DEFUN([AC_C___ATTRIBUTE__], [
479 +AC_MSG_CHECKING(for __attribute__)
480 +AC_CACHE_VAL(ac_cv___attribute__, [
481 +AC_TRY_COMPILE([
482 +#include <stdlib.h>
483 +],
484 +[
485 +static void foo(void) __attribute__ ((noreturn));
486 +
487 +static void
488 +foo(void)
489 +{
490 +  exit(1);
491 +}
492 +],
493 +ac_cv___attribute__=yes,
494 +ac_cv___attribute__=no)])
495 +if test "$ac_cv___attribute__" = "yes"; then
496 +  AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
497 +fi
498 +AC_MSG_RESULT($ac_cv___attribute__)
499 +])
500 +
501 --- nmap-3.77/nbase/configure.ac~autofoo.patch
502 +++ nmap-3.77/nbase/configure.ac
503 @@ -7,9 +7,6 @@
504  # Require autoconf 2.13
505  AC_PREREQ(2.13)
506  
507 -# Include my own macros
508 -sinclude(configlocal.m4)
509 -
510  AC_INIT(nbase.h)
511  
512  AC_ARG_WITH(localdirs,
513 @@ -36,6 +33,7 @@
514  
515  dnl use config.h instad of -D macros
516  AC_CONFIG_HEADER(nbase_config.h)
517 +AC_CONFIG_AUX_DIR(..)
518  
519  dnl Checks for programs.
520  AC_PROG_CC
521 @@ -46,6 +44,7 @@
522  AC_PROG_RANLIB
523  dnl AC_PROG_INSTALL
524  dnl AC_PATH_PROG(MAKEDEPEND, makedepend)
525 +AC_PATH_PROG(RANLIB, ranlib)
526  
527  AC_SUBST(COMPAT_OBJS)
528  AC_SUBST(COMPAT_SRCS)
529 @@ -55,6 +54,17 @@
530  
531  linux=no
532  
533 +AH_TEMPLATE([NETBSD], [Define if building for a netbsd host])
534 +AH_TEMPLATE([LINUX], [Define if building for a linux host])
535 +AH_TEMPLATE([OPENBSD], [Define if building for an openbsd host])
536 +AH_TEMPLATE([SOLARIS], [Define if building for a solaris host])
537 +AH_TEMPLATE([IRIX], [Define if building for an irix host])
538 +AH_TEMPLATE([BSDI], [Define if building for a bsdi host])
539 +AH_TEMPLATE([FREEBSD], [Define if building for a freebsd host])
540 +AH_TEMPLATE([SUNOS], [Define if building for a sunos host])
541 +AH_TEMPLATE([SPRINTF_RETURNS_STRING], [Define if sprintf() returns char *])
542 +AH_TEMPLATE([STUPID_SOLARIS_CHECKSUM_BUG], [Define to handle the solaris checksum bug])
543 +AH_TEMPLATE([PCAP_TIMEOUT_IGNORED], [Does the pcap library obey the timeout])
544  case "$host" in
545    *-netbsd* | *-knetbsd*-gnu)
546      AC_DEFINE(NETBSD)
547 @@ -157,7 +167,7 @@
548  dnl equiv to '#define inline' to 'inline', '__inline__', '__inline' or ''
549  AC_C_INLINE
550  if test -n "$sgi_cc"; then
551 -   AC_DEFINE(inline, )
552 +   AC_DEFINE(inline, ,[Define this if we need to define inline ourselves])
553  fi
554  AC_C___ATTRIBUTE__
555  
556 @@ -259,7 +269,7 @@
557  fi
558  
559  if test "$use_openssl" = "yes"; then
560 -  AC_DEFINE(HAVE_OPENSSL)
561 +  AC_DEFINE(HAVE_OPENSSL, 1, [Define this if we have openssl])
562  fi
563  
564  
565 @@ -319,8 +329,7 @@
566  fi
567  
568  if test "$have_ipv6" = "1"; then
569 -  AC_DEFINE(HAVE_IPV6)
570 +  AC_DEFINE(HAVE_IPV6, 1, [Define this if we have ipv6 support])
571  fi
572  
573  AC_OUTPUT(Makefile)
574 -
575 --- /dev/null
576 +++ nmap-3.77/nmapfe/m4/gtk.m4
577 @@ -0,0 +1,194 @@
578 +# Configure paths for GTK+
579 +# Owen Taylor     97-11-3
580 +
581 +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
582 +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
583 +dnl
584 +AC_DEFUN(AM_PATH_GTK,
585 +[dnl 
586 +dnl Get the cflags and libraries from the gtk-config script
587 +dnl
588 +AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
589 +            gtk_config_prefix="$withval", gtk_config_prefix="")
590 +AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
591 +            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
592 +AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
593 +                   , enable_gtktest=yes)
594 +
595 +  for module in . $4
596 +  do
597 +      case "$module" in
598 +         gthread) 
599 +             gtk_config_args="$gtk_config_args gthread"
600 +         ;;
601 +      esac
602 +  done
603 +
604 +  if test x$gtk_config_exec_prefix != x ; then
605 +     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
606 +     if test x${GTK_CONFIG+set} != xset ; then
607 +        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
608 +     fi
609 +  fi
610 +  if test x$gtk_config_prefix != x ; then
611 +     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
612 +     if test x${GTK_CONFIG+set} != xset ; then
613 +        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
614 +     fi
615 +  fi
616 +
617 +  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
618 +  min_gtk_version=ifelse([$1], ,0.99.7,$1)
619 +  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
620 +  no_gtk=""
621 +  if test "$GTK_CONFIG" = "no" ; then
622 +    no_gtk=yes
623 +  else
624 +    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
625 +    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
626 +    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
627 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
628 +    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
629 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
630 +    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
631 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
632 +    if test "x$enable_gtktest" = "xyes" ; then
633 +      ac_save_CFLAGS="$CFLAGS"
634 +      ac_save_LIBS="$LIBS"
635 +      CFLAGS="$CFLAGS $GTK_CFLAGS"
636 +      LIBS="$GTK_LIBS $LIBS"
637 +dnl
638 +dnl Now check if the installed GTK is sufficiently new. (Also sanity
639 +dnl checks the results of gtk-config to some extent
640 +dnl
641 +      rm -f conf.gtktest
642 +      AC_TRY_RUN([
643 +#include <gtk/gtk.h>
644 +#include <stdio.h>
645 +#include <stdlib.h>
646 +
647 +int 
648 +main ()
649 +{
650 +  int major, minor, micro;
651 +  char *tmp_version;
652 +
653 +  system ("touch conf.gtktest");
654 +
655 +  /* HP/UX 9 (%@#!) writes to sscanf strings */
656 +  tmp_version = g_strdup("$min_gtk_version");
657 +  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
658 +     printf("%s, bad version string\n", "$min_gtk_version");
659 +     exit(1);
660 +   }
661 +
662 +  if ((gtk_major_version != $gtk_config_major_version) ||
663 +      (gtk_minor_version != $gtk_config_minor_version) ||
664 +      (gtk_micro_version != $gtk_config_micro_version))
665 +    {
666 +      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
667 +             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
668 +             gtk_major_version, gtk_minor_version, gtk_micro_version);
669 +      printf ("*** was found! If gtk-config was correct, then it is best\n");
670 +      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
671 +      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
672 +      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
673 +      printf("*** required on your system.\n");
674 +      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
675 +      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
676 +      printf("*** before re-running configure\n");
677 +    } 
678 +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
679 +  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
680 +          (gtk_minor_version != GTK_MINOR_VERSION) ||
681 +           (gtk_micro_version != GTK_MICRO_VERSION))
682 +    {
683 +      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
684 +            GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
685 +      printf("*** library (version %d.%d.%d)\n",
686 +            gtk_major_version, gtk_minor_version, gtk_micro_version);
687 +    }
688 +#endif /* defined (GTK_MAJOR_VERSION) ... */
689 +  else
690 +    {
691 +      if ((gtk_major_version > major) ||
692 +        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
693 +        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
694 +      {
695 +        return 0;
696 +       }
697 +     else
698 +      {
699 +        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
700 +               gtk_major_version, gtk_minor_version, gtk_micro_version);
701 +        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
702 +              major, minor, micro);
703 +        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
704 +        printf("***\n");
705 +        printf("*** If you have already installed a sufficiently new version, this error\n");
706 +        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
707 +        printf("*** being found. The easiest way to fix this is to remove the old version\n");
708 +        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
709 +        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
710 +        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
711 +        printf("*** so that the correct libraries are found at run-time))\n");
712 +      }
713 +    }
714 +  return 1;
715 +}
716 +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
717 +       CFLAGS="$ac_save_CFLAGS"
718 +       LIBS="$ac_save_LIBS"
719 +     fi
720 +  fi
721 +  if test "x$no_gtk" = x ; then
722 +     AC_MSG_RESULT(yes)
723 +     ifelse([$2], , :, [$2])     
724 +  else
725 +     AC_MSG_RESULT(no)
726 +     if test "$GTK_CONFIG" = "no" ; then
727 +       echo "*** The gtk-config script installed by GTK could not be found"
728 +       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
729 +       echo "*** your path, or set the GTK_CONFIG environment variable to the"
730 +       echo "*** full path to gtk-config."
731 +     else
732 +       if test -f conf.gtktest ; then
733 +        :
734 +       else
735 +          echo "*** Could not run GTK test program, checking why..."
736 +          CFLAGS="$CFLAGS $GTK_CFLAGS"
737 +          LIBS="$LIBS $GTK_LIBS"
738 +          AC_TRY_LINK([
739 +#include <gtk/gtk.h>
740 +#include <stdio.h>
741 +],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
742 +        [ echo "*** The test program compiled, but did not run. This usually means"
743 +          echo "*** that the run-time linker is not finding GTK or finding the wrong"
744 +          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
745 +          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
746 +          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
747 +          echo "*** is required on your system"
748 +         echo "***"
749 +          echo "*** If you have an old version installed, it is best to remove it, although"
750 +          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
751 +          echo "***"
752 +          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
753 +          echo "*** came with the system with the command"
754 +          echo "***"
755 +          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
756 +        [ echo "*** The test program failed to compile or link. See the file config.log for the"
757 +          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
758 +          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
759 +          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
760 +          CFLAGS="$ac_save_CFLAGS"
761 +          LIBS="$ac_save_LIBS"
762 +       fi
763 +     fi
764 +     GTK_CFLAGS=""
765 +     GTK_LIBS=""
766 +     ifelse([$3], , :, [$3])
767 +  fi
768 +  AC_SUBST(GTK_CFLAGS)
769 +  AC_SUBST(GTK_LIBS)
770 +  rm -f conf.gtktest
771 +])
772 --- nmap-3.77/nsock/src/configure.ac~autofoo.patch
773 +++ nmap-3.77/nsock/src/configure.ac
774 @@ -137,7 +137,7 @@
775  fi
776  
777  if test "$use_openssl" = "yes"; then
778 -  AC_DEFINE(HAVE_OPENSSL)
779 +  AC_DEFINE(HAVE_OPENSSL, 1, [Define this if we have openssl])
780  fi
781  
782  
783 @@ -151,7 +151,7 @@
784                 [AC_MSG_RESULT(no); bsd_networking=no]);
785  if test $bsd_networking = yes; then
786  
787 -  AC_DEFINE(BSD_NETWORKING)
788 +  AC_DEFINE(BSD_NETWORKING, 1, [Define if we have bsd networking])
789    AC_MSG_CHECKING([ip_v in struct ip])
790    AC_TRY_COMPILE([#include <sys/types.h>
791  #include <netinet/in.h>
792 @@ -199,7 +199,7 @@
793          ac_cv_sockaddr_has_sa_len=yes,
794          ac_cv_sockaddr_has_sa_len=no))
795  if test $ac_cv_sockaddr_has_sa_len = yes ; then
796 -        AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
797 +        AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has a sa_len member])
798  fi
799  
800  AC_CACHE_CHECK(if struct icmp exists, ac_cv_struct_icmp_exists,
801 @@ -217,7 +217,7 @@
802          ac_cv_struct_icmp_exists=yes,
803          ac_cv_struct_icmp_exists=no))
804  if test $ac_cv_struct_icmp_exists = yes ; then
805 -        AC_DEFINE(HAVE_STRUCT_ICMP)
806 +        AC_DEFINE(HAVE_STRUCT_ICMP, 1, [Define if struct icmp exists])
807  fi
808  
809  AC_CACHE_CHECK(if struct ip exists, ac_cv_struct_ip_exists,
810 @@ -234,7 +234,7 @@
811          ac_cv_struct_ip_exists=yes,
812          ac_cv_struct_ip_exists=no))
813  if test $ac_cv_struct_ip_exists = yes ; then
814 -        AC_DEFINE(HAVE_STRUCT_IP)
815 +        AC_DEFINE(HAVE_STRUCT_IP, 1, [Define if struct ip exists])
816  fi
817  
818  AC_CACHE_CHECK(if struct ip has ip_sum member, ac_cv_ip_has_ip_sum,
819 @@ -252,7 +252,7 @@
820          ac_cv_ip_has_ip_sum=yes,
821          ac_cv_ip_has_ip_sum=no))
822  if test $ac_cv_ip_has_ip_sum = yes ; then
823 -        AC_DEFINE(HAVE_IP_IP_SUM)
824 +        AC_DEFINE(HAVE_IP_IP_SUM, 1, [Define if struct ip has ip_sum member])
825  fi
826  
827  AC_OUTPUT(Makefile)