* Re: [Powertop] [PATCH v3 02/15] configure: prefer AS_IF macro rather than shell if statement
@ 2014-10-14 23:29 Joe Konno
0 siblings, 0 replies; 2+ messages in thread
From: Joe Konno @ 2014-10-14 23:29 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 2065 bytes --]
LGTM.
Reviewed-By: Joe Konno <joe.konno(a)intel.com>
On 09/07/2014 02:27 PM, Sami Kerola wrote:
> Jumping in between shell and m4 syntaxes makes reading the code more
> difficult, so stick to m4 when ever possible.
>
> Signed-off-by: Sami Kerola <kerolasa(a)iki.fi>
> ---
> configure.ac | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index b41cfb3..4991d97 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -108,23 +108,25 @@ dnl libnl-2 provides only libnl-2.0.pc file, so we check for separate
> dnl libnl-genl-3.0.pc pkg-config file just for libnl-3.0 case.
> PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [has_libnl_ver=3], [
> PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
> - PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [has_libnl_ver=0])])])
> -if (test "$has_libnl_ver" -eq 0); then
> - AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
> -fi
> -if (test "$has_libnl_ver" -gt 1); then
> + PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [has_libnl_ver=0])
> + ])
> +])
> +AS_IF([test "$has_libnl_ver" -eq 0], [
> + AC_MSG_ERROR([libnl and libnl-genl are required but were not found])
> +])
> +AS_IF([test "$has_libnl_ver" -gt 1], [
> AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
> -fi
> +])
>
> -if (test "$has_libpci" -eq 0); then
> - AC_DEFINE([HAVE_NO_PCI],[1],[Define if pci is not supported])
> +AS_IF([test "$has_libpci" -eq 0], [
> + AC_DEFINE([HAVE_NO_PCI], [1], [Define if pci is not supported])
> AC_MSG_WARN([
> ************* LIBPCI SUPPORT NOT CONFIGURED**************
> If you need or want pci support, please install libpci
> and re-configure PowerTOP.
> *********************************************************
> ])
> -fi
> +])
>
> AC_SEARCH_LIBS([pthread_create], [pthread], [], [
> AC_MSG_ERROR([libpthread is required but was not found])
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Powertop] [PATCH v3 02/15] configure: prefer AS_IF macro rather than shell if statement
@ 2014-09-07 21:27 Sami Kerola
0 siblings, 0 replies; 2+ messages in thread
From: Sami Kerola @ 2014-09-07 21:27 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]
Jumping in between shell and m4 syntaxes makes reading the code more
difficult, so stick to m4 when ever possible.
Signed-off-by: Sami Kerola <kerolasa(a)iki.fi>
---
configure.ac | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index b41cfb3..4991d97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,23 +108,25 @@ dnl libnl-2 provides only libnl-2.0.pc file, so we check for separate
dnl libnl-genl-3.0.pc pkg-config file just for libnl-3.0 case.
PKG_CHECK_MODULES([LIBNL], [libnl-3.0 >= 3.0 libnl-genl-3.0 >= 3.0], [has_libnl_ver=3], [
PKG_CHECK_MODULES([LIBNL], [libnl-2.0 >= 2.0], [has_libnl_ver=2], [
- PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [has_libnl_ver=0])])])
-if (test "$has_libnl_ver" -eq 0); then
- AC_MSG_ERROR(libnl and libnl-genl are required but were not found)
-fi
-if (test "$has_libnl_ver" -gt 1); then
+ PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [has_libnl_ver=0])
+ ])
+])
+AS_IF([test "$has_libnl_ver" -eq 0], [
+ AC_MSG_ERROR([libnl and libnl-genl are required but were not found])
+])
+AS_IF([test "$has_libnl_ver" -gt 1], [
AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
-fi
+])
-if (test "$has_libpci" -eq 0); then
- AC_DEFINE([HAVE_NO_PCI],[1],[Define if pci is not supported])
+AS_IF([test "$has_libpci" -eq 0], [
+ AC_DEFINE([HAVE_NO_PCI], [1], [Define if pci is not supported])
AC_MSG_WARN([
************* LIBPCI SUPPORT NOT CONFIGURED**************
If you need or want pci support, please install libpci
and re-configure PowerTOP.
*********************************************************
])
-fi
+])
AC_SEARCH_LIBS([pthread_create], [pthread], [], [
AC_MSG_ERROR([libpthread is required but was not found])
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-14 23:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-14 23:29 [Powertop] [PATCH v3 02/15] configure: prefer AS_IF macro rather than shell if statement Joe Konno
-- strict thread matches above, loose matches on Subject: below --
2014-09-07 21:27 Sami Kerola
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.