From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 03:32:47 2011 Received: (at submit) by debbugs.gnu.org; 13 Jun 2011 07:32:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW1de-0006HK-Nz for submit@debbugs.gnu.org; Mon, 13 Jun 2011 03:32:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW1dc-0006H7-RF for submit@debbugs.gnu.org; Mon, 13 Jun 2011 03:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW1dW-0005Vm-5D for submit@debbugs.gnu.org; Mon, 13 Jun 2011 03:32:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW1dV-0005VU-SG for submit@debbugs.gnu.org; Mon, 13 Jun 2011 03:32:37 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW1dT-0004HT-R9 for bug-automake@gnu.org; Mon, 13 Jun 2011 03:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW1dS-0005UY-6E for bug-automake@gnu.org; Mon, 13 Jun 2011 03:32:35 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:44447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW1dR-0005UN-Lo; Mon, 13 Jun 2011 03:32:33 -0400 Received: by wwi18 with SMTP id 18so2294693wwi.0 for ; Mon, 13 Jun 2011 00:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=nV6A5h3LwO/C0/syNP/IBQ1TbgK0N0LaL1fiGE6bKTI=; b=p+hdLO/kkWW6ZRfaWNYnQN5wNZZF3+GUYriKe1uHXkm4O2YxzTtMxR2lFeHjA21MeK w7w7ckVQkPN4gOBXxnyI1lnE5tqILWqj/Yn4JxbSSohoO5fbl74VBCiHqCrO8TlSaEFK FYQ5vW2N7v894D8uWH9Ga6v60/7RdeQVaUdTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=UmAgFRqcU2sRSSAX9UsyZyOOuTbt5Har8ZTPHEWkrn06nsSFZDlan6AKQAbD5irh79 4RLWaXx2592zRdEOzyXmvzoQuDWmaPPTtaYj/YKtmeHs8G3tYMVJsVZocg/lwqZ7xB9c KpyR97/0LoDoSd2ZrihHxWZ9KWkzB4mzZnlfA= Received: by 10.216.50.2 with SMTP id y2mr1862469web.77.1307950352501; Mon, 13 Jun 2011 00:32:32 -0700 (PDT) Received: from bigio.localnet (host155-99-dynamic.5-87-r.retail.telecomitalia.it [87.5.99.155]) by mx.google.com with ESMTPS id z66sm2714602weq.0.2011.06.13.00.32.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Jun 2011 00:32:31 -0700 (PDT) From: Stefano Lattarini To: bug-automake@gnu.org Subject: Re: flex header file Date: Mon, 13 Jun 2011 09:32:19 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <20110612224230.GV21380@xinutec.org> In-Reply-To: <20110612224230.GV21380@xinutec.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106130932.20332.stefano.lattarini@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Pippijn van Steenhoven X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) [adding bug-automake, so that we won't forgot about this report] On Monday 13 June 2011, Pippijn van Steenhoven wrote: > Hi, > > in some of my projects, I use (reentrant) flex with the header-file > option. This causes flex to generate a .h file in addition to the usual > lex.yy.c file. However, ylwrap doesn't know about this. What would be the > correct way to use flex with header files? > I see two ways out, not mutually exclusive: 1. Introduce a new automake option `no-ylwrap', instructing automake not to use ylwrap to process Yacc and Lex files; this should assume that bison and flex can be used, so that we know no problem with concurrent make will arise (we can use the `--output' option for both tools). Then you can manually add some rules about the header on your Makefile.am, without ylwrap getting in your way. 2. Improve ylwrap and automake Lex support to recognize the `--header' Lex option, similarly to what is done for the `-d' Yacc option, and emit code handling the header creation, dependencies, etc. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 05:26:03 2011 Received: (at control) by debbugs.gnu.org; 13 Jun 2011 09:26:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW3PG-0000W9-Oc for submit@debbugs.gnu.org; Mon, 13 Jun 2011 05:26:03 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW3PE-0000Vg-U6 for control@debbugs.gnu.org; Mon, 13 Jun 2011 05:26:01 -0400 Received: by wwb28 with SMTP id 28so4300425wwb.15 for ; Mon, 13 Jun 2011 02:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=Gq2NDO+UlRkrgwMSaRIp+0ktjJl4m/9dllqo5NgxLPE=; b=Z/crs/3DWT2ykU2eoxmYHwdceQHn5ExnLp6v2bAhga2pDIPcShGqCRejmCNohDiY6m V/WCGIlH+9gJBYJQ6vLZUTVEC4aaCMhX7KZCnTtuBiO1G3XMFfkqkiq17kcUZ4H5jyEH Rp5I7Kf6qmMxYpaPzjEOzELqaAquQAfklRNx4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=Le//LX/KOOcUYBbKHapEBnsyVJAii30454BPota/CVztYWRoM8st3ywcesFsr8NNYp Bq2jfUvj0ezZn9b+jfy121YTU/9W5rk+xzz4mFw0bNkJCZB0aS2dObN7TPNXvS5lzPYF Bi9GTfn4+fD5FY8aYCdEx4iboBh1NipD1S6wU= Received: by 10.227.202.205 with SMTP id ff13mr4971988wbb.102.1307957155096; Mon, 13 Jun 2011 02:25:55 -0700 (PDT) Received: from bigio.localnet (host155-99-dynamic.5-87-r.retail.telecomitalia.it [87.5.99.155]) by mx.google.com with ESMTPS id m8sm4093561wbh.45.2011.06.13.02.25.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Jun 2011 02:25:54 -0700 (PDT) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: automake bug#8844 is a wishlist Date: Mon, 13 Jun 2011 11:25:44 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106131125.45233.stefano.lattarini@gmail.com> X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.0 (----) severity 8844 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 26 12:43:10 2012 Received: (at control) by debbugs.gnu.org; 26 Aug 2012 16:43:10 +0000 Received: from localhost ([127.0.0.1]:50946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5fva-0007jN-4M for submit@debbugs.gnu.org; Sun, 26 Aug 2012 12:43:10 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:65475) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5fvY-0007jG-5k for control@debbugs.gnu.org; Sun, 26 Aug 2012 12:43:08 -0400 Received: by bkty12 with SMTP id y12so925772bkt.3 for ; Sun, 26 Aug 2012 09:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=HPcKxAmCyWB5y0t7vzhFc0AREY2XLQyZgGEeLzrInws=; b=M4KmeH7y4slSu+Afum1EYbmv+TpLXF1PbiptdPfUCY16OQA/8wswZgSWr5izCCfTZQ TDBzFrGgmTLgW8RcaJ8Ya3OfoGgz+EzZKWLF/cye4Lfts1OgD9LSPnmkJa2ey9IB3rOz ue4cnmjLI6eAar4h6HxuVgcmHNxW09Y0YjOFgrqqfG2GCmJtbD2glX4DvsnUGRd85zAf LmOH1dM8vAU88RUNpkUScX7LhdoTOXb+sUz5Wa0T/B3K3X82LEyDgbArvovd1oifQRIq oyoGth20yFwKitEL/Sr/da/iuG7oyfsbmEBZLdc1as3QiEw0dN3mnOzo8blgI45PaQS2 /eRA== Received: by 10.205.126.15 with SMTP id gu15mr3151206bkc.134.1345999339080; Sun, 26 Aug 2012 09:42:19 -0700 (PDT) Received: from [192.168.178.21] (host42-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.42]) by mx.google.com with ESMTPS id hs2sm9111044bkc.1.2012.08.26.09.42.16 (version=SSLv3 cipher=OTHER); Sun, 26 Aug 2012 09:42:17 -0700 (PDT) Message-ID: <503A51DF.8090506@gmail.com> Date: Sun, 26 Aug 2012 18:42:07 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) forcemerge 8844 9933 thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 26 12:48:44 2012 Received: (at control) by debbugs.gnu.org; 26 Aug 2012 16:48:44 +0000 Received: from localhost ([127.0.0.1]:50954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5g0y-0000GK-4j for submit@debbugs.gnu.org; Sun, 26 Aug 2012 12:48:44 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:49717) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5g0v-0000GD-Tt for control@debbugs.gnu.org; Sun, 26 Aug 2012 12:48:42 -0400 Received: by bkty12 with SMTP id y12so926937bkt.3 for ; Sun, 26 Aug 2012 09:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=5SShKcejfHIG5thcOu1dI71HSbdrxbr4/aXTyZT+TNE=; b=KYenmh0WW7ws9NWWycbQTHpTikEDPVzLzQ8nXbWdtegcUUouefMeO4aZQmHNgln2gw AqQ1HahJwju1HDvfiaAQoPpmhLGDqmRwP7tCTSZgWUFtq8KNm5/ISzxIe1QBPVsRLk8t 0iy+1g66pRIuxgbp9W7D48eTeBZqY4g3khmGMcKjSx9feHYEfbraO2vcdibkBluUeRvp XqnPrHIoQaGo6ovWfrb0gdMijbmufRXomJ65V0JVP4DqpJ6ONcQUrdGMdmhqedTvP7Vj MIYOeyoLLaKpq3sZ7O2ic3uG3aD/wDZ2GLGBI1ZhSd3nDIGU8CbbRvMGWtJ4c5CAAf1a BOXw== Received: by 10.204.145.82 with SMTP id c18mr3179579bkv.133.1345999673139; Sun, 26 Aug 2012 09:47:53 -0700 (PDT) Received: from [192.168.178.21] (host42-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.42]) by mx.google.com with ESMTPS id fu8sm9117009bkc.5.2012.08.26.09.47.51 (version=SSLv3 cipher=OTHER); Sun, 26 Aug 2012 09:47:52 -0700 (PDT) Message-ID: <503A5333.30605@gmail.com> Date: Sun, 26 Aug 2012 18:47:47 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: z Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 8844 - moreinfo tags 9933 - moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 26 13:32:50 2012 Received: (at 8844) by debbugs.gnu.org; 26 Aug 2012 17:32:50 +0000 Received: from localhost ([127.0.0.1]:50997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5ghd-0002uq-Tu for submit@debbugs.gnu.org; Sun, 26 Aug 2012 13:32:50 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:58887) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T5ghb-0002uc-6N; Sun, 26 Aug 2012 13:32:48 -0400 Received: by bkty12 with SMTP id y12so937415bkt.3 for ; Sun, 26 Aug 2012 10:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=TcawtLq4kO4LriWz1oWPGb33AJ/mWHGs3SwWkQhi6Uk=; b=Jf4VuEdBkIIuSLUfPG85nb1uW2M91lYQw+W43SpoWZ3eb4umkrobtUgYJIvmGf8rh9 RXcynCS6G10kdHu+PNvQBZZw1A1QOIfvtOogasBXJ1fnRX04uwxqaxuCVdadc5LjIL2u kYQ9i9wQdPtAIS/163INOI0sw5rMLmYchuZcF/U6v8AO6vN07Cng2doaoZnU/UQkBPQW p4Jfjb3aHh49VkGDLvXhL9O4rbeOT/sRPqGXUMAnGXip0IWg21cIHdmKu18FPAoo/i2s j2x6jb/JEOGY0CghO3LSh7OG78ksIoCYIa3fn8JHrjHM23oNB5Vuk7elKbSOwftvKDOK aBbg== Received: by 10.205.135.6 with SMTP id ie6mr3167577bkc.139.1346002317848; Sun, 26 Aug 2012 10:31:57 -0700 (PDT) Received: from [192.168.178.21] (host42-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.42]) by mx.google.com with ESMTPS id 14sm9163495bkq.12.2012.08.26.10.31.56 (version=SSLv3 cipher=OTHER); Sun, 26 Aug 2012 10:31:57 -0700 (PDT) Message-ID: <503A5D87.1050402@gmail.com> Date: Sun, 26 Aug 2012 19:31:51 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: "automake-patches@gnu.org" Subject: Flex header files References: <20110612224230.GV21380@xinutec.org> <201106130932.20332.stefano.lattarini@gmail.com> In-Reply-To: <201106130932.20332.stefano.lattarini@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8844 Cc: 9933@debbugs.gnu.org, Pippijn van Steenhoven , Bruce Korb , 8844@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) retitle 8844 Flex header files retitle 9933 Flex header files close 8844 close 9933 thanks Replying to two old bug reports: =========================================================================== > On Monday 13 June 2011, Pippijn van Steenhoven wrote: > >> Hi, >> >> in some of my projects, I use (reentrant) flex with the header-file >> option. This causes flex to generate a .h file in addition to the usual >> lex.yy.c file. However, ylwrap doesn't know about this. What would be the >> correct way to use flex with header files? >> > I see two ways out, not mutually exclusive: > > 1. Introduce a new automake option `no-ylwrap', instructing automake not > to use ylwrap to process Yacc and Lex files; this should assume that > bison and flex can be used, so that we know no problem with concurrent > make will arise (we can use the `--output' option for both tools). > Then you can manually add some rules about the header on your > Makefile.am, without ylwrap getting in your way. > > 2. Improve ylwrap and automake Lex support to recognize the `--header' > Lex option, similarly to what is done for the `-d' Yacc option, and > emit code handling the header creation, dependencies, etc. > > Regards, > Stefano > ========================================================================== On Tuesday 01 November 2011, Bruce Korb wrote: > > The bison accepts the option, --header-file=whatever.h > "ylwrap" is a wrapper script meant to canonicalize the invocation > of yacc and bison. True enough, if you use --header-file you > had better be using bison, but here is the problem: > > I am working on a project that will only build in a GNU tools environment. > Therefore, I know that the .l -> .c transformation tool is flex, not > POSIX lex. The code I am working with presumes that it can use this: > AM_LFLAGS = @LEX_FL@ --header-file=$(LEX_HEADER) -DYY_NO_INPUT=1 > So ylwrap fires off the flex program and it runs just fine, the tiny > problem is that it also removes the temporary directory before I can > salvage the generated header. This is inconvenient. > ========================================================================== These issues have been fixed thanks to the recent work done by Akim Demaille on ylwrap. I've checking in the test case below to ensure we won't regress on this use case. And I'm finally closing these bug reports. Thanks, Stefano -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<----- >From 9557b2f89263c8ffe00106430fca8758f6118438 Mon Sep 17 00:00:00 2001 Message-Id: <9557b2f89263c8ffe00106430fca8758f6118438.1346001914.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Sun, 26 Aug 2012 19:25:02 +0200 Subject: [PATCH] coverage: bugs #8844 and #9933 (already fixed by Akim's work on ylwrap) * t/flex-header.sh: New test, show that automake bug#8844 and have already been fixed by the recent-ish improvements to ylwrap (merged with commit v1.12.2-27-gec5cb49 of 2012-07-16, "Merge branch 'yacc-work' into maint"). * t/list-of-tests.mk: Update. Signed-off-by: Stefano Lattarini --- t/lex-header.sh | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/list-of-tests.mk | 1 + 2 files changed, 86 insertions(+) create mode 100755 t/lex-header.sh diff --git a/t/lex-header.sh b/t/lex-header.sh new file mode 100755 index 0000000..06c8561 --- /dev/null +++ b/t/lex-header.sh @@ -0,0 +1,85 @@ +#! /bin/sh +# Copyright (C) 2011-2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Automake lex support can work with flex '--header' option (see +# bugs #8844 and #9933). + +required='cc flex' +. ./defs || exit 1 + +cat >> configure.ac << 'END' +AC_PROG_CC +AC_PROG_LEX +AC_OUTPUT +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = lexer.l main.c mylex.h +foo_LFLAGS = --header-file=mylex.h +BUILT_SOURCES = mylex.h +# Recover from removal of header. +mylex.h: foo-lexer.c + test -f $@ || rm -f foo-lexer.c + test -f $@ || $(MAKE) $(AM_MAKEFLAGS) foo-lexer.c +END + +cat > lexer.l << 'END' +%option noyywrap +%{ +#define YY_NO_UNISTD_H 1 +%} +%% +"GOOD" return EOF; +. +%% +END + +cat > main.c <<'END' +#include "mylex.h" +int main (void) +{ + /* We don't use a 'while' loop here (like a real lexer would do) + to avoid possible hangs. */ + if (yylex () == EOF) + return 0; + else + return 1; +} +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure + +# Program should build and run. +$MAKE +if ! cross_compiling; then + echo GOOD | ./foo + echo BAD | ./foo && exit 1 + : For shells with busted 'set -e'. +fi + +# Recovering from header removal. +rm -f mylexer.h +$MAKE + +# Sanity check on distribution. +yl_distcheck + +: diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index f72a6fa..ff4448e 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -566,6 +566,7 @@ t/lex5.sh \ t/lexcpp.sh \ t/lexvpath.sh \ t/lex-subobj-nodep.sh \ +t/lex-header.sh \ t/lex-lib.sh \ t/lex-lib-external.sh \ t/lex-libobj.sh \ -- 1.7.12 From unknown Fri Jun 20 07:26:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 24 Sep 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator