texlive[45170] Build/source/utils/t1utils: t1utils: Try not to use

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Aug 30 07:35:00 CEST 2017


Revision: 45170
          http://tug.org/svn/texlive?view=revision&revision=45170
Author:   kakuto
Date:     2017-08-30 07:35:00 +0200 (Wed, 30 Aug 2017)
Log Message:
-----------
t1utils: Try not to use system memmem

Modified Paths:
--------------
    trunk/Build/source/utils/t1utils/ChangeLog
    trunk/Build/source/utils/t1utils/Makefile.am
    trunk/Build/source/utils/t1utils/Makefile.in
    trunk/Build/source/utils/t1utils/TLpatches/ChangeLog
    trunk/Build/source/utils/t1utils/TLpatches/TL-Changes
    trunk/Build/source/utils/t1utils/TLpatches/patch-03-warnings
    trunk/Build/source/utils/t1utils/TLpatches/patch-04-TL-binary
    trunk/Build/source/utils/t1utils/TLpatches/patch-07-warnings
    trunk/Build/source/utils/t1utils/config.h.in
    trunk/Build/source/utils/t1utils/configure
    trunk/Build/source/utils/t1utils/configure.ac
    trunk/Build/source/utils/t1utils/t1utils-src/t1asmhelp.h

Added Paths:
-----------
    trunk/Build/source/utils/t1utils/TLpatches/patch-08-notuse-system-memmem
    trunk/Build/source/utils/t1utils/t1utils-src/memmem.c

Removed Paths:
-------------
    trunk/Build/source/utils/t1utils/memmem.c

Modified: trunk/Build/source/utils/t1utils/ChangeLog
===================================================================
--- trunk/Build/source/utils/t1utils/ChangeLog	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/ChangeLog	2017-08-30 05:35:00 UTC (rev 45170)
@@ -1,3 +1,7 @@
+2017-08-30  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* Makefile.am, configure.ac: Do not use system memmem.
+
 2017-08-28  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import t1utils-1.41.

Modified: trunk/Build/source/utils/t1utils/Makefile.am
===================================================================
--- trunk/Build/source/utils/t1utils/Makefile.am	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/Makefile.am	2017-08-30 05:35:00 UTC (rev 45170)
@@ -50,11 +50,13 @@
 t1asm_SOURCES = \
 	@T1UTILS_TREE@/clp.c \
 	@T1UTILS_TREE@/t1lib.c \
+	@T1UTILS_TREE@/memmem.c \
 	@T1UTILS_TREE@/t1asm.c
 
 t1disasm_SOURCES = \
 	@T1UTILS_TREE@/clp.c \
 	@T1UTILS_TREE@/t1lib.c \
+	@T1UTILS_TREE@/memmem.c \
 	@T1UTILS_TREE@/t1disasm.c
 
 t1unmac_SOURCES = \

Modified: trunk/Build/source/utils/t1utils/Makefile.in
===================================================================
--- trunk/Build/source/utils/t1utils/Makefile.in	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/Makefile.in	2017-08-30 05:35:00 UTC (rev 45170)
@@ -113,7 +113,8 @@
 t1ascii_LDADD = $(LDADD)
 t1ascii_DEPENDENCIES = @LIBOBJS@
 am_t1asm_OBJECTS = @T1UTILS_TREE@/clp.$(OBJEXT) \
-	@T1UTILS_TREE@/t1lib.$(OBJEXT) @T1UTILS_TREE@/t1asm.$(OBJEXT)
+	@T1UTILS_TREE@/t1lib.$(OBJEXT) @T1UTILS_TREE@/memmem.$(OBJEXT) \
+	@T1UTILS_TREE@/t1asm.$(OBJEXT)
 t1asm_OBJECTS = $(am_t1asm_OBJECTS)
 t1asm_LDADD = $(LDADD)
 t1asm_DEPENDENCIES = @LIBOBJS@
@@ -124,7 +125,7 @@
 t1binary_LDADD = $(LDADD)
 t1binary_DEPENDENCIES = @LIBOBJS@
 am_t1disasm_OBJECTS = @T1UTILS_TREE@/clp.$(OBJEXT) \
-	@T1UTILS_TREE@/t1lib.$(OBJEXT) \
+	@T1UTILS_TREE@/t1lib.$(OBJEXT) @T1UTILS_TREE@/memmem.$(OBJEXT) \
 	@T1UTILS_TREE@/t1disasm.$(OBJEXT)
 t1disasm_OBJECTS = $(am_t1disasm_OBJECTS)
 t1disasm_LDADD = $(LDADD)
