public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/fw/builtin-syscalls-4] build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
@ 2019-12-31 10:50 Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2019-12-31 10:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1a5bb7fd261e9347027faba5e1e2170162a14144

commit 1a5bb7fd261e9347027faba5e1e2170162a14144
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Dec 16 13:00:58 2019 +0100

    build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
    
    And move install_linux_headers to the top level.

Diff:
---
 scripts/build-many-glibcs.py | 91 +++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 43 deletions(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 92cc613..8b7cf3d 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -1160,6 +1160,53 @@ class Context(object):
                 print('Script changed, bot re-execing.')
                 self.exec_self()
 
+class LinuxHeadersPolicyForBuild(object):
+    """Names and directories for installing Linux headers.  Build variant."""
+
+    def __init__(self, config):
+        self.arch = config.arch
+        self.srcdir = config.ctx.component_srcdir('linux')
+        self.builddir = config.component_builddir('linux')
+        self.headers_dir = os.path.join(config.sysroot, 'usr')
+
+def install_linux_headers(policy, cmdlist):
+    """Install Linux kernel headers."""
+    arch_map = {'aarch64': 'arm64',
+                'alpha': 'alpha',
+                'arm': 'arm',
+                'csky': 'csky',
+                'hppa': 'parisc',
+                'i486': 'x86',
+                'i586': 'x86',
+                'i686': 'x86',
+                'i786': 'x86',
+                'ia64': 'ia64',
+                'm68k': 'm68k',
+                'microblaze': 'microblaze',
+                'mips': 'mips',
+                'nios2': 'nios2',
+                'powerpc': 'powerpc',
+                's390': 's390',
+                'riscv32': 'riscv',
+                'riscv64': 'riscv',
+                'sh': 'sh',
+                'sparc': 'sparc',
+                'x86_64': 'x86'}
+    linux_arch = None
+    for k in arch_map:
+        if policy.arch.startswith(k):
+            linux_arch = arch_map[k]
+            break
+    assert linux_arch is not None
+    cmdlist.push_subdesc('linux')
+    cmdlist.create_use_dir(policy.builddir)
+    cmdlist.add_command('install-headers',
+                        ['make', '-C', policy.srcdir, 'O=%s' % policy.builddir,
+                         'ARCH=%s' % linux_arch,
+                         'INSTALL_HDR_PATH=%s' % policy.headers_dir,
+                         'headers_install'])
+    cmdlist.cleanup_dir()
+    cmdlist.pop_subdesc()
 
 class Config(object):
     """A configuration for building a compiler and associated libraries."""
@@ -1218,7 +1265,7 @@ class Config(object):
                                '--disable-readline',
                                '--disable-sim'])
         if self.os.startswith('linux'):
-            self.install_linux_headers(cmdlist)
+            install_linux_headers(LinuxHeadersPolicyForBuild(self), cmdlist)
         self.build_gcc(cmdlist, True)
         if self.os == 'gnu':
             self.install_gnumach_headers(cmdlist)
@@ -1266,48 +1313,6 @@ class Config(object):
         cmdlist.cleanup_dir()
         cmdlist.pop_subdesc()
 
-    def install_linux_headers(self, cmdlist):
-        """Install Linux kernel headers."""
-        arch_map = {'aarch64': 'arm64',
-                    'alpha': 'alpha',
-                    'arm': 'arm',
-                    'csky': 'csky',
-                    'hppa': 'parisc',
-                    'i486': 'x86',
-                    'i586': 'x86',
-                    'i686': 'x86',
-                    'i786': 'x86',
-                    'ia64': 'ia64',
-                    'm68k': 'm68k',
-                    'microblaze': 'microblaze',
-                    'mips': 'mips',
-                    'nios2': 'nios2',
-                    'powerpc': 'powerpc',
-                    's390': 's390',
-                    'riscv32': 'riscv',
-                    'riscv64': 'riscv',
-                    'sh': 'sh',
-                    'sparc': 'sparc',
-                    'x86_64': 'x86'}
-        linux_arch = None
-        for k in arch_map:
-            if self.arch.startswith(k):
-                linux_arch = arch_map[k]
-                break
-        assert linux_arch is not None
-        srcdir = self.ctx.component_srcdir('linux')
-        builddir = self.component_builddir('linux')
-        headers_dir = os.path.join(self.sysroot, 'usr')
-        cmdlist.push_subdesc('linux')
-        cmdlist.create_use_dir(builddir)
-        cmdlist.add_command('install-headers',
-                            ['make', '-C', srcdir, 'O=%s' % builddir,
-                             'ARCH=%s' % linux_arch,
-                             'INSTALL_HDR_PATH=%s' % headers_dir,
-                             'headers_install'])
-        cmdlist.cleanup_dir()
-        cmdlist.pop_subdesc()
-
     def install_gnumach_headers(self, cmdlist):
         """Install GNU Mach headers."""
         srcdir = self.ctx.component_srcdir('gnumach')


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [glibc/fw/builtin-syscalls-4] build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
@ 2019-12-17  7:31 Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2019-12-17  7:31 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ca418a69d51debde01de9dbb519215a79e674961

commit ca418a69d51debde01de9dbb519215a79e674961
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Dec 16 13:00:58 2019 +0100

    build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild
    
    And move install_linux_headers to the top level.

Diff:
---
 scripts/build-many-glibcs.py | 91 +++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 43 deletions(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 0c7d8ec..3601197 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -1149,6 +1149,53 @@ class Context(object):
                 print('Script changed, bot re-execing.')
                 self.exec_self()
 
+class LinuxHeadersPolicyForBuild(object):
+    """Names and directories for installing Linux headers.  Build variant."""
+
+    def __init__(self, config):
+        self.arch = config.arch
+        self.srcdir = config.ctx.component_srcdir('linux')
+        self.builddir = config.component_builddir('linux')
+        self.headers_dir = os.path.join(config.sysroot, 'usr')
+
+def install_linux_headers(policy, cmdlist):
+    """Install Linux kernel headers."""
+    arch_map = {'aarch64': 'arm64',
+                'alpha': 'alpha',
+                'arm': 'arm',
+                'csky': 'csky',
+                'hppa': 'parisc',
+                'i486': 'x86',
+                'i586': 'x86',
+                'i686': 'x86',
+                'i786': 'x86',
+                'ia64': 'ia64',
+                'm68k': 'm68k',
+                'microblaze': 'microblaze',
+                'mips': 'mips',
+                'nios2': 'nios2',
+                'powerpc': 'powerpc',
+                's390': 's390',
+                'riscv32': 'riscv',
+                'riscv64': 'riscv',
+                'sh': 'sh',
+                'sparc': 'sparc',
+                'x86_64': 'x86'}
+    linux_arch = None
+    for k in arch_map:
+        if policy.arch.startswith(k):
+            linux_arch = arch_map[k]
+            break
+    assert linux_arch is not None
+    cmdlist.push_subdesc('linux')
+    cmdlist.create_use_dir(policy.builddir)
+    cmdlist.add_command('install-headers',
+                        ['make', '-C', policy.srcdir, 'O=%s' % policy.builddir,
+                         'ARCH=%s' % linux_arch,
+                         'INSTALL_HDR_PATH=%s' % policy.headers_dir,
+                         'headers_install'])
+    cmdlist.cleanup_dir()
+    cmdlist.pop_subdesc()
 
 class Config(object):
     """A configuration for building a compiler and associated libraries."""
@@ -1207,7 +1254,7 @@ class Config(object):
                                '--disable-readline',
                                '--disable-sim'])
         if self.os.startswith('linux'):
-            self.install_linux_headers(cmdlist)
+            install_linux_headers(LinuxHeadersPolicyForBuild(self), cmdlist)
         self.build_gcc(cmdlist, True)
         if self.os == 'gnu':
             self.install_gnumach_headers(cmdlist)
@@ -1255,48 +1302,6 @@ class Config(object):
         cmdlist.cleanup_dir()
         cmdlist.pop_subdesc()
 
-    def install_linux_headers(self, cmdlist):
-        """Install Linux kernel headers."""
-        arch_map = {'aarch64': 'arm64',
-                    'alpha': 'alpha',
-                    'arm': 'arm',
-                    'csky': 'csky',
-                    'hppa': 'parisc',
-                    'i486': 'x86',
-                    'i586': 'x86',
-                    'i686': 'x86',
-                    'i786': 'x86',
-                    'ia64': 'ia64',
-                    'm68k': 'm68k',
-                    'microblaze': 'microblaze',
-                    'mips': 'mips',
-                    'nios2': 'nios2',
-                    'powerpc': 'powerpc',
-                    's390': 's390',
-                    'riscv32': 'riscv',
-                    'riscv64': 'riscv',
-                    'sh': 'sh',
-                    'sparc': 'sparc',
-                    'x86_64': 'x86'}
-        linux_arch = None
-        for k in arch_map:
-            if self.arch.startswith(k):
-                linux_arch = arch_map[k]
-                break
-        assert linux_arch is not None
-        srcdir = self.ctx.component_srcdir('linux')
-        builddir = self.component_builddir('linux')
-        headers_dir = os.path.join(self.sysroot, 'usr')
-        cmdlist.push_subdesc('linux')
-        cmdlist.create_use_dir(builddir)
-        cmdlist.add_command('install-headers',
-                            ['make', '-C', srcdir, 'O=%s' % builddir,
-                             'ARCH=%s' % linux_arch,
-                             'INSTALL_HDR_PATH=%s' % headers_dir,
-                             'headers_install'])
-        cmdlist.cleanup_dir()
-        cmdlist.pop_subdesc()
-
     def install_gnumach_headers(self, cmdlist):
         """Install GNU Mach headers."""
         srcdir = self.ctx.component_srcdir('gnumach')


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-31 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31 10:50 [glibc/fw/builtin-syscalls-4] build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild Florian Weimer
  -- strict thread matches above, loose matches on Subject: below --
2019-12-17  7:31 Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).