abiword-2.2.8 portability patches

From: Albert Chin <abiword-dev_at_mlists.thewrittenword.com>
Date: Tue Jul 12 2005 - 18:58:02 CEST

We just finished building abiword-2.2.8 on Solaris, HP-UX, AIX, Tru64
UNIX, and Redhat Linux. We have a few portability patches to submit,
attached below.

1. [abi/ac-helpers/abi-iconv.m4,
    abi/src/af/util/xp/ut_iconv.cpp]
   The ICONV_CONST #define hack in abi/src/af/util/xp/ut_iconv.cpp is
   indeed ugly. So, we did it right by correctly determining what the
   correct 2nd argument to iconv() is via autoconf.
2. [abi/ac-helpers/abi-scandir.m4,
    abi/src/af/util/xp/ut_PerlBindings.cpp,
    abi/src/wp/ap/unix/ap_UnixApp.cpp,
    abi/src/wp/ap/unix/ap_UnixDialog_New.cpp,
    abi/src/af/util/unix/ut_unixDirent.h,
    abi/src/af/util/unix/ut_unixDirent.cpp,
    abi/configure.ac]
   Similar to the ICONV_CONST hack, we determine via autoconf the
   correct "const"ness of the struct dirent entry to scandir(). It's
   const on some systems, and not on others.
3. [abi/src/af/ev/qnx/GNUmakefile.am,
    abi/src/af/ev/cocoa/GNUmakefile.am,
    abi/src/af/ev/unix/GNUmakefile.am,
    abi/src/af/ev/xp/GNUmakefile.am,
    abi/src/af/gr/qnx/GNUmakefile.am,
    abi/src/af/gr/cocoa/GNUmakefile.am,
    abi/src/af/gr/unix/GNUmakefile.am,
    abi/src/af/gr/xp/GNUmakefile.am,
    abi/src/af/util/qnx/GNUmakefile.am,
    abi/src/af/util/unix/GNUmakefile.am,
    abi/src/af/util/win/GNUmakefile.am,
    abi/src/af/util/xp/GNUmakefile.am,
    abi/src/af/xap/qnx/GNUmakefile.am,
    abi/src/af/xap/cocoa/GNUmakefile.am,
    abi/src/af/xap/unix/gnome/GNUmakefile.am,
    abi/src/af/xap/unix/GNUmakefile.am,
    abi/src/af/xap/win/GNUmakefile.am,
    abi/src/af/xap/xp/GNUmakefile.am,
    abi/src/bindings/perl/GNUmakefile.am,
    abi/src/other/spell/xp/GNUmakefile.am,
    abi/src/other/ttftool/unix/GNUmakefile.am,
    abi/src/text/fmt/xp/GNUmakefile.am,
    abi/src/text/ptbl/xp/GNUmakefile.am,
    abi/src/tools/ttftool/unix/GNUmakefile.am,
    abi/src/wp/ap/qnx/GNUmakefile.am,
    abi/src/wp/ap/cocoa/GNUmakefile.am,
    abi/src/wp/ap/unix/gnome/GNUmakefile.am,
    abi/src/wp/ap/unix/GNUmakefile.am,
    abi/src/wp/ap/xp/GNUmakefile.am,
    abi/src/wp/main/qnx/GNUmakefile.am,
    abi/src/wp/main/cocoa/GNUmakefile.am,
    abi/src/wp/main/unix/GNUmakefile.am,
    abi/src/wp/main/xp/GNUmakefile.am,
    abi/src/wp/impexp/qnx/GNUmakefile.am,
    abi/src/wp/impexp/cocoa/GNUmakefile.am,
    abi/src/wp/impexp/unix/GNUmakefile.am,
    abi/src/wp/impexp/xp/GNUmakefile.am,
    abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.am]
   Use of INCLUDES is deprecated (and, it makes it impossible to
   force using your $CPPFLAGS before the program's $CPPFLAGS).
   Converted to AM_CPPFLAGS, AM_CFLAGS, and AM_CXXFLAGS instead.
   Ditto for LDFLAGS.
4. [abi/src/af/xap/unix/xap_UnixEncodingManager.cpp]
   Need to case putenv() type as it's (char *) on Solaris,
   not (const char *).
5. [abiword-plugins/tools/abidash/xp/dashboard-frontend.c]
   Use memset() rathan than old bzero().
6. [abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp]
   AIX #define's jmpbuf in it's /usr/include headers somewhere so
   we undo this so the jmpbuf struct member in <png.h> isn't fooled.

-- 
albert chin (china@thewrittenword.com)
-- snip snip
--- abi/ac-helpers/abi-iconv.m4.orig	2005-07-08 12:03:11.149938000 -0500
+++ abi/ac-helpers/abi-iconv.m4	2005-07-08 15:05:36.312618000 -0500
@@ -126,6 +126,20 @@
 
 fi
 
+dnl test if second argument to iconv() is "char" or "const char"
+AC_MSG_CHECKING([for type of 2nd argument to iconv()])
+AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+
+size_t iconv (iconv_t, char **, size_t *, char **, size_t *);],,[
+	AC_MSG_RESULT([char **])
+        abi_iconv_const=""],[
+	AC_MSG_RESULT([const char **])
+	abi_iconv_const="const"])
+AC_DEFINE_UNQUOTED(ICONV_CONST, $abi_iconv_const,
+	[Whether 2nd argument to iconv() is const])
+
 AC_SUBST(LIBICONV_PEERDIR)
 
 AC_SUBST(ICONV_INCLUDES)
