texlive[68180] Build/source/texk/lcdf-typetools: [lcdf-typetools]

commits+ascherer at tug.org commits+ascherer at tug.org
Tue Sep 5 22:05:12 CEST 2023


Revision: 68180
          http://tug.org/svn/texlive?view=revision&revision=68180
Author:   ascherer
Date:     2023-09-05 22:05:12 +0200 (Tue, 05 Sep 2023)
Log Message:
-----------
[lcdf-typetools] Accommodate 'nullptr' for older compilers.

Code from
https://github.com/kohler/lcdf-typetools/commit/6ddfef2450171f26aae5d0969930a871c88545b0
plus 'autoupdate'.

Modified Paths:
--------------
    trunk/Build/source/texk/lcdf-typetools/configure
    trunk/Build/source/texk/lcdf-typetools/configure.ac

Modified: trunk/Build/source/texk/lcdf-typetools/configure
===================================================================
--- trunk/Build/source/texk/lcdf-typetools/configure	2023-09-05 20:05:11 UTC (rev 68179)
+++ trunk/Build/source/texk/lcdf-typetools/configure	2023-09-05 20:05:12 UTC (rev 68180)
@@ -19729,7 +19729,63 @@
 
 
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nullptr" >&5
+printf %s "checking for nullptr... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main (void)
+{
+
+  int* x = nullptr;
+  return !!x;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supported" >&5
+printf "%s\n" "supported" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
+printf "%s\n" "not supported" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nullptr with -std=gnu++11" >&5
+printf %s "checking for nullptr with -std=gnu++11... " >&6; }
+  OLD_CXX="$CXX"
+  CXX="$CXX -std=gnu++11"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+    int* x = nullptr;
+    return !!x;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: supported" >&5
+printf "%s\n" "supported" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
+printf "%s\n" "not supported" >&6; }
+    as_fn_error $? "The $OLD_CXX compiler does not support the C++11 \`nullptr\` keyword." "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+
+
+
 printf "%s\n" "#define WORDS_BIGENDIAN_SET 1" >>confdefs.h
 
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5

Modified: trunk/Build/source/texk/lcdf-typetools/configure.ac
===================================================================
--- trunk/Build/source/texk/lcdf-typetools/configure.ac	2023-09-05 20:05:11 UTC (rev 68179)
+++ trunk/Build/source/texk/lcdf-typetools/configure.ac	2023-09-05 20:05:12 UTC (rev 68180)
@@ -14,8 +14,8 @@
 dnl *********************************************************************
 dnl
 m4_include([version.ac])[] dnl define lcdf_typetools_version
-AC_INIT([LCDF typetools (TeX Live)], lcdf_typetools_version, [tex-k at tug.org])
-AC_PREREQ([2.65])
+AC_INIT([LCDF typetools (TeX Live)],[lcdf_typetools_version],[tex-k at tug.org])
+AC_PREREQ([2.71])
 AC_CONFIG_SRCDIR([lcdf-typetools-src/NEWS.md])
 AC_CONFIG_AUX_DIR([../../build-aux])
 AC_CONFIG_MACRO_DIRS([../../m4 m4])
@@ -43,7 +43,7 @@
   [AS_HELP_STRING([--disable-adobe-code], [do not include Adobe code])],
   [], [enable_adobe_code=yes])
 if test "$enable_adobe_code" = yes; then
-   AC_DEFINE([HAVE_ADOBE_CODE], [1], [Define to incldue Adobe code in output fonts.])
+   AC_DEFINE([HAVE_ADOBE_CODE], [1], [Define to include Adobe code in output fonts.])
 fi
 
 AC_CXX_TEMPLATE_OBJS
@@ -55,7 +55,7 @@
 dnl directory searching
 dnl
 
-AC_LANG_C
+AC_LANG([C])
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS([fcntl.h unistd.h sys/time.h sys/wait.h])
 
@@ -64,13 +64,13 @@
 dnl <new> and/or <new.h>
 dnl
 
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
 AC_CACHE_CHECK([whether <new> works], ac_cv_good_new_hdr,
-[AC_TRY_LINK([#include <new>], [
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <new>]], [[
   int a;
   int *b = new(&a) int;
   return 0;
-], ac_cv_good_new_hdr=yes, ac_cv_good_new_hdr=no)])
+]])],[ac_cv_good_new_hdr=yes],[ac_cv_good_new_hdr=no])])
 if test "$ac_cv_good_new_hdr" = yes; then
    AC_DEFINE([HAVE_NEW_HDR], [1], [Define if <new> exists and works.])
 fi
@@ -78,6 +78,25 @@
 
 
 dnl
+dnl `nullptr`
+dnl
+
+AC_MSG_CHECKING([for nullptr])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+  int* x = nullptr;
+  return !!x;
+]])],[AC_MSG_RESULT([supported])],[AC_MSG_RESULT([not supported])
+  AC_MSG_CHECKING([for nullptr with -std=gnu++11])
+  OLD_CXX="$CXX"
+  CXX="$CXX -std=gnu++11"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
+    int* x = nullptr;
+    return !!x;
+  ]])],[AC_MSG_RESULT([supported])],[AC_MSG_RESULT([not supported])
+    AC_MSG_ERROR([The $OLD_CXX compiler does not support the C++11 `nullptr` keyword.])])])
+
+
+dnl
 dnl endianness
 dnl
 
@@ -90,12 +109,12 @@
 dnl time headers such as unistd.h
 dnl
 
