Resend: a bunch more autoconf patches


Subject: Resend: a bunch more autoconf patches
From: Alec Wolman (wolman@cs.washington.edu)
Date: Mon Jul 02 2001 - 13:43:10 CDT


I sent this patch about a week ago. Could someone please review
and then hopefully commit it? Thanks,

Alec

------- Forwarded Message

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

The first set of 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 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.

Here it is as one big patch:

diff -u -N -r abi/ac-helpers/abi-detect-platform.m4
abi.new/ac-helpers/abi-detect-platform.m4
- --- abi/ac-helpers/abi-detect-platform.m4 Mon Jun 25 18:01:47 2001
+++ abi.new/ac-helpers/abi-detect-platform.m4 Tue Jun 26 11:13:31 2001
@@ -84,5 +84,6 @@
 esac
 
 AC_SUBST(PLATFORM)
+AC_SUBST(OS_NAME)
 
 ])
diff -u -N -r abi/ac-helpers/abi-glib-gtk.m4 abi.new/ac-helpers/abi-glib-gtk.m4
- --- abi/ac-helpers/abi-glib-gtk.m4 Wed Dec 31 16:00:00 1969
+++ abi.new/ac-helpers/abi-glib-gtk.m4 Tue Jun 26 11:13:13 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
+
+])
diff -u -N -r abi/configure.in-v2.13 abi.new/configure.in-v2.13
- --- abi/configure.in-v2.13 Sun Jun 24 19:01:00 2001
+++ abi.new/configure.in-v2.13 Tue Jun 26 11:11:29 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)
diff -u -N -r abi/configure.in-v2.50 abi.new/configure.in-v2.50
- --- abi/configure.in-v2.50 Sun Jun 24 19:01:00 2001
+++ abi.new/configure.in-v2.50 Tue Jun 26 11:12:44 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)
diff -u -N -r abi/src/af/ev/unix/GNUmakefile.am abi.new/src/af/ev/unix/GNUmakef
ile.am
- --- abi/src/af/ev/unix/GNUmakefile.am Sun Apr 15 01:38:42 2001
+++ abi.new/src/af/ev/unix/GNUmakefile.am Tue Jun 26 11:14:14 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
diff -u -N -r abi/src/af/gr/unix/GNUmakefile.am abi.new/src/af/gr/unix/GNUmakef
ile.am
- --- abi/src/af/gr/unix/GNUmakefile.am Mon Apr 30 14:22:09 2001
+++ abi.new/src/af/gr/unix/GNUmakefile.am Tue Jun 26 11:14:20 2001
@@ -19,7 +19,7 @@
 include $(top_srcdir)/includes.mk
 
 INCLUDES= $(PLATFORM_CFLAGS) \
- - $(AF_INCLUDES)
+ $(AF_INCLUDES) $(ICONV_INCLUDES)
 
 
 noinst_LIBRARIES = libGr_unix.a
diff -u -N -r abi/src/af/xap/unix/GNUmakefile.am abi.new/src/af/xap/unix/GNUmak
efile.am
- --- abi/src/af/xap/unix/GNUmakefile.am Thu Jun 7 08:52:11 2001
+++ abi.new/src/af/xap/unix/GNUmakefile.am Tue Jun 26 11:14:25 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
 
diff -u -N -r abi/src/wp/ap/unix/GNUmakefile.am abi.new/src/wp/ap/unix/GNUmakef
ile.am
- --- abi/src/wp/ap/unix/GNUmakefile.am Sun Apr 29 12:32:03 2001
+++ abi.new/src/wp/ap/unix/GNUmakefile.am Tue Jun 26 11:14: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
 

------- End of Forwarded Message



This archive was generated by hypermail 2b25 : Mon Jul 02 2001 - 13:43:16 CDT