--- abi/ac-helpers/abi-scandir.m4.orig	2005-07-08 13:43:44.132288000 -0500
+++ abi/ac-helpers/abi-scandir.m4	2005-07-08 15:57:28.652958000 -0500
@@ -0,0 +1,55 @@
+# start: abi/ac-helpers/abi-scandir.m4
+# 
+# Copyright (C) 2005 The Written Word, Inc.
+# 
+# This file is free software; you may copy and/or distribute it with
+# or without modifications, as long as this notice is preserved.
+# This software is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even
+# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE.
+#
+# The above license applies to THIS FILE ONLY, the abiword code
+# itself may be copied and distributed under the terms of the GNU
+# GPL, see COPYING for more details
+#
+# This file detects which of the AbiWord platforms we are currently
+# building on.  The detection logic in question is mostly by Jeff
+# Hostetler, and is taken from the original AbiWord build system.  
+#
+# Usage: ABI_SCANDIR
+
+AC_DEFUN([ABI_SCANDIR], [
+	AC_CHECK_FUNCS(scandir,[
+		AC_LANG_PUSH(C++)
+		AC_MSG_CHECKING([for 3rd argument to scandir()])
+		AC_TRY_COMPILE([
+#include <dirent.h>
+
+extern "C" {
+int scandir (const char *, struct dirent ***,
+	     int (*)(struct dirent *),  
+	     int (*)(struct dirent **, struct dirent **));
+}],,[
+			AC_MSG_RESULT([int (*)(struct dirent *)])
+			abi_scandir_const=""],[
+			AC_TRY_COMPILE([
+#include <dirent.h>
+extern "C" {
+/* For AIX */
+int scandir (const char *, struct dirent ***,
+	     int (*)(struct dirent *),  
+	     int (*)(void *, void *));
+}],,[
+				AC_MSG_RESULT([int (*)(struct dirent *)])
+				abi_scandir_const=""],[
+				AC_MSG_RESULT([int (*)(const struct dirent *)])
+				abi_scandir_const="const"])])
+		AC_LANG_POP(C++)],[
+		abi_scandir_const="const"])
+AC_DEFINE_UNQUOTED(SCANDIR_CONST, $abi_scandir_const,
+	[Whether 3nd argument to scandir() is const])
+])
+# 
+# end: abi/ac-helpers/abi-scandir.m4
+# 
--- abi/src/af/ev/qnx/GNUmakefile.am.orig	2005-07-08 11:37:45.040809000 -0500
+++ abi/src/af/ev/qnx/GNUmakefile.am	2005-07-08 12:50:40.339955000 -0500
@@ -18,8 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= @GTK_CFLAGS@ @GMODULE_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= $(GTK_CFLAGS) $(GMODULE_CFLAGS)
 
 noinst_LIBRARIES = libEv_qnx.a
 
--- abi/src/af/ev/cocoa/GNUmakefile.am.orig	2005-07-08 11:34:07.403486000 -0500
+++ abi/src/af/ev/cocoa/GNUmakefile.am	2005-07-08 11:34:33.337028000 -0500
@@ -19,7 +19,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES)	
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES)	
 
 noinst_LIBRARIES = libEv_cocoa.a
 
--- abi/src/af/ev/unix/GNUmakefile.am.orig	2005-07-08 11:37:51.030864000 -0500
+++ abi/src/af/ev/unix/GNUmakefile.am	2005-07-08 12:50:37.394140000 -0500
@@ -18,8 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= @GTK_CFLAGS@ @GMODULE_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= $(GTK_CFLAGS) $(GMODULE_CFLAGS)
 
 noinst_LIBRARIES = libEv_unix.a
 
--- abi/src/af/ev/xp/GNUmakefile.am.orig	2005-07-08 11:37:56.738831000 -0500
+++ abi/src/af/ev/xp/GNUmakefile.am	2005-07-08 11:38:38.307487000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(OTHER_INCLUDES)
 
 noinst_LIBRARIES = libEv_xp.a
 
--- abi/src/af/gr/qnx/GNUmakefile.am.orig	2005-07-08 11:38:03.253122000 -0500
+++ abi/src/af/gr/qnx/GNUmakefile.am	2005-07-08 11:38:41.023824000 -0500
@@ -19,7 +19,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS = $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libGr_qnx.a
 