@@ -415,7 +416,7 @@
 	../../build-aux/depcomp ../../build-aux/install-sh \
 	../../build-aux/ltmain.sh ../../build-aux/missing \
 	../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog \
-	memmem.c strerror.c
+	strerror.c
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -560,11 +561,13 @@
 t1asm_SOURCES = \
 	@T1UTILS_TREE@/clp.c \
 	@T1UTILS_TREE@/t1lib.c \
+	@T1UTILS_TREE@/memmem.c \
 	@T1UTILS_TREE@/t1asm.c
 
 t1disasm_SOURCES = \
 	@T1UTILS_TREE@/clp.c \
 	@T1UTILS_TREE@/t1lib.c \
+	@T1UTILS_TREE@/memmem.c \
 	@T1UTILS_TREE@/t1disasm.c
 
 t1unmac_SOURCES = \
@@ -692,6 +695,8 @@
 t1ascii$(EXEEXT): $(t1ascii_OBJECTS) $(t1ascii_DEPENDENCIES) $(EXTRA_t1ascii_DEPENDENCIES) 
 	@rm -f t1ascii$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(t1ascii_OBJECTS) $(t1ascii_LDADD) $(LIBS)
+ at T1UTILS_TREE@/memmem.$(OBJEXT): @T1UTILS_TREE@/$(am__dirstamp) \
+	@T1UTILS_TREE@/$(DEPDIR)/$(am__dirstamp)
 @T1UTILS_TREE@/t1asm.$(OBJEXT): @T1UTILS_TREE@/$(am__dirstamp) \
 	@T1UTILS_TREE@/$(DEPDIR)/$(am__dirstamp)
 
@@ -730,9 +735,9 @@
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memmem.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@T1UTILS_TREE@/$(DEPDIR)/clp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote@@T1UTILS_TREE@/$(DEPDIR)/memmem.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@T1UTILS_TREE@/$(DEPDIR)/t1ascii.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@T1UTILS_TREE@/$(DEPDIR)/t1asm.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@T1UTILS_TREE@/$(DEPDIR)/t1binary.Po at am__quote@

Modified: trunk/Build/source/utils/t1utils/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/ChangeLog	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/TLpatches/ChangeLog	2017-08-30 05:35:00 UTC (rev 45170)
@@ -1,3 +1,7 @@
+2017-08-30  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* patch-08-notuse-system-memmem: Added.
+
 2017-08-28  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import t1utils-1.41.

Modified: trunk/Build/source/utils/t1utils/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/TL-Changes	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/TLpatches/TL-Changes	2017-08-30 05:35:00 UTC (rev 45170)
@@ -14,4 +14,3 @@
 
 Moved this file to ../:
 	strerror.c
-	memmem.c

Modified: trunk/Build/source/utils/t1utils/TLpatches/patch-03-warnings
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/patch-03-warnings	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/TLpatches/patch-03-warnings	2017-08-30 05:35:00 UTC (rev 45170)
@@ -2,7 +2,7 @@
 
 diff -ur t1utils-1.41.orig/clp.c t1utils-1.41/clp.c
 --- t1utils-1.41.orig/clp.c	Thu Aug 17 00:20:27 2017
