All of these patches are needed in my effort to build AbiWord on FreeBSD
using the autoconf framework.

The first set of four patches changes those GNUmakefile.am files that
need to include the $(ICONV_INCLUDES) directory.  This is needed to
compile properly on FreeBSD (and presumably any other platform that
uses the peer directory of libiconv).

The second set of four patches make the following changes: They take
the glib and gtk detection code and remove it from both 
configure.in-v2.13 and configure.in-v2.50.  They place that code into
a new file in the ac-helpers subdirectory called abi-glib-gtk.m4.
The new ac-helpers version also supports FreeBSD properly, by using
glib12-config and gtk12-config instead of glib-config and gtk-config.
The patch to abi-detect-platorm.m4 allows the other scripts to
detect the FreeBSD operating system.  Finally, both configure.in scripts
are modified to use the correct compilation flags on FreeBSD.

Alec

--- wp/ap/unix/GNUmakefile.am.orig	Sun Apr 29 12:32:03 2001
+++ wp/ap/unix/GNUmakefile.am	Mon Jun 25 21:06:31 2001
@@ -25,7 +25,7 @@
 INCLUDES= -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
 	-DABIWORD_APP_LIBDIR="\"$(ABIWORD_APP_LIBDIR)\"" \
 	$(AF_INCLUDES) $(TEXT_INCLUDES) $(WP_INCLUDES) \
-	@GMODULE_CFLAGS@ @GTK_CFLAGS@ $(OTHER_INCLUDES)
+	@GMODULE_CFLAGS@ @GTK_CFLAGS@ $(OTHER_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libWpAp_unix.a
 
--- af/xap/unix/GNUmakefile.am.orig	Thu Jun  7 08:52:11 2001
+++ af/xap/unix/GNUmakefile.am	Mon Jun 25 21:00:48 2001
@@ -23,7 +23,7 @@
 endif
 
 INCLUDES= -UVERSION @GMODULE_CFLAGS@ @GTK_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES)
+	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
 
 noinst_LIBRARIES = libXap_unix.a
 
--- af/gr/unix/GNUmakefile.am.orig	Mon Apr 30 14:22:09 2001
+++ af/gr/unix/GNUmakefile.am	Mon Jun 25 20:56:30 2001
@@ -19,7 +19,7 @@
 include $(top_srcdir)/includes.mk
 
 INCLUDES= $(PLATFORM_CFLAGS) \
-	$(AF_INCLUDES)
+	$(AF_INCLUDES) $(ICONV_INCLUDES)
 
 
 noinst_LIBRARIES = libGr_unix.a
--- af/ev/unix/GNUmakefile.am.orig	Sun Apr 15 01:38:42 2001
+++ af/ev/unix/GNUmakefile.am	Mon Jun 25 20:12:47 2001
@@ -19,7 +19,7 @@
 include $(top_srcdir)/includes.mk
 
 INCLUDES= @GTK_CFLAGS@ @GMODULE_CFLAGS@ \
-	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES)	
+	$(AF_INCLUDES) $(WP_INCLUDES) $(TEXT_INCLUDES) $(ICONV_INCLUDES)
 
 if WITH_GNOME
 SUBDIRS = gnome
