Initial AIX portability fixes.
PATCH 1/1 Initial AIX portability fixes.
Added an AIX clause in the Makefile; that clause likely will be wrong for any AIX pre-5.2, but I can only test on 5.3. mailinfo.c was missing the compat header file, and convert-objects.c needs to define a specific _XOPEN_SOURCE as well as _XOPEN_SOURCE_EXTENDED.
---
Makefile | 4 ++++ convert-objects.c | 3 ++- mailinfo.c | 1 + 3 files changed, 7 insertions(+), 1 deletions(-)
54b8c282e017b246612b94bcbf5b88ab39c042a0
Makefile +4 -0
@@ -243,6 +243,10 @@ ifeq ($(uname_S),NetBSD) ALL_CFLAGS += -I/usr/pkg/include ALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib endif +ifeq ($(uname_S),AIX) + NO_STRCASESTR=YesPlease + NEEDS_LIBICONV=YesPlease +endif ifneq (,$(findstring arm,$(uname_M))) ARM_SHA1 = YesPlease endif
convert-objects.c +2 -1
@@ -1,4 +1,5 @@ -#define _XOPEN_SOURCE/* glibc2 needs this */ +#define _XOPEN_SOURCE 500/* glibc2 and AIX 5.3L need this */ +#define _XOPEN_SOURCE_EXTENDED 1/* AIX 5.3L needs this */ #include <time.h> #include "cache.h"
mailinfo.c +1 -0
@@ -8,6 +8,7 @@#include <string.h> #include <ctype.h> #include <iconv.h> +#include "git-compat-util.h" #include "cache.h" static FILE *cmitmsg, *patchfile;
Signature · 1 line
0.99.9.GIT
Hi,
convert-objects.c line 2
Quoted 3 lines · Jason Riedy
convert-objects.c +2
-1-#define _XOPEN_SOURCE/* glibc2 needs this */ +#define _XOPEN_SOURCE 500/* glibc2 and AIX 5.3L need this */ +#define _XOPEN_SOURCE_EXTENDED 1/* AIX 5.3L needs this */
Why not enclose the #define in #ifndef/#endif, and do the real magic in the Makefile? Within the AIX clause:
ALL_CFLAGS += -D_XOPEN_SOURCE=500 -XOPEN_SOURCE_EXTENDED=1
This way the source does not get cluttered with platform dependent defines.
Hth,
Dscho
And Johannes Schindelin writes:
- Why not enclose the #define in #ifndef/#endif, and do the real magic in
- the Makefile? Within the AIX clause:
- ALL_CFLAGS += -D_XOPEN_SOURCE=500 -XOPEN_SOURCE_EXTENDED=1
Because other files do _not_ compile when given those options. I'm going for minimal changes to the existing structure; the #define for glibc2 has been there a long, long time. Yes, it probably can be done better, but these are 1.0rc versions...
Jason
Quoted 9 lines · Jason Riedy
And Johannes Schindelin writes:
- Why not enclose the #define in #ifndef/#endif, and do the real magic in
- theMakefile? Within the AIX clause:
-ALL_CFLAGS+= -D_XOPEN_SOURCE=500 -XOPEN_SOURCE_EXTENDED=1Because other files do _not_ compile when given those options. I'm going for minimal changes to the existing structure; the #define for glibc2 has been there a long, long time. Yes, it probably can be done better, but these are 1.0rc versions...
I agree with your approach of least impact for now. Thanks.
Quoted 11 lines · Johannes Schindelin
Hi,
convert-objects.c line 2
Quoted 3 lines · Jason Riedy
convert-objects.c +2
-1-#define _XOPEN_SOURCE/* glibc2 needs this */ +#define _XOPEN_SOURCE 500/* glibc2 and AIX 5.3L need this */ +#define _XOPEN_SOURCE_EXTENDED 1/* AIX 5.3L needs this */ Why not enclose the #define in #ifndef/#endif, and do the real magic in the
Makefile? Within the AIX clause:
Quoted 4 lines
ALL_CFLAGS += -D_XOPEN_SOURCE=500 -XOPEN_SOURCE_EXTENDED=1This way the source does not get cluttered with platform dependent defines.
True but the original convert-objects.c defines _XOPEN_SOURCE on all platforms not just AIX.