Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Cc: linux-mtd@lists.infradead.org, richard@sigma-star.at
Subject: Re: [PATCH] mtd-utils: Add configure switches to disable jffsX or ubifs tools
Date: Thu, 22 Dec 2016 10:19:09 +0100	[thread overview]
Message-ID: <20161222101909.3a386438@free-electrons.com> (raw)
In-Reply-To: <20161221155412.29706-1-david.oberhollenzer@sigma-star.at>

Hello,

On Wed, 21 Dec 2016 16:54:12 +0100, David Oberhollenzer wrote:

> +AC_ARG_WITH([jffs],
> +	[AS_HELP_STRING([--without-jffs], [Disable jffsX utilities])],
> +	[case "${withval}" in
> +	yes) AM_CONDITIONAL([BUILD_JFFSX], [true]) ;;
> +	no)  AM_CONDITIONAL([BUILD_JFFSX], [false]) ;;
> +	*) AC_MSG_ERROR([bad value ${withval} for --without-jffs]) ;;
> +	esac],
> +	[AM_CONDITIONAL([BUILD_JFFSX], [true])])
> +
> +AC_ARG_WITH([ubifs],
> +	[AS_HELP_STRING([--without-ubifs], [Disable ubifs utilities])],
> +	[case "${withval}" in
> +	yes) AM_CONDITIONAL([BUILD_UBIFS], [true]) ;;
> +	no)  AM_CONDITIONAL([BUILD_UBIFS], [false]) ;;
> +	*) AC_MSG_ERROR([bad value ${withval} for --without-ubifs]) ;;
> +	esac],
> +	[AM_CONDITIONAL([BUILD_UBIFS], [true])])

If the only two correct values are "yes" or "no", then you should use
AC_ARG_ENABLE() and not AC_ARG_WITH().

Also, I believe a much more autoconf-ish way of writing this is:

AC_ARG_ENABLE([jffs],
	[AS_HELP_STRING([--without-jffs], [Disable jffsX utilities])],
	[], [enable_jffs=yes])

if "${enable_jffs}" = "yes" ; then
	need_uuid="yes"
	need_zlib="yes"
	need_lzo="yes"
fi

Indeed, using AM_CONDITIONAL() is useful to assign automake variable.
Here, BUILD_JFFS and BUILD_UBIFS are apparently only used within the
configure.ac, so using AM_CONDITIONAL() is useless.

Best regards,

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

  parent reply	other threads:[~2016-12-22  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 15:54 [PATCH] mtd-utils: Add configure switches to disable jffsX or ubifs tools David Oberhollenzer
2016-12-21 22:30 ` Richard Weinberger
2016-12-22  9:19 ` Thomas Petazzoni [this message]
2016-12-22  9:27   ` David Oberhollenzer
2016-12-22  9:34     ` 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=20161222101909.3a386438@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=david.oberhollenzer@sigma-star.at \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@sigma-star.at \
    /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