From f031276e124f33ca8806a34de0a29dd3f337d089 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Mon, 31 Mar 2025 02:23:36 +0200
Subject: [PATCH 1/5] meson: remove no longer required array joins

These are no longer required since meson 1.0 as it introduced
the ability to pass an array to the prefix kwarg.
---
 meson.build                       | 10 +++-------
 modules/text_renderer/meson.build |  5 ++---
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/meson.build b/meson.build
index 1e0951945df9..1175ca386ea8 100644
--- a/meson.build
+++ b/meson.build
@@ -284,10 +284,8 @@ foreach header : check_c_headers
         continue
     endif
 
-    # TODO: Once we require meson 1.0, drop the array join here
-    # See: https://github.com/mesonbuild/meson/pull/11099
     if cc.check_header(header[0],
-                       prefix: '\n'.join(header_kwargs.get('prefix', [])),
+                       prefix: header_kwargs.get('prefix', []),
                        args: header_kwargs.get('args', []))
         cdata.set('HAVE_' + header[0].underscorify().to_upper(), 1)
     endif
@@ -295,10 +293,8 @@ endforeach
 
 foreach header : check_cpp_headers
     header_kwargs = header.get(1, {})
-    # TODO: Once we require meson 1.0, drop the array join here
-    # See: https://github.com/mesonbuild/meson/pull/11099
     if cpp.check_header(header[0],
-                       prefix: '\n'.join(header_kwargs.get('prefix', [])),
+                       prefix: header_kwargs.get('prefix', []),
                        args: header_kwargs.get('args', []))
         cdata.set('HAVE_' + header[0].underscorify().to_upper(), 1)
     endif
@@ -926,7 +922,7 @@ elif host_system == 'windows'
     pollfd_prefix += '#include <winsock2.h>'
 endif
 
-if cc.has_type('struct pollfd', prefix: '\n'.join([vlc_conf_prefix, pollfd_prefix]))
+if cc.has_type('struct pollfd', prefix: [vlc_conf_prefix, pollfd_prefix])
     cdata.set('HAVE_STRUCT_POLLFD', 1)
 endif
 
diff --git a/modules/text_renderer/meson.build b/modules/text_renderer/meson.build
index 52af3f38b1a1..1a8bcf8ebfdd 100644
--- a/modules/text_renderer/meson.build
+++ b/modules/text_renderer/meson.build
@@ -83,11 +83,11 @@ vlc_modules += {
 
 # Windows SAPI text to speech
 if host_system == 'windows'
-    have_sapi = cpp.has_type('ISpObjectToken', prefix: '\n'.join([
+    have_sapi = cpp.has_type('ISpObjectToken', prefix: [
         '#include <windows.h>',
         '#include <sapi.h>',
         '#include <sphelper.h>'
-    ]))
+    ])
 else
     have_sapi = false
 endif
@@ -98,4 +98,3 @@ vlc_modules += {
     'cpp_args' : libcom_cppflags,
     'enabled' : have_sapi,
 }
-
-- 
GitLab


From a9d53bd2f64d376387210cfc5d749926f2ba1d12 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Mon, 31 Mar 2025 02:29:43 +0200
Subject: [PATCH 2/5] meson: use array for prefix in pollfd check

---
 meson.build | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 1175ca386ea8..1cd264ec5d29 100644
--- a/meson.build
+++ b/meson.build
@@ -913,16 +913,14 @@ if not cc.has_type('ssize_t', prefix: '#include <sys/types.h>')
 endif
 
 # Check for struct pollfd type
-# TODO: Refactor once updating to meson 1.0.0
-# which supports prefix arrays.
-pollfd_prefix = '#include <sys/types.h>\n'
+pollfd_prefix = ['#include <sys/types.h>']
 if cdata.get('HAVE_POLL', 0) == 1
     pollfd_prefix += '#include <poll.h>'
 elif host_system == 'windows'
     pollfd_prefix += '#include <winsock2.h>'
 endif
 
-if cc.has_type('struct pollfd', prefix: [vlc_conf_prefix, pollfd_prefix])
+if cc.has_type('struct pollfd', prefix: [vlc_conf_prefix] + pollfd_prefix)
     cdata.set('HAVE_STRUCT_POLLFD', 1)
 endif
 
-- 
GitLab


From cdb373bd4ff1ba3a07e0326e25e11a866dac88ef Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Mon, 31 Mar 2025 02:33:10 +0200
Subject: [PATCH 3/5] meson: use array for prefix in sockaddr check

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 1cd264ec5d29..b6cc4e0c98ba 100644
--- a/meson.build
+++ b/meson.build
@@ -892,7 +892,7 @@ endif
 
 # Check for struct sockaddr_storage type
 # Define it to `sockaddr` if missing
-sockaddr_prefix = '#include <sys/types.h>\n'
+sockaddr_prefix = ['#include <sys/types.h>']
 if host_system == 'windows'
     sockaddr_prefix += '#include <winsock2.h>'
 else
-- 
GitLab


From 965961fc86e8c6d60514c8cc24ed469f9a13a712 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Mon, 31 Mar 2025 02:36:57 +0200
Subject: [PATCH 4/5] meson: use array for vlc_conf_prefix

---
 meson.build | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index b6cc4e0c98ba..dcfeb6516304 100644
--- a/meson.build
+++ b/meson.build
@@ -127,7 +127,7 @@ cargo_bin = find_program('cargo', required: get_option('rust'))
 #
 # General feature defines
 #
-vlc_conf_prefix = ''
+vlc_conf_prefix = []
 
 feature_defines = [
     ['_GNU_SOURCE', 1], # Enable GNU extensions on systems that have them
@@ -135,7 +135,7 @@ feature_defines = [
 
 foreach d : feature_defines
     cdata.set(d.get(0), d.get(1))
-    vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+    vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
 endforeach
 
 vlc_tests = []
@@ -365,7 +365,7 @@ windows_version_test = '''
 
     foreach d : windows_defines
         cdata.set(d.get(0), d.get(1))
-        vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+        vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
     endforeach
 
     mingw_check = '''
@@ -422,7 +422,7 @@ ucrt_version_test = '''
 
         foreach d : mingw_defines
             cdata.set(d.get(0), d.get(1))
-            vlc_conf_prefix = vlc_conf_prefix + '#define @0@ @1@\n'.format(d.get(0), d.get(1))
+            vlc_conf_prefix += '#define @0@ @1@'.format(d.get(0), d.get(1))
         endforeach
 
         # fno-strict-aliasing is necessary for WRL and IID_PPV_ARGS to work safely
@@ -920,7 +920,7 @@ elif host_system == 'windows'
     pollfd_prefix += '#include <winsock2.h>'
 endif
 
-if cc.has_type('struct pollfd', prefix: [vlc_conf_prefix] + pollfd_prefix)
+if cc.has_type('struct pollfd', prefix: vlc_conf_prefix + pollfd_prefix)
     cdata.set('HAVE_STRUCT_POLLFD', 1)
 endif
 
-- 
GitLab


From b66615b0cffe05643a9034c4433fe6d4dc9c1d2c Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Mon, 31 Mar 2025 02:47:05 +0200
Subject: [PATCH 5/5] meson: add configure line to config.h

Equivalent of what we do in autotools.
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index dcfeb6516304..f38fd4bf60ed 100644
--- a/meson.build
+++ b/meson.build
@@ -985,7 +985,7 @@ cdata.set_quoted('COPYRIGHT_MESSAGE',   f'Copyright © @vlc_copyright_years@ the
 cdata.set_quoted('VLC_COMPILER',        cc.get_id() + ' ' + cc.version())
 cdata.set_quoted('VLC_COMPILE_BY',      '[not implemented with meson]') # TODO
 cdata.set_quoted('VLC_COMPILE_HOST',    '[not implemented with meson]') # TODO
-cdata.set_quoted('CONFIGURE_LINE',      '[not implemented with meson]') # TODO
+cdata.set_quoted('CONFIGURE_LINE',      meson.build_options())
 
 # Paths
 prefix_path = get_option('prefix')
-- 
GitLab