# we rewrite this file
rm -f glibconfig-sysdefs.h
-GLIB_DIVERT_BEFORE_HELP([
+GLIB_AC_DIVERT_BEFORE_HELP([
#
-# The following version number definitions apply to GLib, GModule, GObject and GThread
-# as a whole, so if changes occoured in any of them, they are all
+# The following version number definitions apply to GLib, GModule, GObject
+# and GThread as a whole, so if changes occoured in any of them, they are all
# treated with the same interface and binary age.
#
# Making releases:
#
GLIB_MAJOR_VERSION=1
GLIB_MINOR_VERSION=3
-GLIB_MICRO_VERSION=1
+GLIB_MICRO_VERSION=2
GLIB_INTERFACE_AGE=0
GLIB_BINARY_AGE=0
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
dnl
-GLIB_DIVERT_BEFORE_HELP([
+GLIB_AC_DIVERT_BEFORE_HELP([
# figure debugging default, prior to $ac_help setup
-if test `expr $GLIB_MINOR_VERSION \% 2` = 1 ; then
- debug_default=yes
-else
- debug_default=minimum
-fi[]dnl
+case $GLIB_MINOR_VERSION in
+*[[13579]]) debug_default=yes ;;
+*) debug_default=minimum ;;
+esac[]dnl
])
dnl declare --enable-* args and collect ac_help strings
# check for header files
AC_CHECK_HEADERS([float.h limits.h pwd.h sys/param.h sys/poll.h sys/select.h])
-AC_CHECK_HEADERS([sys/time.h sys/times.h unistd.h values.h stdint.h])
+AC_CHECK_HEADERS([sys/time.h sys/times.h unistd.h values.h stdint.h sched.h])
AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
if test $gtk_ok = yes; then
AC_MSG_RESULT([yes, found in sys/types.h])
else
- AC_HEADER_EGREP(fd_set, sys/select.h, gtk_ok=yes)
+ AC_EGREP_HEADER(fd_set, sys/select.h, gtk_ok=yes)
if test $gtk_ok = yes; then
# *** FIXME: give it a different name
AC_DEFINE(HAVE_SYS_SELECT_H,1,[found fd_set in sys/select.h])
fi
if test "x$want_threads" = xyes || test "x$want_threads" = xposix \
|| test "x$want_threads" = xdce; then
- # -D_POSIX4A_DRAFT10_SOURCE is for DG/UX
+ # -D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE is for DG/UX
# -U_OSF_SOURCE is for Digital UNIX 4.0d
- GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE"
+ GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE"
glib_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES"
if test "x$have_threads" = xnone; then
- AC_EGREP_HEADER([(^|[^a-zA-Z_])pthread_attr_init[^a-zA-Z_]],
- pthread.h,
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [pthread_attr_t attr; pthread_attr_init(&attr);],
have_threads=posix)
fi
if test "x$have_threads" = xnone; then
- AC_EGREP_HEADER([(^|[^a-zA-Z_])pthread_attr_create[^a-zA-Z_]],
- pthread.h,
- have_threads=dce)
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [pthread_attr_t attr; pthread_attr_create(&attr);],
+ have_threads=posix)
fi
CPPFLAGS="$glib_save_CPPFLAGS"
fi
G_THREAD_CFLAGS="$G_THREAD_CFLAGS -pthread"
fi
;;
+ *-dg-dgux*) # DG/UX
+ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
esac
# if we are not finding the ctime_r function, then we probably are
glib_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS"
- # Note: Digital UNIX 4.0d #defines ctime_r to _Pctime_r for gcc.
- AC_EGREP_HEADER([[^a-zA-Z_](_P)?ctime_r[^a-zA-Z_]], time.h, ,
- AC_MSG_WARN($FLAG_DOES_NOT_WORK))
+ AC_TRY_COMPILE([#include <time.h>],
+ [time_t t; char b[30]; ctime_r (&t, b);], ,
+ [AC_TRY_COMPILE([#include <time.h>],
+ [time_t t; char b[30]; ctime_r (&t, b, 30);], ,
+ AC_MSG_WARN($FLAG_DOES_NOT_WORK))])
CPPFLAGS="$glib_save_CPPFLAGS"
mutex_has_default=no
case $have_threads in
posix|dce)
- G_THREAD_LIBS=error
+ glib_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES"
+ G_THREAD_LIBS=error
glib_save_LIBS="$LIBS"
case $host in
*-sysv5uw7*) # UnixWare 7
IN=" in -l$thread_lib"
fi
if test x"$have_threads" = xposix; then
- defattr=NULL
+ defattr=0
else
defattr=pthread_attr_default
fi
main()
{ pthread_t t;
void *ret;
- pthread_create (&t, $defattr, func, NULL);
+ pthread_create (&t, $defattr, func, 0);
pthread_join (t, &ret);
exit (check_me != 42);
}],
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; do
+ for thread_lib in "" rt rte; do
if test x"$thread_lib" = x; then
add_thread_lib=""
IN=""
have_threads="posix"
fi
AC_SUBST(GTHREAD_COMPILE_IMPL_DEFINES)
+ CPPFLAGS="$glib_save_CPPFLAGS"
;;
solaris)
G_THREAD_LIBS=error
# LIBS="$LIBS $G_THREAD_LIBS"
AC_CHECK_FUNCS(localtime_r)
if test "$ac_cv_header_pwd_h" = "yes"; then
- AC_CACHE_CHECK([for getpwuid_r],ac_cv_func_getpwuid_r,
+ AC_CACHE_CHECK([for posix getpwuid_r],
+ ac_cv_func_posix_getpwuid_r,
[AC_TRY_RUN([#include <errno.h>
- int main () { char buffer[10000], *pointer;
- char getpwuid_r (long, void*, void*,
- int, void*);
- int error;
- errno = 0;
- error = getpwuid_r (0, &buffer, &buffer,
- sizeof (buffer), &pointer);
- return errno == ENOSYS || error == ENOSYS;}],
- [ac_cv_func_getpwuid_r=yes],
- [ac_cv_func_getpwuid_r=no])])
- if test "$ac_cv_func_getpwuid_r" = yes; then
- AC_DEFINE(HAVE_GETPWUID_R,1,[Have function getpwuid_r])
- fi
- if test "$ac_cv_func_getpwuid_r" = "yes"; then
- AC_MSG_CHECKING(whether getpwuid_r is posix like)
- # The signature for the POSIX version is:
- # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **)
- AC_TRY_COMPILE([#include <pwd.h>
- #include <sys/types.h>
- #include <stdlib.h>],
- [getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
- [AC_DEFINE(HAVE_GETPWUID_R_POSIX,1,
- [Function getpwuid_r has the POSIX signature])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
+ #include <pwd.h>
+ int main () { char buffer[10000];
+ struct passwd pwd, *pwptr = &pwd;
+ int error;
+ errno = 0;
+ error = getpwuid_r (0, &pwd, buffer,
+ sizeof (buffer), &pwptr);
+ return (error < 0 && errno == ENOSYS)
+ || error == ENOSYS; }],
+ [ac_cv_func_posix_getpwuid_r=yes],
+ [ac_cv_func_posix_getpwuid_r=no])])
+ if test "$ac_cv_func_posix_getpwuid_r" = yes; then
+ AC_DEFINE(HAVE_POSIX_GETPWUID_R,1,
+ [Have POSIX function getpwuid_r])
+ else
+ AC_CACHE_CHECK([for nonposix getpwuid_r],
+ ac_cv_func_nonposix_getpwuid_r,
+ [AC_TRY_COMPILE([#include <pwd.h>],
+ [char buffer[10000];
+ struct passwd pwd;
+ getpwuid_r (0, &pwd, buffer,
+ sizeof (buffer));],
+ [ac_cv_func_nonposix_getpwuid_r=yes],
+ [ac_cv_func_nonposix_getpwuid_r=no])])
+ if test "$ac_cv_func_nonposix_getpwuid_r" = yes; then
+ AC_DEFINE(HAVE_NONPOSIX_GETPWUID_R,1,
+ [Have non-POSIX function getpwuid_r])
+ fi
fi
fi
LIBS="$LIBS $G_THREAD_LIBS"
fi
AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
CPPFLAGS="$glib_save_CPPFLAGS"
+
+ AC_MSG_CHECKING(whether to use the PID niceness surrogate for thread priorities)
+ AC_TRY_RUN([#include <pthread.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ pid_t other_pid = 0;
+
+ void* func(void* data) {other_pid = getpid();}
+ main()
+ { pthread_t t;
+ void *ret;
+ pthread_create (&t, $defattr, func, NULL);
+ pthread_join (t, &ret);
+ exit (getpid()==other_pid ||
+ $posix_priority_min != $posix_priority_max);
+ }],
+ [AC_MSG_RESULT(yes),
+ AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1,
+ [whether to use the PID niceness surrogate for thread priorities])
+
+ glib_cv_sizeof_system_thread=`expr $glib_cv_sizeof_system_thread + $ac_cv_sizeof_long`],
+ [AC_MSG_RESULT(no)])
+
else # solaris threads
GLIB_SIZEOF([#include <thread.h>],
thread_t,
LIBS="$glib_save_LIBS"
# now spit out all the warnings.
- if test "$ac_cv_func_getpwuid_r" != "yes"; then
+ if test "$ac_cv_func_posix_getpwuid_r" != "yes" &&
+ test "$ac_cv_func_nonposix_getpwuid_r" != "yes"; then
AC_MSG_WARN($FUNC_NO_GETPWUID_R)
fi
if test "$ac_cv_func_localtime_r" != "yes"; then
glibconfig-sysdefs.h,
=)
+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()
+
+AC_MSG_CHECKING([for EILSEQ])
+AC_TRY_COMPILE([
+#include <errno.h>
+],
+[
+int error = EILSEQ;
+], have_eilseq=yes, have_eilseq=no);
+AC_MSG_RESULT($have_eilseq)
+
dnl **************************
dnl *** Checks for gtk-doc ***
dnl **************************
_______EOF
echo >>$outfile
+ if test x$g_have_eilseq = xno; then
+ cat >>$outfile <<_______EOF
+#ifndef EILSEQ
+/* On some systems, like SunOS and NetBSD, EILSEQ is not defined.
+ * The correspondence between this and the corresponding definition
+ * in libiconv is essential.
+ */
+# define EILSEQ ENOENT
+#endif
+_______EOF
+
+ fi
+
+ echo >>$outfile
if test x$g_mutex_has_default = xyes; then
cat >>$outfile <<_______EOF
$g_enable_threads_def G_THREADS_ENABLED
;;
esac
+g_have_eilseq=$have_eilseq
+
case x$have_threads in
xnone) g_enable_threads_def="#undef";;
*) g_enable_threads_def="#define";;