* [PATCH] Initial AIX portability fixes.
@ 2005-12-06 22:20 Jason Riedy
2005-12-06 23:58 ` Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Jason Riedy @ 2005-12-06 22:20 UTC (permalink / raw)
To: git
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.
Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu>
---
Makefile | 4 ++++
convert-objects.c | 3 ++-
mailinfo.c | 1 +
3 files changed, 7 insertions(+), 1 deletions(-)
54b8c282e017b246612b94bcbf5b88ab39c042a0
diff --git a/Makefile b/Makefile
index 425c519..01b6643 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/convert-objects.c b/convert-objects.c
index d78a8b4..b49bce2 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -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"
diff --git a/mailinfo.c b/mailinfo.c
index 3b97a89..d4b4163 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -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;
--
0.99.9.GIT
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Initial AIX portability fixes.
2005-12-06 22:20 [PATCH] Initial AIX portability fixes Jason Riedy
@ 2005-12-06 23:58 ` Johannes Schindelin
2005-12-07 0:07 ` Jason Riedy
2005-12-07 0:08 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Johannes Schindelin @ 2005-12-06 23:58 UTC (permalink / raw)
To: Jason Riedy; +Cc: git
Hi,
On Tue, 6 Dec 2005, Jason Riedy wrote:
> -#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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Initial AIX portability fixes.
2005-12-06 23:58 ` Johannes Schindelin
@ 2005-12-07 0:07 ` Jason Riedy
2005-12-07 0:12 ` Junio C Hamano
2005-12-07 0:08 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Jason Riedy @ 2005-12-07 0:07 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Initial AIX portability fixes.
2005-12-06 23:58 ` Johannes Schindelin
2005-12-07 0:07 ` Jason Riedy
@ 2005-12-07 0:08 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2005-12-07 0:08 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Hi,
>
> On Tue, 6 Dec 2005, Jason Riedy wrote:
>
>> -#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.
True but the original convert-objects.c defines _XOPEN_SOURCE on
all platforms not just AIX.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Initial AIX portability fixes.
2005-12-07 0:07 ` Jason Riedy
@ 2005-12-07 0:12 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2005-12-07 0:12 UTC (permalink / raw)
To: Jason Riedy; +Cc: git
Jason Riedy <ejr@EECS.Berkeley.EDU> writes:
> 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...
I agree with your approach of least impact for now. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-12-07 0:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-06 22:20 [PATCH] Initial AIX portability fixes Jason Riedy
2005-12-06 23:58 ` Johannes Schindelin
2005-12-07 0:07 ` Jason Riedy
2005-12-07 0:12 ` Junio C Hamano
2005-12-07 0:08 ` Junio C Hamano
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 NNTP newsgroup(s).