[DEV] try isolate in macOs

This commit is contained in:
Edouard DUPIN 2017-09-07 23:35:35 +02:00
parent 7ca034a430
commit 03742be308
5 changed files with 231 additions and 5 deletions

View File

@ -21,4 +21,193 @@ class System(system.System):
self.set_help("C: Generic C library") self.set_help("C: Generic C library")
self.add_flag("c-remove","-nodefaultlibs") self.add_flag("c-remove","-nodefaultlibs")
self.set_valid(True) self.set_valid(True)
if env.get_isolate_system() == False:
# We must have it ... all time
pass
else:
# grep "This file is part of the GNU C Library" /usr/include/*
self.add_header_file([
'/usr/include/aio.h*',
'/usr/include/aliases.h*',
'/usr/include/alloca.h*',
'/usr/include/ansidecl.h*',
'/usr/include/argp.h*',
'/usr/include/argz.h*',
'/usr/include/ar.h*',
'/usr/include/assert.h*',
'/usr/include/byteswap.h*',
'/usr/include/complex.h*',
'/usr/include/cpio.h*',
'/usr/include/ctype.h*',
'/usr/include/dirent.h*',
'/usr/include/dlfcn.h*',
'/usr/include/elf.h*',
'/usr/include/endian.h*',
'/usr/include/envz.h*',
'/usr/include/err.h*',
'/usr/include/errno.h*',
'/usr/include/error.h*',
'/usr/include/execinfo.h*',
'/usr/include/fcntl.h*',
'/usr/include/features.h*',
'/usr/include/fenv.h*',
'/usr/include/fmtmsg.h*',
'/usr/include/fnmatch.h*',
'/usr/include/fpu_control.h*',
'/usr/include/fts.h*',
'/usr/include/ftw.h*',
'/usr/include/gconv.h*',
'/usr/include/getopt.h*',
'/usr/include/glob.h*',
'/usr/include/gnu-versions.h*',
'/usr/include/grp.h*',
'/usr/include/gshadow.h*',
'/usr/include/iconv.h*',
'/usr/include/ieee754.h*',
'/usr/include/ifaddrs.h*',
'/usr/include/inttypes.h*',
'/usr/include/langinfo.h*',
'/usr/include/libgen.h*',
'/usr/include/libintl.h*',
'/usr/include/libio.h*',
'/usr/include/limits.h*',
'/usr/include/link.h*',
'/usr/include/locale.h*',
'/usr/include/malloc.h*',
'/usr/include/mcheck.h*',
'/usr/include/memory.h*',
'/usr/include/mntent.h*',
'/usr/include/monetary.h*',
'/usr/include/mqueue.h*',
'/usr/include/netdb.h*',
'/usr/include/nl_types.h*',
'/usr/include/nss.h*',
'/usr/include/obstack.h*',
'/usr/include/printf.h*',
'/usr/include/pthread.h*',
'/usr/include/pty.h*',
'/usr/include/pwd.h*',
'/usr/include/re_comp.h*',
'/usr/include/regex.h*',
'/usr/include/regexp.h*',
'/usr/include/sched.h*',
'/usr/include/search.h*',
'/usr/include/semaphore.h*',
'/usr/include/setjmp.h*',
'/usr/include/sgtty.h*',
'/usr/include/shadow.h*',
'/usr/include/signal.h*',
'/usr/include/spawn.h*',
'/usr/include/stdc-predef.h*',
'/usr/include/stdint.h*',
'/usr/include/stdio_ext.h*',
'/usr/include/stdio.h*',
'/usr/include/stdlib.h*',
'/usr/include/string.h*',
'/usr/include/strings.h*',
'/usr/include/stropts.h*',
'/usr/include/tar.h*',
'/usr/include/termios.h*',
'/usr/include/tgmath.h*',
'/usr/include/thread_db.h*',
'/usr/include/time.h*',
'/usr/include/uchar.h*',
'/usr/include/ucontext.h*',
'/usr/include/ulimit.h*',
'/usr/include/unistd.h*',
'/usr/include/utime.h*',
'/usr/include/utmp.h*',
'/usr/include/utmpx.h*',
'/usr/include/values.h*',
'/usr/include/wchar.h*',
'/usr/include/wctype.h*',
'/usr/include/wordexp.h*',
'/usr/include/xlocale.h*',
'/usr/include/Availability*',
'/usr/include/_types.h*',
'/usr/include/_wctype.h*',
'/usr/include/runetype.h*',
'/usr/include/_locale.h*',
'/usr/include/_xlocale.h*',
'/usr/include/gethostuuid.h*',
],
destination_path="")
self.add_header_file([
'/usr/include/poll.h*',
'/usr/include/unistdio.h*',
'/usr/include/syslog.h*',
'/usr/include/_G_config.h*',
],
destination_path="")
self.add_header_file([
"/usr/include/machine/*",
],
destination_path="machine",
recursive=True)
self.add_header_file([
"/usr/include/xlocale/*",
],
destination_path="xlocale",
recursive=True)
self.add_header_file([
"/usr/include/i386/*",
],
destination_path="i386",
recursive=True)
self.add_header_file([
"/usr/include/_types/*",
],
destination_path="_types",
recursive=True)
self.add_header_file([
"/usr/include/libkern/*",
],
destination_path="libkern",
recursive=True)
self.add_header_file([
"/usr/include/mach/*",
],
destination_path="mach",
recursive=True)
self.add_header_file([
"/usr/include/sys/*",
],
destination_path="sys",
recursive=True)
self.add_header_file([
"/usr/include/bits/*",
],
destination_path="bits",
recursive=True)
self.add_header_file([
"/usr/include/gnu/*",
],
destination_path="gnu",
recursive=True)
self.add_header_file([
"/usr/include/linux/*",
],
destination_path="linux",
recursive=True)
self.add_header_file([
"/usr/include/asm/*",
],
destination_path="asm",
recursive=True)
self.add_header_file([
"/usr/include/asm-generic/*",
],
destination_path="asm-generic",
recursive=True)
self.add_header_file([
"/usr/include/netinet/*",
],
destination_path="netinet",
recursive=True)
self.add_header_file([
"/usr/include/net/*",
],
destination_path="net",
recursive=True)
self.add_flag("link", "-B/usr/lib")

