From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows build using Posix configury Date: Tue, 16 Apr 2013 20:33:18 -0700 Organization: UCLA Computer Science Department Message-ID: <516E17FE.8050900@cs.ucla.edu> References: <83d2tu49lu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366169607 641 80.91.229.3 (17 Apr 2013 03:33:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Apr 2013 03:33:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 17 05:33:31 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USJ7j-0004Zd-5c for ged-emacs-devel@m.gmane.org; Wed, 17 Apr 2013 05:33:31 +0200 Original-Received: from localhost ([::1]:45541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJ7i-0007BJ-Cz for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2013 23:33:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJ7e-0007B2-D4 for emacs-devel@gnu.org; Tue, 16 Apr 2013 23:33:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USJ7d-0008Mh-94 for emacs-devel@gnu.org; Tue, 16 Apr 2013 23:33:26 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:44304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJ7b-0008Kz-GR; Tue, 16 Apr 2013 23:33:23 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id C336AA60006; Tue, 16 Apr 2013 20:33:20 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LQdkvymY46tK; Tue, 16 Apr 2013 20:33:18 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id A4A46A60012; Tue, 16 Apr 2013 20:33:18 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 In-Reply-To: <83d2tu49lu.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158968 Archived-At: Thanks for getting this to work. On 04/16/13 11:24, Eli Zaretskii wrote: > +lib-src/emacsclient.res > ... > +nt/emacs.res > +src/temacs.map > +src/temacs.tmp How about adding *.res, *.map, *.tmp instead? That should simplify future maintenance. > - cd $(DESTDIR)${bindir} && $(LN_S) $(EMACSFULL) $(EMACS); \ > + cd $(DESTDIR)${bindir} && $(LN_EMACS) $(EMACSFULL) $(EMACS); \ Why prefer hard links on Windows but not everywhere else? How about something like the following instead? cd $(DESTDIR)${bindir} && { \ ln $(EMACSFULL) $(EMACS) 2>/dev/null || $(LN_S) $(EMACSFULL) $(EMACS); \ }; \ That way, we don't need LN_EMACS. > + if test "x$(NTDIR)" != "x"; then \ > + cd $(NTDIR) && \ > + $(MAKE) install $(MFLAGS) prefix=${prefix} \ > + exec_prefix=${exec_prefix} bindir=${bindir} \ > + libexecdir=${libexecdir} archlibdir=${archlibdir} \ > + INSTALL_STRIP=${INSTALL_STRIP}; \ > + fi How about breaking this out into a separate rule (install-arch-dep-nt, say) and executing only on nt platforms? That will cause the output of 'make' to be shorter on non-mingw platforms. It could be implemented something like this, say: install-arch-dep: install-arch-dep-$(NTDIR) install-arch-dep-: install-arch-dep-nt: cd $(NTDIR) && ... > + if test "x$(NTDIR)" != "x"; then \ > + cd $(NTDIR) && \ > + $(MAKE) $(MFLAGS) uninstall \ > + prefix=${prefix} exec_prefix=${exec_prefix} \ > + bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}; \ > + fi Similarly, this should be broken out into a rule uninstall-nt. > gnu-linux|freebsd|netbsd) > AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) > ;; > + mingw32) > + AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) > + ;; The two cases should be combined, by appending "|mingw32" to the previous case. > if test "${opsys}" != "cygwin"; then > - AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) > + if test "${opsys}" != "mingw32"; then > + AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.]) > + fi > fi Please turn this into a "case" instead of a nested "if", as "case" is easier to read for this sort of thing. > + AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], > + [AC_MSG_ERROR([The windows.h header file is required, > + but cannot be found.])]) This code is redundant and can be removed; the next test checks that windows.h compiles, which is a stronger test anyway. Also, there's an earlier AC_CHECK_HEADER([windows.h]...) test that is already there; perhaps it can be removed too? > +if test "${opsys}" = "mingw32"; then > + if test "${with_xpm}" != "no"; then > + AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [ > +#define FOR_MSW 1]) > + fi > + > + if test "${HAVE_XPM}" = "yes"; then > + AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).]) > + fi > +fi There are a number of instances of code like this, where a reasonably large amount of code is duplicated and surrounded by "if test "${opsys}" = "mingw32". It'd be better to duplicate less code and do the mingw32-specific stuff more compactly. Perhaps this is too much to do right now, but at least this deserves a FIXME, as in the long run this is increasing maintenance effort. > +if test "${opsys}" = "mingw32"; then > + AC_DEFINE(NULL_DEVICE, ["NUL:"], [Name of the file to open to get > + a null file, or a data sink.]) > +else > + AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get > + a null file, or a data sink.]) > +fi For stuff like this, how about putting it into conf_post.h instead? That'll be clearer and will help 'configure' run faster. E.g., something like this in conf_post.h: /* Override the default definitions. */ #ifdef __MINGW32__ # define NULL_DEVICE "NUL:" # define IS_DIRECTORY_SEP(c) ((c) == '/' || c == '\') ... #endif /* Default definitions, suitable for GNU and POSIXish platforms. */ /* Name of the file to open to get a empty input file, or a data sink output file. */ #ifndef NULL_DEVICE # define NULL_DEVICE "/dev/null" #endif /* Return true if C is a directory separator in file names. */ #ifndef IS_DIRECTORY_SEP # define IS_DIRECTORY_SEP(c) ((c) == '/') #endif and remove all that stuff from configure.ac. > - regex.o $(LOADLIBES) -o etags > + regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT} > ... > - ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse > + ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT} > ... etc ... Perhaps append $(NTLIB) to LOADLIBES's value instead?