Exemplo n.º 1
0
def setup():
    inarytools.dosed("config/override.m4", "2.64", "2.69")
    shelltools.system(
        'sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure')
    shelltools.makedirs("build")
    shelltools.cd("build")
    shelltools.export("PYTHON", "/usr/bin/python3")
    shelltools.system("../configure \
                       --prefix=/{0} \
                       --build={1} \
                       --mandir=/{2} \
                       --libdir=/{0}/lib \
                       --infodir=/{3} \
                       --datadir=/{4} \
                       --sysconfdir=/{5} \
                       --localstatedir=/{6} \
                       --libexecdir=/{7} \
                       --with-system-readline \
                       --with-separate-debug-dir=/usr/lib/debug \
                       --with-gdb-datadir=/usr/share/gdb \
                       --with-python=/usr/bin/{8} \
                       --with-pythondir=/usr/lib/{8}/site-packages \
                       --disable-nls \
                       --disable-rpath \
                       --with-expat".format(get.defaultprefixDIR(), get.HOST(),
                                            get.manDIR(), get.infoDIR(),
                                            get.dataDIR(), get.confDIR(),
                                            get.localstateDIR(),
                                            get.libexecDIR(), get.curPYTHON()))
Exemplo n.º 2
0
def configure(parameters=''):
    """configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"""

    if can_access_file('configure'):
        gnuconfig_update()

        prefix = get.emul32prefixDIR() if get.buildTYPE(
        ) == "emul32" else get.defaultprefixDIR()
        args = './configure \
                --prefix=/{0} \
                --build={1} \
                --mandir=/{2} \
                --infodir=/{3} \
                --datadir=/{4} \
                --sysconfdir=/{5} \
                --localstatedir=/{6} \
                --libexecdir=/{7} \
                {8}{9}'.format(
            prefix, get.HOST(), get.manDIR(), get.infoDIR(), get.dataDIR(),
            get.confDIR(), get.localstateDIR(), get.libexecDIR(),
            "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "",
            parameters)

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(
            _('No configure script found. (\"{}\" file not found.)'.format(
                "configure")))
Exemplo n.º 3
0
def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # Simple wrapper for gcc
    host_gcc = "/usr/bin/%s-dietlibc-gcc" % get.HOST()
    shelltools.echo("%s%s" % (get.installDIR(), host_gcc), """\
#!/bin/bash
exec /usr/bin/diet %s "$@"
""" % get.CC())

    shelltools.chmod("%s%s" % (get.installDIR(), host_gcc), 0o755)
    inarytools.dosym(host_gcc, "/usr/bin/dietlibc-gcc")

    inarytools.dodoc("AUTHOR", "BUGS", "CAVEAT", "CHANGES", "FAQ", "README*", "THANKS", "TODO")
Exemplo n.º 4
0
def install():
    shelltools.cd("../build")
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())
    #autotools.install()

    for header in ["limits.h", "syslimits.h"]:
        inarytools.insinto(
            "/usr/lib/gcc/%s/%s/include" % (get.HOST(), verMajor),
            "gcc/include-fixed/%s" % header)

    # Not needed
    inarytools.removeDir("/usr/lib/gcc/*/*/include-fixed")
    inarytools.removeDir("/usr/lib/gcc/*/*/install-tools")

    # This one comes with binutils
    inarytools.remove("/usr/lib*/libiberty.a")

    # cc symlink
    inarytools.dosym("/usr/bin/gcc", "/usr/bin/cc")

    # /lib/cpp symlink for legacy X11 stuff
    inarytools.dosym("/usr/bin/cpp", "/lib/cpp")

    inarytools.dosym("/usr/bin/x86_64-pc-linux-gnu-gcc-ar",
                     "/usr/bin/x86_64-pc-linux-gnu-ar")

    # Remove our options section from crt stuff
    removeSulinLinuxSection("%s/usr/lib/" % get.installDIR())
    if get.ARCH() == "x86_64":
        removeSulinLinuxSection("%s/usr/lib32/" % get.installDIR())

    # autoload gdb pretty printers
    gdbpy_dir = "/usr/share/gdb/auto-load/usr/lib/"
    inarytools.dodir(gdbpy_dir)

    gdbpy_files = shelltools.ls("%s/usr/lib/libstdc++*gdb.py*" %
                                get.installDIR())
    for i in gdbpy_files:
        inarytools.domove("/usr/lib/%s" % shelltools.baseName(i), gdbpy_dir)

    if arch == "x86-64":
        inarytools.remove("/usr/lib32/libstdc++*gdb.py*")
    inarytools.rename("/usr/bin/go", "go1.12.2")
    inarytools.rename("/usr/bin/gofmt", "gofmt1.12.2")
