Skip to content

Commit d4ed67c

Browse files
committed
Make sure that strerror-override.c compiles, no matter what.
Patch from Dima Pasechnik. This fixes build on Solaris (and would also on Cygwin -- but we have already worked around that in a different way).
1 parent 56a53e1 commit d4ed67c

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

code/gnulib/strerror-override.c

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
/* If ERRNUM maps to an errno value defined by gnulib, return a string
3333
describing the error. Otherwise return NULL. */
34+
#ifndef strerror_override_switch
3435
const char *
3536
strerror_override (int errnum)
3637
{
@@ -300,3 +301,4 @@ strerror_override (int errnum)
300301
return NULL;
301302
}
302303
}
304+
#endif

code/gnulib/strerror-override.h

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
extern const char *strerror_override (int errnum);
5252
# else
5353
# define strerror_override(ignored) NULL
54+
# define strerror_override_switch
5455
# endif
5556

5657
#endif /* _GL_STRERROR_OVERRIDE_H */

install-reloc

+8-6
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ fi
148148
# Compile wrapper.
149149
#
150150
# CHANGE: We added source files lstat, stat here to get it compile on
151-
# Mac OS X. But this is all very brittle; for example on Cygwin,
152-
# strerror-override.c does not compile (it is excluded when compiling
153-
# libgnu.a, but here it is included conditionally.) May be better to
154-
# link against the built gnulib, but this is tricky because of
155-
# possible libtool. So we are leaving it like this for now, and on
151+
# Mac OS X. But this is all very brittle; for example on Cygwin and
152+
# Solaris, strerror-override.c does not compile (it is excluded when
153+
# compiling libgnu.a, but here it is included conditionally.) May be
154+
# better to link against the built gnulib, but this is tricky because
155+
# of possible libtool. So we are leaving it like this for now, and on
156156
# Cygwin disable compilation of wrappers, because everything seems to
157-
# work fine without them?! --mkoeppe, 2013-08-14.
157+
# work fine without them?! To also get it to work on Solaris, used
158+
# patch from Dima Pasechnik to make strerror-override.c compile.
159+
# --mkoeppe, 2013-08-20.
158160
func_verbose $compile_command \
159161
-I"$builddir" -I"$srcdir" -I"$config_h_dir" \
160162
-DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \

0 commit comments

Comments
 (0)