From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Making gnulib imports build on Windows Date: Wed, 26 Jan 2011 21:29:59 +0200 Message-ID: <83vd1bwjig.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1296071252 30832 80.91.229.12 (26 Jan 2011 19:47:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 26 Jan 2011 19:47:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 26 20:47:28 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PiBKw-0000Pn-Tc for ged-emacs-devel@m.gmane.org; Wed, 26 Jan 2011 20:47:27 +0100 Original-Received: from localhost ([127.0.0.1]:36548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiBKw-00068Z-F1 for ged-emacs-devel@m.gmane.org; Wed, 26 Jan 2011 14:47:26 -0500 Original-Received: from [140.186.70.92] (port=46611 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiB59-0007jz-2r for emacs-devel@gnu.org; Wed, 26 Jan 2011 14:32:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiB3f-0000tQ-Lq for emacs-devel@gnu.org; Wed, 26 Jan 2011 14:31:04 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:60141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiB3f-0000sF-9F for emacs-devel@gnu.org; Wed, 26 Jan 2011 14:29:35 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LFN00N00A3E4U00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Wed, 26 Jan 2011 21:29:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.46.39]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LFN00MDPA5830N0@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Wed, 26 Jan 2011 21:29:33 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135048 Archived-At: One problem with these imports that may mean a relatively significant change in the build prerequisites is the fact that during the build, getopt.in.h needs to be edited into getopt.h. This editing is done by Sed in lib/Makefile.in: getopt.h: getopt.in.h $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ < $(srcdir)/getopt.in.h; \ } > $@-t && \ mv -f $@-t $@ Until now, building Emacs for Windows did not require Sed. I see the following possible ways to deal with this: 1) Add Sed to programs required for the build, and run it as part of each build. 2) Have a maintainer-only rule to produce getopt.h for Windows (by using Sed). Someone(TM) will invoke that rule whenever getopt.in.h changes, and commit the result to the bzr repo, to be used by all the other people who build Emacs on Windows. 3) Write an auxiliary C program to perform replacements like Sed does (but without all the other bells and whistles in Sed), build it at the beginning of the build, and use it instead of Sed. I don't like asking every end user to have Sed, especially since many Windows ports of Sed are notoriously broken (I had to port it myself to get a reliable tool). And since 3) sounds like wheel reinvention, I tend to alternative 2). Comments and ideas are welcome.