2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2021 Intel Corporation
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.
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
19 os.chdir(os.environ['MESON_INSTALL_DESTDIR_PREFIX'])
22 pmd_subdir = sys.argv[2]
24 pmd_dir = os.path.join(lib_dir, pmd_subdir)
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.
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)
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)
41 # symlink shared objects
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):
49 print(to + ' -> ' + file)