[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to pass AC_ARG_ENABLE an argument
From: |
Dave Kirkby |
Subject: |
Re: How to pass AC_ARG_ENABLE an argument |
Date: |
Sun, 21 Dec 2003 08:25:28 +0000 (GMT) |
On Sun, 2003-12-21 at 03:55, Kevin P. Fleming wrote:
> Dave Kirkby wrote:
>
> > Hi,
> > I want to allow a configure script to be told the number of CPUs
> > to build some software for. The manual says 'AC_ARG_ENABLE' can read
an
> > agument, but I can't for the life of me see how to get it. I basically
> > want to have something AC_DEFINE CPUS to be an integer read whilst
> > configuring the program.
>
> The argument passed to --enable-foo will be in $enableval after the
> option is processed (although it's best to only refer to it in the code
> blocks you supply to AC_ARG_ENABLE).
You can safely use $enable_foo instead of $enableval, even outside of
blocks suppled to AC_ARG_ENABLE.
What am I doing wrong here then?
AC_ARG_ENABLE([cpus],
AC_HELP_STRING([--enable-CPUs=<N>], [use N CPUs in SMP mode
(default is 4)]),
AC_DEFINE([CPUS],$enable_cpus,[Enabled N CPUs in SMP mode]),
AC_DEFINE([CPUS],4,[Enabled the default number of CPUs in SMP
mode]))
where I'm trying to AC_DEFINE CPUs to be either
configure --enable-cpus=12
Then my config.h shows:
#define CPUS $enable_cpus
I've tried both $enableval and $enable_cpus, but I still can't seem to
#define CPUS to 12
Dr. David Kirkby PhD,
Senior Research Fellow,
Department of Medical Physics,
University College London,
11-20 Capper St, London, WC1E 6JA.
Tel: 020 7679 6408 Fax: 020 7679 6269
Internal telephone: ext 46408
e-mail address@hidden
Web page: http://www.medphys.ucl.ac.uk/~davek