View File

@ -12,6 +12,7 @@ from lutin import debug
from lutin import system from lutin import system
from lutin import tools from lutin import tools
from lutin import env from lutin import env
from lutin import multiprocess
import os import os
class System(system.System): class System(system.System):
@ -22,8 +23,24 @@ class System(system.System):
self.set_valid(True) self.set_valid(True)
# no check needed ==> just add this: # no check needed ==> just add this:
self.add_depend("c") self.add_depend("c")
self.add_flag("c++","-D__STDCPP_LLVM__") self.add_flag("c++", "-D__STDCPP_LLVM__")
self.add_flag("c++-remove","-nostdlib") if env.get_isolate_system() == False:
self.add_flag("need-libstdc++", True) self.add_flag("c++-remove", "-nostdlib")
self.add_flag("need-libstdc++", True)
else:
self.add_flag("link-lib", "stdc++")
compilator_gcc = "g++"
if target.config["compilator-version"] != "":
compilator_gcc = compilator_gcc + "-" + target.config["compilator-version"]
#get g++ compilation version :
version_cpp = multiprocess.run_command_direct(compilator_gcc + " -dumpversion");
if version_cpp == False:
debug.error("Can not get the g++ version ...")
self.add_header_file([
"/usr/include/c++/" + version_cpp + "/*"
],
recursive=True)

View File

@ -23,5 +23,14 @@ class System(system.System):
self.set_valid(True) self.set_valid(True)
# todo : create a searcher of the presence of the library: # todo : create a searcher of the presence of the library:
self.add_flag("link-lib", "m") self.add_flag("link-lib", "m")
self.add_depend([
'c'
])
if env.get_isolate_system() == True:
self.add_header_file([
"/usr/include/math.h"
],
clip_path="/usr/include",
recursive=False)

View File

@ -31,14 +31,22 @@ class System(system.System):
self.add_depend([ self.add_depend([
'c' 'c'
]) ])
"""
if env.get_isolate_system() == True: if env.get_isolate_system() == True:
self.add_header_file([ self.add_header_file([
"/usr/include/sched.h", "/usr/include/sched.h",
"/usr/include/pthread.h" "/usr/include/pthread.h"
], ],
clip_path="/usr/include/") clip_path="/usr/include/")
""" self.add_header_file([
"/usr/include/pthread/*",
],
destination_path="pthread",
recursive=True)
self.add_header_file([
"/usr/include/pthread/*",
],
destination_path="",
recursive=True)

View File

@ -14,6 +14,7 @@ from lutin import tools
from lutin import host from lutin import host
from lutin import multiprocess from lutin import multiprocess
from lutin import depend from lutin import depend
from lutin import env
import os import os
import stat import stat
import shutil import shutil
@ -48,6 +49,8 @@ class Target(target.Target):
self.pkg_path_bin = "MacOS" self.pkg_path_bin = "MacOS"
self.pkg_path_lib = "lib" self.pkg_path_lib = "lib"
self.pkg_path_license = "license" self.pkg_path_license = "license"
if env.get_isolate_system() == True:
self.sysroot = "--sysroot=/aDirectoryThatDoesNotExist/"
self.add_flag("link-lib", [ self.add_flag("link-lib", [
"dl" "dl"