Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sed 4.3 is available, fixing mingw-w64 build issues #17

Closed
StephanTLavavej opened this issue Feb 20, 2016 · 6 comments
Closed

sed 4.3 is available, fixing mingw-w64 build issues #17

StephanTLavavej opened this issue Feb 20, 2016 · 6 comments
Milestone

Comments

@StephanTLavavej
Copy link
Owner

My sed.patch fixes minor build issues with mingw-w64. It appears that they've all been fixed upstream in gnulib, so sed simply needs to update its copy and release a new version.

@StephanTLavavej
Copy link
Owner Author

"It has been over four years since the preceding release of sed. We expect to make upcoming releases with far greater frequency. Please give this test release a workout and let us know of any problem you find." - Jim Meyering, Dec 5, 2016

I should try this.

@StephanTLavavej
Copy link
Owner Author

Good news: sed updated its copy of gnulib.

Bad news: everything else is broken. I tried to build sed-4.2.2.177-a348 and encountered multiple problems.

  1. Hacked around this by adding -I/c/temp/gcc/build to CFLAGS:
gcc -O3  -s  ../src/sed/sed.c   -o sed/sed
In file included from ../src/sed/sed.c:19:0:
../src/sed/sed.h:18:20: fatal error: config.h: No such file or directory
 #include <config.h>
                    ^
  1. Hacked around this by adding -I/c/temp/gcc/src to CFLAGS:
gcc -O3 -I/c/temp/gcc/build  -s  ../src/sed/sed.c   -o sed/sed
In file included from ../src/sed/sed.c:19:0:
../src/sed/sed.h:19:23: fatal error: basicdefs.h: No such file or directory
 #include "basicdefs.h"
                       ^
  1. Hacked around this by adding -I/c/temp/gcc/src/lib to CFLAGS:
gcc -O3 -I/c/temp/gcc/build -I/c/temp/gcc/src  -s  ../src/sed/sed.c   -o sed/sed
In file included from ../src/sed/sed.c:19:0:
../src/sed/sed.h:20:17: fatal error: dfa.h: No such file or directory
 #include "dfa.h"
                 ^
  1. Hacked around this by adding #ifdef HAVE_ALLOCA_H to the file:
gcc -O3 -I/c/temp/gcc/build -I/c/temp/gcc/src  -s  ../src/sed/sed.c   -o sed/sed
In file included from ../src/sed/sed.h:19:0,
                 from ../src/sed/sed.c:19:
C:/temp/gcc/src/basicdefs.h:21:20: fatal error: alloca.h: No such file or directory
 #include <alloca.h>
                    ^
  1. Hacked around
gcc -O3 -I/c/temp/gcc/build -I/c/temp/gcc/src  -s  ../src/sed/sed.c   -o sed/sed
In file included from ../src/sed/sed.h:19:0,
                 from ../src/sed/sed.c:19:
C:/temp/gcc/src/basicdefs.h:29:21: fatal error: gettext.h: No such file or directory
 #include <gettext.h>
                     ^

by adding:

#ifdef HAVE_GETTEXT
#include <gettext.h>
#define N_(String) gettext_noop(String)
#define _(String) gettext(String)
#else
#define N_(String) (String)
#define _(String) (String)
#endif

which seems vaguely plausible but I am increasingly inventing nonsense.

  1. Got completely stuck with:
In file included from ../src/sed/sed.h:26:0,
                 from ../src/sed/sed.c:19:
../src/sed/utils.h: In function 'panic':
../src/sed/utils.h:30:45: error: expected declaration specifiers before '_GL_ATTRIBUTE_FORMAT_PRINTF'
 _Noreturn void panic (const char *str, ...) _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2);
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/sed/utils.h:42:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_GL_ARG_NONNULL'
                    const char *mode) _GL_ARG_NONNULL ((1, 2, 3, 4));
                                      ^~~~~~~~~~~~~~~
../src/sed/utils.h:52:26: warning: '__pure__' attribute ignored [-Wattributes]
 char *get_buffer (struct buffer const *b) _GL_ATTRIBUTE_PURE;
                          ^~~~~~
../src/sed/utils.h:53:28: warning: '__pure__' attribute ignored [-Wattributes]
 size_t size_buffer (struct buffer const *b) _GL_ATTRIBUTE_PURE;
                            ^~~~~~
../src/sed/utils.h:58:20: error: storage class specified for parameter 'myname'
 extern const char *myname;
                    ^~~~~~
In file included from ../src/sed/sed.c:19:0:
../src/sed/sed.h:29:1: warning: empty declaration
 struct vector {
 ^~~~~~
../src/sed/sed.h:39:1: warning: empty declaration
 struct output {
 ^~~~~~

followed by many more diverse errors.

@StephanTLavavej StephanTLavavej changed the title sed should update its copy of gnulib sed's build is severely broken for MinGW after sed 4.2.2 Dec 13, 2016
@mmicko
Copy link

mmicko commented Dec 13, 2016

Line 5779 of Makefile.in should be:
doc/sed.1: sed/sed$(EXEEXT) .version $(srcdir)/doc/sed.x
instead of
doc/sed.1: sed/sed .version $(srcdir)/doc/sed.x

After that just use plain make to build, no additional parameter needed.

@StephanTLavavej
Copy link
Owner Author

Absolutely amazing, worked perfectly! Thank you!

@StephanTLavavej
Copy link
Owner Author

I've sent a patch in unified diff format to the sed-devel mailing list.

@mmicko
Copy link

mmicko commented Dec 14, 2016

Great. Thank you

@StephanTLavavej StephanTLavavej changed the title sed's build is severely broken for MinGW after sed 4.2.2 sed 4.3 is available, fixing mingw-w64 build issues Dec 30, 2016
@StephanTLavavej StephanTLavavej added this to the v15.0 milestone Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants