Subject: Re: autoconf question
To: None <tech-pkg@NetBSD.org>
From: Bruce J.A. Nourish <firstname.lastname@example.org>
Date: 03/21/2004 09:37:28
On Sun, Mar 21, 2004 at 04:51:52PM +0100, Manuel Bouyer wrote:
> does anyone know how to check for a global variable with autoconf ?
> I need to patch a ./configure to check for
> extern char *__progname;
> AC_CHECK_DECL() is not enouth because usually this isn't defined in any header.
> It seems that there isn't a AC_CHECK_VAR().
Maybe some variant of the following (untested, probably needs tweaking):
[AC_CACHE_CHECK([for extern char *__progname],
[AC_TRY_LINK([char **p;], [extern char *__progname; p = &__progname;],
if test x"$cv_extern_char_progname" = xyes; then
AC_DEFINE(HAVE_PROGNAME, 1, [Define if your system provides extern char *__progname])
Bruce J.A. Nourish <email@example.com> http://bjan.freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org