emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making gnulib imports build on Windows


From: Eli Zaretskii
Subject: Making gnulib imports build on Windows
Date: Wed, 26 Jan 2011 21:29:59 +0200

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 address@hidden $@ && \
          { 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; \
          } > address@hidden && \
          mv -f address@hidden $@

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]