Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] bdwgc: add patch automatically detecting for NO_GETCONTEXT need
Date: Sun, 21 Dec 2014 23:17:31 +0100	[thread overview]
Message-ID: <20141221231731.7bdd1631@free-electrons.com> (raw)
In-Reply-To: <20141217213602.GC4293@free.fr>

Dear Yann E. MORIN,

On Wed, 17 Dec 2014 22:36:02 +0100, Yann E. MORIN wrote:

> The first I could find was GNU Pth (dead since 2006), and then ruby. And
> they both use that:
> 
>     AC_CHECK_FUNCS([getcontext setcontext])
> 
> which would automatically define HAVE_getcontext and HAVE_setcontext if
> they are available, but that's macro definitions, not available in
> configure, so we could not do the following:
> 
> > ++AC_MSG_RESULT($need_no_getcontext)
> > ++if test x$need_no_getcontext = xyes ; then
> > ++  CFLAGS="$CFLAGS -DNO_GETCONTEXT"
> > ++  CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"
> > ++fi

Well, you can do:

	AC_CHECK_FUNCS([getcontext], [has_getcontext=yes])
	AC_CHECK_FUNCS([setcontext], [has_setcontext=yes])

if test x${has_getcontext} != xyes -o x${has_setcontext} != xyes; then
	CFLAGS="$CFLAGS -DNO_GETCONTEXT"
	CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"
fi

You need two tests because AC_CHECK_FUNCS() runs the action-if-found if
at least one of the functions are found.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-12-21 22:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13 17:43 [Buildroot] [PATCH 1/3] bdwgc: add patch automatically detecting for NO_GETCONTEXT need Samuel Martin
2014-12-13 17:43 ` [Buildroot] [PATCH 2/3] package/guile: rename patch to new convention Samuel Martin
2014-12-21 22:11   ` Thomas Petazzoni
2014-12-13 17:43 ` [Buildroot] [PATCH 3/3] package/guile: fix build failure Samuel Martin
2014-12-24 19:03   ` Yann E. MORIN
2014-12-17 21:36 ` [Buildroot] [PATCH 1/3] bdwgc: add patch automatically detecting for NO_GETCONTEXT need Yann E. MORIN
2014-12-21 22:17   ` Thomas Petazzoni [this message]
2014-12-23 13:02     ` Yann E. MORIN
2014-12-23 22:18       ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141221231731.7bdd1631@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox