]> git.draconx.ca Git - dxcommon.git/blobdiff - m4/gl-patches.m4
gl-patches: Don't force HAVE_LONG_LONG_INT.
[dxcommon.git] / m4 / gl-patches.m4
index 5e4d3e15d7283d6d8a7ecf0997c4f2b3a41f6cb0..b30f62c9be426572142acd896bb884863eceb9f8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2023 Nick Bowler
+# Copyright © 2023-2024 Nick Bowler
 #
 # Monkey patches for gnulib macros.
 #
@@ -6,13 +6,6 @@
 # This is free software: you are free to do what the fuck you want to.
 # There is NO WARRANTY, to the extent permitted by law.
 
-# DX_PATCH_MACRO([macro-name], [regexp], [replacement])
-#
-# Patches the definition of macro-name by replacing substrings that match
-# the given regexp (a la m4_bpatsubst).
-AC_DEFUN([DX_PATCH_MACRO], [m4_ifdef([$1],
-  [m4_define([$1], m4_bpatsubst(m4_dquote(m4_defn([$1])), [$2], [$3]))])])
-
 # DX_PATCH_GNULIB
 #
 # Apply all the patches described below.  Should be expanded before AC_INIT.
@@ -46,3 +39,19 @@ _DX_GL_PATCH([gl-threadlib-mingw-default],
   [DX_PATCH_MACRO([gl_THREADLIB_EARLY_BODY],
     [\[gl_use_winpthreads_default=\]],
     [[gl_use_winpthreads_default=no]])])
+
+# Remove silly warning flag probes that are included unconditionally in newer
+# gnulib and bloat downstream configure scripts for no real reason.
+_DX_GL_PATCH([gl-no-warnings],
+  [m4_ifdef([gl_CC_GNULIB_WARNINGS], [AC_DEFUN([gl_CC_GNULIB_WARNINGS])])])
+
+# Avoid gnulib stdint.m4 from forcing HAVE_(UNSIGNED_)LONG_LONG_INT as this
+# breaks anything which actually tries to use AC_TYPE_LONG_LONG_INT to work
+# with missing long long, and is otherwise pointless.
+#
+# Gnulib itself doesn't care about these definitions and unconditionally uses
+# long long.  So by itself, this won't fix any failures in Gnulib due to an
+# actually missing 'long long' but also should not create new problems.
+_DX_GL_PATCH([stdint-no-fake-longlong],
+  [DX_PATCH_MACRO([gl_STDINT_H],
+    [AC_DEFINE(\[HAVE[_UNSIGNED]*_LONG_LONG_INT\][^)]*.], [dnl])])