From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50133 invoked by alias); 30 Nov 2015 15:23:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 50111 invoked by uid 89); 30 Nov 2015 15:23:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 30 Nov 2015 15:23:06 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 0137CAAC; Mon, 30 Nov 2015 15:23:04 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAUFN3RK028370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Nov 2015 10:23:04 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id tAUFN1Z5027976; Mon, 30 Nov 2015 16:23:02 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id tAUFN06K027975; Mon, 30 Nov 2015 16:23:00 +0100 Date: Mon, 30 Nov 2015 15:37:00 -0000 From: Jakub Jelinek To: Aleksander Ivanyushenko Cc: kirill.yukhin@gmail.com, iverbin@gmail.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH 3/4] Add libgomp plugin for Intel MIC Message-ID: <20151130152300.GF5675@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20151111145615.GA4807@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151111145615.GA4807@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg03492.txt.bz2 On Wed, Nov 11, 2015 at 05:56:15PM +0300, Aleksander Ivanyushenko wrote: > diff --git a/configure.ac b/configure.ac > index 9241261..b997646 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -494,6 +494,18 @@ else > fi]) > AC_SUBST(extra_liboffloadmic_configure_flags) > > +# Intelmic and intelmicemul require xxd or python. > +case "${target}" in > + *-intelmic-* | *-intelmicemul-*) > + AC_CHECK_PROG(xxd_present, xxd, "yes", "no") > + AC_CHECK_PROG(python2_present, python2, "yes", "no") > + AC_CHECK_PROG(python3_present, python3, "yes", "no") > + if test "$xxd_present$python2_present$python3_present" = "nonono"; then > + AC_MSG_ERROR([cannot find neither xxd nor python]) > + fi > + ;; > +esac Why here? I'd do something like that only in liboffloadmic/plugin/configure.ac. Furthermore, it is inconsistent with what you actually use in liboffloadmic/plugin (where you look only for python and above you only look for python[23]). > @@ -73,7 +75,7 @@ main_target_image.h: offload_target_main > @echo "};" >> $@ > @echo "extern \"C\" const MainTargetImage main_target_image = {" >> $@ > @echo " image_size, \"offload_target_main\"," >> $@ > - @cat $< | xxd -include >> $@ > + @if test "x$(xxd_path)" != "xno"; then cat $< | $(xxd_path) -include >> $@; else $(python_path) $(XXD_PY) $< >> $@; fi; > @echo "};" >> $@ I'd prefer to use $(XXD) and $(PYTHON) instead of $(xxd_path) and $(python_path), that is more consistent with dozens of other variables for other tools. > --- a/liboffloadmic/plugin/configure.ac > +++ b/liboffloadmic/plugin/configure.ac > @@ -124,6 +124,10 @@ case ${enable_version_specific_runtime_libs} in > ;; > esac > > +# Find path to xxd or python > +AC_PATH_PROG(xxd_path, xxd, "no") > +AC_PATH_PROG(python_path, python, "no") I'd use +AC_PATH_PROG(XXD, xxd, no) +AC_PATH_PROGS(PYTHON, python python2 python3, no) and then add the conditional AC_MSG_ERROR if x$XXD = xno && x$PYTHON = xno Jakub