-+++ t1utils-1.41/clp.c	Mon Aug 28 14:14:04 2017
++++ t1utils-1.41/clp.c	Mon Aug 28 15:43:58 2017
 @@ -1095,22 +1095,28 @@
  parse_int(Clp_Parser* clp, const char* arg, int complain, void* user_data)
  {

Modified: trunk/Build/source/utils/t1utils/TLpatches/patch-04-TL-binary
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/patch-04-TL-binary	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/TLpatches/patch-04-TL-binary	2017-08-30 05:35:00 UTC (rev 45170)
@@ -2,7 +2,7 @@
 
 diff -ur t1utils-1.41.orig/t1ascii.c t1utils-1.41/t1ascii.c
 --- t1utils-1.41.orig/t1ascii.c	Thu Aug 17 01:31:02 2017
-+++ t1utils-1.41/t1ascii.c	Mon Aug 28 14:22:17 2017
++++ t1utils-1.41/t1ascii.c	Mon Aug 28 15:43:58 2017
 @@ -286,6 +286,7 @@
    /* As we are processing a PFB (binary) input */
    /* file, we must set its file mode to binary. */
@@ -13,7 +13,7 @@
    /* prepare font reader */
 diff -ur t1utils-1.41.orig/t1disasm.c t1utils-1.41/t1disasm.c
 --- t1utils-1.41.orig/t1disasm.c	Thu Aug 17 01:31:24 2017
-+++ t1utils-1.41/t1disasm.c	Mon Aug 28 14:23:22 2017
++++ t1utils-1.41/t1disasm.c	Mon Aug 28 15:43:58 2017
 @@ -727,6 +727,7 @@
    /* As we might be processing a PFB (binary) input file, we must set its file
       mode to binary. */
@@ -24,7 +24,7 @@
    /* prepare font reader */
 diff -ur t1utils-1.41.orig/t1unmac.c t1utils-1.41/t1unmac.c
 --- t1utils-1.41.orig/t1unmac.c	Thu Aug 17 01:31:39 2017
-+++ t1utils-1.41/t1unmac.c	Mon Aug 28 14:26:09 2017
++++ t1utils-1.41/t1unmac.c	Mon Aug 28 15:43:58 2017
 @@ -656,8 +655,7 @@
    _setmode(_fileno(ifp), _O_BINARY);
    /* If we are processing a PFB (binary) output */

Modified: trunk/Build/source/utils/t1utils/TLpatches/patch-07-warnings
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/patch-07-warnings	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/TLpatches/patch-07-warnings	2017-08-30 05:35:00 UTC (rev 45170)
@@ -2,8 +2,8 @@
 
 diff -ur t1utils-1.41.orig/t1asmhelp.h t1utils-1.41/t1asmhelp.h
 --- t1utils-1.41.orig/t1asmhelp.h	Thu Aug 17 00:20:27 2017
-+++ t1utils-1.41/t1asmhelp.h	Mon Aug 28 14:30:14 2017
-@@ -26,7 +26,8 @@
++++ t1utils-1.41/t1asmhelp.h	Wed Aug 30 13:42:34 2017
+@@ -26,7 +28,8 @@
  }
  
  
@@ -13,7 +13,14 @@
  
  static void
  set_cs_start(const char* line, size_t line_len)
