[-]
[+]
|
Changed |
glb.changes
|
|
[-]
[+]
|
Changed |
glb.spec
^
|
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/ChangeLog
^
|
@@ -1,3 +1,15 @@
+2013-01-10 alex
+- Added asynchronous connection processing by default. -Y option to turn back
+ old synchronous (one-at-a-time) bevaviour.
+- Avoid destination map recalculation when not using 'random' or 'source'
+ policies.
+- A more intuitive weghting algorithm where weight 100 means that the dest.
+ will get ~100 connections before a destination with weight 1 will be tried.
+- Made libglb connect() more compliant with standard connect() - i.e.
+ returning -1 in case of error instead of negative error code and setting
+ errno acordingly. Also improved handling of non-blocking sockets in libglb.
+ Version 0.9.1
+
2012-12-19 alex
- Fixed division by 0 when destination list is empty introduced by
"round-robin" policy support.
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/Makefile.in
^
|
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -15,6 +15,23 @@
@SET_MAKE@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -59,6 +76,11 @@
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -465,13 +487,10 @@
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
@@ -557,7 +576,7 @@
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
+ chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/aclocal.m4
^
|
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -8644,7 +8644,7 @@
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.11.6], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -8660,7 +8660,7 @@
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/compile
^
|
@@ -1,7 +1,7 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-01-04.17; # UTC
+scriptversion=2012-03-05.13; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
# Software Foundation, Inc.
@@ -79,6 +79,48 @@
esac
}
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
@@ -109,43 +151,34 @@
;;
esac
;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
-l*)
- lib=${1#-l}
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- set x "$@" "$dir/$lib.dll.lib"
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- set x "$@" "$dir/$lib.lib"
- break
- fi
- done
- IFS=$save_IFS
-
- test "$found" != yes && set x "$@" "$lib.lib"
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
shift
;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
-L*)
- func_file_conv "${1#-L}"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
+ func_cl_dashL "${1#-L}"
;;
-static)
shared=false
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/config.sub
^
|
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
-timestamp='2012-02-10'
+timestamp='2012-04-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -225,6 +225,12 @@
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -1537,6 +1543,9 @@
c4x-* | tic4x-*)
os=-coff
;;
+ hexagon-*)
+ os=-elf
+ ;;
tic54x-*)
os=-coff
;;
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/configure
^
|
@@ -1,13 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for glb 0.9.0.
+# Generated by GNU Autoconf 2.69 for glb 0.9.1.
#
# Report bugs to <info@codership.com>.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -169,7 +192,8 @@
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -222,21 +246,25 @@
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -339,6 +367,14 @@
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -460,6 +496,10 @@
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -494,16 +534,16 @@
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -515,28 +555,8 @@
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -570,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='glb'
PACKAGE_TARNAME='glb'
-PACKAGE_VERSION='0.9.0'
-PACKAGE_STRING='glb 0.9.0'
+PACKAGE_VERSION='0.9.1'
+PACKAGE_STRING='glb 0.9.1'
PACKAGE_BUGREPORT='info@codership.com'
PACKAGE_URL=''
@@ -1227,8 +1247,6 @@
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1314,7 +1332,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures glb 0.9.0 to adapt to many kinds of systems.
+\`configure' configures glb 0.9.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1385,7 +1403,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of glb 0.9.0:";;
+ short | recursive ) echo "Configuration of glb 0.9.1:";;
esac
cat <<\_ACEOF
@@ -1495,10 +1513,10 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-glb configure 0.9.0
-generated by GNU Autoconf 2.68
+glb configure 0.9.1
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1612,7 +1630,7 @@
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -1872,7 +1890,7 @@
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2039,8 +2057,8 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by glb $as_me 0.9.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+It was created by glb $as_me 0.9.1, which was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2570,7 +2588,7 @@
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -2739,7 +2757,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2779,7 +2797,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2830,7 +2848,7 @@
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
@@ -2883,7 +2901,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2969,7 +2987,7 @@
# Define the identity of the package.
PACKAGE='glb'
- VERSION='0.9.0'
+ VERSION='0.9.1'
cat >>confdefs.h <<_ACEOF
@@ -3116,7 +3134,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3160,7 +3178,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3808,7 +3826,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3848,7 +3866,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3901,7 +3919,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3942,7 +3960,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -4000,7 +4018,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4044,7 +4062,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4240,8 +4258,7 @@
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4696,7 +4713,7 @@
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+ as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
@@ -4772,7 +4789,7 @@
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@@ -4838,7 +4855,7 @@
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@@ -4905,7 +4922,7 @@
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+ as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
@@ -5161,7 +5178,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5205,7 +5222,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5629,7 +5646,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5669,7 +5686,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5975,7 +5992,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6015,7 +6032,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6119,7 +6136,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6163,7 +6180,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6288,7 +6305,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6328,7 +6345,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6387,7 +6404,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6427,7 +6444,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7076,7 +7093,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7116,7 +7133,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7196,7 +7213,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7236,7 +7253,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7288,7 +7305,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7328,7 +7345,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7380,7 +7397,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7420,7 +7437,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7472,7 +7489,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7512,7 +7529,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7564,7 +7581,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7604,7 +7621,7 @@
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -15438,60 +15455,60 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
-
- struct s { _Bool s: 1; _Bool t; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- /* See body of main program for 'e'. */
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- /* The following fails for
- HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- /* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- */
- _Bool q = true;
- _Bool *pq = &q;
+ #include <stdbool.h>
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: true is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
int
main ()
{
- bool e = &s;
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
;
return 0;
@@ -15506,7 +15523,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
$as_echo "$ac_cv_header_stdbool_h" >&6; }
-ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+ ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
if test "x$ac_cv_type__Bool" = xyes; then :
cat >>confdefs.h <<_ACEOF
@@ -15516,6 +15533,7 @@
fi
+
if test $ac_cv_header_stdbool_h = yes; then
$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
@@ -15533,11 +15551,11 @@
int
main ()
{
-/* FIXME: Include the comments suggested by Paul. */
+
#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
+ /* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
- const charset cs;
+ const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
@@ -15554,8 +15572,9 @@
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
@@ -15571,10 +15590,10 @@
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this saying
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
@@ -16558,16 +16577,16 @@
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -16627,28 +16646,16 @@
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -16669,8 +16676,8 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by glb $as_me 0.9.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+This file was extended by glb $as_me 0.9.1, which was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -16735,11 +16742,11 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-glb config.status 0.9.0
-configured by $0, generated by GNU Autoconf 2.68,
+glb config.status 0.9.1
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -16830,7 +16837,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/configure.ac
^
|
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
-AC_INIT(glb, 0.9.0, info@codership.com)
+AC_INIT(glb, 0.9.1, info@codership.com)
AC_CONFIG_SRCDIR([src/glb_main.c])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_SYSTEM
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/depcomp
^
|
@@ -1,10 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2011-12-04.11; # UTC
+scriptversion=2012-03-27.16; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
-# 2011 Free Software Foundation, Inc.
+# 2011, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
case $1 in
'')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
@@ -40,8 +40,8 @@
Environment variables:
depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
@@ -57,6 +57,12 @@
;;
esac
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
@@ -102,6 +108,12 @@
depmode=msvc7
fi
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
@@ -156,15 +168,14 @@
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
+ tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
@@ -203,18 +214,15 @@
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
+ # the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
+ tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> "$depfile"
+ tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
+ tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
@@ -226,10 +234,17 @@
rm -f "$tmpdepfile"
;;
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
+ # current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
@@ -259,12 +274,11 @@
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
- # Each line is of the form `foo.o: dependent.h'.
+ # Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
@@ -275,23 +289,26 @@
;;
icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+ # However on
+ # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
- # which is wrong. We want:
+ # which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
+ # and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
-
+ # tcc 0.9.26 (FIXME still under development at the moment of writing)
+ # will emit a similar output, but also prepend the continuation lines
+ # with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
@@ -300,15 +317,21 @@
exit $stat
fi
rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Each line is of the form 'foo.o: dependent.h',
+ # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
+ < "$tmpdepfile" > "$depfile"
+ sed '
+ s/[ '"$tab"'][ '"$tab"']*/ /g
+ s/^ *//
+ s/ *\\*$//
+ s/^[^:]*: *//
+ /^$/d
+ /:$/d
+ s/$/ :/
+ ' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -344,7 +367,7 @@
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
+ # Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
@@ -359,9 +382,9 @@
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
+ # dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
@@ -407,8 +430,7 @@
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
@@ -443,11 +465,11 @@
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
-s/\(.*\)/ \1 \\/p
+s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
- s/.*/ /
+ s/.*/'"$tab"'/
G
p
}' >> "$depfile"
@@ -478,7 +500,7 @@
shift
fi
- # Remove `-o $object'.
+ # Remove '-o $object'.
IFS=" "
for arg
do
@@ -498,15 +520,14 @@
done
test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
+ # Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
+ tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -562,8 +583,7 @@
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+ sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -583,7 +603,7 @@
shift
fi
- # Remove `-o $object'.
+ # Remove '-o $object'.
IFS=" "
for arg
do
@@ -652,8 +672,8 @@
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/doc/Makefile.in
^
|
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -25,6 +25,23 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -56,6 +73,11 @@
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/ltmain.sh
^
|
@@ -70,7 +70,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -80,7 +80,7 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
+VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
TIMESTAMP=""
package_revision=1.3337
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/Makefile.in
^
|
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -20,6 +20,23 @@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -114,6 +131,11 @@
$(LDFLAGS) -o $@
SOURCES = $(libglb_la_SOURCES) $(glbd_SOURCES)
DIST_SOURCES = $(libglb_la_SOURCES) $(glbd_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -305,7 +327,6 @@
$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
@@ -313,6 +334,8 @@
else :; fi; \
done; \
test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
@@ -338,8 +361,11 @@
$(libglb_la_LINK) -rpath $(libdir) $(libglb_la_OBJECTS) $(libglb_la_LIBADD) $(LIBS)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_cmd.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_cmd.c 98 2012-12-08 19:47:15Z alex $
+ * $Id: glb_cmd.c 126 2013-01-08 03:36:55Z alex $
*/
#include "glb_cmd.h"
@@ -21,6 +21,7 @@
typedef enum cmd_opt
{
CMD_OPT_VERSION = 'V',
+ CMD_OPT_SYNCHRONOUS = 'Y',
CMD_OPT_DEFER_ACCEPT = 'a',
CMD_OPT_ROUND_ROBIN = 'b',
CMD_OPT_CONTROL = 'c',
@@ -100,6 +101,9 @@
fprintf (out,
" -v|--verbose turn on verbose reporting.\n");
fprintf (out,
+ " -Y "
+ "connect synchronously (one-at-a-time).\n");
+ fprintf (out,
" -V|--version print program version.\n");
fprintf (out, "LISTEN_ADDRESS:\n"
" [IP:]PORT "
@@ -132,9 +136,16 @@
if (!tmp) exit (EXIT_FAILURE);
// parse options
- while ((opt = getopt_long (argc, argv, "abc:dfhm:nt:rsvV", cmd_options,
+ while ((opt = getopt_long (argc, argv, "VYabc:dfhm:nt:rsv", cmd_options,
&opt_idx)) != -1) {
switch (opt) {
+ case CMD_OPT_VERSION:
+ glb_print_version (stdout);
+ if (argc == 2) exit(0);
+ break;
+ case CMD_OPT_SYNCHRONOUS:
+ tmp->synchronous = true;
+ break;
case CMD_OPT_DEFER_ACCEPT:
tmp->defer_accept = true;
break;
@@ -185,10 +196,6 @@
case CMD_OPT_VERBOSE:
tmp->verbose = true;
break;
- case CMD_OPT_VERSION:
- glb_print_version (stdout);
- if (argc == 2) exit(0);
- break;
default:
fprintf (stderr, "Option '%s' (%d) not supported yet. Ignoring.\n",
cmd_options[opt_idx].name, opt);
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_cnf.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2012-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_cnf.c 96 2012-12-08 18:35:57Z alex $
+ * $Id: glb_cnf.c 126 2013-01-08 03:36:55Z alex $
*/
#include "../config.h" // for version
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_cnf.h
^
|
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2012 Codership Oy <info@codership.com>
*
- * $Id: glb_cnf.h 96 2012-12-08 18:35:57Z alex $
+ * $Id: glb_cnf.h 126 2013-01-08 03:36:55Z alex $
*/
#ifndef _glb_cnf_h_
@@ -34,6 +34,7 @@
bool defer_accept; // use TCP_DEFER_ACCEPT?
bool verbose; // be verbose?
bool daemonize; // become a daemon?
+ bool synchronous; // connect synchronously
#endif /* GLBD */
bool ctrl_set; // was set? (false)
glb_policy_t policy; // algorithm to use for load-balancing
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_listener.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_listener.c 94 2012-12-07 16:10:13Z alex $
+ * $Id: glb_listener.c 132 2013-01-10 15:10:04Z alex $
*/
#include "glb_listener.h"
@@ -40,8 +40,6 @@
int server_sock;
glb_sockaddr_t server;
- assert (1 == ret);
-
client_sock = accept (listener->sock,
(struct sockaddr*) &client, &client_size);
if (client_sock < 0) {
@@ -50,18 +48,23 @@
goto err;
}
- server_sock = glb_router_connect(listener->router, &client ,&server);
- if (server_sock < 0) {
+ ret = glb_router_connect(listener->router, &client ,&server,
+ &server_sock);
+ if (server_sock < 0 && ret != -EINPROGRESS) {
if (server_sock != -EMFILE)
glb_log_error("Failed to connect to destination: %d (%s)",
- -server_sock, strerror(-server_sock));
+ -ret, strerror(-ret));
goto err1;
}
+ assert (0 == ret || -EINPROGRESS == ret);
+
glb_socket_setopt(client_sock, GLB_SOCK_NODELAY); // ignore error here
- ret = glb_pool_add_conn (listener->pool, client_sock, server_sock,
- &server);
+ ret = glb_pool_add_conn (listener->pool,
+ client_sock, &client,
+ server_sock, &server,
+ 0 == ret);
if (ret < 0) {
glb_log_error ("Failed to add connection to pool: "
"%d (%s)", -ret, strerror (-ret));
@@ -78,7 +81,7 @@
err2:
close (server_sock);
- glb_router_disconnect (listener->router, &server);
+ glb_router_disconnect (listener->router, &server, false);
err1:
close (client_sock);
err:
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_misc.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2009 Codership Oy <info@codership.com>
+ * Copyright (C) 2009-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_misc.h 112 2012-12-19 22:14:11Z alex $
+ * $Id: glb_misc.h 132 2013-01-10 15:10:04Z alex $
*/
#ifndef _glb_misc_h_
@@ -9,10 +9,21 @@
#include "glb_log.h"
+#include <stdbool.h>
+#include <fcntl.h>
+
+#if __GNUC__ >= 3
+# define GLB_LIKELY(x) __builtin_expect((x), 1)
+# define GLB_UNLIKELY(x) __builtin_expect((x), 0)
+#else
+# define GLB_LIKELY(x) (x)
+# define GLB_UNLIKELY(x) (x)
+#endif
+
#define GLB_MUTEX_LOCK(mtx) \
{ \
int ret; \
- if ((ret = pthread_mutex_lock (mtx))) { \
+ if (GLB_UNLIKELY((ret = pthread_mutex_lock (mtx)) != 0)) { \
glb_log_fatal ("Failed to lock mutex: %d (%s)", ret, strerror(ret));\
abort(); \
} \
@@ -21,10 +32,22 @@
#define GLB_MUTEX_UNLOCK(mtx) \
{ \
int ret; \
- if ((ret = pthread_mutex_unlock (mtx))) { \
+ if (GLB_UNLIKELY((ret = pthread_mutex_unlock (mtx)) != 0)) { \
glb_log_fatal ("Failed to unlock mutex: %d (%s)", ret, strerror(ret));\
abort(); \
} \
}
+static inline int
+glb_fd_set_flag (int fd, int flag, bool on)
+{
+ int flags = fcntl (fd, F_GETFL);
+
+ if (on && !(flags & flag))
+ return fcntl (fd, F_SETFL, flags | flag);
+ else if (!on && (flags & flag))
+ return fcntl (fd, F_SETFL, flags & (~flag));
+
+ return 0;
+}
#endif // _glb_misc_h_
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_pool.c
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_pool.c 94 2012-12-07 16:10:13Z alex $
+ * $Id: glb_pool.c 132 2013-01-10 15:10:04Z alex $
*/
#include "glb_misc.h"
@@ -50,34 +50,44 @@
void* data;
} pool_ctl_t;
+// connection end can be either client or server
+// and server end can be either complete or incomplete
+typedef enum pool_end
+{
+ POOL_END_INCOMPLETE = 0,
+ POOL_END_COMPLETE,
+ POOL_END_CLIENT
+} pool_end_t;
+
typedef struct pool_conn_end
{
- bool inc; // to differentiate between the ends
- int sock; // fd of connection
- int fds_idx; // index in the file descriptor set (for poll())
- uint32_t events; // events waited by descriptor
- size_t sent;
- size_t total;
- glb_sockaddr_t dst_addr; // destinaiton id
+ glb_sockaddr_t addr;
+ size_t sent;
+ size_t total;
#ifdef GLB_USE_SPLICE
- int splice[2];
+ int splice[2];
#endif
- uint8_t buf[]; // has pool_buf_size
+ int sock; // fd of connection
+ int fds_idx; // index in the file descriptor set (for poll())
+ uint32_t events; // events waited by descriptor
+ pool_end_t end; // to differentiate between the ends
+ uint8_t buf[]; // has pool_buf_size
} pool_conn_end_t;
-#define POOL_MAX_FD (1 << 16) // highest possible file descriptor + 1
- // only affects the map size
-
-// We want to allocate memory for both ends in one malloc() call and have it
-// nicely aligned. This is presumably a page multiple and
-// should be enough for two ethernet frames (what about jumbo?)
-#define pool_end_size (BUFSIZ)
-#define pool_conn_size (pool_end_size << 2)
+/* We want to allocate memory for both ends in one malloc() call and have it
+ * nicely aligned. This is presumably a page multiple and should be enough
+ * for two ethernet frames (what about jumbo?) */
+/* Overall layout: |inc end|....inc buf....|dst end|....dst buf....| */
+#define pool_end_size BUFSIZ
+#define pool_conn_size (pool_end_size << 1) // total 2 buffers
#define pool_buf_size (pool_end_size - sizeof(pool_conn_end_t))
+#define POOL_MAX_FD (1 << 16) // highest possible file descriptor + 1
+ // only affects the map size
typedef struct pool
{
const glb_cnf_t* cnf;
+ glb_sockaddr_t addr_out; // for async conn handling.
pthread_t thread;
pthread_mutex_t lock;
pthread_cond_t cond;
@@ -93,7 +103,6 @@
int fd_max;
glb_router_t* router;
glb_pool_stats_t stats;
-
pool_conn_end_t* route_map[ POOL_MAX_FD ]; // connection ctx look-up by fd
} pool_t;
@@ -181,7 +190,7 @@
{
// map points to the other end, but that's enough
register pool_conn_end_t* other_end = pool->route_map[fd];
- if (other_end->inc) {
+ if (POOL_END_CLIENT == other_end->end) {
return (pool_conn_end_t*)((uint8_t*)other_end + pool_end_size);
} else {
return (pool_conn_end_t*)((uint8_t*)other_end - pool_end_size);
@@ -256,56 +265,99 @@
static inline void
pool_set_conn_end (pool_t* pool, pool_conn_end_t* end1, pool_conn_end_t* end2)
{
- end1->fds_idx = pool_fds_add (pool, end1->sock, POOL_FD_READ);
+ pool_fd_ops_t event =
+ POOL_END_INCOMPLETE == end1->end ? POOL_FD_WRITE : POOL_FD_READ;
+
+ end1->fds_idx = pool_fds_add (pool, end1->sock, event);
if (end1->fds_idx < 0) abort();
- end1->events = POOL_FD_READ;
+
+ end1->events = event;
pool->route_map[end1->sock] = end2;
}
// removing traces of connection end - reverse to what pool_set_conn_end() did
static inline void
-pool_reset_conn_end (pool_t* pool, pool_conn_end_t* end)
+pool_reset_conn_end (pool_t* const pool, pool_conn_end_t* const end,
+ bool const cl)
{
pool_fds_del (pool, end);
- close (end->sock);
+ if (cl) close (end->sock);
pool->route_map[end->sock] = NULL;
}
static void
-pool_remove_conn (pool_t* pool, int src_fd, bool notify_router)
+pool_remove_conn (pool_t* const pool, int const fd, bool const notify_router)
{
- pool_conn_end_t* dst = pool->route_map[src_fd];
- int dst_fd = dst->sock;
- pool_conn_end_t* src = pool->route_map[dst_fd];
+ pool_conn_end_t* inc_end;
+ pool_conn_end_t* dst_end;
+ bool full; // whether to do full cleanup
+
+ if (pool->route_map[fd]->end != POOL_END_CLIENT) { // close from client
+ dst_end = pool->route_map[fd];
+ inc_end = (pool_conn_end_t*)(((uint8_t*)dst_end) - pool_end_size);
+ full = true;
+ }
+ else {
+ inc_end = pool->route_map[fd];
+ dst_end = (pool_conn_end_t*)(((uint8_t*)inc_end) + pool_end_size);
+ full = POOL_END_INCOMPLETE != dst_end->end;
#ifndef NDEBUG
- if (notify_router && !src->inc) {
- glb_log_warn ("Connection close from server");
- }
+ if (notify_router) { glb_log_warn ("Connection close from server"); }
#endif
+ }
pool->n_conns--;
pool->stats.conns_closed++;
+ pool_reset_conn_end (pool, dst_end, true);
+
+ if (full) {
+ pool_reset_conn_end (pool, inc_end, true);
- if (notify_router)
- glb_router_disconnect (pool->router, &dst->dst_addr);
+ if (notify_router)
+ glb_router_disconnect (pool->router, &dst_end->addr, false);
#ifdef GLB_USE_SPLICE
- close (dst->splice[0]); close (dst->splice[1]);
- close (src->splice[0]); close (src->splice[1]);
+ close (dst_end->splice[0]); close (dst_end->splice[1]);
+ close (inc_end->splice[0]); close (inc_end->splice[1]);
#endif
+ free (inc_end); // frees both ends
+ }
+ else {
+ pool_reset_conn_end (pool, inc_end, false);
+ assert (false == notify_router);
+ /* at this point we should be as if before pool_handle_add_conn() */
+ }
+}
- // in reverse order to pool_set_conn_end() in pool_handle_add_conn()
- pool_reset_conn_end (pool, dst);
- pool_reset_conn_end (pool, src);
-
- if (dst->inc) {
- free (dst); // frees both ends
+static inline int
+pool_handle_async_conn (pool_t* pool,
+ pool_conn_end_t* dst_end)
+{
+ dst_end->sock = glb_socket_create(&pool->addr_out,
+ GLB_SOCK_NODELAY | GLB_SOCK_NONBLOCK);
+ int error;
+ if (dst_end->sock > 0) {
+ int ret = connect (dst_end->sock, (struct sockaddr*)&dst_end->addr,
+ sizeof (dst_end->addr));
+ error = ret ? errno : 0;
+ assert (error); /* should be EINPROGRESS in case of success */
+ if (GLB_UNLIKELY(error != EINPROGRESS) && error != 0) {
+ glb_log_error ("Async connect() failed: %d (%s)",
+ error, strerror(error));
+ close (dst_end->sock);
+ }
+ else error = 0;
}
else {
- assert (src->inc);
- free (src); // frees both ends
+ error = errno;
+ if (error != EINPROGRESS) {
+ glb_log_error ("Creating destination socket failed: %d (%s)",
+ error, strerror(error));
+ }
}
+
+ return error;
}
static void
@@ -314,6 +366,22 @@
pool_conn_end_t* inc_end = ctl->data;
pool_conn_end_t* dst_end = ctl->data + pool_end_size;
+ assert (POOL_END_CLIENT == inc_end->end);
+ assert (inc_end->sock > 0);
+
+ if (dst_end->sock < 0) {
+ assert (POOL_END_INCOMPLETE == dst_end->end);
+ if (pool_handle_async_conn (pool, dst_end)) {
+ glb_router_disconnect (pool->router, &dst_end->addr, true);
+ close (inc_end->sock);
+ free (inc_end);
+ return;
+ }
+ }
+ else {
+ assert (POOL_END_COMPLETE == dst_end->end);
+ }
+
pool_set_conn_end (pool, inc_end, dst_end);
pool_set_conn_end (pool, dst_end, inc_end);
@@ -326,25 +394,37 @@
}
}
+static inline const glb_sockaddr_t*
+pool_conn_end_dstaddr (pool_conn_end_t* end)
+{
+ const glb_sockaddr_t* const ret =
+ ((glb_sockaddr_t*)(POOL_END_CLIENT == end->end ?
+ (uint8_t*)end : ((uint8_t*)end) - pool_end_size)) -1;
+ return ret;
+}
+
static void
pool_handle_drop_dst (pool_t* pool, pool_ctl_t* ctl)
{
- const glb_sockaddr_t* dst = ctl->data;
+ assert (POOL_CTL_DROP_DST == ctl->code);
+
+ const glb_sockaddr_t* const dst = ctl->data;
int fd;
int count = pool->fd_max - 1; // ctl_recv is not in route_map
for (fd = 0; count; fd++) {
- pool_conn_end_t* end = pool->route_map[fd];
+ pool_conn_end_t* const end = pool->route_map[fd];
assert (fd < POOL_MAX_FD);
if (end) {
count--;
- if (glb_socket_addr_is_equal(&end->dst_addr, dst)) {
+ const glb_sockaddr_t* const end_dst = pool_conn_end_dstaddr (end);
+ if (glb_socket_addr_is_equal (dst, end_dst)) {
// remove conn, but don't try to notify router 'cause it's
// already dropped this destination
pool_remove_conn (pool, fd, false);
- count--; // 1 connection means 2 file descriptors
+ count--; // removing connection removes 2 file descriptors
}
}
}
@@ -412,9 +492,9 @@
dst->total - dst->sent, SPLICE_F_NONBLOCK);
#endif
- if (ret > 0) {
+ if (GLB_LIKELY(ret > 0)) {
pool->stats.send_bytes += ret;
- pool->stats.tx_bytes += dst->inc * ret;
+ pool->stats.tx_bytes += (POOL_END_CLIENT == dst->end) * ret;
dst->sent += ret;
if (dst->sent == dst->total) { // all data sent, reset pointers
@@ -423,7 +503,8 @@
}
else { // there is unsent data left
glb_log_debug ("Setting WRITE flag on %s: sent = %zu, total = "
- "%zu, bufsiz = %zu", dst->inc ? "client" : "server",
+ "%zu, bufsiz = %zu",
+ POOL_END_CLIENT == dst->end ? "client" : "server",
dst->sent, dst->total,pool_buf_size);
dst_events |= POOL_FD_WRITE; // set WRITE flag
}
@@ -438,19 +519,27 @@
else {
ret = -errno;
switch (-ret) {
- case ESPIPE:
- case EBUSY:
- case EINTR:
- case ENOBUFS:
- case EAGAIN:
+ case EINTR: // 4
+ case EAGAIN: // 11
+ case EBUSY: // 16
+ case ENOBUFS: // 105
+ case ENOTCONN: // 107
glb_log_debug ("Send data error: %d (%s)", -ret, strerror(-ret));
dst_events |= POOL_FD_WRITE;
ret = 0; // pretend nothing happened
break;
- case EPIPE:
- glb_log_debug ("pool_remove_conn() from pool_send_data()");
- pool_remove_conn(pool, dst->sock, true);
- break;
+ case EPIPE: // 32
+ /* according to man 2 send,
+ * Linux can return EPIPE on unconnected socket. WTF? */
+ if (POOL_END_INCOMPLETE != dst->end) {
+ glb_log_debug ("pool_remove_conn() from pool_send_data()");
+ pool_remove_conn(pool, dst->sock, true);
+ }
+ else {
+ /* POOL_FD_WRITE is already set there, just wait for it */
+ ret = 0;
+ }
+ return ret;
default:
glb_log_warn ("Send data failed, unhandled error: %d (%s)",
-ret, strerror(-ret));
@@ -460,12 +549,14 @@
pool->stats.n_send++;
if (dst_events != dst->events) { // events changed
- glb_log_debug ("Old flags on %s: %s %s", dst->inc ? "client":"server",
+ glb_log_debug ("Old flags on %s: %s %s",
+ POOL_END_CLIENT == dst->end ? "client":"server",
dst->events & POOL_FD_READ ? "POOL_FD_READ":"",
dst->events & POOL_FD_WRITE ? "POOL_FD_WRITE":"");
dst->events = dst_events;
pool_fds_set_events (pool, dst);
- glb_log_debug ("New flags on %s: %s %s", dst->inc ? "client":"server",
+ glb_log_debug ("New flags on %s: %s %s",
+ POOL_END_CLIENT == dst->end ? "client":"server",
dst->events & POOL_FD_READ ? "POOL_FD_READ":"",
dst->events & POOL_FD_WRITE ? "POOL_FD_WRITE":"");
}
@@ -492,7 +583,7 @@
pool_buf_size - dst->total,
SPLICE_F_MORE | SPLICE_F_MOVE);
#endif
- if (ret > 0) {
+ if (GLB_LIKELY(ret > 0)) {
dst->total += ret;
// now try to send whatever we have received so far
// (since we're here, POOL_FD_READ on src is not cleared, no need
@@ -501,6 +592,10 @@
if ((send_err = pool_send_data (pool, dst, NULL)) < 0) {
glb_log_warn ("pool_send_data(): %zd (%s)",
-send_err, strerror(-send_err));
+ if (-EPIPE == send_err) {
+ /* connection removed in pool_send_data(), nothing to do */
+ return send_err;
+ }
}
if (dst->total == pool_buf_size) {
@@ -514,7 +609,7 @@
pool->stats.recv_bytes += ret;
// increment only if it's coming from incoming interface
- pool->stats.rx_bytes += (!dst->inc) * ret;
+ pool->stats.rx_bytes += (POOL_END_CLIENT != dst->end) * ret;
}
else {
if (0 == ret) { // socket closed, must close another end and cleanup
@@ -538,14 +633,66 @@
return ret;
}
+static int
+pool_handle_conn_complete (pool_t* pool, pool_conn_end_t* dst_end)
+{
+ int ret = -1;
+ socklen_t ret_size = sizeof(ret);
+
+ assert (POOL_END_INCOMPLETE == dst_end->end);
+
+ getsockopt (dst_end->sock, SOL_SOCKET, SO_ERROR, &ret, &ret_size);
+
+ if (ret) {
+ glb_log_info ("Async connection to ... failed: %d (%s)",
+ ret, strerror (ret));
+
+ pool_conn_end_t* const inc_end =
+ (pool_conn_end_t*)(((uint8_t*)dst_end) - pool_end_size);
+
+ uint32_t const hint = pool->cnf->policy < GLB_POLICY_SOURCE ?
+ 0 : glb_socket_addr_hash (&inc_end->addr);
+
+ ret = glb_router_choose_dst_again (pool->router, hint, &dst_end->addr);
+
+ if (!ret) {
+ glb_log_info ("Reconnecting.");
+ pool_remove_conn (pool, dst_end->sock, false); dst_end->sock = -1;
+
+ pool_ctl_t ctl = { POOL_CTL_ADD_CONN, inc_end };
+ pool_handle_add_conn (pool, &ctl);
+ }
+ else {
+ dst_end->end = POOL_END_COMPLETE; // cause complete cleanup
+ pool_remove_conn (pool, dst_end->sock, false/* router didn't give us
+ * any destination */);
+ }
+ }
+ else {
+ dst_end->end = POOL_END_COMPLETE;
+ dst_end->events = POOL_FD_READ;
+ pool_fds_set_events (pool, dst_end);
+ }
+
+ return ret;
+}
+
static inline ssize_t
pool_handle_write (pool_t* pool, int dst_fd)
{
pool_conn_end_t* src = pool->route_map[dst_fd];
pool_conn_end_t* dst = pool->route_map[src->sock];
- glb_log_debug ("pool_handle_write() to %s: %zu",
- dst->inc ? "client" : "server", dst->total - dst->sent);
+ if (pool->cnf->verbose) {
+ glb_log_debug ("pool_handle_write() to %s: %zu",
+ POOL_END_CLIENT == dst->end ? "client" : "server",
+ dst->total - dst->sent);
+ }
+
+ if (GLB_UNLIKELY(POOL_END_INCOMPLETE == dst->end) &&
+ pool_handle_conn_complete (pool, dst)) return 0;
+
+ assert (dst->end != POOL_END_INCOMPLETE);
if (dst->total) {
ssize_t send_err;
@@ -557,6 +704,7 @@
-send_err, strerror(-send_err));
}
}
+
return 0;
}
@@ -693,8 +841,9 @@
pool->router = router;
pool->stats = glb_zero_stats;
- pthread_mutex_init (&pool->lock, NULL);
- pthread_cond_init (&pool->cond, NULL);
+ glb_socket_addr_init (&pool->addr_out, "0.0.0.0", 0); //for outgoing conn
+ pthread_mutex_init (&pool->lock, NULL);
+ pthread_cond_init (&pool->cond, NULL);
ret = pipe(pipe_fds);
if (ret) {
@@ -809,44 +958,46 @@
}
int
-glb_pool_add_conn (glb_pool_t* pool,
- int inc_sock,
- int dst_sock,
- glb_sockaddr_t* dst_addr)
-{
- pool_t* p = pool_get_pool (pool);
- int ret = -ENOMEM;
- void* route = NULL;
-
- GLB_MUTEX_LOCK (&pool->lock);
+glb_pool_add_conn (glb_pool_t* const pool,
+ int const inc_sock,
+ const glb_sockaddr_t* const inc_addr,
+ int const dst_sock,
+ const glb_sockaddr_t* const dst_addr,
+ bool const complete)
+{
+ int ret = -ENOMEM;
+ void* route = NULL;
route = malloc (pool_conn_size);
if (route) {
- pool_conn_end_t* inc_end = route;
- pool_conn_end_t* dst_end = route + pool_end_size;
- pool_ctl_t add_conn_ctl = { POOL_CTL_ADD_CONN, route };
+ pool_conn_end_t* const inc_end = route;
+ pool_conn_end_t* const dst_end = route + pool_end_size;
- inc_end->inc = true;
+ inc_end->addr = *inc_addr;
+ inc_end->end = POOL_END_CLIENT;
inc_end->sock = inc_sock;
inc_end->sent = 0;
inc_end->total = 0;
- inc_end->dst_addr = *dst_addr; // needed for cleanups
- dst_end->inc = false;
+ dst_end->addr = *dst_addr;
+ dst_end->end = complete ? POOL_END_COMPLETE : POOL_END_INCOMPLETE;
dst_end->sock = dst_sock;
dst_end->sent = 0;
dst_end->total = 0;
- dst_end->dst_addr = *dst_addr; // needed for cleanups
#ifdef GLB_USE_SPLICE
if (pipe (inc_end->splice)) abort();
if (pipe (dst_end->splice)) abort();
#endif
+ pool_ctl_t add_conn_ctl = { POOL_CTL_ADD_CONN, inc_end };
+
+ GLB_MUTEX_LOCK (&pool->lock);
+ pool_t* p = pool_get_pool (pool);
+ GLB_MUTEX_UNLOCK (&pool->lock);
+
ret = pool_send_ctl (p, &add_conn_ctl);
}
- GLB_MUTEX_UNLOCK (&pool->lock);
-
return ret;
}
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_pool.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_pool.h 94 2012-12-07 16:10:13Z alex $
+ * $Id: glb_pool.h 132 2013-01-10 15:10:04Z alex $
*/
#ifndef _glb_pool_h_
@@ -22,10 +22,12 @@
// Adds connection to conneciton pool
extern int
-glb_pool_add_conn (glb_pool_t* pool,
- int inc_sock,
- int dst_sock,
- glb_sockaddr_t* dst_addr);
+glb_pool_add_conn (glb_pool_t* pool,
+ int inc_sock,
+ const glb_sockaddr_t* inc_addr,
+ int dst_sock,
+ const glb_sockaddr_t* dst_addr,
+ bool complete);
// Closes all connecitons to a given destination
extern int
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_router.c
^
|
@@ -1,10 +1,10 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
* NOTE: connection count and usage make sense only for standalone balancer
* so all operations on them are #ifdef GLBD ... #endif
*
- * $Id: glb_router.c 109 2012-12-19 03:33:25Z alex $
+ * $Id: glb_router.c 134 2013-01-11 15:43:49Z alex $
*/
#define _GNU_SOURCE 1 /* for function overloading */
@@ -75,10 +75,15 @@
difftime (now, d->failed) > DST_RETRY_INTERVAL);
}
+static inline bool
+router_uses_map (const glb_router_t* const router)
+{
+ return (router->cnf->policy >= GLB_POLICY_RANDOM);
+}
+
static void
-router_redo_map (glb_router_t* router)
+router_redo_map (glb_router_t* router, time_t now)
{
- time_t now = time(NULL);
int i;
// pass 1: calculate total weight of available destinations
@@ -114,7 +119,8 @@
#ifdef GLBD
static inline double
router_dst_usage (router_dst_t* d)
-{ return (d->dst.weight / (d->conns + router_div_prot)); }
+/* +1 stands for what would be the usage of dst if we connect to it */
+{ return (d->dst.weight / (d->conns + 1)); }
#endif
int
@@ -214,7 +220,7 @@
#endif
}
- router_redo_map (router);
+ if (router_uses_map(router)) router_redo_map (router, time (NULL));
assert (router->n_dst >= 0);
assert (0 == router->busy_count);
@@ -373,10 +379,11 @@
n -= 1;
}
#else /* OLD */
- if (router->map_failed != 0 &&
+ if (router_uses_map (router) &&
+ router->map_failed != 0 &&
difftime (now, router->map_failed) > DST_RETRY_INTERVAL)
{
- router_redo_map (router);
+ router_redo_map (router, now);
router->map_failed = 0;
}
@@ -394,6 +401,15 @@
return NULL;
}
+static inline uint32_t
+router_random_hint (glb_router_t* router)
+{
+ uint32_t ret = rand_r(&router->seed);
+ // the above returns only positive signed integers.
+ // Need to expand it to 32 bits below.
+ return ret ^ (ret << 1);
+}
+
#ifdef GLBD
#define glb_connect connect
@@ -401,13 +417,45 @@
static inline router_dst_t*
router_choose_dst (glb_router_t* router, uint32_t hint)
{
+ router_dst_t* ret = NULL;
+
switch (router->cnf->policy) {
- case GLB_POLICY_LEAST: return router_choose_dst_least (router);
- case GLB_POLICY_ROUND: return router_choose_dst_round (router);
- case GLB_POLICY_RANDOM:
- case GLB_POLICY_SOURCE: return router_choose_dst_hint (router, hint);
+ case GLB_POLICY_LEAST: ret = router_choose_dst_least (router); break;
+ case GLB_POLICY_ROUND: ret = router_choose_dst_round (router); break;
+ case GLB_POLICY_RANDOM: hint = router_random_hint (router);
+ case GLB_POLICY_SOURCE: ret = router_choose_dst_hint (router, hint);
}
- return NULL;
+
+ if (GLB_LIKELY(ret != NULL)) {
+ ret->conns++; router->conns++;
+ ret->usage = router_dst_usage(ret);
+ }
+
+ return ret;
+}
+
+int
+glb_router_choose_dst (glb_router_t* const router,
+ uint32_t const src_hint,
+ glb_sockaddr_t* const dst_addr)
+{
+ int ret;
+
+ GLB_MUTEX_LOCK (&router->lock);
+
+ router_dst_t* const dst = router_choose_dst (router, src_hint);
+
+ if (GLB_LIKELY(dst != NULL)) {
+ *dst_addr = dst->dst.addr;
+ ret = 0;
+ }
+ else {
+ ret = -EHOSTDOWN;
+ }
+
+ GLB_MUTEX_UNLOCK (&router->lock);
+
+ return ret;
}
#else /* GLBD */
@@ -420,7 +468,7 @@
switch (router->cnf->policy) {
case GLB_POLICY_LEAST: return NULL;
case GLB_POLICY_ROUND: return router_choose_dst_round (router);
- case GLB_POLICY_RANDOM:
+ case GLB_POLICY_RANDOM: hint = router_random_hint (router);
case GLB_POLICY_SOURCE: return router_choose_dst_hint (router, hint);
}
return NULL;
@@ -428,6 +476,16 @@
#endif /* GLBD */
+static inline void
+router_dst_failed (glb_router_t* router, router_dst_t* dst)
+{
+ time_t now = time(NULL);
+ if (router_uses_map (router) && router_dst_is_good (dst, now))
+ router_redo_map(router, now);
+ dst->failed = now;
+ router->map_failed = now;
+}
+
// connect to a best destination, possiblly failing over to a next best
static int
router_connect_dst (glb_router_t* const router,
@@ -437,7 +495,7 @@
{
router_dst_t* dst;
int error = EHOSTDOWN;
- int ret;
+ int ret = -1;
bool redirect = false;
GLB_MUTEX_LOCK (&router->lock);
@@ -446,19 +504,17 @@
// keep trying until we run out of destinations
while ((dst = router_choose_dst (router, hint))) {
-#ifdef GLBD
- dst->conns++; router->conns++;
- dst->usage = router_dst_usage(dst);
-#endif
+
GLB_MUTEX_UNLOCK (&router->lock);
ret = glb_connect (sock, (struct sockaddr*)&dst->dst.addr,
sizeof (dst->dst.addr));
+ error = ret ? errno : 0;
+
GLB_MUTEX_LOCK (&router->lock);
- if (ret != 0) {
- error = errno;
+ if (error && error != EINPROGRESS) {
// connect failed, undo usage count, update destination failed mark
#ifdef GLBD
dst->conns--; router->conns--;
@@ -468,9 +524,7 @@
glb_log_warn ("Failed to connect to %s: %d (%s)",
glb_socket_addr_to_string (&dst->dst.addr),
error, strerror(error));
- dst->failed = time(NULL);
- router_redo_map(router);
- router->map_failed = dst->failed;
+ router_dst_failed (router, dst);
redirect = true;
}
else {
@@ -479,7 +533,6 @@
glb_log_warn ("Redirecting to %s",
glb_socket_addr_to_string (addr));
}
- error = 0; // return success
break;
}
}
@@ -493,85 +546,126 @@
GLB_MUTEX_UNLOCK (&router->lock);
- return -error; // all attempts failed, return last errno
-}
-
-static inline uint32_t
-router_random_hint (glb_router_t* router)
-{
- uint32_t ret = rand_r(&router->seed);
- // the above returns only positive signed integers.
- // Need to expand it to 32 bits below.
- return ret ^ (ret << 1);
+ return -error;
}
#ifdef GLBD
-// returns socket number or negative error code
+// returns 0 or negative error code
int
glb_router_connect (glb_router_t* router, const glb_sockaddr_t* src_addr,
- glb_sockaddr_t* dst_addr)
+ glb_sockaddr_t* dst_addr, int* sock)
{
- int sock, ret;
+ int ret;
/* Here it is assumed that this function is called only from one thread. */
- if (router->conns >= router->cnf->max_conn) {
+ if (GLB_UNLIKELY(router->conns >= router->cnf->max_conn)) {
glb_log_warn ("Maximum connection limit of %ld exceeded. Rejecting "
"connection attempt.", router->cnf->max_conn);
- return -EMFILE;
+ *sock = -EMFILE;
+ return *sock;
}
- // prepare a socket
- sock = glb_socket_create (&router->sock_out, GLB_SOCK_NODELAY);
- if (sock < 0) {
- glb_log_error ("glb_socket_create() failed");
- return sock;
+ uint32_t hint = router->cnf->policy < GLB_POLICY_SOURCE ?
+ 0 : glb_socket_addr_hash (src_addr);
+
+ if (!router->cnf->synchronous) {
+ ret = glb_router_choose_dst (router, hint, dst_addr);
+ if (!ret) ret = -EINPROGRESS;
+ *sock = -1;
}
+ else {
+ // prepare a socket
+ *sock = glb_socket_create (&router->sock_out,
+ GLB_SOCK_NODELAY /*| GLB_SOCK_NONBLOCK*/);
- uint32_t hint = 0;
- switch (router->cnf->policy)
- {
- case GLB_POLICY_LEAST:
- case GLB_POLICY_ROUND: break;
- case GLB_POLICY_RANDOM: hint = router_random_hint(router); break;
- case GLB_POLICY_SOURCE: hint = glb_socket_addr_hash(src_addr); break;
- };
-
- // attmept to connect until we run out of destinations
- ret = router_connect_dst (router, sock, hint, dst_addr);
-
- // avoid socket leak
- if (ret < 0) {
- glb_log_error ("router_connect_dst() failed.");
- close (sock);
- sock = ret;
+ if (*sock < 0) {
+ glb_log_error ("glb_socket_create() failed");
+ return *sock;
+ }
+
+ // attmept to connect until we run out of destinations
+ ret = router_connect_dst (router, *sock, hint, dst_addr);
+
+ // avoid socket leak
+ if (ret < 0 /* && ret != -EINPROGRESS*/) {
+ glb_log_error ("router_connect_dst() failed.");
+ close (*sock);
+ *sock = ret;
+ }
}
- return sock;
+ return ret;
}
-void
-glb_router_disconnect (glb_router_t* router, const glb_sockaddr_t* dst)
+static inline int
+router_disconnect (glb_router_t* const router,
+ const glb_sockaddr_t* const dst,
+ bool const failed)
{
- long i;
-
- GLB_MUTEX_LOCK (&router->lock);
+ int i;
for (i = 0; i < router->n_dst; i++) {
router_dst_t* d = &router->dst[i];
if (glb_socket_addr_is_equal (&d->dst.addr, dst)) {
d->conns--; router->conns--;
assert(d->conns >= 0);
- d->usage = router_dst_usage(d);
+ d->usage = router_dst_usage (d);
+ if (failed) router_dst_failed (router, d);
break;
}
}
+ return i;
+}
+
+void
+glb_router_disconnect (glb_router_t* const router,
+ const glb_sockaddr_t* const dst,
+ bool const failed)
+{
+ GLB_MUTEX_LOCK (&router->lock);
+
+ int const i = router_disconnect (router, dst, failed);
+
+ GLB_MUTEX_UNLOCK (&router->lock);
+
if (i == router->n_dst) {
glb_log_warn ("Attempt to disconnect from non-existing destination: %s",
glb_socket_addr_to_string(dst));
}
+}
+
+int
+glb_router_choose_dst_again (glb_router_t* const router,
+ uint32_t const src_hint,
+ glb_sockaddr_t* const dst_addr)
+{
+ int ret;
+
+ GLB_MUTEX_LOCK (&router->lock);
+
+#ifndef NDEBUG
+ int const old_conns = router->conns;
+#endif
+
+ ret = router_disconnect (router, dst_addr, true);
+ assert (ret != router->n_dst);
+
+ router_dst_t* const dst = router_choose_dst (router, src_hint);
+
+ assert (old_conns == router->conns);
+
+ if (GLB_LIKELY(dst != NULL)) {
+ *dst_addr = dst->dst.addr;
+ ret = 0;
+ }
+ else {
+ ret = -EHOSTDOWN;
+ }
GLB_MUTEX_UNLOCK (&router->lock);
+
+ return ret;
}
size_t
@@ -595,11 +689,21 @@
for (i = 0; i < router->n_dst; i++) {
router_dst_t* d = &router->dst[i];
- len += snprintf (buf + len, buf_len - len,
- "%s : %8.3f %7.3f %7.3f %5d\n",
- glb_socket_addr_to_string(&d->dst.addr),
- d->dst.weight, 1.0/(d->usage + 1.0), d->map,
- d->conns);
+ if (router_uses_map (router)) {
+ len += snprintf (buf + len, buf_len - len,
+ "%s : %8.3f %7.3f %7.3f %5d\n",
+ glb_socket_addr_to_string(&d->dst.addr),
+ d->dst.weight, 1.0 - (d->usage/d->dst.weight),
+ d->map, d->conns);
+ }
+ else {
+ len += snprintf (buf + len, buf_len - len,
+ "%s : %8.3f %7.3f N/A %5d\n",
+ glb_socket_addr_to_string(&d->dst.addr),
+ d->dst.weight, 1.0 - (d->usage/d->dst.weight),
+ d->conns);
+ }
+
if (len == buf_len) {
buf[len - 1] = '\0';
return (len - 1);
@@ -629,11 +733,38 @@
{
glb_sockaddr_t dst;
- uint32_t hint =
- GLB_POLICY_RANDOM == router->cnf->policy ?
- router_random_hint(router) : router->seed;
+ uint32_t hint = router->seed;
+ // random hint will be generated in router_connect_dst()
+
+ // need to temporarily make socket blocking
+ int const orig_flags = fcntl (sockfd, F_GETFL);
+ if (orig_flags >= 0) {
+ int const block_flags = orig_flags & (~O_NONBLOCK);
+
+ if (orig_flags != block_flags) fcntl (sockfd, F_SETFL, block_flags);
+
+ int const ret = router_connect_dst (router, sockfd, hint, &dst);
+
+ if (orig_flags != block_flags) fcntl (sockfd, F_SETFL, orig_flags);
+
+ if (GLB_UNLIKELY(ret < 0)) {
+ errno = -ret;
+ }
+ else {
+ if (orig_flags == block_flags) {
+ // socket was blocking, no voodoo was made.
+ return 0;
+ }
+ else {
+ // socket was non-blocking, temporarily reverted to blocking
+ // for non-blocking socket connect() is expected to return -1
+ // and set errno to EINPROGRESS
+ errno = EINPROGRESS;
+ }
+ }
+ }
- return router_connect_dst (router, sockfd, hint, &dst);
+ return -1;
}
size_t
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_router.h
^
|
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2012 Codership Oy <info@codership.com>
+ * Copyright (C) 2008-2013 Codership Oy <info@codership.com>
*
- * $Id: glb_router.h 101 2012-12-10 20:17:20Z alex $
+ * $Id: glb_router.h 132 2013-01-10 15:10:04Z alex $
*/
#ifndef _glb_router_h_
@@ -29,22 +29,44 @@
#ifdef GLBD
/*!
+ * Finds destination for connection and copies its address to dst_addr.
+ * @param src_hint 4-byte hash of client address if available
+ * @return 0 if found, -EHOSTDOWN if not
+ */
+extern int
+glb_router_choose_dst (glb_router_t* const router,
+ uint32_t const src_hint,
+ glb_sockaddr_t* const dst_addr);
+
+/*!
+ * Atomically marks destination referenced by dst_addr as unavailable plus
+ * finds new destination and copies its address to dst_addr.
+ * @param src_hint 4-byte hash of client address if available
+ * @return 0 if found, -EHOSTDOWN if not
+ */
+extern int
+glb_router_choose_dst_again (glb_router_t* const router,
+ uint32_t const src_hint,
+ glb_sockaddr_t* const dst_addr);
+
+/*!
* Returns file descriptor of a new destinaiton conneciton and fills
* dst_addr with real server address
*
* Not thread-safe. Supposed to be called ONLY from the listener main loop.
*
- * @return file descriptor or negative error code
+ * @return 0 or negative error code
*/
extern int
glb_router_connect (glb_router_t* router, const glb_sockaddr_t* src_addr,
- glb_sockaddr_t* dst_addr);
+ glb_sockaddr_t* dst_addr, int* sock);
/*!
* Decrements connection reference count for destination
*/
extern void
-glb_router_disconnect (glb_router_t* router, const glb_sockaddr_t* dst_addr);
+glb_router_disconnect (glb_router_t* router, const glb_sockaddr_t* dst_addr,
+ bool failed);
#else /* GLBD */
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_socket.c
^
|
@@ -1,12 +1,13 @@
/*
* Copyright (C) 2008-2012 Codership Oy <info@codership.com>
*
- * $Id: glb_socket.c 101 2012-12-10 20:17:20Z alex $
+ * $Id: glb_socket.c 126 2013-01-08 03:36:55Z alex $
*/
#include "glb_socket.h"
#include "glb_cnf.h"
#include "glb_log.h"
+#include "glb_misc.h"
#include <stdio.h>
#include <stdlib.h>
@@ -167,6 +168,14 @@
}
#endif /* TCP_DEFER_ACCEPT */
+ if ((optflags & GLB_SOCK_NONBLOCK) &&
+ glb_fd_set_flag (sock, O_NONBLOCK, true))
+ {
+ glb_log_warn ("Setting O_NONBLCK failed: %d (%s)",
+ errno, strerror(errno));
+ ret = -errno;
+ }
+
return ret;
}
|
[-]
[+]
|
Changed |
glb-0.9.1.tar.bz2/src/glb_socket.h
^
|
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2008-2012 Codership Oy <info@codership.com>
*
- * $Id: glb_socket.h 101 2012-12-10 20:17:20Z alex $
+ * $Id: glb_socket.h 126 2013-01-08 03:36:55Z alex $
*/
#ifndef _glb_socket_h_
@@ -47,6 +47,7 @@
#define GLB_SOCK_NODELAY 1U
#define GLB_SOCK_DEFER_ACCEPT 2U
+#define GLB_SOCK_NONBLOCK 4U
// Returns socket (file descriptor) bound to a given address
// with default options set
|