]> Pileus Git - ~andy/gtk/blobdiff - configure.in
Reverted global changes of g_new to malloc(), added back in the one place
[~andy/gtk] / configure.in
index 9aa45647f16ec30206e507cdeaa394f43facb1e8..1f3b62ab41e27e478e2715571f03a4a0bed208f5 100644 (file)
@@ -14,13 +14,15 @@ cflags_set=${CFLAGS+set}
 #
 GTK_MAJOR_VERSION=1
 GTK_MINOR_VERSION=1
-GTK_MICRO_VERSION=0
+GTK_MICRO_VERSION=2
 GTK_INTERFACE_AGE=0
 GTK_BINARY_AGE=0
 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
 AC_SUBST(GTK_MAJOR_VERSION)
 AC_SUBST(GTK_MINOR_VERSION)
 AC_SUBST(GTK_MICRO_VERSION)
+AC_SUBST(GTK_INTERFACE_AGE)
+AC_SUBST(GTK_BINARY_AGE)
 AC_SUBST(GTK_VERSION)
 
 # libtool versioning
@@ -33,14 +35,10 @@ AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
 AC_SUBST(LT_AGE)
 
-
 # For automake.
 VERSION=$GTK_VERSION
 PACKAGE=gtk+
 
-# Configure glib
-AC_CONFIG_SUBDIRS(glib)
-
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
@@ -63,6 +61,7 @@ AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available
 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
                    , enable_ansi=no)
+AC_ARG_WITH(glib, [  --with-glib=DIR         Use uninstalled copy of glib])
 AC_ARG_ENABLE(xim, [  --enable-xim            support XIM [default=yes]],
                        echo $enable_xim, enable_xim="yes")
 AC_ARG_WITH(locale, [  --with-locale=LOCALE    locale name you want to use ])
@@ -81,6 +80,8 @@ else
   fi
 fi
 
+AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}")
+
 # Build time sanity check...
 AM_SANITY_CHECK
 
@@ -106,8 +107,9 @@ if test "x$GCC" = "xyes"; then
   fi
 fi
 
-AC_MSG_CHECKING([For extra flags to get ANSI library prototypes])
-gtk_save_LDFLAGS=$LDFLAGS
+dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
+AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
+gtk_save_LIBS=$LIBS
 LIBS="$LIBS -lm"
 AC_TRY_RUN([#include <math.h>
              int main (void) { return (log(1) != log(1.)); }],
@@ -125,10 +127,73 @@ AC_TRY_RUN([#include <math.h>
 )
 LIBS=$gtk_save_LIBS
 
+dnl NeXTStep cc seems to need this
+AC_MSG_CHECKING([for extra flags for POSIX compliance])
+AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
+  AC_MSG_RESULT(none needed),
+  gtk_save_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -posix"
+  AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
+    AC_MSG_RESULT(-posix),
+    AC_MSG_RESULT()
+    CFLAGS=$gtk_save_CFLAGS
+    AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
+
 if test "x$enable_xim" = "xyes"; then
   CFLAGS="$CFLAGS -DUSE_XIM"
 fi
 
+if test x$with_glib = xyes ; then
+  AC_MSG_ERROR([
+*** Directory must be specified for --with-glib])
+fi
+
+if test x$with_glib = x ; then 
+  # Look for separately installed glib
+
+  AM_PATH_GLIB(1.1.3,,
+    AC_MSG_ERROR([
+*** GLIB 1.1.3 or better is required. The latest version of GLIB
+*** is always available from ftp://ftp.gtk.org.]),
+    gmodule)
+
+  glib_cflags=$GLIB_CFLAGS
+  glib_libs=$GLIB_LIBS
+else
+  # Use uninstalled glib (assume they got the version right)
+
+  if test -x $with_glib/glib-config ; then 
+    :
+  else
+    AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
+  fi
+
+  # For use in gtk-config
+  glib_cflags=`$with_glib/glib-config --cflags`
+  glib_libs=`$with_glib/glib-config --libs`
+
+  glib_release=`$with_glib/glib-config --version | sed 's%\\.[[0-9]]*$%%'`
+
+  # canonicalize relative paths
+  case $with_glib in 
+    /*)
+      glib_dir=$with_glib
+      ;;
+    *)
+      glib_dir="\$(top_builddir)/$with_glib"
+      ;;
+  esac
+
+  GLIB_CFLAGS="-I$glib_dir"
+  GLIB_LIBS=$glib_dir/libglib-$glib_release.la
+
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+fi
+
+AC_SUBST(glib_cflags)
+AC_SUBST(glib_libs)
+
 # Find the X11 include and library directories
 AC_PATH_X
 AC_PATH_XTRA
@@ -176,6 +241,13 @@ AC_CHECK_LIB(Xext, XShapeCombineMask,
       ,
       $x_libs)
 
+# Check for XConvertCase (X11R6 specific)
+
+AC_CHECK_LIB(X11, XConvertCase,
+      AC_DEFINE(HAVE_XCONVERTCASE),
+      ,
+      $x_libs)
+
 x_cflags="$X_CFLAGS"
 x_ldflags="$X_LDFLAGS $X_LIBS"
 
@@ -311,25 +383,29 @@ AC_HEADER_STDC
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
+# Checks for endianness (needed by GdkRgb).
+AC_C_BIGENDIAN
+
 # Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_MMAP
 
-# Check for sys/select.h
-
-AC_MSG_CHECKING([fd_set and sys/select])
+# Check if <sys/select.h> needs to be included for fd_set
+AC_MSG_CHECKING([for fd_set])
 AC_TRY_COMPILE([#include <sys/types.h>],
         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
-if test $gtk_ok = no; then
+if test $gtk_ok = yes; then
+    AC_MSG_RESULT([yes, found in sys/types.h])
+else
     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
     if test $gtk_ok = yes; then
         AC_DEFINE(HAVE_SYS_SELECT_H)
+        AC_MSG_RESULT([yes, found in sys/select.h])
+    else
+       AC_DEFINE(NO_FD_SET)
+       AC_MSG_RESULT(no)
     fi
 fi
-AC_MSG_RESULT($gtk_ok)
-if test $gtk_ok = no; then
-    AC_DEFINE(NO_FD_SET)
-fi
 
 AC_OUTPUT([
 Makefile