--- ../ac-helpers.orig/abi-glib-gtk.m4	Wed Dec 31 16:00:00 1969
+++ ../ac-helpers/abi-glib-gtk.m4	Mon Jun 25 19:14:55 2001
@@ -0,0 +1,65 @@
+
+# On unix, Check for glib and gtk libraries.  Ensure that the version
+# number of glib is >= 1.2.0 and the version number of gtk is >= 1.2.2
+
+# Usage: 
+# ABI_GLIB_GTK
+#
+
+AC_DEFUN([ABI_GLIB_GTK], [
+
+if test "$OS_NAME" = "FreeBSD"; then
+	GLIB_CONFIG=glib12-config
+	GTK_CONFIG=gtk12-config
+else
+	GLIB_CONFIG=glib-config
+	GTK_CONFIG=gtk-config
+fi
+
+if test "$PLATFORM" = "unix"; then
+        dnl ******************************
+        dnl glib checking
+        dnl ******************************
+        AC_MSG_CHECKING(for glib >= 1.2.0)
+        if $GLIB_CONFIG --version > /dev/null 2>&1; then 
+            dnl We need the "%d" in order not to get e-notation on hpux.
+            vers=`$GLIB_CONFIG --version | awk 'BEGIN { FS = "."; } { printf "%d", ($[1] * 1000 + $[2]) * 1000 + $[3];}'`
+            if test "$vers" -ge 1002000; then
+                AC_MSG_RESULT(found)
+            else
+	        AC_MSG_ERROR(You need at least glib 1.2.0 for this version of AbiWord)
+            fi
+        else
+            AC_MSG_ERROR(Did not find glib installed)
+        fi
+
+        dnl AM_PATH_GLIB(1.2.0)
+        GMODULE_CFLAGS=`$GLIB_CONFIG --cflags gmodule`
+        GMODULE_LIBS=`$GLIB_CONFIG --libs gmodule`
+
+        dnl ******************************
+        dnl gtk+ checking
+        dnl ******************************
+        AC_MSG_CHECKING(for GTK >= 1.2.2)
+        if $GTK_CONFIG --version > /dev/null 2>&1; then 
+            dnl We need the "%d" in order not to get e-notation on hpux.
+            vers=`$GTK_CONFIG --version | awk 'BEGIN { FS = "."; } { printf "%d", ($[1] * 1000 + $[2]) * 1000 + $[3];}'`
+            if test "$vers" -ge 1002002; then
+                AC_MSG_RESULT(found)
+            else
+                AC_MSG_ERROR(You need at least GTK+ 1.2.2 for this version of AbiWord)
+            fi
+        else
+            AC_MSG_ERROR(Did not find GTK+ installed)
+        fi
+
+        GTK_CFLAGS=`$GTK_CONFIG --cflags`
+        GTK_LIBS=`$GTK_CONFIG --libs`
+
+        AC_SUBST(GTK_CFLAGS)
+        AC_SUBST(GTK_LIBS)
+        AC_SUBST(GMODULE_CFLAGS)
+        AC_SUBST(GMODULE_LIBS)
+fi
+
+])
--- ../ac-helpers/abi-detect-platform.m4.orig	Mon Jun 25 18:01:47 2001
+++ ../ac-helpers/abi-detect-platform.m4	Mon Jun 25 19:11:11 2001
@@ -84,5 +84,6 @@
 esac
 
 AC_SUBST(PLATFORM)
+AC_SUBST(OS_NAME)
 
 ])
--- ../configure.in-v2.50.orig	Sun Jun 24 19:01:00 2001
+++ ../configure.in-v2.50	Mon Jun 25 21:16:39 2001
@@ -61,6 +61,8 @@
 dnl precompiled Mac headers.... with Apple's GCC.
 if test "$PLATFORM" = "mac"; then
 	WARNING_CFLAGS=""
+elif test "$OS_NAME" = "FreeBSD"; then
+	WARNING_CFLAGS="-Wall -pedantic -ansi -D_BSD_SOURCE -pipe"
 else
 	WARNING_CFLAGS="-Wall -pedantic -ansi -D_POSIX_SOURCE -D_BSD_SOURCE -pipe"
 fi
@@ -90,53 +92,8 @@
 fi
 AC_SUBST(ICONV_INCLUDES)
 
