From 48ca38baa7cd591a19a4e6b676d633472e77607b Mon Sep 17 00:00:00 2001 From: Francesco Salvestrini Date: Wed, 15 Oct 2008 00:26:11 +0200 Subject: [PATCH] Updated gnulib related files --- tools/autotools/m4/getopt.m4 | 83 ++++++++++++++++++++++++++++++++++++++ tools/autotools/m4/gnulib-cache.m4 | 5 ++- tools/autotools/m4/gnulib-comp.m4 | 12 ++++++ tools/autotools/m4/unistd_h.m4 | 73 +++++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 tools/autotools/m4/getopt.m4 create mode 100644 tools/autotools/m4/unistd_h.m4 diff --git a/tools/autotools/m4/getopt.m4 b/tools/autotools/m4/getopt.m4 new file mode 100644 index 0000000..9b683c2 --- /dev/null +++ b/tools/autotools/m4/getopt.m4 @@ -0,0 +1,83 @@ +# getopt.m4 serial 14 +dnl Copyright (C) 2002-2006, 2008 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. + +# The getopt module assume you want GNU getopt, with getopt_long etc, +# rather than vanilla POSIX getopt. This means your code should +# always include for the getopt prototypes. + +AC_DEFUN([gl_GETOPT_SUBSTITUTE], +[ + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_GETOPT_SUBSTITUTE_HEADER + gl_PREREQ_GETOPT +]) + +AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], +[ + GETOPT_H=getopt.h + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + AC_SUBST([GETOPT_H]) +]) + +AC_DEFUN([gl_GETOPT_CHECK_HEADERS], +[ + if test -z "$GETOPT_H"; then + AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) + fi + + if test -z "$GETOPT_H"; then + AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) + fi + + dnl BSD getopt_long uses an incompatible method to reset option processing, + dnl and (as of 2004-10-15) mishandles optional option-arguments. + if test -z "$GETOPT_H"; then + AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) + fi + + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + if test -z "$GETOPT_H"; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[ + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + ]])], + [gl_cv_func_gnu_getopt=yes], + [gl_cv_func_gnu_getopt=no], + [dnl cross compiling - pessimistically guess based on decls + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + AC_CHECK_DECL([getopt_clip], + [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], + [#include ])])]) + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi +]) + +AC_DEFUN([gl_GETOPT_IFELSE], +[ + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + AS_IF([test -n "$GETOPT_H"], [$1], [$2]) +]) + +AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) + +# Prerequisites of lib/getopt*. +AC_DEFUN([gl_PREREQ_GETOPT], +[ + AC_CHECK_DECLS_ONCE([getenv]) +]) diff --git a/tools/autotools/m4/gnulib-cache.m4 b/tools/autotools/m4/gnulib-cache.m4 index b487803..b2e833a 100644 --- a/tools/autotools/m4/gnulib-cache.m4 +++ b/tools/autotools/m4/gnulib-cache.m4 @@ -15,13 +15,14 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=./src/gnulib --m4-base=./tools/autotools/m4 --doc-base=doc --tests-base=tests --aux-dir=./tools/autotools --lgpl=2 --no-libtool --macro-prefix=GNULIB --no-vc-files crypto/md5 crypto/sha1 +# gnulib-tool --import --dir=. --lib=libgnu --source-base=./src/gnulib --m4-base=./tools/autotools/m4 --doc-base=doc --tests-base=tests --aux-dir=./tools/autotools --lgpl --no-libtool --macro-prefix=GNULIB --no-vc-files crypto/md5 crypto/sha1 getopt # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) gl_MODULES([ crypto/md5 crypto/sha1 + getopt ]) gl_AVOID([]) gl_SOURCE_BASE([./src/gnulib]) @@ -30,7 +31,7 @@ gl_PO_BASE([]) gl_DOC_BASE([doc]) gl_TESTS_BASE([tests]) gl_LIB([libgnu]) -gl_LGPL([2]) +gl_LGPL gl_MAKEFILE_NAME([]) gl_MACRO_PREFIX([GNULIB]) gl_PO_DOMAIN([]) diff --git a/tools/autotools/m4/gnulib-comp.m4 b/tools/autotools/m4/gnulib-comp.m4 index bd4194c..2bc9df0 100644 --- a/tools/autotools/m4/gnulib-comp.m4 +++ b/tools/autotools/m4/gnulib-comp.m4 @@ -44,7 +44,11 @@ AC_DEFUN([GNULIB_INIT], gl_source_base='./src/gnulib' gl_MD5 gl_SHA1 + gl_GETOPT + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) gl_STDINT_H + gl_UNISTD_H gl_WCHAR_H m4_ifval(GNULIB_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([GNULIB_LIBSOURCES_DIR])[ || @@ -180,18 +184,26 @@ AC_DEFUN([GNULIBtests_LIBSOURCES], [ AC_DEFUN([GNULIB_FILE_LIST], [ build-aux/link-warning.h lib/dummy.c + lib/getopt.c + lib/getopt.in.h + lib/getopt1.c + lib/getopt_int.h + lib/gettext.h lib/md5.c lib/md5.h lib/sha1.c lib/sha1.h lib/stdint.in.h + lib/unistd.in.h lib/wchar.in.h + m4/getopt.m4 m4/gnulib-common.m4 m4/include_next.m4 m4/longlong.m4 m4/md5.m4 m4/sha1.m4 m4/stdint.m4 + m4/unistd_h.m4 m4/wchar.m4 m4/wint_t.m4 ]) diff --git a/tools/autotools/m4/unistd_h.m4 b/tools/autotools/m4/unistd_h.m4 new file mode 100644 index 0000000..e9f7a7d --- /dev/null +++ b/tools/autotools/m4/unistd_h.m4 @@ -0,0 +1,73 @@ +# unistd_h.m4 serial 14 +dnl Copyright (C) 2006-2008 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. + +dnl Written by Simon Josefsson, Bruno Haible. + +AC_DEFUN([gl_UNISTD_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([unistd.h]) + + AC_CHECK_HEADERS_ONCE([unistd.h]) + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi + AC_SUBST([HAVE_UNISTD_H]) +]) + +AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_UNISTD_H_DEFAULTS], +[ + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) +]) -- 2.11.4.GIT