diff options
author | Colin Watson <cjwatson@debian.org> | 2009-05-13 18:29:56 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2009-05-13 18:29:56 +0100 |
commit | 274ee1283e39f60477652a4ea7066409fb061bd2 (patch) | |
tree | a407148de89f17903a70987f5d272bca986a2b31 | |
parent | e0df298f07a42a310e842979fedec138c19c089f (diff) |
* gnulib: Upgrade to 20090501.
* tools/config.guess, tools/config.sub: Update.
106 files changed, 1258 insertions, 262 deletions
diff --git a/Makefile.in b/Makefile.in index 08efe098..ec276cf0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ @@ -990,6 +990,7 @@ m4_include([gnulib/m4/malloc.m4]) m4_include([gnulib/m4/malloca.m4]) m4_include([gnulib/m4/mbrtowc.m4]) m4_include([gnulib/m4/mbsinit.m4]) +m4_include([gnulib/m4/mbsrtowcs.m4]) m4_include([gnulib/m4/mbstate_t.m4]) m4_include([gnulib/m4/memcmp.m4]) m4_include([gnulib/m4/mempcpy.m4]) diff --git a/config.h.in b/config.h.in index e81c02b8..2f6a057a 100644 --- a/config.h.in +++ b/config.h.in @@ -952,6 +952,10 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define if rename does not work when the destination file exists, as on + Windows. */ +#undef RENAME_DEST_EXISTS_BUG + /* Define if rename does not work for source file names with a trailing slash, like the one from SunOS 4.1.1_U1. */ #undef RENAME_TRAILING_SLASH_BUG @@ -15521,6 +15521,9 @@ $as_echo "$gl_cv_solaris_64bit" >&6; } if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; @@ -21228,13 +21231,7 @@ else esac if test $LOCALE_FR != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22841,6 +22838,7 @@ _ACEOF + { $as_echo "$as_me:$LINENO: checking for working fcntl.h" >&5 $as_echo_n "checking for working fcntl.h... " >&6; } if test "${gl_cv_header_working_fcntl_h+set}" = set; then @@ -25933,13 +25931,7 @@ else esac if test $LOCALE_JA != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26026,13 +26018,7 @@ else esac if test $LOCALE_ZH_CN != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26155,13 +26141,7 @@ else esac if test $LOCALE_FR_UTF8 != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26251,13 +26231,7 @@ else esac if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26363,13 +26337,7 @@ else esac if test $LOCALE_ZH_CN != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26533,13 +26501,7 @@ else esac if test $LOCALE_JA != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26626,13 +26588,7 @@ else esac if test $LOCALE_ZH_CN != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26762,6 +26718,400 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } GNULIB_MBSINIT=1 + + + + + + + + + : + + + + + + + : + + + + + + if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then + + + + { $as_echo "$as_me:$LINENO: checking whether mbrtowc handles incomplete characters" >&5 +$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } +if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on AIX and OSF/1. + osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; + esac + if test $LOCALE_JA != none; then + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) + if (mbsinit (&state)) + return 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_incomplete_state=yes +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_incomplete_state=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 +$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } + + + + + { $as_echo "$as_me:$LINENO: checking whether mbrtowc works as well as mbtowc" >&5 +$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } +if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on Solaris 8. + solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; + esac + if test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* This fails on Solaris 8: + mbrtowc returns 2, and sets wc to 0x00F0. + mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ + mbstate_t state; + wchar_t wc; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, input + 3, 6, &state) != 4 + && mbtowc (&wc, input + 3, 6) == 4) + return 1; + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbrtowc_sanitycheck=yes +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbrtowc_sanitycheck=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 +$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } + + REPLACE_MBSTATE_T=0 + case "$gl_cv_func_mbrtowc_incomplete_state" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + case "$gl_cv_func_mbrtowc_sanitycheck" in + *yes) ;; + *) REPLACE_MBSTATE_T=1 ;; + esac + else + REPLACE_MBSTATE_T=1 + fi + if test $REPLACE_MBSTATE_T = 1; then + + + WCHAR_H=wchar.h + + fi + + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + fi + + : + + + + + + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + fi + if test $HAVE_MBSRTOWCS != 0 && test $REPLACE_MBSRTOWCS != 1; then + + + + + + { $as_echo "$as_me:$LINENO: checking whether mbsrtowcs works" >&5 +$as_echo_n "checking whether mbsrtowcs works... " >&6; } +if test "${gl_cv_func_mbsrtowcs_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_mbsrtowcs_works=yes +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_mbsrtowcs_works=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + fi + +fi +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbsrtowcs_works" >&5 +$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + WCHAR_H=wchar.h + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + GNULIB_MBSRTOWCS=1 + + if test $cross_compiling != no; then # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling. # We default to yes if memcmp appears to exist, which works @@ -28679,8 +29029,9 @@ fi fi - { $as_echo "$as_me:$LINENO: checking whether rename is broken" >&5 -$as_echo_n "checking whether rename is broken... " >&6; } + + { $as_echo "$as_me:$LINENO: checking whether rename is broken with a trailing slash" >&5 +$as_echo_n "checking whether rename is broken with a trailing slash... " >&6; } if test "${gl_cv_func_rename_trailing_slash_bug+set}" = set; then $as_echo_n "(cached) " >&6 else @@ -28751,7 +29102,22 @@ fi fi { $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_trailing_slash_bug" >&5 $as_echo "$gl_cv_func_rename_trailing_slash_bug" >&6; } - if test $gl_cv_func_rename_trailing_slash_bug = yes; then + { $as_echo "$as_me:$LINENO: checking whether rename is broken when the destination exists" >&5 +$as_echo_n "checking whether rename is broken when the destination exists... " >&6; } +if test "${gl_cv_func_rename_dest_exists_bug+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + case "$host_os" in + mingw*) gl_cv_func_rename_dest_exists_bug=yes ;; + *) gl_cv_func_rename_dest_exists_bug=no ;; + esac + +fi +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_dest_exists_bug" >&5 +$as_echo "$gl_cv_func_rename_dest_exists_bug" >&6; } + if test $gl_cv_func_rename_trailing_slash_bug = yes || + test $gl_cv_func_rename_dest_exists_bug = yes; then @@ -28767,11 +29133,20 @@ cat >>confdefs.h <<\_ACEOF #define rename rpl_rename _ACEOF + if test $gl_cv_func_rename_trailing_slash_bug; then cat >>confdefs.h <<\_ACEOF #define RENAME_TRAILING_SLASH_BUG 1 _ACEOF + fi + if test $gl_cv_func_rename_dest_exists_bug; then + +cat >>confdefs.h <<\_ACEOF +#define RENAME_DEST_EXISTS_BUG 1 +_ACEOF + + fi : fi @@ -37266,20 +37641,14 @@ if test "${gl_cv_func_wcrtomb_retval+set}" = set; then else case "$host_os" in - # Guess no on OSF/1 and Solaris. - osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; esac if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ diff --git a/docs/ChangeLog b/docs/ChangeLog index 8358f436..12bcf7df 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -1,3 +1,8 @@ +Wed May 13 18:28:44 BST 2009 Colin Watson <cjwatson@debian.org> + + * gnulib: Upgrade to 20090501. + * tools/config.guess, tools/config.sub: Update. + Wed Apr 22 15:50:51 BST 2009 Colin Watson <cjwatson@debian.org> * src/lexgrog.l (lt_name): Add. diff --git a/docs/Makefile.in b/docs/Makefile.in index 87cd9f05..f800cf39 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am index 40c6a5fd..a6878828 100644 --- a/gnulib/lib/Makefile.am +++ b/gnulib/lib/Makefile.am @@ -174,7 +174,7 @@ EXTRA_DIST += close-hook.h # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -204,7 +204,12 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t - mv $@-t $@ + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi + BUILT_SOURCES += configmake.h CLEANFILES += configmake.h configmake.h-t @@ -691,6 +696,15 @@ EXTRA_libgnu_a_SOURCES += mbsinit.c ## end gnulib module mbsinit +## begin gnulib module mbsrtowcs + + +EXTRA_DIST += mbsrtowcs-state.c mbsrtowcs.c + +EXTRA_libgnu_a_SOURCES += mbsrtowcs-state.c mbsrtowcs.c + +## end gnulib module mbsrtowcs + ## begin gnulib module memcmp @@ -1309,6 +1323,12 @@ EXTRA_libgnu_a_SOURCES += strnlen.c ## end gnulib module strnlen +## begin gnulib module strnlen1 + +libgnu_a_SOURCES += strnlen1.h strnlen1.c + +## end gnulib module strnlen1 + ## begin gnulib module strsep diff --git a/gnulib/lib/Makefile.in b/gnulib/lib/Makefile.in index f41f4df0..2553fd26 100644 --- a/gnulib/lib/Makefile.in +++ b/gnulib/lib/Makefile.in @@ -128,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ @@ -219,7 +220,7 @@ am_libgnu_a_OBJECTS = areadlink-with-size.$(OBJEXT) argp-ba.$(OBJEXT) \ argp-pvh.$(OBJEXT) argp-xinl.$(OBJEXT) close-hook.$(OBJEXT) \ file-set.$(OBJEXT) hash-pjw.$(OBJEXT) hash-triple.$(OBJEXT) \ localcharset.$(OBJEXT) glthread/lock.$(OBJEXT) \ - malloca.$(OBJEXT) openat-die.$(OBJEXT) \ + malloca.$(OBJEXT) openat-die.$(OBJEXT) strnlen1.$(OBJEXT) \ glthread/threadlib.$(OBJEXT) glthread/tls.$(OBJEXT) \ xalloc-die.$(OBJEXT) xstrndup.$(OBJEXT) xvasprintf.$(OBJEXT) \ xasprintf.$(OBJEXT) @@ -845,20 +846,20 @@ EXTRA_DIST = alloca.c alloca.in.h areadlink.h atexit.c btowc.c \ hash-triple.h $(top_srcdir)/tools/config.rpath intprops.h \ lchown.c $(top_srcdir)/tools/link-warning.h config.charset \ ref-add.sin ref-del.sin lstat.c malloc.c malloc.c malloca.h \ - malloca.valgrind mbrtowc.c mbsinit.c memcmp.c mempcpy.c \ - memrchr.c mkdtemp.c mkstemp.c open.c at-func.c fchmodat.c \ - fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c \ - openat.c openat.h pathmax.h rawmemchr.c rawmemchr.valgrind \ - readlink.c regcomp.c regex.c regex.h regex_internal.c \ - regex_internal.h regexec.c rename.c same.c same.h same-inode.h \ - save-cwd.c save-cwd.h setenv.c sig-handler.h sigaction.c \ - signal.in.h sigprocmask.c sleep.c snprintf.c stdarg.in.h \ - stdbool.in.h stdint.in.h stdio-write.c stdio.in.h stdlib.in.h \ - strcasecmp.c strncasecmp.c strchrnul.c strchrnul.valgrind \ - strcspn.c streq.h strerror.c string.in.h strings.in.h \ - strndup.c strnlen.c strsep.c siglist.h strsignal.c \ - sys_select.in.h sys_socket.in.h sys_stat.in.h sys_time.in.h \ - sysexits.in.h tempname.c tempname.h \ + malloca.valgrind mbrtowc.c mbsinit.c mbsrtowcs-state.c \ + mbsrtowcs.c memcmp.c mempcpy.c memrchr.c mkdtemp.c mkstemp.c \ + open.c at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c \ + openat-priv.h openat-proc.c openat.c openat.h pathmax.h \ + rawmemchr.c rawmemchr.valgrind readlink.c regcomp.c regex.c \ + regex.h regex_internal.c regex_internal.h regexec.c rename.c \ + same.c same.h same-inode.h save-cwd.c save-cwd.h setenv.c \ + sig-handler.h sigaction.c signal.in.h sigprocmask.c sleep.c \ + snprintf.c stdarg.in.h stdbool.in.h stdint.in.h stdio-write.c \ + stdio.in.h stdlib.in.h strcasecmp.c strncasecmp.c strchrnul.c \ + strchrnul.valgrind strcspn.c streq.h strerror.c string.in.h \ + strings.in.h strndup.c strnlen.c strsep.c siglist.h \ + strsignal.c sys_select.in.h sys_socket.in.h sys_stat.in.h \ + sys_time.in.h sysexits.in.h tempname.c tempname.h \ $(top_srcdir)/tools/config.rpath unistd.in.h dup-safer.c \ fd-safer.c pipe-safer.c unistd--.h unistd-safer.h unsetenv.c \ asnprintf.c float+.h printf-args.c printf-args.h \ @@ -905,9 +906,10 @@ libgnu_a_SOURCES = areadlink-with-size.c argp.h argp-ba.c argp-eexst.c \ argp-xinl.c close-hook.c file-set.c gettext.h hash-pjw.h \ hash-pjw.c hash-triple.c localcharset.h localcharset.c \ glthread/lock.h glthread/lock.c malloca.c minmax.h \ - openat-die.c size_max.h glthread/threadlib.c glthread/tls.h \ - glthread/tls.c verify.h xalloc-die.c xsize.h xstrndup.h \ - xstrndup.c xvasprintf.h xvasprintf.c xasprintf.c + openat-die.c size_max.h strnlen1.h strnlen1.c \ + glthread/threadlib.c glthread/tls.h glthread/tls.c verify.h \ + xalloc-die.c xsize.h xstrndup.h xstrndup.c xvasprintf.h \ + xvasprintf.c xasprintf.c libgnu_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ EXTRA_libgnu_a_SOURCES = alloca.c atexit.c btowc.c canonicalize.c \ @@ -916,17 +918,18 @@ EXTRA_libgnu_a_SOURCES = alloca.c atexit.c btowc.c canonicalize.c \ exitfail.c fchdir.c fclose.c creat-safer.c open-safer.c \ filenamecat.c fnmatch.c fnmatch_loop.c getcwd.c getlogin_r.c \ getopt.c getopt1.c gettimeofday.c glob.c hash.c lchown.c \ - lstat.c malloc.c malloc.c mbrtowc.c mbsinit.c memcmp.c \ - mempcpy.c memrchr.c mkdtemp.c mkstemp.c open.c at-func.c \ - fchmodat.c fchownat.c fstatat.c mkdirat.c openat-proc.c \ - openat.c rawmemchr.c readlink.c regcomp.c regex.c \ - regex_internal.c regexec.c rename.c same.c save-cwd.c setenv.c \ - sigaction.c sigprocmask.c sleep.c snprintf.c stdio-write.c \ - strcasecmp.c strncasecmp.c strchrnul.c strcspn.c strerror.c \ - strndup.c strnlen.c strsep.c strsignal.c tempname.c \ - dup-safer.c fd-safer.c pipe-safer.c unsetenv.c asnprintf.c \ - printf-args.c printf-parse.c vasnprintf.c asprintf.c \ - vasprintf.c vsnprintf.c wcrtomb.c xmalloc.c xgetcwd.c + lstat.c malloc.c malloc.c mbrtowc.c mbsinit.c \ + mbsrtowcs-state.c mbsrtowcs.c memcmp.c mempcpy.c memrchr.c \ + mkdtemp.c mkstemp.c open.c at-func.c fchmodat.c fchownat.c \ + fstatat.c mkdirat.c openat-proc.c openat.c rawmemchr.c \ + readlink.c regcomp.c regex.c regex_internal.c regexec.c \ + rename.c same.c save-cwd.c setenv.c sigaction.c sigprocmask.c \ + sleep.c snprintf.c stdio-write.c strcasecmp.c strncasecmp.c \ + strchrnul.c strcspn.c strerror.c strndup.c strnlen.c strsep.c \ + strsignal.c tempname.c dup-safer.c fd-safer.c pipe-safer.c \ + unsetenv.c asnprintf.c printf-args.c printf-parse.c \ + vasnprintf.c asprintf.c vasprintf.c vsnprintf.c wcrtomb.c \ + xmalloc.c xgetcwd.c LINK_WARNING_H = $(top_srcdir)/tools/link-warning.h charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp @@ -1061,6 +1064,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs-state.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsrtowcs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ @@ -1098,6 +1103,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ @@ -1447,7 +1453,7 @@ alloca.h: alloca.in.h # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile - rm -f $@-t $@ + rm -f $@-t { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ @@ -1477,7 +1483,11 @@ configmake.h: Makefile echo '#define PKGLIBDIR "$(pkglibdir)"'; \ echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ } | sed '/""/d' > $@-t - mv $@-t $@ + if test -f $@ && cmp $@-t $@ > /dev/null; then \ + rm -f $@-t; \ + else \ + rm -f $@; mv $@-t $@; \ + fi # We need the following in order to create <dirent.h> when the system # doesn't have one that works with the given compiler. diff --git a/gnulib/lib/alloca.c b/gnulib/lib/alloca.c index ff1cb7e9..3a1f4e27 100644 --- a/gnulib/lib/alloca.c +++ b/gnulib/lib/alloca.c @@ -486,4 +486,4 @@ i00afunc (long address) # endif /* CRAY */ # endif /* no alloca */ -#endif /* not GCC version 3 */ +#endif /* not GCC version 2 */ diff --git a/gnulib/lib/alloca.in.h b/gnulib/lib/alloca.in.h index 6269607a..5d16e08b 100644 --- a/gnulib/lib/alloca.in.h +++ b/gnulib/lib/alloca.in.h @@ -5,7 +5,7 @@ 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 the Free Software Foundation; either version 3, or (at your option) + by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/asnprintf.c b/gnulib/lib/asnprintf.c index bf2abf3c..26c3988b 100644 --- a/gnulib/lib/asnprintf.c +++ b/gnulib/lib/asnprintf.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/asprintf.c b/gnulib/lib/asprintf.c index 0bbecf81..1d51eac4 100644 --- a/gnulib/lib/asprintf.c +++ b/gnulib/lib/asprintf.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/config.charset b/gnulib/lib/config.charset index 7f912120..03ed8c34 100755 --- a/gnulib/lib/config.charset +++ b/gnulib/lib/config.charset @@ -5,7 +5,7 @@ # # 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 -# the Free Software Foundation; either version 3, or (at your option) +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/errno.in.h b/gnulib/lib/errno.in.h index 51ac6624..eef3931f 100644 --- a/gnulib/lib/errno.in.h +++ b/gnulib/lib/errno.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/float+.h b/gnulib/lib/float+.h index 240fe365..4de25a94 100644 --- a/gnulib/lib/float+.h +++ b/gnulib/lib/float+.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/fnmatch.c b/gnulib/lib/fnmatch.c index 676e1bd8..48bc8b5d 100644 --- a/gnulib/lib/fnmatch.c +++ b/gnulib/lib/fnmatch.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/fnmatch.in.h b/gnulib/lib/fnmatch.in.h index 3518c298..b086b45a 100644 --- a/gnulib/lib/fnmatch.in.h +++ b/gnulib/lib/fnmatch.in.h @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/fnmatch_loop.c b/gnulib/lib/fnmatch_loop.c index 337fba9d..d1008c24 100644 --- a/gnulib/lib/fnmatch_loop.c +++ b/gnulib/lib/fnmatch_loop.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/getlogin_r.c b/gnulib/lib/getlogin_r.c index dbd23050..39b6f275 100644 --- a/gnulib/lib/getlogin_r.c +++ b/gnulib/lib/getlogin_r.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/getopt1.c b/gnulib/lib/getopt1.c index d6a3ecf4..ba115c47 100644 --- a/gnulib/lib/getopt1.c +++ b/gnulib/lib/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -91,7 +91,7 @@ main (int argc, char **argv) { int this_option_optind = optind ? optind : 1; int option_index = 0; - static struct option long_options[] = + static const struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, diff --git a/gnulib/lib/gettext.h b/gnulib/lib/gettext.h index 763dd3c1..9d76ec9a 100644 --- a/gnulib/lib/gettext.h +++ b/gnulib/lib/gettext.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c index eb6bf9c1..7e711f79 100644 --- a/gnulib/lib/gettimeofday.c +++ b/gnulib/lib/gettimeofday.c @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/glob-libc.h b/gnulib/lib/glob-libc.h index 2f7b750c..154e52da 100644 --- a/gnulib/lib/glob-libc.h +++ b/gnulib/lib/glob-libc.h @@ -4,7 +4,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gnulib/lib/glob.c b/gnulib/lib/glob.c index 6214eb8c..83b40993 100644 --- a/gnulib/lib/glob.c +++ b/gnulib/lib/glob.c @@ -5,7 +5,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gnulib/lib/glob.in.h b/gnulib/lib/glob.in.h index 997833b7..05898178 100644 --- a/gnulib/lib/glob.in.h +++ b/gnulib/lib/glob.in.h @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/glthread/lock.c b/gnulib/lib/glthread/lock.c index 7db6426e..dc44d086 100644 --- a/gnulib/lib/glthread/lock.c +++ b/gnulib/lib/glthread/lock.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/glthread/lock.h b/gnulib/lib/glthread/lock.h index 0cfb30ea..282a22b6 100644 --- a/gnulib/lib/glthread/lock.h +++ b/gnulib/lib/glthread/lock.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/glthread/threadlib.c b/gnulib/lib/glthread/threadlib.c index 5feb3042..791c4309 100644 --- a/gnulib/lib/glthread/threadlib.c +++ b/gnulib/lib/glthread/threadlib.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/localcharset.c b/gnulib/lib/localcharset.c index a7ca94c1..1ff46052 100644 --- a/gnulib/lib/localcharset.c +++ b/gnulib/lib/localcharset.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/localcharset.h b/gnulib/lib/localcharset.h index b9a3013a..5030210d 100644 --- a/gnulib/lib/localcharset.h +++ b/gnulib/lib/localcharset.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/malloc.c b/gnulib/lib/malloc.c index f2f66637..eba131d1 100644 --- a/gnulib/lib/malloc.c +++ b/gnulib/lib/malloc.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/malloca.c b/gnulib/lib/malloca.c index 1f410781..4145bf6d 100644 --- a/gnulib/lib/malloca.c +++ b/gnulib/lib/malloca.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/malloca.h b/gnulib/lib/malloca.h index 3be0a386..5bb2d473 100644 --- a/gnulib/lib/malloca.h +++ b/gnulib/lib/malloca.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/mbsrtowcs-state.c b/gnulib/lib/mbsrtowcs-state.c new file mode 100644 index 00000000..89011183 --- /dev/null +++ b/gnulib/lib/mbsrtowcs-state.c @@ -0,0 +1,37 @@ +/* Convert string to wide string. + Copyright (C) 2008-2009 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <wchar.h> + +/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */ +mbstate_t _gl_mbsrtowcs_state +/* The state must initially be in the "initial state"; so, zero-initialize it. + On most systems, putting it into BSS is sufficient. Not so on MacOS X 10.3, + see <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>. + When it needs an initializer, use 0 or {0} as initializer? 0 only works + when mbstate_t is a scalar type (such as when gnulib defines it, or on + AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct + or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */ +#if defined __ELF__ + /* On ELF systems, variables in BSS behave well. */ +#else + /* Use braces, to be on the safe side. */ + = { 0 } +#endif + ; diff --git a/gnulib/lib/mbsrtowcs.c b/gnulib/lib/mbsrtowcs.c new file mode 100644 index 00000000..ea6a0187 --- /dev/null +++ b/gnulib/lib/mbsrtowcs.c @@ -0,0 +1,136 @@ +/* Convert string to wide string. + Copyright (C) 2008 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2008. + + 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include <wchar.h> + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> + +#include "strnlen1.h" + + +extern mbstate_t _gl_mbsrtowcs_state; + +size_t +mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) +{ + if (ps == NULL) + ps = &_gl_mbsrtowcs_state; + { + const char *src = *srcp; + + if (dest != NULL) + { + wchar_t *destptr = dest; + + for (; len > 0; destptr++, len--) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (destptr, src, src_avail, ps); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input; + if (ret == 0) + { + src = NULL; + /* Here mbsinit (ps). */ + break; + } + src += ret; + } + + *srcp = src; + return destptr - dest; + } + else + { + /* Ignore dest and len, don't store *srcp at the end, and + don't clobber *ps. */ + mbstate_t state = *ps; + size_t totalcount = 0; + + for (;; totalcount++) + { + size_t src_avail; + size_t ret; + + /* An optimized variant of + src_avail = strnlen1 (src, MB_LEN_MAX); */ + if (src[0] == '\0') + src_avail = 1; + else if (src[1] == '\0') + src_avail = 2; + else if (src[2] == '\0') + src_avail = 3; + else if (MB_LEN_MAX <= 4 || src[3] == '\0') + src_avail = 4; + else + src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); + + /* Parse the next multibyte character. */ + ret = mbrtowc (NULL, src, src_avail, &state); + + if (ret == (size_t)(-2)) + /* Encountered a multibyte character that extends past a '\0' byte + or that is longer than MB_LEN_MAX bytes. Cannot happen. */ + abort (); + + if (ret == (size_t)(-1)) + goto bad_input2; + if (ret == 0) + { + /* Here mbsinit (&state). */ + break; + } + src += ret; + } + + return totalcount; + } + + bad_input: + *srcp = src; + bad_input2: + errno = EILSEQ; + return (size_t)(-1); + } +} diff --git a/gnulib/lib/mempcpy.c b/gnulib/lib/mempcpy.c index 33c7a607..1c702c7f 100644 --- a/gnulib/lib/mempcpy.c +++ b/gnulib/lib/mempcpy.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/minmax.h b/gnulib/lib/minmax.h index 1ebc2207..975ea76d 100644 --- a/gnulib/lib/minmax.h +++ b/gnulib/lib/minmax.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/pathmax.h b/gnulib/lib/pathmax.h index 28d85043..f18d7600 100644 --- a/gnulib/lib/pathmax.h +++ b/gnulib/lib/pathmax.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/printf-args.c b/gnulib/lib/printf-args.c index 871c720a..49789146 100644 --- a/gnulib/lib/printf-args.c +++ b/gnulib/lib/printf-args.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/printf-args.h b/gnulib/lib/printf-args.h index 67cb990c..6f75e2ae 100644 --- a/gnulib/lib/printf-args.h +++ b/gnulib/lib/printf-args.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/printf-parse.c b/gnulib/lib/printf-parse.c index 28b9bd41..b11f6bb2 100644 --- a/gnulib/lib/printf-parse.c +++ b/gnulib/lib/printf-parse.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/printf-parse.h b/gnulib/lib/printf-parse.h index e5d68d75..de7fc49b 100644 --- a/gnulib/lib/printf-parse.h +++ b/gnulib/lib/printf-parse.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/ref-add.sin b/gnulib/lib/ref-add.sin index 222d7529..bc5cc797 100644 --- a/gnulib/lib/ref-add.sin +++ b/gnulib/lib/ref-add.sin @@ -4,7 +4,7 @@ # # 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 -# the Free Software Foundation; either version 3, or (at your option) +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/ref-del.sin b/gnulib/lib/ref-del.sin index 1bf073e1..e9301bf2 100644 --- a/gnulib/lib/ref-del.sin +++ b/gnulib/lib/ref-del.sin @@ -4,7 +4,7 @@ # # 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 -# the Free Software Foundation; either version 3, or (at your option) +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regcomp.c b/gnulib/lib/regcomp.c index b114b4d1..6472ff6b 100644 --- a/gnulib/lib/regcomp.c +++ b/gnulib/lib/regcomp.c @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regex.c b/gnulib/lib/regex.c index ee36378a..d4eb726b 100644 --- a/gnulib/lib/regex.c +++ b/gnulib/lib/regex.c @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regex.h b/gnulib/lib/regex.h index a5312832..7a79ca37 100644 --- a/gnulib/lib/regex.h +++ b/gnulib/lib/regex.h @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regex_internal.c b/gnulib/lib/regex_internal.c index 7acec79d..904b88ed 100644 --- a/gnulib/lib/regex_internal.c +++ b/gnulib/lib/regex_internal.c @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regex_internal.h b/gnulib/lib/regex_internal.h index dc322ec5..859832f5 100644 --- a/gnulib/lib/regex_internal.h +++ b/gnulib/lib/regex_internal.h @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/regexec.c b/gnulib/lib/regexec.c index 5452ef78..21a81669 100644 --- a/gnulib/lib/regexec.c +++ b/gnulib/lib/regexec.c @@ -6,7 +6,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/rename.c b/gnulib/lib/rename.c index 9667c39e..b27fd910 100644 --- a/gnulib/lib/rename.c +++ b/gnulib/lib/rename.c @@ -1,8 +1,9 @@ -/* Work around the bug in some systems whereby rename fails when the source - file has a trailing slash. The rename functions of SunOS 4.1.1_U1 and - mips-dec-ultrix4.4 have this bug. +/* Work around rename bugs in some systems. On SunOS 4.1.1_U1 + and mips-dec-ultrix4.4, rename fails when the source file has + a trailing slash. On mingw, rename fails when the destination + exists. - Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 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 @@ -22,6 +23,113 @@ #include <config.h> #undef rename +#if RENAME_DEST_EXISTS_BUG +/* This replacement must come first, otherwise when cross + * compiling to Windows we will guess that it has the trailing + * slash bug and entirely miss this one. */ +#include <errno.h> + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +/* Rename the file SRC to DST. This replacement is necessary on + Windows, on which the system rename function will not replace + an existing DST. */ +int +rpl_rename (char const *src, char const *dst) +{ + int error; + + /* MoveFileEx works if SRC is a directory without any flags, + but fails with MOVEFILE_REPLACE_EXISTING, so try without + flags first. */ + if (MoveFileEx (src, dst, 0)) + return 0; + + /* Retry with MOVEFILE_REPLACE_EXISTING if the move failed + * due to the destination already existing. */ + error = GetLastError (); + if (error == ERROR_FILE_EXISTS || error == ERROR_ALREADY_EXISTS) + { + if (MoveFileEx (src, dst, MOVEFILE_REPLACE_EXISTING)) + return 0; + + error = GetLastError (); + } + + switch (error) + { + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + case ERROR_BAD_PATHNAME: + case ERROR_DIRECTORY: + errno = ENOENT; + break; + + case ERROR_ACCESS_DENIED: + case ERROR_SHARING_VIOLATION: + errno = EACCES; + break; + + case ERROR_OUTOFMEMORY: + errno = ENOMEM; + break; + + case ERROR_CURRENT_DIRECTORY: + errno = EBUSY; + break; + + case ERROR_NOT_SAME_DEVICE: + errno = EXDEV; + break; + + case ERROR_WRITE_PROTECT: + errno = EROFS; + break; + + case ERROR_WRITE_FAULT: + case ERROR_READ_FAULT: + case ERROR_GEN_FAILURE: + errno = EIO; + break; + + case ERROR_HANDLE_DISK_FULL: + case ERROR_DISK_FULL: + case ERROR_DISK_TOO_FRAGMENTED: + errno = ENOSPC; + break; + + case ERROR_FILE_EXISTS: + case ERROR_ALREADY_EXISTS: + errno = EEXIST; + break; + + case ERROR_BUFFER_OVERFLOW: + case ERROR_FILENAME_EXCED_RANGE: + errno = ENAMETOOLONG; + break; + + case ERROR_INVALID_NAME: + case ERROR_DELETE_PENDING: + errno = EPERM; /* ? */ + break; + +#ifndef ERROR_FILE_TOO_LARGE +/* This value is documented but not defined in all versions of windows.h. */ +#define ERROR_FILE_TOO_LARGE 223 +#endif + case ERROR_FILE_TOO_LARGE: + errno = EFBIG; + break; + + default: + errno = EINVAL; + break; + } + + return -1; +} +#elif RENAME_TRAILING_SLASH_BUG #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -54,3 +162,4 @@ rpl_rename (char const *src, char const *dst) return ret_val; } +#endif /* RENAME_TRAILING_SLASH_BUG */ diff --git a/gnulib/lib/siglist.h b/gnulib/lib/siglist.h index 4e8a7498..be4a56f6 100644 --- a/gnulib/lib/siglist.h +++ b/gnulib/lib/siglist.h @@ -5,7 +5,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gnulib/lib/size_max.h b/gnulib/lib/size_max.h index 2ccc5f08..ed0bc137 100644 --- a/gnulib/lib/size_max.h +++ b/gnulib/lib/size_max.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/snprintf.c b/gnulib/lib/snprintf.c index dafbda81..7b9725b3 100644 --- a/gnulib/lib/snprintf.c +++ b/gnulib/lib/snprintf.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/stdarg.in.h b/gnulib/lib/stdarg.in.h index 186a4951..976005c0 100644 --- a/gnulib/lib/stdarg.in.h +++ b/gnulib/lib/stdarg.in.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/stdbool.in.h b/gnulib/lib/stdbool.in.h index cffa0ab2..8e62b082 100644 --- a/gnulib/lib/stdbool.in.h +++ b/gnulib/lib/stdbool.in.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/stdint.in.h b/gnulib/lib/stdint.in.h index 53aa34a8..869bd3a7 100644 --- a/gnulib/lib/stdint.in.h +++ b/gnulib/lib/stdint.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h index cb273d76..ba63f2cc 100644 --- a/gnulib/lib/stdio.in.h +++ b/gnulib/lib/stdio.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strcasecmp.c b/gnulib/lib/strcasecmp.c index bbfd570b..c605fb0f 100644 --- a/gnulib/lib/strcasecmp.c +++ b/gnulib/lib/strcasecmp.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/string.in.h b/gnulib/lib/string.in.h index f021a3ed..7d508ccd 100644 --- a/gnulib/lib/string.in.h +++ b/gnulib/lib/string.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strings.in.h b/gnulib/lib/strings.in.h index 05e71528..0c87af21 100644 --- a/gnulib/lib/strings.in.h +++ b/gnulib/lib/strings.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strncasecmp.c b/gnulib/lib/strncasecmp.c index 5e29a0a5..473a610f 100644 --- a/gnulib/lib/strncasecmp.c +++ b/gnulib/lib/strncasecmp.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strndup.c b/gnulib/lib/strndup.c index 507e9c06..3a1b0eae 100644 --- a/gnulib/lib/strndup.c +++ b/gnulib/lib/strndup.c @@ -5,7 +5,7 @@ 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 the - Free Software Foundation; either version 3, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strnlen.c b/gnulib/lib/strnlen.c index 93d1ac14..d346d327 100644 --- a/gnulib/lib/strnlen.c +++ b/gnulib/lib/strnlen.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strnlen1.c b/gnulib/lib/strnlen1.c new file mode 100644 index 00000000..752d4fe8 --- /dev/null +++ b/gnulib/lib/strnlen1.c @@ -0,0 +1,35 @@ +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + Copyright (C) 2005-2006 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "strnlen1.h" + +#include <string.h> + +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + If no '\0' terminator is found in that many characters, return MAXLEN. */ +/* This is the same as strnlen (string, maxlen - 1) + 1. */ +size_t +strnlen1 (const char *string, size_t maxlen) +{ + const char *end = (const char *) memchr (string, '\0', maxlen); + if (end != NULL) + return end - string + 1; + else + return maxlen; +} diff --git a/gnulib/lib/strnlen1.h b/gnulib/lib/strnlen1.h new file mode 100644 index 00000000..c0ea3570 --- /dev/null +++ b/gnulib/lib/strnlen1.h @@ -0,0 +1,39 @@ +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + Copyright (C) 2005 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef _STRNLEN1_H +#define _STRNLEN1_H + +#include <stddef.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Find the length of STRING + 1, but scan at most MAXLEN bytes. + If no '\0' terminator is found in that many characters, return MAXLEN. */ +/* This is the same as strnlen (string, maxlen - 1) + 1. */ +extern size_t strnlen1 (const char *string, size_t maxlen); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _STRNLEN1_H */ diff --git a/gnulib/lib/strsep.c b/gnulib/lib/strsep.c index a5667843..9f2fdd2b 100644 --- a/gnulib/lib/strsep.c +++ b/gnulib/lib/strsep.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/strsignal.c b/gnulib/lib/strsignal.c index 4bf017d7..7fd23c1e 100644 --- a/gnulib/lib/strsignal.c +++ b/gnulib/lib/strsignal.c @@ -4,7 +4,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gnulib/lib/sys_select.in.h b/gnulib/lib/sys_select.in.h index e87b7d04..62cd1048 100644 --- a/gnulib/lib/sys_select.in.h +++ b/gnulib/lib/sys_select.in.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/sys_socket.in.h b/gnulib/lib/sys_socket.in.h index 311d2d69..6508bf77 100644 --- a/gnulib/lib/sys_socket.in.h +++ b/gnulib/lib/sys_socket.in.h @@ -5,7 +5,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/sys_stat.in.h b/gnulib/lib/sys_stat.in.h index 1e6294da..da965d02 100644 --- a/gnulib/lib/sys_stat.in.h +++ b/gnulib/lib/sys_stat.in.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/sys_time.in.h b/gnulib/lib/sys_time.in.h index 454078f7..d9fb361b 100644 --- a/gnulib/lib/sys_time.in.h +++ b/gnulib/lib/sys_time.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/unistd.in.h b/gnulib/lib/unistd.in.h index fa8d84a3..cd3a60b7 100644 --- a/gnulib/lib/unistd.in.h +++ b/gnulib/lib/unistd.in.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c index a583ebd2..a5b07d95 100644 --- a/gnulib/lib/vasnprintf.c +++ b/gnulib/lib/vasnprintf.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -1799,18 +1799,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-8 to locale encoding. */ - if (u8_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + converted = + u8_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); # else /* Convert from UTF-8 to UTF-16/UTF-32. */ converted = U8_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -1927,18 +1927,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-16 to locale encoding. */ - if (u16_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + converted = + u16_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); # else /* Convert from UTF-16 to UTF-8/UTF-32. */ converted = U16_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -2055,18 +2055,18 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, size_t converted_len = allocated - length; # if DCHAR_IS_TCHAR /* Convert from UTF-32 to locale encoding. */ - if (u32_conv_to_encoding (locale_charset (), - iconveh_question_mark, - arg, arg_end - arg, NULL, - &converted, &converted_len) - < 0) + converted = + u32_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); # else /* Convert from UTF-32 to UTF-8/UTF-16. */ converted = U32_TO_DCHAR (arg, arg_end - arg, converted, &converted_len); - if (converted == NULL) # endif + if (converted == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) @@ -2493,14 +2493,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } /* Convert from TCHAR_T[] to DCHAR_T[]. */ - tmpdst = NULL; - tmpdst_len = 0; - if (DCHAR_CONV_FROM_ENCODING (locale_charset (), - iconveh_question_mark, - tmpsrc, characters, - NULL, - &tmpdst, &tmpdst_len) - < 0) + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) { int saved_errno = errno; free (tmpsrc); @@ -5216,14 +5215,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # else tmpsrc = tmp; # endif - tmpdst = NULL; - tmpdst_len = 0; - if (DCHAR_CONV_FROM_ENCODING (locale_charset (), - iconveh_question_mark, - tmpsrc, count, - NULL, - &tmpdst, &tmpdst_len) - < 0) + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, count, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) { int saved_errno = errno; if (!(result == resultbuf || result == NULL)) diff --git a/gnulib/lib/vasnprintf.h b/gnulib/lib/vasnprintf.h index b9a3d6ed..c56353e9 100644 --- a/gnulib/lib/vasnprintf.h +++ b/gnulib/lib/vasnprintf.h @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/vasprintf.c b/gnulib/lib/vasprintf.c index d1b81373..2f38c3a7 100644 --- a/gnulib/lib/vasprintf.c +++ b/gnulib/lib/vasprintf.c @@ -3,7 +3,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/vsnprintf.c b/gnulib/lib/vsnprintf.c index 02af2520..043999d3 100644 --- a/gnulib/lib/vsnprintf.c +++ b/gnulib/lib/vsnprintf.c @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/wchar.in.h b/gnulib/lib/wchar.in.h index cc436b14..3c6cd7b8 100644 --- a/gnulib/lib/wchar.in.h +++ b/gnulib/lib/wchar.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/wctype.in.h b/gnulib/lib/wctype.in.h index f008d8ff..bcd0151d 100644 --- a/gnulib/lib/wctype.in.h +++ b/gnulib/lib/wctype.in.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/lib/xsize.h b/gnulib/lib/xsize.h index 284cf7f6..2d99a6b1 100644 --- a/gnulib/lib/xsize.h +++ b/gnulib/lib/xsize.h @@ -4,7 +4,7 @@ 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 - the Free Software Foundation; either version 3, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/m4/btowc.m4 b/gnulib/m4/btowc.m4 index 64ff8290..b46f74fb 100644 --- a/gnulib/m4/btowc.m4 +++ b/gnulib/m4/btowc.m4 @@ -1,5 +1,5 @@ -# btowc.m4 serial 3 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# btowc.m4 serial 4 +dnl Copyright (C) 2008-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -47,7 +47,7 @@ int main () }], [gl_cv_func_btowc_eof=yes], [gl_cv_func_btowc_eof=no], - []) + [:]) fi ]) case "$gl_cv_func_btowc_eof" in diff --git a/gnulib/m4/fcntl_h.m4 b/gnulib/m4/fcntl_h.m4 index 4a7fc42b..1ae0b15a 100644 --- a/gnulib/m4/fcntl_h.m4 +++ b/gnulib/m4/fcntl_h.m4 @@ -9,6 +9,8 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_FCNTL_H], [ AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index ae5b4839..ed7049b6 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -126,6 +126,8 @@ AC_DEFUN([gl_INIT], gl_WCHAR_MODULE_INDICATOR([mbrtowc]) gl_FUNC_MBSINIT gl_WCHAR_MODULE_INDICATOR([mbsinit]) + gl_FUNC_MBSRTOWCS + gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) gl_FUNC_MEMCMP gl_FUNC_MEMPCPY gl_STRING_MODULE_INDICATOR([mempcpy]) @@ -450,6 +452,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/malloca.valgrind lib/mbrtowc.c lib/mbsinit.c + lib/mbsrtowcs-state.c + lib/mbsrtowcs.c lib/memcmp.c lib/mempcpy.c lib/memrchr.c @@ -514,6 +518,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/strncasecmp.c lib/strndup.c lib/strnlen.c + lib/strnlen1.c + lib/strnlen1.h lib/strsep.c lib/strsignal.c lib/sys_select.in.h @@ -618,6 +624,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/malloca.m4 m4/mbrtowc.m4 m4/mbsinit.m4 + m4/mbsrtowcs.m4 m4/mbstate_t.m4 m4/memcmp.m4 m4/mempcpy.m4 diff --git a/gnulib/m4/lib-link.m4 b/gnulib/m4/lib-link.m4 index fcd3391b..21442033 100644 --- a/gnulib/m4/lib-link.m4 +++ b/gnulib/m4/lib-link.m4 @@ -1,4 +1,4 @@ -# lib-link.m4 serial 18 (gettext-0.18) +# lib-link.m4 serial 19 (gettext-0.18) dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -43,12 +43,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS], popdef([Name]) ]) -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl the ability to compile and link the specified testcode. The missing-message +dnl defaults to 'no' and may contain additional hints for the user. +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname @@ -74,12 +75,14 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + AC_TRY_LINK([$3], [$4], + [ac_cv_lib[]Name=yes], + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib[]$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else diff --git a/gnulib/m4/lib-prefix.m4 b/gnulib/m4/lib-prefix.m4 index 3bdc0fc5..4b7ee335 100644 --- a/gnulib/m4/lib-prefix.m4 +++ b/gnulib/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 6 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc. +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -206,6 +206,9 @@ sixtyfour bits if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; diff --git a/gnulib/m4/mbrtowc.m4 b/gnulib/m4/mbrtowc.m4 index b6276b27..11d7d23e 100644 --- a/gnulib/m4/mbrtowc.m4 +++ b/gnulib/m4/mbrtowc.m4 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 14 +# mbrtowc.m4 serial 15 dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -127,7 +127,7 @@ int main () }], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], - []) + [:]) fi ]) ]) @@ -178,7 +178,7 @@ int main () }], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], - []) + [:]) fi ]) ]) @@ -225,7 +225,7 @@ int main () return 1; } return 0; -}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], []) +}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:]) fi ]) ]) @@ -295,7 +295,7 @@ int main () }], [gl_cv_func_mbrtowc_retval=yes], [gl_cv_func_mbrtowc_retval=no], - []) + [:]) fi ]) ]) @@ -342,7 +342,7 @@ int main () }], [gl_cv_func_mbrtowc_nul_retval=yes], [gl_cv_func_mbrtowc_nul_retval=no], - []) + [:]) fi ]) ]) diff --git a/gnulib/m4/mbsrtowcs.m4 b/gnulib/m4/mbsrtowcs.m4 new file mode 100644 index 00000000..55b87c17 --- /dev/null +++ b/gnulib/m4/mbsrtowcs.m4 @@ -0,0 +1,121 @@ +# mbsrtowcs.m4 serial 5 +dnl Copyright (C) 2008-2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MBSRTOWCS], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSRTOWCS=1 + fi + AC_CHECK_FUNCS_ONCE([mbsrtowcs]) + if test $ac_cv_func_mbsrtowcs = no; then + HAVE_MBSRTOWCS=0 + fi + if test $HAVE_MBSRTOWCS != 0 && test $REPLACE_MBSRTOWCS != 1; then + gl_MBSRTOWCS_WORKS + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + gl_REPLACE_WCHAR_H + AC_LIBOBJ([mbsrtowcs]) + AC_LIBOBJ([mbsrtowcs-state]) + gl_PREREQ_MBSRTOWCS + fi +]) + +dnl Test whether mbsrtowcs works. +dnl Result is gl_cv_func_mbsrtowcs_works. + +AC_DEFUN([gl_MBSRTOWCS_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_REQUIRE([gt_LOCALE_JA]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbsrtowcs works], + [gl_cv_func_mbsrtowcs_works], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on HP-UX and Solaris. + hpux* | solaris*) gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then + AC_TRY_RUN([ +#include <locale.h> +#include <string.h> +#include <wchar.h> +int main () +{ + /* Test whether the function works when started with a conversion state + in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + const char input[] = "B\303\274\303\237er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + { + const char input[] = "<\306\374\313\334\270\354>"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 4; + if (mbsrtowcs (NULL, &src, 10, &state) != 3) + return 1; + } + } + if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + const char input[] = "B\250\271\201\060\211\070er"; + mbstate_t state; + + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + return 1; + } + } + return 0; +}], + [gl_cv_func_mbsrtowcs_works=yes], + [gl_cv_func_mbsrtowcs_works=no], + [:]) + fi + ]) +]) + +# Prerequisites of lib/mbsrtowcs.c. +AC_DEFUN([gl_PREREQ_MBSRTOWCS], [ + : +]) diff --git a/gnulib/m4/rename.m4 b/gnulib/m4/rename.m4 index fa7ae8d3..53f9ea5b 100644 --- a/gnulib/m4/rename.m4 +++ b/gnulib/m4/rename.m4 @@ -1,4 +1,4 @@ -# serial 11 +# serial 12 # Copyright (C) 2001, 2003, 2005, 2006, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -15,7 +15,8 @@ dnl AC_DEFUN([gl_FUNC_RENAME], [ - AC_CACHE_CHECK([whether rename is broken], + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether rename is broken with a trailing slash], gl_cv_func_rename_trailing_slash_bug, [ rm -rf conftest.d1 conftest.d2 @@ -37,13 +38,29 @@ AC_DEFUN([gl_FUNC_RENAME], rm -rf conftest.d1 conftest.d2 ]) - if test $gl_cv_func_rename_trailing_slash_bug = yes; then + AC_CACHE_CHECK([whether rename is broken when the destination exists], + gl_cv_func_rename_dest_exists_bug, + [ + case "$host_os" in + mingw*) gl_cv_func_rename_dest_exists_bug=yes ;; + *) gl_cv_func_rename_dest_exists_bug=no ;; + esac + ]) + if test $gl_cv_func_rename_trailing_slash_bug = yes || + test $gl_cv_func_rename_dest_exists_bug = yes; then AC_LIBOBJ([rename]) AC_DEFINE([rename], [rpl_rename], [Define to rpl_rename if the replacement function should be used.]) - AC_DEFINE([RENAME_TRAILING_SLASH_BUG], [1], - [Define if rename does not work for source file names with a trailing - slash, like the one from SunOS 4.1.1_U1.]) + if test $gl_cv_func_rename_trailing_slash_bug; then + AC_DEFINE([RENAME_TRAILING_SLASH_BUG], [1], + [Define if rename does not work for source file names with a trailing + slash, like the one from SunOS 4.1.1_U1.]) + fi + if test $gl_cv_func_rename_dest_exists_bug; then + AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1], + [Define if rename does not work when the destination file exists, + as on Windows.]) + fi gl_PREREQ_RENAME fi ]) diff --git a/gnulib/m4/wcrtomb.m4 b/gnulib/m4/wcrtomb.m4 index 22d94336..11a197fd 100644 --- a/gnulib/m4/wcrtomb.m4 +++ b/gnulib/m4/wcrtomb.m4 @@ -1,5 +1,5 @@ -# wcrtomb.m4 serial 2 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# wcrtomb.m4 serial 3 +dnl Copyright (C) 2008-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_WCRTOMB], HAVE_WCRTOMB=0 else - dnl On OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes + dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes dnl returns 0 instead of 1. AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_FR]) @@ -29,10 +29,10 @@ AC_DEFUN([gl_FUNC_WCRTOMB], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on OSF/1 and Solaris. - osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + # Guess no on AIX 4, OSF/1 and Solaris. + aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wcrtomb_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then @@ -67,7 +67,7 @@ int main () }], [gl_cv_func_wcrtomb_retval=yes], [gl_cv_func_wcrtomb_retval=no], - []) + [:]) fi ]) case "$gl_cv_func_wcrtomb_retval" in diff --git a/lib/Makefile.in b/lib/Makefile.in index 73fa976b..cad16194 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/libdb/Makefile.in b/libdb/Makefile.in index 0fff5dc9..b580f0e2 100644 --- a/libdb/Makefile.in +++ b/libdb/Makefile.in @@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/Makefile.in b/man/Makefile.in index d504f1f5..4f1d91a1 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/de/Makefile.in b/man/de/Makefile.in index 93518c45..9a8ca66c 100644 --- a/man/de/Makefile.in +++ b/man/de/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/es/Makefile.in b/man/es/Makefile.in index 1f74ccfd..7bac4081 100644 --- a/man/es/Makefile.in +++ b/man/es/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/fr/Makefile.in b/man/fr/Makefile.in index 4704c46c..75016124 100644 --- a/man/fr/Makefile.in +++ b/man/fr/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/id/Makefile.in b/man/id/Makefile.in index 22bf5627..c7756ea7 100644 --- a/man/id/Makefile.in +++ b/man/id/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/it/Makefile.in b/man/it/Makefile.in index e1af3cf6..8a831cab 100644 --- a/man/it/Makefile.in +++ b/man/it/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/ja/Makefile.in b/man/ja/Makefile.in index 9c009c1c..37a8ba4e 100644 --- a/man/ja/Makefile.in +++ b/man/ja/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/pl/Makefile.in b/man/pl/Makefile.in index c410398b..312b881b 100644 --- a/man/pl/Makefile.in +++ b/man/pl/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/po4a/Makefile.in b/man/po4a/Makefile.in index 967f1ff9..5952332e 100644 --- a/man/po4a/Makefile.in +++ b/man/po4a/Makefile.in @@ -113,6 +113,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/man/ru/Makefile.in b/man/ru/Makefile.in index 6c3cc769..0c23a4fe 100644 --- a/man/ru/Makefile.in +++ b/man/ru/Makefile.in @@ -114,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/manual/Makefile.in b/manual/Makefile.in index 08f0ef96..4783b661 100644 --- a/manual/Makefile.in +++ b/manual/Makefile.in @@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/src/Makefile.in b/src/Makefile.in index e824089c..d33aaecb 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/tools/Makefile.in b/tools/Makefile.in index 3b6621ee..11758183 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \ $(top_srcdir)/gnulib/m4/malloca.m4 \ $(top_srcdir)/gnulib/m4/mbrtowc.m4 \ $(top_srcdir)/gnulib/m4/mbsinit.m4 \ + $(top_srcdir)/gnulib/m4/mbsrtowcs.m4 \ $(top_srcdir)/gnulib/m4/mbstate_t.m4 \ $(top_srcdir)/gnulib/m4/memcmp.m4 \ $(top_srcdir)/gnulib/m4/mempcpy.m4 \ diff --git a/tools/config.guess b/tools/config.guess index f32079ab..da833146 100755 --- a/tools/config.guess +++ b/tools/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-23' +timestamp='2009-04-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -331,7 +334,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -796,7 +812,7 @@ EOF x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -935,6 +951,9 @@ EOF if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -985,9 +1004,6 @@ EOF a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. @@ -1102,8 +1118,11 @@ EOF pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1141,6 +1160,16 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1216,6 +1245,9 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1324,6 +1356,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/tools/config.sub b/tools/config.sub index 6759825a..a39437d0 100755 --- a/tools/config.sub +++ b/tools/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-16' +timestamp='2009-04-17' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -249,13 +250,16 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -268,6 +272,7 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -277,7 +282,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -286,7 +291,7 @@ case $basic_machine in | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -329,14 +334,17 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -358,20 +366,20 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -439,6 +447,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,6 +471,10 @@ case $basic_machine in basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -526,6 +542,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -1128,6 +1148,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1166,7 +1190,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1238,8 +1262,9 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,7 +1273,7 @@ case $os in | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1388,6 +1413,9 @@ case $os in -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) |