[Makefiles] Get arch and distro specific vars from Makefile.configs

Extend Makefile.configs and define several variables for make to use
derived from 'gcc -dumpmachine'. In particular:
- ARCH as the architecture, e.g., x86_64
- ARCH_LONG as the long version of the architecture, e.g., x86_64-linux-gnu
- ARCH_LIBDIR as the directory where libraries are located,
  e.g., /lib/x86_64-linux-gnu

In Makefiles and manifest templates, replace the hard-coded
x86_64-linux_gnu and /lib/x86_64-linux-gnu through these variables.
Extend the already existing sed scripts to replace the necessary
variables.
This commit is contained in:
Stefan Berger
2020-04-27 16:05:00 +00:00
committed by Dmitrii Kuvaiskii
parent b8bfb52520
commit 206eb81eec
54 changed files with 308 additions and 233 deletions
@@ -18,10 +18,10 @@ loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so
loader.debug_type = $(GRAPHENEDEBUG)
# Environment variables for Python
loader.env.LD_LIBRARY_PATH = $(PYTHONHOME)/lib:/lib:/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu
loader.env.LD_LIBRARY_PATH = $(PYTHONHOME)/lib:/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)
loader.env.PATH = $(PYTHONHOME)/bin:/usr/bin:/bin
loader.env.PYTHONHOME = $(PYTHONHOME)
loader.env.PYTHONPATH = $(PYTHONHOME):$(PYTHONHOME)/plat-x86_64-linux-gnu:$(PYTHONDISTHOME):$(PYTHONHOME)/lib-dynload
loader.env.PYTHONPATH = $(PYTHONHOME):$(PYTHONHOME)/plat-$(ARCH_LONG):$(PYTHONDISTHOME):$(PYTHONHOME)/lib-dynload
# Mounted FSes. The following "chroot" FSes mount a part of the host FS into the
# guest. Other parts of the host FS will not be available in the guest.
@@ -31,10 +31,10 @@ fs.mount.lib.type = chroot
fs.mount.lib.path = /lib
fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime
# Host-level libraries (/lib/x86_64-linux-gnu) required by the Python executable
# Host-level libraries (e.g., /lib/x86_64-linux-gnu) required by the Python executable
fs.mount.lib2.type = chroot
fs.mount.lib2.path = /lib/x86_64-linux-gnu
fs.mount.lib2.uri = file:/lib/x86_64-linux-gnu
fs.mount.lib2.path = $(ARCH_LIBDIR)
fs.mount.lib2.uri = file:$(ARCH_LIBDIR)
# Host-level directory (/usr) required by the Python executable
fs.mount.usr.type = chroot
@@ -90,9 +90,9 @@ sgx.trusted_files.libnssdns = file:$(GRAPHENEDIR)/Runtime/libnss_dns.so.2
sgx.trusted_files.libresolve = file:$(GRAPHENEDIR)/Runtime/libresolv.so.2
# Other libraries
sgx.trusted_files.libexpat = file:/lib/x86_64-linux-gnu/libexpat.so.1
sgx.trusted_files.libnssfiles = file:/lib/x86_64-linux-gnu/libnss_files.so.2
sgx.trusted_files.libnssmdns4 = file:/lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2
sgx.trusted_files.libexpat = file:$(ARCH_LIBDIR)/libexpat.so.1
sgx.trusted_files.libnssfiles = file:$(ARCH_LIBDIR)/libnss_files.so.2
sgx.trusted_files.libnssmdns4 = file:$(ARCH_LIBDIR)/libnss_mdns4_minimal.so.2
$(PYTHON_TRUSTED_LIBS)
# Python scripts required for helloworld.py/fibonacci.py