0.1.0-devel moved from c5ee93e4ad19 to 9f2e2afd2476 2 new revisions: Revision: e3e5be5bf63c Author: Niek Linnenbank <nieklinnenbank@xxxxxxxxx> Date: Thu Jan 22 18:33:49 2015 UTC Log: Added CXX and CROSS_COMPILE directives to .conf files. https://code.google.com/p/freenos/source/detail?r=e3e5be5bf63c Revision: 9f2e2afd2476 Author: Niek Linnenbank <nieklinnenbank@xxxxxxxxx> Date: Thu Jan 22 18:34:13 2015 UTCLog: Merge branch '0.1.0-devel' of https://code.google.com/p/freenos into 0...
https://code.google.com/p/freenos/source/detail?r=9f2e2afd2476 ============================================================================== Revision: e3e5be5bf63c Author: Niek Linnenbank <nieklinnenbank@xxxxxxxxx> Date: Thu Jan 22 18:33:49 2015 UTC Log: Added CXX and CROSS_COMPILE directives to .conf files. https://code.google.com/p/freenos/source/detail?r=e3e5be5bf63c Modified: /config/x86/pc/clang.conf /config/x86/pc/gcc.conf /site_scons/build.py ======================================= --- /config/x86/pc/clang.conf Tue Jan 20 18:37:02 2015 UTC +++ /config/x86/pc/clang.conf Thu Jan 22 18:33:49 2015 UTC @@ -16,6 +16,7 @@ # CC = 'clang' +CXX = 'clang' AS = 'clang' LD = 'clang' CCFLAGS = [ '-m32', '-Wall', '-nostdinc', ======================================= --- /config/x86/pc/gcc.conf Tue Jan 20 18:37:02 2015 UTC +++ /config/x86/pc/gcc.conf Thu Jan 22 18:33:49 2015 UTC @@ -18,6 +18,7 @@ CC = 'gcc' AS = 'gcc' LD = 'gcc' +CXX = 'g++' CCFLAGS = [ '-m32', '-Wall', '-nostdinc', '-fno-stack-protector', '-fno-builtin', '-g3', '-Wno-write-strings' ] ======================================= --- /site_scons/build.py Wed Jan 21 18:25:37 2015 UTC +++ /site_scons/build.py Thu Jan 22 18:33:49 2015 UTC @@ -96,8 +96,10 @@ # System-specific configuration. system_vars = Variables(target['COMPILER']) system_vars.Add('CC', 'C Compiler') +system_vars.Add('CXX', 'C++ Compiler') system_vars.Add('AS', 'Assembler') system_vars.Add('LD', 'Linker') +system_vars.Add('CROSS_COMPILE', 'Cross Compiler toolchain prefix', '') system_vars.Add('CCFLAGS', 'C/C++ Compiler flags') system_vars.Add('CXXFLAGS', 'C++ Compiler flags') system_vars.Add('ASFLAGS', 'Assembler flags') @@ -106,6 +108,11 @@ system_vars.Add('LINKUSER', 'Linker flags for user programs linker script') system_vars.Add('CPPPATH', 'C Preprocessor include directories') system_vars.Update(target) + +target.Prepend(CC = target['CROSS_COMPILE'], + CXX = target['CROSS_COMPILE'], + AS = target['CROSS_COMPILE'], + LD = target['CROSS_COMPILE']) target.Append(LINKFLAGS = target['LINKUSER']) # Enables verbose compilation command output. ============================================================================== Revision: 9f2e2afd2476 Author: Niek Linnenbank <nieklinnenbank@xxxxxxxxx> Date: Thu Jan 22 18:34:13 2015 UTCLog: Merge branch '0.1.0-devel' of https://code.google.com/p/freenos into 0.1.0-devel
https://code.google.com/p/freenos/source/detail?r=9f2e2afd2476 Modified: /site_scons/build.py ======================================= --- /site_scons/build.py Thu Jan 22 18:33:49 2015 UTC +++ /site_scons/build.py Thu Jan 22 18:34:13 2015 UTC @@ -15,9 +15,14 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +import os.path from SCons.Script import * from autoconf import * +""" A list of files which are installed in the final RootFS """ +rootfs_files = [] +Export('rootfs_files') + def UseLibraries(env, libs = [], arch = None): """ Prepares a given environment, by adding library dependencies. @@ -49,14 +54,31 @@ if env['ARCH'] == 'host': env.Program(target, source) -def TargetProgram(env, target, source): +def TargetProgram(env, target, source, install_dir = None): if env['ARCH'] != 'host': env.Program(target, source) + env.TargetInstall(target, install_dir) def TargetLibrary(env, lib, source): if env['ARCH'] != 'host': env.Library(lib, source) +def CopyStrFunc(target, source, env):+ return " " + env.subst_target_source("COPY $SOURCE => $TARGET", 0, target, source)
+ +def DirStrFunc(target): + return " MKDIR " + target + +def TargetInstall(env, source, target = None): + if env['ARCH'] != 'host': + SCons.Tool.install.install_action.strfunction = CopyStrFunc + + if not target: + target = '${ROOTFS}/' + Dir('.').srcnode().path + + env.Install(target, source) + rootfs_files.append(str(target) + os.sep + os.path.basename(source)) + def SubDirectories(): dir_list = [] dir_src = Dir('.').srcnode().abspath @@ -70,6 +92,7 @@ Export('SubDirectories') + # Create target, host and kernel environments. host = Environment() host.AddMethod(HostProgram, "HostProgram") @@ -77,7 +100,15 @@ host.AddMethod(TargetLibrary, "TargetLibrary") host.AddMethod(UseLibraries, "UseLibraries") host.AddMethod(UseServers, "UseServers") -target = host.Clone(tools = ["default", "bootimage", "iso", "binary"], +host.AddMethod(TargetInstall, "TargetInstall") +host.Append(ROOTFS = '#${BUILDROOT}/rootfs') +host.Append(ROOTFS_FILES = []) +host.Append(bin = '${ROOTFS}/bin', + etc = '${ROOTFS}/etc', + srv = '${ROOTFS}/srv', + boot = '${ROOTFS}/boot') ++target = host.Clone(tools = ["default", "bootimage", "iso", "binary", "linn"],
toolpath = ["site_scons"]) # Global top-level configuration. @@ -124,6 +155,7 @@ target['ARCOMSTR'] = host['ARCOMSTR'] = " AR $TARGET" target['RANLIBCOMSTR'] = host['RANLIBCOMSTR'] = " LIB $TARGET" target['LINKCOMSTR'] = host['LINKCOMSTR'] = " LD $TARGET"+ target['COPYSTR'] = host['COPYSTR'] = " COPY $SOURCE => $TARGET"
# Verify the configured CFLAGS. if not GetOption('clean'):