AC_DEFINE_UNQUOTED(GLIB_BINARY_AGE, $GLIB_BINARY_AGE)
dnl Initialize libtool
-AM_PROG_LIBTOOL
+AC_PROG_LIBTOOL
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
# Checks for library functions.
AC_FUNC_VPRINTF
+AC_FUNC_ALLOCA
+
AC_CHECK_FUNCS(atexit on_exit)
AC_CHECK_SIZEOF(char)
size_includes=["
#include <stdarg.h>
#include <stdio.h>
-#include <stdlib.h>
#include <ctype.h>
#include <string.h>
"]
GLIB_SIZEOF([$size_includes], intmax_t, intmax_t)
# Check for some functions
-AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf strcasecmp strncasecmp poll)
+AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf strcasecmp strncasecmp poll getcwd)
# Check if bcopy can be used for overlapping copies, if memmove isn't found.
# The check is borrowed from the PERL Configure script.
AC_MSG_CHECKING(for sys_siglist)
AC_TRY_LINK(, [
extern char *sys_siglist[];
-strlen (sys_siglist[0]);
+exit (sys_siglist[0]);
], glib_ok=yes, glib_ok=no)
AC_MSG_RESULT($glib_ok)
if test $glib_ok = no; then
AC_DEFINE(HAVE_CODESET)
have_codeset=yes,
have_codeset=no)
-
AC_MSG_RESULT($have_codeset)
+
+
+dnl ****************************************
+dnl *** strlcpy/strlcat ***
+dnl ****************************************
+# Check for strlcpy
+AC_MSG_CHECKING(for strlcpy/strlcat)
+AC_TRY_LINK([#include <stdlib.h>
+#include <string.h>], [
+char *p = malloc(10);
+(void) strlcpy(p, "hi", 10);
+(void) strlcat(p, "bye", 10);
+], glib_ok=yes, glib_ok=no)
+AC_MSG_RESULT($glib_ok)
+if test $glib_ok = yes; then
+ AC_DEFINE(HAVE_STRLCPY)
+fi
dnl **********************
glibconfig-sysdefs.h,
=)
+dnl **************************
+dnl *** Checks for gtk-doc ***
+dnl **************************
+
+AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
+
+if test "x$with_html_dir" = "x" ; then
+ HTML_DIR='${datadir}/gtk-doc/html'
+else
+ HTML_DIR=$with_html_dir
+fi
+
+AC_SUBST(HTML_DIR)
+
+
+AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
+AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
+AC_SUBST(HAVE_GTK_DOC)
+
+AC_CHECK_PROG(DB2HTML, db2html, true, false)
+AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
+
+dnl Let people disable the gtk-doc stuff.
+AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
+
+if test x$enable_gtk_doc = xauto ; then
+ if test x$GTKDOC = xtrue ; then
+ enable_gtk_doc=yes
+ else
+ enable_gtk_doc=no
+ fi
+fi
+
+dnl NOTE: We need to use a separate automake conditional for this
+dnl to make this work with the tarballs.
+AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
dnl ******************************
dnl *** output the whole stuff ***
#ifndef GLIBCONFIG_H
#define GLIBCONFIG_H
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
_______EOF
if test x$glib_limits_h = xyes; then
if test x$g_mutex_header_file != x; then
echo '#include <'"$g_mutex_header_file"'>' >> $outfile
fi
+ if test "$glib_header_alloca_h" = "yes"; then
+ echo '#include <alloca.h>' >> $outfile
+ fi
if test x$glib_sys_poll_h = xyes; then
echo '#define GLIB_HAVE_SYS_POLL_H' >> $outfile
fi
cat >> $outfile <<_______EOF
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define G_MINFLOAT $glib_mf
#define G_MAXFLOAT $glib_Mf
#define G_MINDOUBLE $glib_md
#define G_GINT64_FORMAT $gint64_format
#define G_GUINT64_FORMAT $guint64_format
#define G_GINT64_CONSTANT(val) $gint64_constant
+
_______EOF
fi
+ case x$glib_size_t in
+ x2) echo "typedef gint16 gssize;" >> $outfile
+ echo "typedef guint16 gsize;" >> $outfile
+ ;;
+ x4) echo "typedef gint32 gssize;" >> $outfile
+ echo "typedef guint32 gsize;" >> $outfile
+ ;;
+ x8) echo "typedef gint64 gssize;" >> $outfile
+ echo "typedef guint64 gsize;" >> $outfile
+ ;;
+ *) echo "#error size of size_t is unknown" >> $outfile
+ ;;
+ esac
if test -z "$glib_unknown_void_p"; then
cat >>$outfile <<_______EOF
# on variable expansion in case labels. Look at the generated config.status
# for a hint.
+glib_header_alloca_h="$ac_cv_header_alloca_h"
+
case xyes in
x$ac_cv_header_float_h)
glib_float_h=yes
gint64_constant='(G_GNUC_EXTENSION (val##LL))'
;;
esac
+glib_size_t=$glib_cv_sizeof_size_t
gintbits=`expr $ac_cv_sizeof_int \* 8`
glongbits=`expr $ac_cv_sizeof_long \* 8`
])
AC_OUTPUT([
+glib-2.0.pc
+gmodule-2.0.pc
+gthread-2.0.pc
+gobject-2.0.pc
glib.spec
Makefile
glib-config-2.0
+build/Makefile
+build/win32/Makefile
gmodule/gmoduleconf.h
gmodule/Makefile
gobject/Makefile
gthread/Makefile
docs/Makefile
docs/glib-config.1
+docs/reference/Makefile
+docs/reference/glib/Makefile
+docs/reference/gobject/Makefile
tests/Makefile
],[case "$CONFIG_FILES" in
*glib-config-2.0*)chmod +x glib-config-2.0;;