eal/memory: fix unused SIGBUS handler
[dpdk.git] / buildtools / symlink-drivers-solibs.py
1 #!/usr/bin/env python3
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2021 Intel Corporation
4
5 import os
6 import sys
7 import glob
8 import shutil
9
10 # post-install script for meson/ninja builds to symlink the PMDs stored in
11 # $libdir/dpdk/pmds-*/ to $libdir. This is needed as some PMDs depend on
12 # others, e.g. PCI device PMDs depending on the PCI bus driver.
13
14 # parameters to script are paths relative to install prefix:
15 # 1. directory for installed regular libs e.g. lib64
16 # 2. subdirectory of libdir where the PMDs are
17 # 3. directory for installed regular binaries e.g. bin
18
19 os.chdir(os.environ['MESON_INSTALL_DESTDIR_PREFIX'])
20
21 lib_dir = sys.argv[1]
22 pmd_subdir = sys.argv[2]
23 bin_dir = sys.argv[3]
24 pmd_dir = os.path.join(lib_dir, pmd_subdir)
25
26 # copy Windows PMDs to avoid any issues with symlinks since the
27 # build could be a cross-compilation under WSL, Msys or Cygnus.
28 # the filenames are dependent upon the specific toolchain in use.
29
30 def copy_pmd_files(pattern, to_dir):
31         for file in glob.glob(os.path.join(pmd_dir, pattern)):
32                 to = os.path.join(to_dir, os.path.basename(file))
33                 shutil.copy2(file, to)
34                 print(to + ' -> ' + file)
35
36 copy_pmd_files('*rte_*.dll', bin_dir)
37 copy_pmd_files('*rte_*.pdb', bin_dir)
38 copy_pmd_files('*rte_*.lib', lib_dir)
39 copy_pmd_files('*rte_*.dll.a', lib_dir)
40
41 # symlink shared objects
42
43 os.chdir(lib_dir)
44 for file in glob.glob(os.path.join(pmd_subdir, 'librte_*.so*')):
45         to = os.path.basename(file)
46         if os.path.exists(to):
47                 os.remove(to)
48         os.symlink(file, to)
49         print(to + ' -> ' + file)