home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / utils / bug / 1383 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.5 KB  |  46 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!icule.UUCP!pinard
  3. From: pinard@icule.UUCP (Francois Pinard)
  4. Subject: Autoconf and duplicated function tests
  5. Message-ID: <9208191755.AA05200@icule.UUCP>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: pinard@iro.umontreal.ca
  8. Organization: GNUs Not Usenet
  9. Distribution: gnu
  10. Date: Wed, 19 Aug 1992 17:55:44 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 32
  13.  
  14. Hi, people.  In one application, my configure.in contains:
  15.  
  16.     AC_HAVE_FUNCS(strstr)
  17.     AC_REPLACE_FUNCS(strstr)
  18.  
  19. I wonder if the double check generated in configure by autoconf could
  20. be avoided.  Once AC_HAVE_FUNCS knows for some function, the test does
  21. not need to be done again for AC_REPLACE_FUNCS.
  22.  
  23. Here is the logic behind this particular usage.  The AC_REPLACE_FUNCS
  24. is for providing a replacement strstr if the standard library does not
  25. contain it, it just plays with the Makefile variable LIBOBJS.  The
  26. AC_HAVE_FUNCS determination is transmitted, via DEFS, to the module
  27. calling strstr, which uses it the following way:
  28.  
  29.     #ifdef USG
  30.     #include <string.h>
  31.     #else
  32.     #include <strings.h>
  33.     #endif
  34.     #ifndef HAVE_STRSTR
  35.     const char *strstr ();
  36.     #endif
  37.  
  38. If the system already offers strstr, <string.h> or <strings.h> will
  39. declare it, and my own definition will fatally conflict.
  40.  
  41. -- 
  42. Franc,ois Pinard        ``Vivement GNU!''        pinard@iro.umontreal.ca
  43. (514) 588-4656                                    ...!uunet!iros1!pinard
  44. Consider joining the League for Programming Freedom.  Email for details!
  45.  
  46.