From a10fd8b6f5be9646d171a0f699a0a9a152ae41fd Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 10 Oct 2012 09:55:03 +0000 Subject: chktex: Check for declaration of stpcpy() git-svn-id: svn://tug.org/texlive/trunk@27936 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/chktex/ChangeLog | 4 + .../texk/chktex/chktex-1.7.1-PATCHES/ChangeLog | 6 + .../texk/chktex/chktex-1.7.1-PATCHES/TL-Changes | 1 + .../chktex/chktex-1.7.1-PATCHES/patch-07-kpathsea | 19 +-- .../chktex/chktex-1.7.1-PATCHES/patch-08-stpcpy | 19 ++- .../chktex/chktex-1.7.1-PATCHES/patch-10-semicolon | 23 ++++ Build/source/texk/chktex/chktex-1.7.1/ChkTeX.c | 14 +- Build/source/texk/chktex/chktex-1.7.1/ChkTeX.h | 1 - Build/source/texk/chktex/chktex-1.7.1/FindErrs.c | 3 +- Build/source/texk/chktex/chktex-1.7.1/config.h.in | 142 --------------------- Build/source/texk/chktex/chktex-1.7.1/configure.in | 2 + Build/source/texk/chktex/config.h.in | 4 + Build/source/texk/chktex/configure | 58 +++++++++ Build/source/texk/chktex/configure.ac | 3 + 14 files changed, 138 insertions(+), 161 deletions(-) create mode 100644 Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-10-semicolon delete mode 100644 Build/source/texk/chktex/chktex-1.7.1/config.h.in (limited to 'Build/source/texk') diff --git a/Build/source/texk/chktex/ChangeLog b/Build/source/texk/chktex/ChangeLog index 4d362c16b00..3b4bf429357 100644 --- a/Build/source/texk/chktex/ChangeLog +++ b/Build/source/texk/chktex/ChangeLog @@ -1,3 +1,7 @@ +2012-10-10 Peter Breitenlohner + + * configure.ac: Check for declaration of stpcpy(). + 2012-10-02 Peter Breitenlohner Avoid (most) MinGW compiler warnings from regex code. diff --git a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/ChangeLog b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/ChangeLog index 81d0ce801a0..2e70d8d189b 100644 --- a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/ChangeLog +++ b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/ChangeLog @@ -1,3 +1,9 @@ +2012-10-10 Peter Breitenlohner + + * patch-08-stpcpy: Check for declaration of stpcpy(). + * patch-07-kpathsea: Modify as discussed with upstream. + * patch-10-semicolon (new): Avoid to create isolated semicolon. + 2012-09-27 Peter Breitenlohner Imported chktex-1.7.1 source tree from: diff --git a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/TL-Changes b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/TL-Changes index 0cbbc649fd5..57b92396f19 100644 --- a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/TL-Changes +++ b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/TL-Changes @@ -3,6 +3,7 @@ Changes applied to the chktex-1.7.1 tree as obtained from: http://download.savannah.gnu.org/releases/chktex/chktex-1.7.1.tar.gz Remove: + config.h.in configure install-sh stamp-h.in diff --git a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-07-kpathsea b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-07-kpathsea index f5ae61eb536..bbe955aaf09 100644 --- a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-07-kpathsea +++ b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-07-kpathsea @@ -1,26 +1,29 @@ diff -ur chktex-1.7.1.orig/ChkTeX.c chktex-1.7.1/ChkTeX.c --- chktex-1.7.1.orig/ChkTeX.c 2012-07-26 12:44:22.000000000 +0200 -+++ chktex-1.7.1/ChkTeX.c 2012-09-27 10:08:21.000000000 +0200 -@@ -27,7 +27,9 @@ ++++ chktex-1.7.1/ChkTeX.c 2012-10-10 11:34:16.000000000 +0200 +@@ -27,8 +27,12 @@ */ -+#ifndef KPATHSEA - #include "getopt.h" -+#endif +-#include "getopt.h" #include "ChkTeX.h" ++#ifdef KPATHSEA ++#include ++#else ++#include ++#endif #include "OpSys.h" #include "Utility.h" + #include "FindErrs.h" diff -ur chktex-1.7.1.orig/ChkTeX.h chktex-1.7.1/ChkTeX.h --- chktex-1.7.1.orig/ChkTeX.h 2012-08-04 21:28:49.000000000 +0200 -+++ chktex-1.7.1/ChkTeX.h 2012-09-27 10:08:21.000000000 +0200 -@@ -38,6 +38,11 @@ ++++ chktex-1.7.1/ChkTeX.h 2012-10-10 11:32:49.000000000 +0200 +@@ -38,6 +38,10 @@ # include CONFIG_H_NAME #endif +#ifdef KPATHSEA +#include -+#include +#endif + #include diff --git a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-08-stpcpy b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-08-stpcpy index e2536cd8fcc..bb4904e9411 100644 --- a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-08-stpcpy +++ b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-08-stpcpy @@ -1,17 +1,30 @@ diff -ur chktex-1.7.1.orig/FindErrs.c chktex-1.7.1/FindErrs.c --- chktex-1.7.1.orig/FindErrs.c 2012-08-08 22:27:57.000000000 +0200 -+++ chktex-1.7.1/FindErrs.c 2012-09-27 10:58:01.000000000 +0200 -@@ -33,6 +33,13 @@ ++++ chktex-1.7.1/FindErrs.c 2012-10-10 11:24:26.000000000 +0200 +@@ -33,6 +33,14 @@ #include "Utility.h" #include "Resource.h" -+/* Not everyone has stpcpy() */ ++#if !(defined HAVE_DECL_STPCPY && HAVE_DECL_STPCPY) +static inline char * +stpcpy(char *dest, const char *src) +{ + return strcpy(dest, src) + strlen(src); +} ++#endif + #if HAVE_PCRE || HAVE_POSIX_ERE #if HAVE_PCRE +diff -ur chktex-1.7.1.orig/configure.in chktex-1.7.1/configure.in +--- chktex-1.7.1.orig/configure.in 2012-08-22 16:27:32.000000000 +0200 ++++ chktex-1.7.1/configure.in 2012-10-10 11:24:37.000000000 +0200 +@@ -164,6 +164,8 @@ + AC_CHECK_FUNCS(access closedir fileno isatty opendir readdir stat dnl + strcasecmp strdup strlwr strtol) + ++dnl Checks for declarations. ++AC_CHECK_DECLS([stpcpy]) + + dnl Check for PCRE regular expression support + AC_MSG_CHECKING(whether PCRE regular expressions are enabled) diff --git a/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-10-semicolon b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-10-semicolon new file mode 100644 index 00000000000..6fb15c56e0c --- /dev/null +++ b/Build/source/texk/chktex/chktex-1.7.1-PATCHES/patch-10-semicolon @@ -0,0 +1,23 @@ +diff -ur chktex-1.7.1.orig/ChkTeX.c chktex-1.7.1/ChkTeX.c +--- chktex-1.7.1.orig/ChkTeX.c 2012-10-10 11:34:16.000000000 +0200 ++++ chktex-1.7.1/ChkTeX.c 2012-10-10 11:41:42.000000000 +0200 +@@ -196,8 +196,8 @@ + char VerbNormal[] = "%k %n in %f line %l: %m\n" "%r%s%t\n" "%u\n"; + + #define DEF(type, name, value) type name = value; +-OPTION_DEFAULTS; +-STATE_VARS; ++OPTION_DEFAULTS ++STATE_VARS + #undef DEF + FILE *OutputFile = NULL; + +@@ -688,7 +688,7 @@ + { + + #define DEF(type, name, value) name = value; +- OPTION_DEFAULTS; ++ OPTION_DEFAULTS + #undef DEF + if (OutputFile != stdout) + { diff --git a/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.c b/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.c index 1bddf930e46..495a518f37f 100644 --- a/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.c +++ b/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.c @@ -27,10 +27,12 @@ */ -#ifndef KPATHSEA -#include "getopt.h" -#endif #include "ChkTeX.h" +#ifdef KPATHSEA +#include +#else +#include +#endif #include "OpSys.h" #include "Utility.h" #include "FindErrs.h" @@ -194,8 +196,8 @@ enum Quote Quote; char VerbNormal[] = "%k %n in %f line %l: %m\n" "%r%s%t\n" "%u\n"; #define DEF(type, name, value) type name = value; -OPTION_DEFAULTS; -STATE_VARS; +OPTION_DEFAULTS +STATE_VARS #undef DEF FILE *OutputFile = NULL; @@ -686,7 +688,7 @@ static void ResetSettings(void) { #define DEF(type, name, value) name = value; - OPTION_DEFAULTS; + OPTION_DEFAULTS #undef DEF if (OutputFile != stdout) { diff --git a/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.h b/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.h index eaca3227436..f2b2e13c386 100644 --- a/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.h +++ b/Build/source/texk/chktex/chktex-1.7.1/ChkTeX.h @@ -40,7 +40,6 @@ #ifdef KPATHSEA #include -#include #endif #include diff --git a/Build/source/texk/chktex/chktex-1.7.1/FindErrs.c b/Build/source/texk/chktex/chktex-1.7.1/FindErrs.c index 4cfc7fa509b..6ec6e6828f8 100644 --- a/Build/source/texk/chktex/chktex-1.7.1/FindErrs.c +++ b/Build/source/texk/chktex/chktex-1.7.1/FindErrs.c @@ -33,12 +33,13 @@ #include "Utility.h" #include "Resource.h" -/* Not everyone has stpcpy() */ +#if !(defined HAVE_DECL_STPCPY && HAVE_DECL_STPCPY) static inline char * stpcpy(char *dest, const char *src) { return strcpy(dest, src) + strlen(src); } +#endif #if HAVE_PCRE || HAVE_POSIX_ERE diff --git a/Build/source/texk/chktex/chktex-1.7.1/config.h.in b/Build/source/texk/chktex/chktex-1.7.1/config.h.in deleted file mode 100644 index 4c5c597974d..00000000000 --- a/Build/source/texk/chktex/chktex-1.7.1/config.h.in +++ /dev/null @@ -1,142 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define to 1 if you have the `access' function. */ -#undef HAVE_ACCESS - -/* Define to 1 if you have the `closedir' function. */ -#undef HAVE_CLOSEDIR - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `fileno' function. */ -#undef HAVE_FILENO - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `isatty' function. */ -#undef HAVE_ISATTY - -/* Define to 1 if you have the `termcap' library (-ltermcap). */ -#undef HAVE_LIBTERMCAP - -/* Define to 1 if you have the `termlib' library (-ltermlib). */ -#undef HAVE_LIBTERMLIB - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `opendir' function. */ -#undef HAVE_OPENDIR - -/* "Whether PCRE can be used for user warnings." */ -#undef HAVE_PCRE - -/* "Whether PCRE can be used for user warnings." */ -#undef HAVE_POSIX_ERE - -/* Define to 1 if you have the `readdir' function. */ -#undef HAVE_READDIR - -/* Define to 1 if you have the `stat' function. */ -#undef HAVE_STAT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strlwr' function. */ -#undef HAVE_STRLWR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMCAP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* "Strip debug info" */ -#undef STRIP_DEBUG - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/Build/source/texk/chktex/chktex-1.7.1/configure.in b/Build/source/texk/chktex/chktex-1.7.1/configure.in index cebe7921f6b..eacc296d951 100644 --- a/Build/source/texk/chktex/chktex-1.7.1/configure.in +++ b/Build/source/texk/chktex/chktex-1.7.1/configure.in @@ -164,6 +164,8 @@ AC_FUNC_VPRINTF AC_CHECK_FUNCS(access closedir fileno isatty opendir readdir stat dnl strcasecmp strdup strlwr strtol) +dnl Checks for declarations. +AC_CHECK_DECLS([stpcpy]) dnl Check for PCRE regular expression support AC_MSG_CHECKING(whether PCRE regular expressions are enabled) diff --git a/Build/source/texk/chktex/config.h.in b/Build/source/texk/chktex/config.h.in index aa228abcdee..23c5e0c5e7a 100644 --- a/Build/source/texk/chktex/config.h.in +++ b/Build/source/texk/chktex/config.h.in @@ -21,6 +21,10 @@ /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. + */ +#undef HAVE_DECL_STPCPY + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H diff --git a/Build/source/texk/chktex/configure b/Build/source/texk/chktex/configure index 80954515836..cb06c418846 100755 --- a/Build/source/texk/chktex/configure +++ b/Build/source/texk/chktex/configure @@ -2120,6 +2120,52 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -12816,6 +12862,18 @@ fi done +ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default" +if test "x$ac_cv_have_decl_stpcpy" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STPCPY $ac_have_decl +_ACEOF + + ac_config_headers="$ac_config_headers config.h" diff --git a/Build/source/texk/chktex/configure.ac b/Build/source/texk/chktex/configure.ac index a0063c59f64..1713e7a5e78 100644 --- a/Build/source/texk/chktex/configure.ac +++ b/Build/source/texk/chktex/configure.ac @@ -31,6 +31,9 @@ dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([access closedir fileno isatty opendir readdir stat strcasecmp strdup strlwr strtol]) +dnl Checks for declarations. +AC_CHECK_DECLS([stpcpy]) + AC_CONFIG_HEADERS([config.h]) dnl For TeX Live we always use Posix extended regular expressions -- cgit v1.2.3