Exemplo n.º 5
0
def configure(parameters=''):
    """configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"""

    prefix = get.defaultprefixDIR()
    if get.buildTYPE() == "emul32":
        prefix = get.emul32prefixDIR()

    args = '--prefix=/{0} \
                --build={1} \
                --mandir=/{2} \
                --infodir=/{3} \
                --datadir=/{4} \
                --sysconfdir=/{5} \
                --localstatedir=/{6} \
                --libexecdir=/{7} \
                --libdir=/{8}\
                {9}'.format(prefix, get.HOST(), get.manDIR(), get.infoDIR(),
                            get.dataDIR(), get.confDIR(), get.localstateDIR(),
                            get.libexecDIR(), get.libDIR(), parameters)
    rawConfigure(args)
Exemplo n.º 6
0
def setup():
    autotools.autoreconf("-vif")
    args = '../configure \
            --prefix=/{0} \
            --build={1} \
            --mandir=/{2} \
            --infodir=/{3} \
            --datadir=/{4} \
            --sysconfdir=/{5} \
            --localstatedir=/{6} \
            --libexecdir=/{7} \
            --libdir=/usr/lib '.format(get.defaultprefixDIR(), get.HOST(),
                                       get.manDIR(), get.infoDIR(),
                                       get.dataDIR(), get.confDIR(),
                                       get.localstateDIR(), get.libexecDIR())
    shelltools.makedirs("build-python3")
    shelltools.cd("build-python3")
    shelltools.system(args + "PYTHON=/usr/bin/python3 --with-python")
    shelltools.cd("..")
    shelltools.makedirs("build-python2")
    shelltools.cd("build-python2")
    shelltools.system(args + "PYTHON=/usr/bin/python2 --with-python")
Exemplo n.º 7
0
def setup():
    shelltools.export("PYTHON", "/usr/bin/python3")
    for dirs in ["tools", "projects"]:
        if not shelltools.can_access_directory(dirs):
            shelltools.makedirs(dirs)

    if not shelltools.can_access_directory("tools/clang"):
        shelltools.system("tar -xvf ../clang-%s.src.tar.xz -C tools" %
                          get.srcVERSION())
        shelltools.move("tools/clang-%s.src" % get.srcVERSION(), "tools/clang")

        shelltools.system(
            "tar -xvf ../clang-tools-extra-%s.src.tar.xz -C tools" %
            get.srcVERSION())
        shelltools.move("tools/clang-tools-extra-*", "tools/clang/extra")

    if get.buildTYPE() != "emul32":
        shelltools.system("tar -xvf ../lldb-%s.src.tar.xz -C tools" %
                          get.srcVERSION())
        shelltools.move("tools/lldb-*", "tools/lldb")

    if not shelltools.can_access_directory("tools/polly"):
        shelltools.system("tar -xvf ../polly-%s.src.tar.xz -C tools" %
                          get.srcVERSION())
        shelltools.move("tools/polly-*", "tools/polly")

    if not shelltools.can_access_directory("projects/compiler-rt"):
        shelltools.system("tar -xvf ../compiler-rt-%s.src.tar.xz -C projects" %
                          get.srcVERSION())
        shelltools.move("projects/compiler-rt-%s.src" % get.srcVERSION(),
                        "projects/compiler-rt")

        shelltools.export("CC", "gcc")
        shelltools.export("CXX", "g++")

    if get.buildTYPE() == "emul32":
        shelltools.export("CC", "gcc -m32")
        shelltools.export("CXX", "g++ -m32")
        shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")

    shelltools.makedirs("inary-build")

    shelltools.cd("inary-build")

    if get.buildTYPE() != "emul32":
        options = "-DCMAKE_C_FLAGS:STRING=-m64 \
                            -DCMAKE_INSTALL_PREFIX=/usr \
                            -DCMAKE_CXX_FLAGS:STRING=-m64 \
                            -DLLVM_TARGET_ARCH:STRING=x86_64 \
                            -DLLVM_DEFAULT_TARGET_TRIPLE=%s " % get.HOST()

    if get.buildTYPE() == "emul32":
        options = "  -DCMAKE_C_FLAGS:STRING=-m32 \
                            -DCMAKE_INSTALL_PREFIX=/emul32 \
                            -DLLVM_TARGET_ARCH:STRING=i686  \
                            -DLLVM_INCLUDE_TESTS=NO \
                            -DLLVM_LIBDIR_SUFFIX=32 \
                            -DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
                            -DCMAKE_CXX_FLAGS:STRING=-m32"

    cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
                             %s \
                             -DLLVM_BUILD_LLVM_DYLIB=ON \
                             -DLLVM_LINK_LLVM_DYLIB=ON \
                             -DLLVM_INSTALL_UTILS=ON \
                             -DLLVM_ENABLE_RTTI=ON \
                             -DLLVM_ENABLE_FFI=ON \
                             -DLLVM_BUILD_TESTS=OFF \
                             -DLLVM_BUILD_DOCS=OFF \
                             -DLLVM_ENABLE_SPHINX=OFF \
                             -DLLVM_ENABLE_DOXYGEN=OFF \
                             -DPOLLY_ENABLE_GPGPU_CODEGEN=ON \
                             -DFFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include \
                             -DSPHINX_WARNINGS_AS_ERRORS=OFF \
                             -DLLVM_BINUTILS_INCDIR=/usr/include" % options,
                         sourceDir="..")
