builtin(include, glib/libcharset/codeset.m4)dnl
builtin(include, glib/libcharset/glibc21.m4)dnl
-# require autoconf 2.13
-AC_PREREQ(2.13)
+# require autoconf 2.52
+AC_PREREQ(2.52)
# Process this file with autoconf to produce a configure script.
AC_INIT(glib/glib.h)
# if backwards compatibility has been broken,
# set GLIB_BINARY_AGE _and_ GLIB_INTERFACE_AGE to 0.
#
-GLIB_MAJOR_VERSION=1
-GLIB_MINOR_VERSION=3
-GLIB_MICRO_VERSION=10
-GLIB_INTERFACE_AGE=0
-GLIB_BINARY_AGE=0
+GLIB_MAJOR_VERSION=2
+GLIB_MINOR_VERSION=0
+GLIB_MICRO_VERSION=1
+GLIB_INTERFACE_AGE=1
+GLIB_BINARY_AGE=1
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
])dnl
AM_PROG_CC_STDC
AC_PROG_INSTALL
+AC_SYS_LARGEFILE
+
#
# Find pkg-config
#
AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
fi
-if pkg-config --atleast-pkgconfig-version 0.5 ; then
+if $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then
:
else
AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
fi
AC_SUBST(PERL_PATH)
+dnl ***********************
+dnl *** Tests for iconv ***
+dnl ***********************
+dnl
+dnl We do this before the gettext checks, to avoid distortion
+
+AC_ARG_WITH(libiconv, [ --with-libiconv=[no/gnu/native] use the libiconv library ],,with_libiconv=maybe)
+
+found_iconv=no
+case $with_libiconv in
+ maybe)
+ # Check in the C library first
+ AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes)
+ # Check if we have GNU libiconv
+ if test $found_iconv = "no"; then
+ AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=gnu; found_iconv=yes)
+ fi
+ # Check if we have a iconv in -liconv, possibly from vendor
+ if test $found_iconv = "no"; then
+ AC_CHECK_LIB(iconv, iconv_open, with_libiconv=native; found_iconv=yes)
+ fi
+ ;;
+ no)
+ AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes)
+ ;;
+ gnu|yes)
+ AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=gnu; found_iconv=yes)
+ ;;
+ native)
+ AC_CHECK_LIB(iconv, iconv_open, with_libiconv=native; found_iconv=yes)
+ ;;
+esac
+
+if test "x$found_iconv" = "xno" ; then
+ AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
+fi
+
dnl
dnl gettext support
dnl
-ALL_LINGUAS="az ca de es eu fr nn no ro ru sk sl sv ta tr uk zh_CN zh_TW"
+ALL_LINGUAS="az ca cs de el es eu fr gl hi ja ko ms nl nn no pl pt ro ru sk sl sv ta tr uk vi zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
if test "$gt_cv_func_dgettext_libc" = "yes" || test "$gt_cv_func_dgettext_libintl" = "yes"; then
GLIB_LOCALE_DIR="${prefix}/${DATADIRNAME}/locale"
AC_DEFINE_UNQUOTED(GLIB_LOCALE_DIR,"$GLIB_LOCALE_DIR")
+AC_CHECK_FUNCS(bind_textdomain_codeset)
+
+dnl
+dnl Now we are done with gettext checks, figure out ICONV_LIBS
+dnl
+
+if test x$with_libiconv != xno ; then
+ case " $INTLLIBS " in
+ *[[\ \ ]]-liconv[[\ \ ]]*) ;;
+ *) ICONV_LIBS="-liconv" ;;
+ esac
+fi
+AC_SUBST(ICONV_LIBS)
+
+case $with_libiconv in
+ gnu)
+ AC_DEFINE(USE_LIBICONV_GNU, [Using GNU libiconv])
+ ;;
+ native)
+ AC_DEFINE(USE_LIBICONV_NATIVE, [Using a native implementation of iconv in a separate library])
+ ;;
+esac
+
dnl Initialize libtool
+AM_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
if test x$ac_cv_sizeof_long_long = x8; then
# long long is a 64 bit integer.
- AC_MSG_CHECKING(for format to printf and scanf a gint64)
+ AC_MSG_CHECKING(for format to printf and scanf a guint64)
AC_CACHE_VAL(glib_cv_long_long_format,[
for format in ll q I64; do
AC_TRY_RUN([#include <stdio.h>
fi
elif test x$ac_cv_sizeof___int64 = x8; then
# __int64 is a 64 bit integer.
- AC_MSG_CHECKING(for format to printf and scanf a gint64)
+ AC_MSG_CHECKING(for format to printf and scanf a guint64)
# We know this is MSVC, and what the formats are
glib_cv_long_long_format=I64
AC_MSG_RESULT(%${glib_cv_long_long_format}u)
AC_MSG_RESULT($SANE_MALLOC_PROTOS)
CFLAGS=$glib_save_CFLAGS
+dnl
+dnl check in which direction the stack grows
+dnl
+AC_CACHE_CHECK([for growing stack pointer],glib_cv_stack_grows,[
+ AC_TRY_RUN([
+ volatile int *a = 0, *b = 0;
+ void foo (void);
+ int main () { volatile int y = 7; a = &y; foo (); return b > a; }
+ void foo (void) { volatile int x = 5; b = &x; }
+ ],
+ glib_cv_stack_grows=no
+ ,
+ glib_cv_stack_grows=yes
+ ,)
+])
dnl AC_C_INLINE is useless to us since it bails out too early, we need to
dnl truely know which ones of `inline', `__inline' and `__inline__' are
GLIB_SIZEOF([$size_includes], ptrdiff_t, ptrdiff_t)
GLIB_SIZEOF([$size_includes], intmax_t, intmax_t)
+dnl Try to figure out whether gsize, gssize should be long or int
+AC_MSG_CHECKING([for the appropriate definition for size_t])
+
+case $glib_cv_sizeof_size_t in
+ $ac_cv_sizeof_short)
+ glib_size_type=short
+ ;;
+ $ac_cv_sizeof_int)
+ glib_size_type=int
+ ;;
+ $ac_cv_sizeof_long)
+ glib_size_type=long
+ ;;
+ *) AC_MSG_ERROR([No type matching size_t in size])
+ ;;
+esac
+
+dnl If int/long are the same size, we see which one produces
+dnl warnings when used in the location as size_t. (This matters
+dnl on AIX with xlc)
+dnl
+if test $glib_cv_sizeof_size_t = $ac_cv_sizeof_int &&
+ test $glib_cv_sizeof_size_t = $ac_cv_sizeof_long ; then
+ GLIB_CHECK_COMPILE_WARNINGS([
+#include <stddef.h>
+int main ()
+{
+ size_t s = 1;
+ unsigned int *size_int = &s;
+ return (int)*size_int;
+}
+ ],glib_size_type=int,
+ [GLIB_CHECK_COMPILE_WARNINGS([
+#include <stddef.h>
+int main ()
+{
+ size_t s = 1;
+ unsigned long *size_long = &s;
+ return (int)*size_long;
+}
+ ],glib_size_type=long)])
+fi
+
+AC_MSG_RESULT(unsigned $glib_size_type)
+
# Check for some functions
-AC_CHECK_FUNCS(lstat strerror strsignal memmove mkstemp vsnprintf stpcpy strcasecmp strncasecmp poll getcwd nanosleep vasprintf)
+AC_CHECK_FUNCS(lstat strerror strsignal memmove mkstemp vsnprintf stpcpy strcasecmp strncasecmp poll getcwd nanosleep vasprintf unsetenv getc_unlocked)
+
+AC_FUNC_VSNPRINTF_C99
# Check if bcopy can be used for overlapping copies, if memmove isn't found.
# The check is borrowed from the PERL Configure script.
G_MODULE_LIBS=
G_MODULE_LIBS_EXTRA=
G_MODULE_PLUGIN_LIBS=
-G_MODULE_LDFLAGS=
+G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
dnl G_MODULE_IMPL= don't reset, so cmd-line can override
G_MODULE_NEED_USCORE=0
G_MODULE_BROKEN_RTLD_GLOBAL=0
G_MODULE_IMPL=G_MODULE_IMPL_BEOS],
[])
fi
+dnl *** NSLinkModule (dyld) in system libraries (Darwin)
+if test -z "$G_MODULE_IMPL"; then
+ AC_CHECK_FUNC(NSLinkModule,
+ [G_MODULE_IMPL=G_MODULE_IMPL_DYLD
+ G_MODULE_NEED_USCORE=1],
+ [])
+fi
dnl *** dlopen() and dlsym() in libdl
if test -z "$G_MODULE_IMPL"; then
AC_CHECK_LIB(dl, dlopen,
G_MODULE_IMPL=G_MODULE_IMPL_DL],[])],
[])
fi
-dnl *** NSLinkModule (dyld) in system libraries (Darwin)
-if test -z "$G_MODULE_IMPL"; then
- AC_CHECK_FUNC(NSLinkModule,
- [G_MODULE_IMPL=G_MODULE_IMPL_DYLD
- G_MODULE_NEED_USCORE=1],
- [])
-fi
dnl *** shl_load() in libdld (HP-UX)
if test -z "$G_MODULE_IMPL"; then
- AC_MSG_CHECKING(how to export all symbols)
- SAVED_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -Wl,-E"
- AC_TRY_LINK(,[ return 0; ],
- [ G_MODULE_LDFLAGS="-Wl,-E" ],[
- LDFLAGS="$SAVED_LDFLAGS -bexpall"
- AC_TRY_LINK(,[ return 0; ],
- [G_MODULE_LDFLAGS="-bexpall"],
- [G_MODULE_LDFLAGS="none"])
- ])
- LDFLAGS=$SAVED_LDFLAGS
- AC_MSG_RESULT($G_MODULE_LDFLAGS)
- if test "x$G_MODULE_LDFLAGS" = "xnone"; then
- G_MODULE_LDFLAGS=
- fi
AC_CHECK_LIB(dld, shl_load,
[G_MODULE_LIBS=-ldld
G_MODULE_IMPL=G_MODULE_IMPL_DLD],
fi
dnl *** additional checks for G_MODULE_IMPL_DL
if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
- case "$host_os" in
- linux*)
- G_MODULE_LDFLAGS='-rdynamic'
- ;;
- esac
LIBS_orig="$LIBS"
LDFLAGS_orig="$LDFLAGS"
LIBS="$LIBS $G_MODULE_LIBS"
if test "x$have_threads" = xno; then
AC_TRY_COMPILE([#include <pthread.h>],
[pthread_attr_t attr; pthread_attr_create(&attr);],
- have_threads=posix)
+ have_threads=dce)
fi
CPPFLAGS="$glib_save_CPPFLAGS"
fi
*-aix*)
G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_THREAD_SAFE"
if test x"$GCC" = xyes; then
- G_THREAD_CFLAGS="$G_THREAD_CFLAGS -mthreads"
+ # GCC 3.0 and above needs -pthread
+ # GCC 2.x and below needs -mthreads
+ AC_TRY_COMPILE(,[#if __GNUC__ <= 2
+ bail out here
+ #endif],
+ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -pthread",
+ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -mthreads")
fi
;;
*-freebsd2.2*)
G_THREAD_LIBS="-pthread"
fi
;;
+ *-*-openbsd* | *-*-freebsd*)
+ # FreeBSD and OpenBSD want us to use the -pthread flag
+ # instead of linking to -lc_r and libtool enforces that.
+ G_THREAD_LIBS="-pthread"
+ ;;
*)
- for thread_lib in "" pthread pthread32 pthreads c_r thread dce; do
+ for thread_lib in "" pthread pthread32 pthreads thread dce; do
if test x"$thread_lib" = x; then
add_thread_lib=""
IN=""
break],
[AC_MSG_RESULT(no)])
done
- if test "x$G_THREAD_LIBS" = xerror; then
- AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2)
- fi
- for thread_lib in "" rt rte; do
- if test x"$thread_lib" = x; then
- add_thread_lib=""
- IN=""
- else
- add_thread_lib="-l$thread_lib"
- IN=" in -l$thread_lib"
- fi
- LIBS="$glib_save_LIBS $add_thread_lib"
+ ;;
+ esac
+ if test "x$G_THREAD_LIBS" = xerror; then
+ AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2)
+ fi
+ for thread_lib in "" rt rte; do
+ if test x"$thread_lib" = x; then
+ add_thread_lib=""
+ IN=""
+ else
+ add_thread_lib="-l$thread_lib"
+ IN=" in -l$thread_lib"
+ fi
+ LIBS="$glib_save_LIBS $add_thread_lib"
- AC_MSG_CHECKING(for sched_get_priority_min$IN)
- AC_TRY_RUN([#include <sched.h>
- #include <errno.h>
- int main() {
- errno = 0;
- return sched_get_priority_min(SCHED_OTHER)==-1
- && errno != 0;
- }],
- [AC_MSG_RESULT(yes)
- G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib"
- posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
- posix_priority_max="sched_get_priority_max(SCHED_OTHER)"
- break],
- [AC_MSG_RESULT(no)])
- done
- LIBS="$glib_save_LIBS"
- ;;
- esac
+ AC_MSG_CHECKING(for sched_get_priority_min$IN)
+ AC_TRY_RUN([#include <sched.h>
+ #include <errno.h>
+ int main() {
+ errno = 0;
+ return sched_get_priority_min(SCHED_OTHER)==-1
+ && errno != 0;}],
+ [AC_MSG_RESULT(yes)
+ G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib"
+ posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
+ posix_priority_max="sched_get_priority_max(SCHED_OTHER)"
+ break],
+ [AC_MSG_RESULT(no)])
+ done
+ LIBS="$glib_save_LIBS"
mutex_has_default=yes
mutex_default_type='pthread_mutex_t'
mutex_default_init='PTHREAD_MUTEX_INITIALIZER'
g_threads_impl="WIN32"
G_THREAD_LIBS=""
;;
- none)
+ none|no)
g_threads_impl="NONE"
;;
*)
fi
fi
+if test x"$glib_cv_sizeof_system_thread" = x; then
+ # use a pointer as a fallback.
+ GLIB_SIZEOF(,void *, system_thread)
+fi
+
AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c",
[Source file containing theread implementation])
AC_SUBST(G_THREAD_CFLAGS)
esac
AC_SUBST(G_LIBS_EXTRA)
-dnl ***********************
-dnl *** Tests for iconv ***
-dnl ***********************
-
-AC_ARG_WITH(libiconv, [ --with-libiconv Use the libiconv library ],,with_libiconv=maybe)
-
-found_iconv=no
-
-if test "x$with_libiconv" != "xyes" ; then
- #
- # Check in the C library
- #
- AC_CHECK_FUNC(iconv_open, with_libiconv=no; found_iconv=yes)
-fi
-
-if test "x$with_libiconv" != "xno" ; then
- #
- # Check for libiconv
- #
- AC_CHECK_LIB(iconv, libiconv_open, with_libiconv=yes; found_iconv=yes)
-fi
-
-if test "x$found_iconv" = "xno" ; then
- AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
-fi
-
-if test "x$with_libiconv" = "xyes" ; then
- ICONV_LIBS="-liconv"
- AC_DEFINE(USE_LIBICONV)
-fi
-AC_SUBST(ICONV_LIBS)
-
dnl If the system doesn't define EILSEQ, we should define EILSEQ ourselves
dnl since we need it for g_iconv()
], have_eilseq=yes, have_eilseq=no);
AC_MSG_RESULT($have_eilseq)
+dnl ******************************************************************
+dnl *** Look for glib-genmarshal in PATH if we are cross-compiling ***
+dnl ******************************************************************
+
+AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
+
+if test $cross_compiling = yes; then
+ AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
+ if test x$GLIB_GENMARSHAL = xno; then
+ AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH)
+ fi
+fi
+
dnl **************************
dnl *** Checks for gtk-doc ***
dnl **************************
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)
+AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
-if test x$enable_gtk_doc = xauto ; then
+if test x$enable_gtk_doc = xyes ; then
if test x$GTKDOC = xtrue ; then
enable_gtk_doc=yes
else
${glib_extension}typedef unsigned $gint64 guint64;
#define G_GINT64_CONSTANT(val) $gint64_constant
+_______EOF
+ if test x$gint64_format != x ; then
+ cat >>$outfile <<_______EOF
#define G_GINT64_FORMAT $gint64_format
#define G_GUINT64_FORMAT $guint64_format
_______EOF
+ else
+ cat >>$outfile <<_______EOF
+#undef G_GINT64_FORMAT
+#undef G_GUINT64_FORMAT
+_______EOF
+ fi
cat >>$outfile <<_______EOF
#define GLIB_SIZEOF_VOID_P $glib_void_p
#define GLIB_SIZEOF_LONG $glib_long
+#define GLIB_SIZEOF_SIZE_T $glib_size_t
_______EOF
- 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
+echo "typedef signed $glib_size_type_define gssize;" >> $outfile
+echo "typedef unsigned $glib_size_type_define gsize;" >> $outfile
if test -z "$glib_unknown_void_p"; then
cat >>$outfile <<_______EOF
if test x$g_have_gnuc_varargs = xyes ; then
cat >>$outfile <<_______EOF
+/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
+ * is passed ISO vararg support is turned off, and there is no work
+ * around to turn it on, so we unconditionally turn it off.
+ */
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
+# undef G_HAVE_ISO_VARARGS
+#endif
+
#define G_HAVE_GNUC_VARARGS 1
_______EOF
fi
+ case x$g_stack_grows in
+ xyes) echo "#define G_HAVE_GROWING_STACK 1" >>$outfile ;;
+ *) echo "#define G_HAVE_GROWING_STACK 0" >>$outfile ;;
+ esac
+
+
echo >>$outfile
if test x$g_have_eilseq = xno; then
cat >>$outfile <<_______EOF
;;
esac
glib_size_t=$glib_cv_sizeof_size_t
+glib_size_type_define=$glib_size_type
glib_void_p=$ac_cv_sizeof_long
glib_long=$ac_cv_sizeof_void_p
;;
esac
+g_stack_grows=$glib_cv_stack_grows
+
g_have_eilseq=$have_eilseq
case x$have_threads in
g_mutex_has_default="$mutex_has_default"
g_mutex_sizeof="$glib_cv_sizeof_gmutex"
-if test x"$glib_cv_sizeof_system_thread" != x; then
- g_system_thread_sizeof="$glib_cv_sizeof_system_thread"
-else
- g_system_thread_sizeof="$ac_cv_sizeof_void_p"
-fi
+g_system_thread_sizeof="$glib_cv_sizeof_system_thread"
g_mutex_contents="$glib_cv_byte_contents_gmutex"
g_module_suffix="$glib_gmodule_suffix"
docs/reference/gobject/Makefile
tests/Makefile
m4macros/Makefile
-],[echo ""
-echo " *** IMPORTANT *** "
-echo ""
-echo "This is a development version of GLib. You should be using a stable"
-echo "version, which is available at ftp://ftp.gtk.org/pub/gtk/v1.2/. The"
-echo "version you just configured is meant for developers of GLib only:"
-echo ""
-echo " * You should not base stable software on this version of GLib."
-echo " * GNOME developers should use a stable version of GLib."
-echo ""
-echo " *** You should be using GLib 1.2 instead. ***"
])