add ext4,vfat and tar.bz2
[u-tools.git] / u-tools / apps / tar / SConscript
bloba1bd48a4d5e05466288fa96ee3343b44c259dc30
1 Import("*")
2 import os
4 build_dir = Dir(env.builddir + "/tar").abspath
5 inst_dir = Dir(env.builddir + "/tar_install").abspath
6 tar_dir = os.path.join(env.project_dir, 'apps', 'tar')
7 #tar_dir = "tar"
8 #root_dir = Dir("#").abspath
10 rootfs_inst_dir = Dir(env.builddir + "/install").abspath
12 def b(file_name):
13     return os.path.join(build_dir, file_name)
14 def i(file_name):
15     return os.path.join(inst_dir, file_name)
17 env.scons_env["MAKE"] = "make"
19 #env.toolchain_name.
20 #print env.toolchain_name
22 def cross_name():
23     return '%s%s' % (env.toolchain.dict["TOOLPREFIX"],env.toolchain.dict["_CC"])
25 #print cross_name()
28 tar_conf = env.Command(b("Makefile"),
29                           [],
30                           #"cd %s && DESTDIR=%s %s/configure --host=arm-linux --enable-elf-shlibs --with-cc=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-gcc --prefix=/" % (build_dir, inst_dir, tar_dir)
31                           #"cd %s && DESTDIR=%s %s/configure --host=arm-linux --enable-elf-shlibs --with-cc=%s" % (build_dir, inst_dir, tar_dir,cross_name()) #./configure  --help
32                           "cd %s && DESTDIR=%s %s/configure --host=arm-linux CC=%s" % (build_dir, inst_dir, tar_dir,cross_name())
33                           )
35 tar = env.Command(b("tar.built"),
36                       tar_conf,
37                       "cd %s && $MAKE -j %d && touch tar.built" %
38                      (build_dir, GetOption('num_jobs')))
39                      
40 tar_install = env.Command(i("usr/local/bin/tar"),
41                              tar,
42                              "cd %s && DESTDIR=%s $MAKE install" % (build_dir, inst_dir)
43                              )
45 env.Depends(tar, tar_conf)
46 env.Depends(tar_install, tar)
51 rootfs_install = InstallAs(os.path.join(rootfs_inst_dir, "sbin/tar"),os.path.join(inst_dir, "usr/local/bin/tar"))
52 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "lib/libss.so.2"),os.path.join(inst_dir, "lib/libss.so.2"))
53 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "lib/libext2fs.so.2"),os.path.join(inst_dir, "lib/libext2fs.so.2"))
54 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "lib/libe2p.so.2"),os.path.join(inst_dir, "lib/libe2p.so.2"))
55 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "lib/libcom_err.so.2"),os.path.join(inst_dir, "lib/libcom_err.so.2"))
56 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "lib/libblkid.so.1"),os.path.join(inst_dir, "lib/libblkid.so.1"))
57 #rootfs_install += Install(os.path.join(rootfs_inst_dir, "lib"),os.path.join(inst_dir, "lib/e2initrd_helper"))
59 #rootfs_install += Install(os.path.join(rootfs_inst_dir, "etc"),os.path.join(inst_dir, "etc/mke2fs.conf"))
61 #rootfs_install += Install(os.path.join(rootfs_inst_dir, "sbin"),os.path.join(inst_dir, "sbin/mkfs.ext3"))
62 #rootfs_install += Install(os.path.join(rootfs_inst_dir, "sbin"),os.path.join(inst_dir, "sbin/fsck.ext3"))
63 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "sbin/mke2fs"),os.path.join(inst_dir, "sbin/mke2fs"))
64 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "sbin/e2fsck"),os.path.join(inst_dir, "sbin/e2fsck"))
65 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "sbin/resize2fs"),os.path.join(inst_dir, "sbin/resize2fs"))
66 #rootfs_install += InstallAs(os.path.join(rootfs_inst_dir, "sbin/tune2fs"),os.path.join(inst_dir, "sbin/tune2fs"))
68 env.Depends(rootfs_install, tar_install)
70 #__all = [tar_install, rootfs_install]
72 #Return("tar_install")
73 Return("rootfs_install")
74 #Return("__all")