Exemplo n.º 8
0
def setup():
    if get.buildTYPE() != "emul32":
        if not shelltools.can_access_directory("tools/clang"):
            shelltools.system("tar xf ../cfe-%s.src.tar.xz -C tools" %
                              get.srcVERSION())
            shelltools.move("tools/cfe-%s.src" % get.srcVERSION(),
                            "tools/clang")

            shelltools.system(
                "tar xf ../clang-tools-extra-%s.src.tar.xz -C tools" %
                get.srcVERSION())
            shelltools.move("tools/clang-tools-extra-*", "tools/clang/extra")

            shelltools.system("tar xf ../lldb-%s.src.tar.xz -C tools" %
                              get.srcVERSION())
            shelltools.move("tools/lldb-*", "tools/lldb")

        if not shelltools.can_access_directory("projects/compiler-rt"):
            shelltools.system(
                "tar xf ../compiler-rt-%s.src.tar.xz -C projects" %
                get.srcVERSION())
            shelltools.move("projects/compiler-rt-%s.src" % get.srcVERSION(),
                            "projects/compiler-rt")

            shelltools.export("CC", "gcc")
            shelltools.export("CXX", "g++")

    if get.buildTYPE() == "emul32":
        shelltools.export("CC", "gcc -m32")
        shelltools.export("CXX", "g++ -m32")
        shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")

    shelltools.makedirs("inary-build")

    shelltools.cd("inary-build")

    if get.buildTYPE() != "emul32":
        options = "-DCMAKE_C_FLAGS:STRING=-m64 \
                              -DCMAKE_INSTALL_PREFIX=/usr \
                            -DCMAKE_CXX_FLAGS:STRING=-m64 \
                            -DLLVM_TARGET_ARCH:STRING=x86_64 \
                            -DLLVM_DEFAULT_TARGET_TRIPLE=%s " % get.HOST()

    if get.buildTYPE() == "emul32":
        options = "  -DCMAKE_C_FLAGS:STRING=-m32 \
                            -DCMAKE_INSTALL_PREFIX=/emul32 \
                            -DLLVM_TARGET_ARCH:STRING=i686  \
                            -DLLVM_LIBDIR_SUFFIX=32 \
                            -DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
                            -DCMAKE_CXX_FLAGS:STRING=-m32"

    cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
                                        %s \
                                        -DLLVM_ENABLE_FFI=ON \
                                        -DLLVM_BUILD_DOCS=OFF \
                                        -DBUILD_SHARED_LIBS=ON \
                                        -DLLVM_ENABLE_RTTI=ON \
                                        -DLLVM_INCLUDEDIR=/usr/include \
                                        -DLLVM_ENABLE_ASSERTIONS=OFF \
                                        -DFFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include \
                                        -DENABLE_SHARED=ON" % options,
                         sourceDir="..")
Exemplo n.º 9
0
def setup():
    autotools.rawConfigure("--with-diffutils \
                            --prefix=/%s \
                            --host=%s \ "                                          %
                            (get.defaultprefixDIR(), \
                             get.HOST()))