-if test "$PLATFORM" = "unix"; then
-	dnl ******************************
-	dnl glib checking
-	dnl ******************************
-	AC_MSG_CHECKING(for glib >= 1.2.0)
-	if glib-config --version > /dev/null 2>&1; then 
-	    dnl We need the "%d" in order not to get e-notation on hpux.
-	    vers=`glib-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-	    if test "$vers" -ge 1002000; then
-	        AC_MSG_RESULT(found)
-	    else
-	        AC_MSG_ERROR(You need at least glib 1.2.0 for this version of AbiWord)
-	    fi
-	else
-	    AC_MSG_ERROR(Did not find glib installed)
-	fi
-
-	dnl AM_PATH_GLIB(1.2.0)
-	GMODULE_CFLAGS=`glib-config --cflags gmodule`
-	AC_SUBST(GMODULE_CFLAGS)
-	GMODULE_LIBS=`glib-config --libs gmodule`
-	AC_SUBST(GMODULE_LIBS)
-
-	dnl ******************************
-	dnl gtk+ checking
-	dnl ******************************
-	AC_MSG_CHECKING(for GTK >= 1.2.2)
-	if gtk-config --version > /dev/null 2>&1; then 
-	    dnl We need the "%d" in order not to get e-notation on hpux.
-	    vers=`gtk-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-	    if test "$vers" -ge 1002002; then
-	        AC_MSG_RESULT(found)
-	    else
-	        AC_MSG_ERROR(You need at least GTK+ 1.2.2 for this version of AbiWord)
-	    fi
-	else
-	    AC_MSG_ERROR(Did not find GTK+ installed)
-	fi
-
-	dnl AM_PATH_GTK(1.2.2)
-	GTK_CFLAGS=`gtk-config --cflags`
-	AC_SUBST(GTK_CFLAGS)
-	GTK_LIBS=`gtk-config --libs`
-	AC_SUBST(GTK_LIBS)
-
-	dnl GNOME_INIT
-fi
+dnl locate glib and gtk
+ABI_GLIB_GTK
 
 ABIWORD_APP_NAME="AbiWord"
 AC_SUBST(ABIWORD_APP_NAME)
--- configure.in-v2.13.orig	Mon Jun 25 20:41:56 2001
+++ configure.in-v2.13	Mon Jun 25 20:46:56 2001
@@ -58,6 +58,8 @@
 dnl precompiled Mac headers.... with Apple's GCC.
 if test "$PLATFORM" = "mac"; then
 	WARNING_CFLAGS=""
+elif test "$OS_NAME" = "FreeBSD"; then
+	WARNING_CFLAGS="-Wall -pedantic -ansi -D_BSD_SOURCE -pipe"
 else
 	WARNING_CFLAGS="-Wall -pedantic -ansi -D_POSIX_SOURCE -D_BSD_SOURCE -pipe"
 fi
@@ -87,53 +89,8 @@
 fi
 AC_SUBST(ICONV_INCLUDES)
 
-if test "$PLATFORM" = "unix"; then
-	dnl ******************************
-	dnl glib checking
-	dnl ******************************
-	AC_MSG_CHECKING(for glib >= 1.2.0)
-	if glib-config --version > /dev/null 2>&1; then 
-	    dnl We need the "%d" in order not to get e-notation on hpux.
-	    vers=`glib-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-	    if test "$vers" -ge 1002000; then
-	        AC_MSG_RESULT(found)
-	    else
-	        AC_MSG_ERROR(You need at least glib 1.2.0 for this version of AbiWord)
-	    fi
-	else
-	    AC_MSG_ERROR(Did not find glib installed)
-	fi
-
-	dnl AM_PATH_GLIB(1.2.0)
-	GMODULE_CFLAGS=`glib-config --cflags gmodule`
-	AC_SUBST(GMODULE_CFLAGS)
-	GMODULE_LIBS=`glib-config --libs gmodule`
-	AC_SUBST(GMODULE_LIBS)
-
-	dnl ******************************
-	dnl gtk+ checking
-	dnl ******************************
-	AC_MSG_CHECKING(for GTK >= 1.2.2)
-	if gtk-config --version > /dev/null 2>&1; then 
-	    dnl We need the "%d" in order not to get e-notation on hpux.
-	    vers=`gtk-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
-	    if test "$vers" -ge 1002002; then
-	        AC_MSG_RESULT(found)
-	    else
-	        AC_MSG_ERROR(You need at least GTK+ 1.2.2 for this version of AbiWord)
-	    fi
-	else
-	    AC_MSG_ERROR(Did not find GTK+ installed)
-	fi
-
-	dnl AM_PATH_GTK(1.2.2)
-	GTK_CFLAGS=`gtk-config --cflags`
-	AC_SUBST(GTK_CFLAGS)
-	GTK_LIBS=`gtk-config --libs`
-	AC_SUBST(GTK_LIBS)
-
-	dnl GNOME_INIT
-fi
+dnl locate glib and gtk
+ABI_GLIB_GTK
 
 ABIWORD_APP_NAME="AbiWord"
 AC_SUBST(ABIWORD_APP_NAME)

Reply via email to