-@@ -43,7 +44,7 @@
+@@ -37,13 +40,13 @@
+     if ((p = memmem(line, line_len, "string currentfile", 18))
+         && memmem(line, line_len, "readstring", 10)) {
+         /* locate the name of the charstring start command */
+-        for (q = p; q != line && q[-1] != '/'; --q)
++        for (q = p; q != line && *(q-1) != '/'; --q)
+             /* nada */;
+         if (q != line) {
              for (r = q; r != p && !isspace((unsigned char) *r) && *r != '{'; ++r)
                  /* nada */;
              if (cs_start_set)

Added: trunk/Build/source/utils/t1utils/TLpatches/patch-08-notuse-system-memmem
===================================================================
--- trunk/Build/source/utils/t1utils/TLpatches/patch-08-notuse-system-memmem	                        (rev 0)
+++ trunk/Build/source/utils/t1utils/TLpatches/patch-08-notuse-system-memmem	2017-08-30 05:35:00 UTC (rev 45170)
@@ -0,0 +1,25 @@
+diff -ur t1utils-1.41.orig/memmem.c t1utils-1.41/memmem.c
+--- t1utils-1.41.orig/memmem.c	Thu Aug 17 00:20:27 2017
++++ t1utils-1.41/memmem.c	Wed Aug 30 13:40:56 2017
+@@ -9,6 +9,8 @@
+ extern "C" {
+ #endif
+ 
++#define memmem my_memmem
++
+ void*
+ memmem(const void* haystack, size_t haystack_len,
+        const void* needle, size_t needle_len)
+diff -ur t1utils-1.41.orig/t1asmhelp.h t1utils-1.41/t1asmhelp.h
+--- t1utils-1.41.orig/t1asmhelp.h	Thu Aug 17 00:20:27 2017
++++ t1utils-1.41/t1asmhelp.h	Wed Aug 30 13:42:34 2017
+@@ -7,6 +7,8 @@
+    lenIV to <num>.  This indicates the number of random bytes at the beginning
+    of each charstring. */
+ 
++#define memmem my_memmem
++
+ static void
+ set_lenIV(const char* line, size_t line_len)
+ {
+

Modified: trunk/Build/source/utils/t1utils/config.h.in
===================================================================
--- trunk/Build/source/utils/t1utils/config.h.in	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/config.h.in	2017-08-30 05:35:00 UTC (rev 45170)
@@ -9,9 +9,6 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the `memmem' function. */
-#undef HAVE_MEMMEM
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -98,11 +95,9 @@
 char *strerror(int errno);
 #endif
 
-/* Prototype memmem if we don't have it. */
-#if !HAVE_MEMMEM
-void *memmem(const void* haystack, size_t haystack_len,
+/* Prototype my_memmem */
+void *my_memmem(const void* haystack, size_t haystack_len,
              const void* needle, size_t needle_len);
-#endif
 
 #ifdef __cplusplus
 }

Modified: trunk/Build/source/utils/t1utils/configure
===================================================================
--- trunk/Build/source/utils/t1utils/configure	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/configure	2017-08-30 05:35:00 UTC (rev 45170)
@@ -4989,21 +4989,8 @@
 
 fi
 
-ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem"
-if test "x$ac_cv_func_memmem" = xyes; then :
-  $as_echo "#define HAVE_MEMMEM 1" >>confdefs.h
 
-else
-  case " $LIBOBJS " in
-  *" memmem.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS memmem.$ac_objext"
- ;;
-esac
 
-fi
-
-
-
 for ac_func in strtoul
 do :
   ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul"

Modified: trunk/Build/source/utils/t1utils/configure.ac
===================================================================
--- trunk/Build/source/utils/t1utils/configure.ac	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/configure.ac	2017-08-30 05:35:00 UTC (rev 45170)
@@ -28,7 +28,7 @@
 dnl strerror()?
 dnl
 
-AC_REPLACE_FUNCS([strerror memmem])
+AC_REPLACE_FUNCS([strerror])
 
 AC_CHECK_FUNCS([strtoul])
 
@@ -105,11 +105,9 @@
 char *strerror(int errno);
 #endif
 
-/* Prototype memmem if we don't have it. */
-#if !HAVE_MEMMEM
-void *memmem(const void* haystack, size_t haystack_len,
+/* Prototype my_memmem */
+void *my_memmem(const void* haystack, size_t haystack_len,
              const void* needle, size_t needle_len);
-#endif
 
 #ifdef __cplusplus
 }

Deleted: trunk/Build/source/utils/t1utils/memmem.c
===================================================================
--- trunk/Build/source/utils/t1utils/memmem.c	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/memmem.c	2017-08-30 05:35:00 UTC (rev 45170)
@@ -1,32 +0,0 @@
-/* Some operating systems might not have memmem. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#include <stddef.h>
-#include <string.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void*
-memmem(const void* haystack, size_t haystack_len,
-       const void* needle, size_t needle_len)
-{
-    const unsigned char* s = (const unsigned char*) haystack;
-    const unsigned char* ends = s + haystack_len - needle_len;
-    const unsigned char* p = (const unsigned char*) needle;
-    void* try;
-    if (needle_len == 0)
-        return (void*) haystack;
-    while (s <= ends && (try = memchr(s, *p, ends - s + 1)))
-        if (memcmp(try, p, needle_len) == 0)
-            return (void*) try;
-        else
-            s = (const unsigned char*) try + 1;
-    return 0;
-}
-
-#ifdef __cplusplus
-}
-#endif

Added: trunk/Build/source/utils/t1utils/t1utils-src/memmem.c
===================================================================
--- trunk/Build/source/utils/t1utils/t1utils-src/memmem.c	                        (rev 0)
+++ trunk/Build/source/utils/t1utils/t1utils-src/memmem.c	2017-08-30 05:35:00 UTC (rev 45170)
@@ -0,0 +1,34 @@
+/* Some operating systems might not have memmem. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <stddef.h>
+#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define memmem my_memmem
+
+void*
+memmem(const void* haystack, size_t haystack_len,
+       const void* needle, size_t needle_len)
+{
+    const unsigned char* s = (const unsigned char*) haystack;
+    const unsigned char* ends = s + haystack_len - needle_len;
+    const unsigned char* p = (const unsigned char*) needle;
+    void* try;
+    if (needle_len == 0)
+        return (void*) haystack;
+    while (s <= ends && (try = memchr(s, *p, ends - s + 1)))
+        if (memcmp(try, p, needle_len) == 0)
+            return (void*) try;
+        else
+            s = (const unsigned char*) try + 1;
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif


Property changes on: trunk/Build/source/utils/t1utils/t1utils-src/memmem.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/utils/t1utils/t1utils-src/t1asmhelp.h
===================================================================
--- trunk/Build/source/utils/t1utils/t1utils-src/t1asmhelp.h	2017-08-30 00:21:24 UTC (rev 45169)
+++ trunk/Build/source/utils/t1utils/t1utils-src/t1asmhelp.h	2017-08-30 05:35:00 UTC (rev 45170)
@@ -7,6 +7,8 @@
    lenIV to <num>.  This indicates the number of random bytes at the beginning
    of each charstring. */
 
+#define memmem my_memmem
+
 static void
 set_lenIV(const char* line, size_t line_len)
 {



More information about the tex-live-commits mailing list