-AC_LANG_C
+AC_LANG([C])
 need_fixlibc=0
 AC_CHECK_FUNCS([strerror], [], [need_fixlibc=1])
 
 AC_CACHE_CHECK([for broken strtod], [ac_cv_broken_strtod],
-[AC_TRY_RUN([#include <stdio.h>
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
 #include <stdlib.h>
 int main(int c, char **v) {
   char s[] = "12 ";
@@ -102,31 +121,29 @@
   char *endp;
   double d = strtod(s, &endp);
   return (s + 2) == endp;
-}], [ac_cv_broken_strtod=yes], [ac_cv_broken_strtod=no],
-[ac_cv_broken_strtod=no])])
+}]])],[ac_cv_broken_strtod=yes],[ac_cv_broken_strtod=no],[ac_cv_broken_strtod=no])])
 if test "x$ac_cv_broken_strtod" = xyes; then
     need_fixlibc=1
     AC_DEFINE([HAVE_BROKEN_STRTOD], [1], [Define if strtod is broken.])
 fi
 
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
 AC_CHECK_DECLS([strnlen], [], [], [#include <string.h>])
 AC_CHECK_FUNCS([strnlen], [have_strnlen=1], [need_fixlibc=1])
 if test "x$have_strnlen" = x1; then
     AC_CACHE_CHECK([for broken strnlen], [ac_cv_broken_strnlen],
-    [AC_TRY_RUN([#include <string.h>
+    [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <string.h>
 #include <stdio.h>
 int main(int c, char **v) {
   char s[] = "01234567891";
   return strnlen(s, 10) == 10;
-}], [ac_cv_broken_strnlen=yes], [ac_cv_broken_strnlen=no],
-[ac_cv_broken_strnlen=no])])
+}]])],[ac_cv_broken_strnlen=yes],[ac_cv_broken_strnlen=no],[ac_cv_broken_strnlen=no])])
     if test "x$ac_cv_broken_strnlen" = xyes; then
 	need_fixlibc=1
 	AC_DEFINE([HAVE_BROKEN_STRNLEN], [1], [Define if strnlen is broken.])
     fi
 fi
-AC_LANG_C
+AC_LANG([C])
 
 AC_CHECK_FUNCS([ctime ftruncate mkstemp sigaction strdup strtoul vsnprintf waitpid])
 AC_CHECK_FUNC([floor], [], [AC_CHECK_LIB([m], [floor])])
@@ -186,7 +203,7 @@
 dnl ntohs, ntohl (need them in C++ code)
 dnl
 
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
 AC_CHECK_HEADERS(byteorder.h netinet/in.h sys/param.h)
 AC_MSG_CHECKING([whether ntohs and ntohl are defined])
 ac_ntoh_defined=no
@@ -238,7 +255,7 @@
     AC_MSG_ERROR([exiting])
   fi
 fi
-AC_LANG_C
+AC_LANG([C])
 AC_SEARCH_LIBS([ntohs], [-lnet -lwinsock32])
 
 KPSE_CHECK_WIN32
@@ -250,10 +267,10 @@
 dnl is va_list addressable?
 dnl
 
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
 AC_CACHE_CHECK([for addressable va_list type],
     ac_cv_va_list_addr,
-    [AC_TRY_COMPILE([#include <stdarg.h>
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
 void f(va_list *) {
 }
 void g(va_list val) {
@@ -264,7 +281,7 @@
     va_start(val, a);
     g(val);
     va_end(val);
-}], [h(2, 3, 4);], ac_cv_va_list_addr=yes, ac_cv_va_list_addr=no)])
+}]], [[h(2, 3, 4);]])],[ac_cv_va_list_addr=yes],[ac_cv_va_list_addr=no])])
 if test "x$ac_cv_va_list_addr" = xyes; then
     AC_DEFINE(HAVE_ADDRESSABLE_VA_LIST, 1, [Define if the va_list type is addressable.])
 fi
@@ -277,13 +294,11 @@
 m4_include([ac/lcdf-typetools.ac])
 
 SELECTED_SUBDIRS=
-AC_FOREACH([Kpse_Prog], kpse_lcdf_typetools_progs,
-           [test "x$enable_[]Kpse_Prog" = xno || SELECTED_SUBDIRS="$SELECTED_SUBDIRS Kpse_Prog"
+m4_foreach_w([Kpse_Prog],[kpse_lcdf_typetools_progs],[test "x$enable_[]Kpse_Prog" = xno || SELECTED_SUBDIRS="$SELECTED_SUBDIRS Kpse_Prog"
 ])
 AC_SUBST(SELECTED_SUBDIRS)
 
-AC_FOREACH([Kpse_Opt], kpse_otftotfm_auto_opts,
-           [AS_IF([test "x$enable_auto_]Kpse_Opt[" != xno],
+m4_foreach_w([Kpse_Opt],[kpse_otftotfm_auto_opts],[AS_IF([test "x$enable_auto_]Kpse_Opt[" != xno],
                   [AC_DEFINE([HAVE_AUTO_]AS_TR_CPP(Kpse_Opt), 1,
                              [Define to run ]Kpse_Opt[ from otftotfm.])])
 ])
@@ -421,7 +436,6 @@
 AC_SUBST([LCDF_TYPETOOLS_TREE], [lcdf-typetools-src])
 
 AC_CONFIG_FILES([Makefile lcdf-typetools-src/Makefile])
-AC_FOREACH([Kpse_Prog], [liblcdf libefont] kpse_lcdf_typetools_progs,
-           [AC_CONFIG_FILES([lcdf-typetools-src/]Kpse_Prog[/Makefile])])
+m4_foreach_w([Kpse_Prog],[liblcdf libefont kpse_lcdf_typetools_progs],[AC_CONFIG_FILES([lcdf-typetools-src/]Kpse_Prog[/Makefile])])
 
 AC_OUTPUT



More information about the tex-live-commits mailing list.