From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: MS-Windows build using Posix configury
Date: Tue, 16 Apr 2013 20:33:18 -0700 [thread overview]
Message-ID: <516E17FE.8050900@cs.ucla.edu> (raw)
In-Reply-To: <83d2tu49lu.fsf@gnu.org>
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?
next prev parent reply other threads:[~2013-04-17 3:33 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 18:24 MS-Windows build using Posix configury Eli Zaretskii
2013-04-16 18:40 ` Eli Zaretskii
2013-04-16 20:13 ` Stefan Monnier
2013-04-17 2:53 ` Eli Zaretskii
2013-04-16 21:17 ` Glenn Morris
2013-04-17 2:56 ` Eli Zaretskii
2013-04-17 6:25 ` Glenn Morris
2013-04-17 16:48 ` Eli Zaretskii
2013-04-17 17:11 ` Glenn Morris
2013-04-17 17:34 ` Eli Zaretskii
2013-04-17 17:53 ` Glenn Morris
2013-04-17 18:15 ` Glenn Morris
2013-04-17 18:44 ` Eli Zaretskii
2013-04-17 0:42 ` Glenn Morris
2013-04-17 2:57 ` Eli Zaretskii
2013-04-17 6:24 ` Glenn Morris
2013-04-17 3:33 ` Paul Eggert [this message]
2013-04-17 17:00 ` Eli Zaretskii
2013-04-17 18:48 ` Paul Eggert
2013-04-17 19:15 ` Glenn Morris
2013-04-17 19:45 ` Eli Zaretskii
2013-04-17 20:43 ` Glenn Morris
2013-04-17 21:19 ` Paul Eggert
2013-04-17 22:38 ` Glenn Morris
2013-04-18 0:52 ` Paul Eggert
2013-04-18 5:29 ` Glenn Morris
2013-04-18 16:11 ` Eli Zaretskii
2013-04-17 6:27 ` Glenn Morris
2013-04-17 6:31 ` Glenn Morris
2013-04-18 19:32 ` Dani Moncayo
2013-04-18 20:27 ` Dani Moncayo
2013-04-18 21:20 ` Eli Zaretskii
2013-04-18 22:03 ` Dani Moncayo
2013-04-19 6:34 ` Eli Zaretskii
2013-04-19 20:17 ` Dani Moncayo
2013-04-20 6:34 ` Eli Zaretskii
2013-04-20 7:35 ` Dani Moncayo
2013-04-20 7:56 ` Eli Zaretskii
2013-04-20 17:18 ` Dani Moncayo
2013-04-20 18:30 ` Eli Zaretskii
2013-04-20 20:21 ` Dani Moncayo
2013-04-21 15:12 ` Eli Zaretskii
2013-04-21 19:53 ` Dani Moncayo
2013-05-01 15:30 ` Dani Moncayo
2013-05-01 16:30 ` Eli Zaretskii
2013-05-01 19:30 ` Dani Moncayo
2013-05-01 19:40 ` Eli Zaretskii
2013-05-02 6:43 ` Dani Moncayo
2013-05-02 16:19 ` Eli Zaretskii
2013-05-02 18:40 ` Dani Moncayo
2013-05-02 19:49 ` Eli Zaretskii
2013-05-02 21:42 ` Dani Moncayo
2013-05-02 21:43 ` Dani Moncayo
2013-05-03 8:50 ` Eli Zaretskii
2013-05-04 10:59 ` Dani Moncayo
2013-05-04 11:04 ` Dani Moncayo
2013-05-04 11:27 ` Eli Zaretskii
2013-05-04 12:00 ` Dani Moncayo
2013-05-04 12:30 ` Eli Zaretskii
2013-05-07 19:36 ` Dani Moncayo
2013-05-07 21:13 ` Eli Zaretskii
2013-05-07 22:04 ` Dani Moncayo
2013-05-08 17:09 ` Eli Zaretskii
2013-05-08 17:32 ` Dani Moncayo
2013-05-13 12:23 ` Andy Moreton
2013-05-13 16:23 ` Eli Zaretskii
2013-05-16 6:00 ` Eli Zaretskii
2013-05-16 6:31 ` Paul Eggert
2013-05-16 6:56 ` Eli Zaretskii
2013-05-16 7:16 ` Paul Eggert
2013-05-16 7:30 ` Eli Zaretskii
2013-05-16 13:19 ` Eli Zaretskii
2013-05-16 14:43 ` Dmitry Gutov
2013-05-16 15:41 ` Eli Zaretskii
2013-05-16 16:10 ` Dmitry Gutov
2013-05-16 17:17 ` Dani Moncayo
2013-05-16 17:54 ` Eli Zaretskii
2013-05-16 18:01 ` Dani Moncayo
2013-05-16 18:36 ` Eli Zaretskii
2013-05-16 21:02 ` Dmitry Gutov
2013-05-17 6:02 ` Eli Zaretskii
2013-05-16 17:18 ` Eli Zaretskii
2013-05-16 21:19 ` Dmitry Gutov
2013-05-17 9:39 ` Eli Zaretskii
2013-05-17 12:05 ` Dmitry Gutov
2013-05-17 13:13 ` Eli Zaretskii
2013-05-17 14:03 ` Dmitry Gutov
2013-05-17 14:26 ` Eli Zaretskii
2013-05-17 15:29 ` Dmitry Gutov
2013-05-17 16:05 ` Eli Zaretskii
2013-05-17 16:30 ` Dmitry Gutov
2013-05-17 17:40 ` Eli Zaretskii
2013-05-17 18:43 ` Eli Zaretskii
2013-05-17 20:47 ` Dmitry Gutov
2013-05-18 7:18 ` Eli Zaretskii
2013-05-18 8:08 ` Dmitry Gutov
2013-05-18 9:08 ` Eli Zaretskii
2013-05-18 13:24 ` Dmitry Gutov
2013-05-18 14:25 ` Eli Zaretskii
2013-05-18 14:28 ` Dmitry Gutov
2013-05-18 18:21 ` Eli Zaretskii
2013-05-18 18:42 ` Dmitry Gutov
2013-05-18 18:53 ` Eli Zaretskii
2013-05-18 19:15 ` Dmitry Gutov
2013-05-18 19:24 ` Eli Zaretskii
2013-06-07 8:51 ` Eli Zaretskii
2013-06-07 9:36 ` Dmitry Gutov
2013-06-07 9:56 ` Eli Zaretskii
2013-05-19 6:48 ` Stephen Leake
2013-05-19 14:51 ` Eli Zaretskii
2013-05-21 8:31 ` Stephen Leake
2013-05-21 17:07 ` Eli Zaretskii
2013-05-21 19:36 ` Stephen Leake
2013-05-25 7:29 ` Eli Zaretskii
2013-04-19 3:05 ` Ken Brown
2013-04-19 6:35 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516E17FE.8050900@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).