--- abi/src/af/gr/cocoa/GNUmakefile.am.orig	2005-07-08 11:38:09.230803000 -0500
+++ abi/src/af/gr/cocoa/GNUmakefile.am	2005-07-08 12:50:34.291581000 -0500
@@ -18,8 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(PLATFORM_CFLAGS) \
-	$(AF_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= $(PLATFORM_CFLAGS)
 
 
 noinst_LIBRARIES = libGr_cocoa.a
--- abi/src/af/gr/unix/GNUmakefile.am.orig	2005-07-08 11:18:40.080331000 -0500
+++ abi/src/af/gr/unix/GNUmakefile.am	2005-07-08 12:50:30.581748000 -0500
@@ -18,7 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= @GTK_CFLAGS@ @GMODULE_CFLAGS@ $(AF_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= $(GTK_CFLAGS) $(GMODULE_CFLAGS)
 
 noinst_LIBRARIES = libGr_unix.a
 
--- abi/src/af/gr/xp/GNUmakefile.am.orig	2005-07-08 11:38:55.351294000 -0500
+++ abi/src/af/gr/xp/GNUmakefile.am	2005-07-08 11:39:12.804362000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS = $(AF_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libGr_xp.a
 
--- abi/src/af/util/qnx/GNUmakefile.am.orig	2005-07-08 11:39:01.761239000 -0500
+++ abi/src/af/util/qnx/GNUmakefile.am	2005-07-08 11:39:16.357973000 -0500
@@ -19,7 +19,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES) -I../unix
+AM_CPPFLAGS= $(AF_INCLUDES) -I../unix
 
 noinst_LIBRARIES = libUtil_qnx.a
 
--- abi/src/af/util/unix/ut_unixDirent.h.orig	2005-07-08 11:07:29.010961000 -0500
+++ abi/src/af/util/unix/ut_unixDirent.h	2005-07-08 11:15:17.831529000 -0500
@@ -21,7 +21,7 @@
 #ifndef UT_UNIXDIRENT_H
 #define UT_UNIXDIRENT_H
 
-#ifdef SCANDIR_MISSING
+#ifndef HAVE_SCANDIR
 
 #include <sys/types.h> 
 #include <sys/stat.h> 
@@ -43,7 +43,7 @@
 }
 #endif /* __cplusplus */
 
-#endif // SCANDIR_MISSING
+#endif // !HAVE_SCANDIR
 
 
 #endif // UT_UNIXDIRENT_H
--- abi/src/af/util/unix/ut_unixDirent.cpp.orig	2005-07-08 11:14:20.255967000 -0500
+++ abi/src/af/util/unix/ut_unixDirent.cpp	2005-07-08 11:15:21.886955000 -0500
@@ -18,19 +18,7 @@
  * 02111-1307, USA.
  */
 
-#ifdef SunOS
-
-/*
- * If defined at the top level, this breaks things badly, but these 
- * functions need either _POSIX_C_SOURCE or _XOPEN_SOURCE defined
- * to use the DIR structure as expeceted in the code
-*/
-
-#define _POSIX_C_SOURCE 1
- 
-#endif
-
-#ifdef SCANDIR_MISSING
+#ifndef HAVE_SCANDIR
 /* 
  * Scan the directory dirname calling select to make a list of selected 
  * directory entries then sort using qsort and compare routine dcomp. 
@@ -129,4 +117,4 @@
 				  (*(struct dirent **)(d2))->d_name)); 
 } 
 
-#endif // SCANDIR_MISSING
+#endif // !HAVE_SCANDIR
--- abi/src/af/util/unix/GNUmakefile.am.orig	2005-07-08 11:34:47.223907000 -0500
+++ abi/src/af/util/unix/GNUmakefile.am	2005-07-08 12:50:26.702004000 -0500
@@ -18,7 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= @GMODULE_CFLAGS@ @GTK_CFLAGS@ $(AF_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS)
 
 noinst_LIBRARIES = libUtil_unix.a
 
--- abi/src/af/util/win/GNUmakefile.am.orig	2005-07-08 11:33:24.363087000 -0500
+++ abi/src/af/util/win/GNUmakefile.am	2005-07-08 11:34:00.049616000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES)
 
 noinst_LIBRARIES = libUtil_win.a
 
--- abi/src/af/util/xp/ut_iconv.cpp.orig	2005-07-08 10:55:43.237118000 -0500
+++ abi/src/af/util/xp/ut_iconv.cpp	2005-07-08 12:34:57.190581000 -0500
@@ -50,31 +50,6 @@
 /************************************************************************/
 /************************************************************************/
 
-/* UGLY UGLY Iconv hack for operating systems with strange declartions
-   for iconv.  Why, oh why can't they all be the same? <sob> I will
-   suffer in the afterlife for this - sam - dec 2000 
-
-   Update - the folks repsonsible for the Single Unix Specification
-   are responsible for this.  They will suffer even more in the
-   afterlife than I will. - sam - mar 2001
-
-   Update - I ditched this, it was breaking builds.  Besides, the platforms
-   that would have been broken by using const have since changed to allow it.
-   AIX and hpux are my only concerns, and hpux is under the care of someone
-   else who will look into it.  Enjoy your afterlife, sam. - MG - jun 2002
-*/
-
-#if defined (WIN32) || defined(__QNXNTO__) || defined(__CYGWIN__) ||  \
-(defined (__MACH__) && defined (__APPLE__)) || \
-(defined(TARGET_OS_MAC) && TARGET_OS_MAC) || \
-defined(__BEOS__) || defined (__AIX__) || \
-(defined(__linux__) && defined(__powerpc__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1))
-
-#define ICONV_CONST const
-#else
-#define ICONV_CONST
-#endif
-
 /*
  * This file represents my own personal assault on iconv, the most horrid
  * utility ever, which is yet somehow still essential.
@@ -83,7 +58,6 @@
  * 1) freebsd: requires extern "C" around iconv.h
  * 2) invalid iconv handles (== iconv_t -1 (usually))
  * 3) iconv resetting (vlad's i18n issues)
- * 4) ICONV_CONST passed to iconv()
  * 5) UCS2 internally to AbiWord
  * 6) byte-order problems
  * 7) good C/C++ linkage
--- abi/src/af/util/xp/GNUmakefile.am.orig	2005-07-08 11:33:17.507763000 -0500
+++ abi/src/af/util/xp/GNUmakefile.am	2005-07-08 11:33:57.894501000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES) $(OTHER_INCLUDES) $(ICONV_INCLUDES) $(LIBPNG_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(OTHER_INCLUDES) $(ICONV_INCLUDES) $(LIBPNG_INCLUDES)
 
 noinst_LIBRARIES = libUtil_xp.a
 
--- abi/src/af/util/xp/ut_PerlBindings.cpp.orig	2005-07-08 14:54:00.415239000 -0500
+++ abi/src/af/util/xp/ut_PerlBindings.cpp	2005-07-08 14:54:13.399109000 -0500
@@ -101,12 +101,7 @@
 extern "C" {
 
   // return > 0 for perl directory entries
-#if defined (__APPLE__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
-	|| defined(_AIX)
-  static int perl_only (struct dirent *d)
-#else
-  static int perl_only (const struct dirent *d)
-#endif
+  static int perl_only (SCANDIR_CONST struct dirent *d)
   {
     const char * name = d->d_name;
     
--- abi/src/af/xap/qnx/GNUmakefile.am.orig	2005-07-08 11:33:11.142824000 -0500
+++ abi/src/af/xap/qnx/GNUmakefile.am	2005-07-08 11:33:50.931936000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
 
 noinst_LIBRARIES = libXap_qnx.a
 
--- abi/src/af/xap/cocoa/GNUmakefile.am.orig	2005-07-08 11:33:05.404247000 -0500
+++ abi/src/af/xap/cocoa/GNUmakefile.am	2005-07-08 12:50:21.935217000 -0500
@@ -19,7 +19,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= @GLIB_CFLAGS@ $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GLIB_CFLAGS)
 
 noinst_LIBRARIES = libXap_cocoa.a
 
--- abi/src/af/xap/unix/gnome/GNUmakefile.am.orig	2005-07-08 11:32:59.011422000 -0500
+++ abi/src/af/xap/unix/gnome/GNUmakefile.am	2005-07-08 12:50:07.276263000 -0500
@@ -18,9 +18,9 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= -UVERSION @GMODULE_CFLAGS@ @GTK_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) \
-	@GNOME_CFLAGS@
+AM_CPPFLAGS= -UVERSION $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES)
+AM_CFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
 
 noinst_LIBRARIES = libXap_Gnome.a
 
--- abi/src/af/xap/unix/GNUmakefile.am.orig	Wed Jul  6 18:14:46 2005
+++ abi/src/af/xap/unix/GNUmakefile.am	Tue Jul 12 11:53:15 2005
@@ -22,8 +22,9 @@
 SUBDIRS = gnome
 endif
 
-INCLUDES= -UVERSION @GTK_CFLAGS@ @GMODULE_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS= -UVERSION $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) \
+	$(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GTK_CFLAGS) $(GMODULE_CFLAGS)
 
 noinst_LIBRARIES = libXap_unix.a
 
--- abi/src/af/xap/unix/xap_UnixEncodingManager.cpp.orig	2005-07-08 12:59:39.464313000 -0500
+++ abi/src/af/xap/unix/xap_UnixEncodingManager.cpp	2005-07-08 13:00:52.417408000 -0500
@@ -546,7 +546,7 @@
 					MYLANG += LanguageISOName;
 					MYLANG += "_";
 					MYLANG += LanguageISOTerritory;
-					putenv(MYLANG.utf8_str());
+					putenv((char *)MYLANG.utf8_str());
 #else
 					UT_UTF8String MYLANG (LanguageISOName);
 					MYLANG += "_";
@@ -569,7 +569,7 @@
 #if defined(SETENV_MISSING)
 					MYLANG = "LANG=";
 					MYLANG += OLDLANG;
-					putenv(MYLANG.utf8_str());
+					putenv((char *)MYLANG.utf8_str());
 #else
 					setenv("LANG", OLDLANG.utf8_str(), 1);
 #endif			
--- abi/src/af/xap/win/GNUmakefile.am.orig	2005-07-08 11:32:06.221209000 -0500
+++ abi/src/af/xap/win/GNUmakefile.am	2005-07-08 11:51:24.966531000 -0500
@@ -19,7 +19,7 @@
 include $(top_srcdir)/includes.mk
 
 
-INCLUDES= -UVERSION \
+AM_CPPFLAGS= -UVERSION \
 	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
 
 noinst_LIBRARIES = libXap_win.a
--- abi/src/af/xap/xp/GNUmakefile.am.orig	2005-07-08 11:31:12.776058000 -0500
+++ abi/src/af/xap/xp/GNUmakefile.am	2005-07-08 11:31:57.822914000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS = $(AF_INCLUDES) $(ICONV_INCLUDES) $(OTHER_INCLUDES)
 
 if WITH_RESOURCE_MANAGER
 RESOURCE_MANAGER_OBJ = xap_Resource.cpp xap_ResourceManager.cpp
--- abi/src/bindings/perl/GNUmakefile.am.orig	2005-07-08 11:28:34.623066000 -0500
+++ abi/src/bindings/perl/GNUmakefile.am	2005-07-08 12:49:51.924484000 -0500
@@ -27,11 +27,14 @@
 PERM_RW = 644
 ###################
 
-INCLUDES=\
-	-DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" -DPERL_GCC_BRACE_GROUPS_FORBIDDEN=1\
+AM_CPPFLAGS=\
+	-DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
+	-DPERL_GCC_BRACE_GROUPS_FORBIDDEN=1\
 	$(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) \
-	$(TEXT_INCLUDES) $(SCRIPT_CFLAGS) -I$(top_srcdir) \
-	$(AF_INCLUDES) $(AP_INCLUDES) @GMODULE_CFLAGS@ @GTK_CFLAGS@ 
+	$(TEXT_INCLUDES) -I$(top_srcdir) \
+	$(AF_INCLUDES) $(AP_INCLUDES)
+AM_CXXFLAGS=\
+	$(SCRIPT_CFLAGS) $(GMODULE_CFLAGS) $(GTK_CFLAGS)
 
 AbiWord.cpp: AbiWord.xs $(srcdir)/typemap
 	@perl $(XSUBPP) -typemap $(XSUBPPDIR)/typemap -typemap typemap \
--- abi/src/other/spell/xp/GNUmakefile.am.orig	2005-07-08 11:31:05.576013000 -0500
+++ abi/src/other/spell/xp/GNUmakefile.am	2005-07-08 12:47:40.552302000 -0500
@@ -18,7 +18,8 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES) $(WP_INCLUDES) $(ICONV_INCLUDES) @SPELL_CFLAGS@
+AM_CPPFLAGS = $(AF_INCLUDES) $(WP_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS = $(SPELL_CFLAGS)
 
 noinst_LIBRARIES = libSpell.a
 
--- abi/src/other/ttftool/unix/GNUmakefile.am.orig	2005-07-08 11:28:24.399824000 -0500
+++ abi/src/other/ttftool/unix/GNUmakefile.am	2005-07-08 11:28:58.248473000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES) $(ICONV_INCLUDES) 
+AM_CPPFLAGS = $(AF_INCLUDES) $(ICONV_INCLUDES) 
 
 noinst_LIBRARIES = libTtfTool.a
 
--- abi/src/text/fmt/xp/GNUmakefile.am.orig	2005-07-08 11:30:59.663658000 -0500
+++ abi/src/text/fmt/xp/GNUmakefile.am	2005-07-08 11:31:45.184202000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(TEXT_INCLUDES) $(WP_INCLUDES) $(AF_INCLUDES) $(OTHER_INCLUDES) $(ICONV_INCLUDES)
+AM_CPPFLAGS= $(TEXT_INCLUDES) $(WP_INCLUDES) $(AF_INCLUDES) $(OTHER_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libFmt.a
 
--- abi/src/text/ptbl/xp/GNUmakefile.am.orig	2005-07-08 11:30:53.729863000 -0500
+++ abi/src/text/ptbl/xp/GNUmakefile.am	2005-07-08 11:31:41.376107000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(TEXT_INCLUDES) $(WP_INCLUDES) $(AF_INCLUDES) $(OTHER_INCLUDES)
+AM_CPPFLAGS= $(TEXT_INCLUDES) $(WP_INCLUDES) $(AF_INCLUDES) $(OTHER_INCLUDES)
 
 noinst_LIBRARIES = libPtbl.a
 
--- abi/src/tools/ttftool/unix/GNUmakefile.am.orig	2005-07-08 11:27:41.502021000 -0500
+++ abi/src/tools/ttftool/unix/GNUmakefile.am	2005-07-08 11:28:00.308870000 -0500
@@ -20,7 +20,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES = $(AF_INCLUDES)
+AM_CPPFLAGS = $(AF_INCLUDES)
 
 noinst_PROGRAMS = ttftool
 
--- abi/src/wp/ap/qnx/GNUmakefile.am.orig	2005-07-08 11:30:47.909826000 -0500
+++ abi/src/wp/ap/qnx/GNUmakefile.am	2005-07-08 11:31:37.744189000 -0500
@@ -19,7 +19,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
+AM_CPPFLAGS= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABIWORD_APP_LIBDIR="\"$(ABIWORD_APP_LIBDIR)\"" \
 	$(AF_INCLUDES) $(TEXT_INCLUDES) $(WP_INCLUDES) \
 	$(WV_INCLUDES) $(OTHER_INCLUDES)
--- abi/src/wp/ap/cocoa/GNUmakefile.am.orig	2005-07-08 11:30:07.815282000 -0500
+++ abi/src/wp/ap/cocoa/GNUmakefile.am	2005-07-08 12:49:43.022096000 -0500
@@ -19,10 +19,11 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
+AM_CPPFLAGS= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABIWORD_APP_LIBDIR="\"$(ABIWORD_APP_LIBDIR)\"" \
 	$(AF_INCLUDES) $(TEXT_INCLUDES) $(WP_INCLUDES) \
-	@GMODULE_CFLAGS@ $(OTHER_INCLUDES) $(ICONV_INCLUDES)
+	$(OTHER_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS)
 
 noinst_LIBRARIES = libWpAp_cocoa.a
 
--- abi/src/wp/ap/unix/gnome/GNUmakefile.am.orig	2005-07-08 11:27:49.059168000 -0500
+++ abi/src/wp/ap/unix/gnome/GNUmakefile.am	2005-07-08 12:49:35.811192000 -0500
@@ -18,11 +18,11 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
+AM_CPPFLAGS= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABIWORD_APP_LIBDIR="\"$(ABIWORD_APP_LIBDIR)\"" \
 	$(AF_INCLUDES) $(TEXT_INCLUDES) $(WP_INCLUDES) \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ $(OTHER_INCLUDES) \
-	@GNOME_CFLAGS@
+	$(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
 
 noinst_LIBRARIES = libWpAp_Gnome.a
 
--- abi/src/wp/ap/unix/GNUmakefile.am.orig	Wed Jul  6 17:59:26 2005
+++ abi/src/wp/ap/unix/GNUmakefile.am	Tue Jul 12 11:54:36 2005
@@ -22,15 +22,17 @@
 #SUBDIRS = gnome
 endif
 
-INCLUDES= \
+AM_CPPFLAGS= \
 	-DABIWORD_PREFIX=\""$(prefix)"\"			\
 	-DABIWORD_SYSCONFDIR=\""$(sysconfdir)"\"			\
 	-DABIWORD_DATADIR=\""$(datadir)"\"			\
 	-DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABIWORD_APP_LIBDIR="\"$(ABIWORD_APP_LIBDIR)\"" \
-	-DABIWORD_PLUGINDIR="\"$(libdir)/AbiWord-2.2/plugins/\"" \
+	-DABIWORD_PLUGINDIR="\"$(libdir)/plugins/\"" \
 	$(AF_INCLUDES) $(TEXT_INCLUDES) $(WP_INCLUDES) \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ $(OTHER_INCLUDES) $(ICONV_INCLUDES)
+	$(OTHER_INCLUDES) $(ICONV_INCLUDES)
+AM_CXXFLAGS= \
+	$(GMODULE_CFLAGS) $(GTK_CFLAGS)
 
 noinst_LIBRARIES = libWpAp_unix.a
 
--- abi/src/wp/ap/unix/ap_UnixApp.cpp.orig	2005-07-06 21:42:54.811917000 -0500
+++ abi/src/wp/ap/unix/ap_UnixApp.cpp	2005-07-08 13:43:24.128920000 -0500
@@ -710,12 +710,7 @@
 extern "C" {
 
 	// return > 0 for directory entries ending in ".so" ".sl" and the like
-#if defined (__APPLE__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
-	|| defined(_AIX) || defined(__sgi)
-	static int so_only (struct dirent *d)
-#else
-	static int so_only (const struct dirent *d)
-#endif
+	static int so_only (SCANDIR_CONST struct dirent *d)
 	{
 		const char * name = d->d_name;
 		
--- abi/src/wp/ap/unix/ap_UnixDialog_New.cpp.orig	2005-07-08 14:53:09.836816000 -0500
+++ abi/src/wp/ap/unix/ap_UnixDialog_New.cpp	2005-07-08 14:53:22.544459000 -0500
@@ -237,12 +237,7 @@
 extern "C" {
 
 	// return > 0 for directory entries ending in ".awt" and ".dot"
-#if defined (__APPLE__) || defined (__FreeBSD__) || defined (__OpenBSD__) \
-	|| defined(_AIX) || defined(__sgi)
-	static int awt_only (struct dirent *d)
-#else
-	static int awt_only (const struct dirent *d)
-#endif
+	static int awt_only (SCANDIR_CONST struct dirent *d)
 	{
 		const char * name = d->d_name;
 		
--- abi/src/wp/ap/xp/GNUmakefile.am.orig	2005-07-08 11:30:01.808595000 -0500
+++ abi/src/wp/ap/xp/GNUmakefile.am	2005-07-08 11:30:35.022815000 -0500
@@ -20,7 +20,7 @@
 
 CLEANFILES=ap_wp_splash.cpp ap_wp_sidebar.cpp
 
-INCLUDES= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) \
+AM_CPPFLAGS= $(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) \
 	  $(OTHER_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libWpAp_xp.a
--- abi/src/wp/main/qnx/GNUmakefile.am.orig	2005-07-08 11:29:55.803003000 -0500
+++ abi/src/wp/main/qnx/GNUmakefile.am	2005-07-08 11:30:32.349083000 -0500
@@ -25,7 +25,7 @@
 bin_SCRIPTS = AbiWord
 
 
-INCLUDES = \
+AM_CPPFLAGS = \
 	-DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABISUITE_HOME="\"$(pkgdatadir)\"" \
 	$(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) $(TEXT_INCLUDES) \
--- abi/src/wp/main/cocoa/GNUmakefile.am.orig	2005-07-08 11:29:49.589429000 -0500
+++ abi/src/wp/main/cocoa/GNUmakefile.am	2005-07-08 11:30:27.242496000 -0500
@@ -33,7 +33,7 @@
 
 DEFS = @DEFS@ -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\""
 
-INCLUDES = $(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) $(TEXT_INCLUDES)
+AM_CPPFLAGS = $(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) $(TEXT_INCLUDES)
 
 abi_ver.cpp:
 	cp $(srcdir)/../xp/abi_ver.cpp .
--- abi/src/wp/main/unix/GNUmakefile.am.orig	Wed Jul  6 18:19:35 2005
+++ abi/src/wp/main/unix/GNUmakefile.am	Tue Jul 12 11:56:00 2005
@@ -22,12 +22,12 @@
 
 bin_PROGRAMS = AbiWord-2.2
 
-INCLUDES = \
+AM_CPPFLAGS = \
 	-DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABISUITE_HOME="\"$(pkgdatadir)\"" \
 	$(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) $(TEXT_INCLUDES) \
-	$(PLUGIN_DEFS) -I$(top_srcdir)/../abiword-plugins \
-	$(BINRELOC_CFLAGS)
+	$(PLUGIN_DEFS) -I$(top_srcdir)/../abiword-plugins
+AM_CXXFLAGS = $(BINRELOC_CFLAGS)
 
 REPEAT_LIBS = $(ABI_LIBS) $(ABI_LIBS) $(ABI_LIBS) $(ABI_LIBS)
 
--- abi/src/wp/main/xp/GNUmakefile.am.orig	2005-07-08 11:29:43.817657000 -0500
+++ abi/src/wp/main/xp/GNUmakefile.am	2005-07-08 12:48:57.257209000 -0500
@@ -1,5 +1,7 @@
 
-INCLUDES = \
-	$(WP_INCLUDES) $(BINRELOC_CFLAGS)
+AM_CPPFLAGS = \
+	$(WP_INCLUDES)
+AM_CXXFLAGS = \
+	$(BINRELOC_CFLAGS)
 
 SOURCES = abi_ver.cpp
--- abi/src/wp/impexp/qnx/GNUmakefile.am.orig	2005-07-08 11:28:46.370748000 -0500
+++ abi/src/wp/impexp/qnx/GNUmakefile.am	2005-07-08 12:48:41.640526000 -0500
@@ -18,10 +18,10 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
+AM_CPPFLAGS= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
 	$(TEXT_INCLUDES) $(AF_INCLUDES)  $(ICONV_INCLUDES) \
-	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES) \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ @GNOME_CFLAGS@
+	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
 
 noinst_LIBRARIES = libImpExp_qnx.a
 
--- abi/src/wp/impexp/cocoa/GNUmakefile.am.orig	2005-07-08 11:28:40.202048000 -0500
+++ abi/src/wp/impexp/cocoa/GNUmakefile.am	2005-07-08 12:48:26.071546000 -0500
@@ -19,10 +19,10 @@
 include $(top_srcdir)/includes.mk
 
 
-INCLUDES= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
+AM_CPPFLAGS= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
 	$(TEXT_INCLUDES) $(AF_INCLUDES)  $(ICONV_INCLUDES) \
-	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES)  \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ @GNOME_CFLAGS@
+	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
 
 noinst_LIBRARIES = libImpExp_cocoa.a
 
--- abi/src/wp/impexp/unix/GNUmakefile.am.orig	2005-07-08 11:26:43.007519000 -0500
+++ abi/src/wp/impexp/unix/GNUmakefile.am	2005-07-08 12:48:09.906483000 -0500
@@ -18,10 +18,10 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
+AM_CPPFLAGS= $(PSICONV_INCLUDES) $(WP_INCLUDES) \
 	$(TEXT_INCLUDES) $(AF_INCLUDES)  $(ICONV_INCLUDES) \
-	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES)  \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ @GNOME_CFLAGS@
+	$(LIBPNG_INCLUDES) $(OTHER_INCLUDES)
+AM_CXXFLAGS= $(GMODULE_CFLAGS) $(GTK_CFLAGS) $(GNOME_CFLAGS)
 
 noinst_LIBRARIES = libImpExp_unix.a
 
--- abi/src/wp/impexp/xp/GNUmakefile.am.orig	2005-07-08 11:26:36.996246000 -0500
+++ abi/src/wp/impexp/xp/GNUmakefile.am	2005-07-08 11:26:55.748996000 -0500
@@ -18,7 +18,7 @@
 
 include $(top_srcdir)/includes.mk
 
-INCLUDES=  $(OTHER_INCLUDES) $(PSICONV_INCLUDES) $(WP_INCLUDES) \
+AM_CPPFLAGS=  $(OTHER_INCLUDES) $(PSICONV_INCLUDES) $(WP_INCLUDES) \
 	$(TEXT_INCLUDES) $(AF_INCLUDES) $(WV_INCLUDES) $(ICONV_INCLUDES) \
 	$(LIBPNG_INCLUDES)
 
--- abi/configure.ac.orig	2005-07-08 11:12:37.438971000 -0500
+++ abi/configure.ac	2005-07-08 13:44:44.347272000 -0500
@@ -356,6 +356,9 @@
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS(re_comp regcomp strdup strstr strcasecmp stricmp)
 
+dnl check for scandir
+ABI_SCANDIR
+
 AC_CHECK_FUNC(putenv,abi_putenv=maybe,abi_putenv=no)
 AC_CHECK_FUNC(setenv,abi_setenv=maybe,abi_setenv=no)
 
--- abiword-plugins/tools/abidash/xp/dashboard-frontend.c.orig	2005-07-08 10:54:32.372600000 -0500
+++ abiword-plugins/tools/abidash/xp/dashboard-frontend.c	2005-07-08 10:54:57.206056000 -0500
@@ -50,7 +50,7 @@
 		return 0;
 	}
 
-	bzero ((char *) &sock, sizeof (sock));
+	memset ((char *) &sock, 0, sizeof (sock));
 	sock.sin_family      = AF_INET;
 	sock.sin_port        = htons (DASHBOARD_PORT);
 	sock.sin_addr.s_addr = inet_addr ("127.0.0.1");
--- abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.am.orig	Fri Jul  8 13:20:49 2005
+++ abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.am	Tue Jul 12 11:57:10 2005
@@ -1,6 +1,7 @@
-CPPFLAGS = @ABI_CPPFLAGS@ @CPPFLAGS@ @LIBRSVG_CPPFLAGS@ @PLATFORM_CPPFLAGS@
+AM_CPPFLAGS = $(ABI_CPPFLAGS) $(LIBRSVG_CPPFLAGS) \
+	$(PLATFORM_CPPFLAGS) $(LIBPNG_CFLAGS)
 
-LDFLAGS = @LDFLAGS@ @LIBRSVG_LDFLAGS@ @PLATFORM_LDFLAGS@
+AM_LDFLAGS = $(LIBRSVG_LDFLAGS) $(PLATFORM_LDFLAGS)
 
 plugindir = @ABI_PLUGIN_DIR@
 
--- abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp.orig	2005-07-08 16:24:08.222630000 -0500
+++ abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp	2005-07-08 16:24:28.264857000 -0500
@@ -36,6 +36,9 @@
 #include "ie_impGraphic.h"
 #include "fg_GraphicRaster.h"
 
+// Workaround for __jmpbuf #define on AIX
+#undef jmpbuf
+
 //------------------------------------------------------------------------------------
 
 /*! 
Received on Tue Jul 12 18:57:33 2005

This archive was generated by hypermail 2.1.8 : Tue Jul 12 2005 - 18:57:33 CEST