🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Francois Pinard Wed, 19 Aug 1992 17:55
Autoconf and duplicated function tests
#674
Author: Francois Pinard
Date: Wed, 19 Aug 1992 17:55
31 lines
1556 bytes
Hi, people.  In one application, my configure.in contains:

	AC_HAVE_FUNCS(strstr)
	AC_REPLACE_FUNCS(strstr)

I wonder if the double check generated in configure by autoconf could
be avoided.  Once AC_HAVE_FUNCS knows for some function, the test does
not need to be done again for AC_REPLACE_FUNCS.

Here is the logic behind this particular usage.  The AC_REPLACE_FUNCS
is for providing a replacement strstr if the standard library does not
contain it, it just plays with the Makefile variable LIBOBJS.  The
AC_HAVE_FUNCS determination is transmitted, via DEFS, to the module
calling strstr, which uses it the following way:

	#ifdef USG
	#include <string.h>
	#else
	#include <strings.h>
	#endif
	#ifndef HAVE_STRSTR
	const char *strstr ();
	#endif

If the system already offers strstr, <string.h> or <strings.h> will
declare it, and my own definition will fatally conflict.

-- 
Franc,ois Pinard        ``Vivement GNU!''        pinard@iro.umontreal.ca
(514) 588-4656                                    ...!uunet!iros1!pinard
Consider joining the League for Programming Freedom.  Email for details!
Re: Autoconf and duplicated function tests
#686
Author: Roland McGrath
Date: Thu, 20 Aug 1992 08:18
15 lines
897 bytes
> 	#ifdef USG
> 	#include <string.h>
> 	#else
> 	#include <strings.h>
> 	#endif
> 	#ifndef HAVE_STRSTR
> 	const char *strstr ();
> 	#endif
> 
> If the system already offers strstr, <string.h> or <strings.h> will
> declare it, and my own definition will fatally conflict.

That is only because your declaration is wrong.  The correct declaration,
"char *strstr ();" should not conflict with a correct prototype in
<string.h>.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads