Skip to content

Commit

Permalink
tc_build/binutils: Dont install unwanted man pages and info files
Browse files Browse the repository at this point in the history
Signed-off-by: Dakkshesh <[email protected]>
  • Loading branch information
dakkshesh07 committed Jan 29, 2025
1 parent d2c105c commit d18dce7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tc_build/binutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
from pathlib import Path
import platform
from tempfile import TemporaryDirectory

from tc_build.builder import Builder
from tc_build.source import SourceManager
Expand All @@ -27,6 +28,12 @@ def __init__(self):
'--quiet',
'--with-system-zlib',
]

# Redirect unwanted docs to a temporary dir
self.tmpdir = TemporaryDirectory()
doc_dirs = ['infodir', 'htmldir', 'pdfdir', 'mandir']
self.configure_flags += [f"--{d}={self.tmpdir.name}" for d in doc_dirs]

# gprofng uses glibc APIs that might not be available on musl
if tc_build.utils.libc_is_musl():
self.configure_flags.append('--disable-gprofng')
Expand Down Expand Up @@ -68,6 +75,8 @@ def build(self):
if self.folders.install:
self.run_cmd([*make_cmd, 'install'])
tc_build.utils.create_gitignore(self.folders.install)
# Clean temporary dir containing docs after installing
self.tmpdir.cleanup()


class StandardBinutilsBuilder(BinutilsBuilder):
Expand Down

0 comments on commit d18dce7

Please sign in to comment.