Add new development platforms: linux_arm, linux_i686 and linux_x86_64

This commit is contained in:
Ivan Kravets
2015-08-10 21:39:31 +03:00
parent 27ca987284
commit ad7be3b397
16 changed files with 357 additions and 6 deletions

View File

@ -6,8 +6,11 @@ Release History
* Added
`native <http://docs.platformio.org/en/latest/platforms/native.html>`__,
`linux_arm <http://docs.platformio.org/en/latest/platforms/linux_arm.html>`__,
`linux_i686 <http://docs.platformio.org/en/latest/platforms/linux_i686.html>`__,
`linux_x86_64 <http://docs.platformio.org/en/latest/platforms/linux_x86_64.html>`__,
`windows_x86 <http://docs.platformio.org/en/latest/platforms/windows_x86.html>`__
development platform
development platforms
(`issue #263 <https://github.com/platformio/platformio/issues/263>`_)
* Added support for Adafruit Gemma board to
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__

View File

@ -108,9 +108,18 @@ Packages
* - ``toolchain-atmelavr``
- `avr-gcc <https://gcc.gnu.org/wiki/avr-gcc>`_, `GDB <http://www.gnu.org/software/gdb/>`_, `AVaRICE <http://avarice.sourceforge.net/>`_, `SimulAVR <http://www.nongnu.org/simulavr/>`_
* - ``toolchain-gccarmlinuxgnueabi``
- `GCC for Linux ARM GNU EABI <https://gcc.gnu.org>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``toolchain-gcclinux32``
- `GCC for Linux i686 <https://gcc.gnu.org>`_
* - ``toolchain-gcclinux64``
- `GCC for Linux x86_64 <https://gcc.gnu.org>`_
* - ``toolchain-gccmingw32``
- `MinGW <http://www.mingw.org>`_

View File

@ -36,6 +36,9 @@ Desktop
:maxdepth: 2
native
linux_arm
linux_i686
linux_x86_64
windows_x86
Own Platform/Board

View File

@ -0,0 +1,21 @@
.. _platform_linux_arm:
Platform ``linux_arm``
======================
Linux ARM is a Unix-like and mostly POSIX-compliant computer operating system (OS) assembled under the model of free and open-source software development and distribution. Using host OS (Mac OS X, Linux ARM) you can build native application for Linux ARM platform.
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/linux_arm>`_.
.. contents::
Packages
--------
.. list-table::
:header-rows: 1
* - Name
- Contents
* - ``toolchain-gccarmlinuxgnueabi``
- `GCC for Linux ARM GNU EABI <https://gcc.gnu.org>`_, `GDB <http://www.gnu.org/software/gdb/>`_

View File

@ -0,0 +1,21 @@
.. _platform_linux_i686:
Platform ``linux_i686``
=======================
Linux i686 (32-bit) is a Unix-like and mostly POSIX-compliant computer operating system (OS) assembled under the model of free and open-source software development and distribution. Using host OS (Mac OS X or Linux 32-bit) you can build native application for Linux i686 platform.
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/linux_i686>`_.
.. contents::
Packages
--------
.. list-table::
:header-rows: 1
* - Name
- Contents
* - ``toolchain-gcclinux32``
- `GCC for Linux i686 <https://gcc.gnu.org>`_

View File

@ -0,0 +1,21 @@
.. _platform_linux_x86_64:
Platform ``linux_x86_64``
=========================
Linux x86_64 (64-bit) is a Unix-like and mostly POSIX-compliant computer operating system (OS) assembled under the model of free and open-source software development and distribution. Using host OS (Mac OS X or Linux 64-bit) you can build native application for Linux x86_64 platform.
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/linux_i686>`_.
.. contents::
Packages
--------
.. list-table::
:header-rows: 1
* - Name
- Contents
* - ``toolchain-gcclinux64``
- `GCC for Linux x86_64 <https://gcc.gnu.org>`_

View File

@ -2,7 +2,7 @@
Platform ``windows_x86``
========================
Windows x86 (32-bit) is a metafamily of graphical operating systems developed and marketed by Microsoft. Using host OS (Windows or Mac OS X) you can build native application for Windows x86 platform.
Windows x86 (32-bit) is a metafamily of graphical operating systems developed and marketed by Microsoft. Using host OS (Windows, Linux 32/64 or Mac OS X) you can build native application for Windows x86 platform.
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/windows_x86>`_.

View File

@ -22,3 +22,23 @@ platform = native
[env:win32]
platform = windows_x86
#
# If host OS is Mac OS X
#
# [env:darwin_x86_64]
# platform = native
# [env:linux_i686]
# platform = linux_i686
# [env:linux_x86_64]
# platform = linux_x86_64
# [env:windows_x86]
# platform = windows_x86
# [env:linux_armv6l]
# platform = linux_arm
# build_flags = -march=armv6

View File

@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (2, 3, "0.dev1")
VERSION = (2, 3, "0.dev2")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -0,0 +1,49 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Builder for Linux ARM
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
_BINPREFIX="",
AR="${_BINPREFIX}ar",
AS="${_BINPREFIX}as",
CC="${_BINPREFIX}gcc",
CXX="${_BINPREFIX}g++",
OBJCOPY="${_BINPREFIX}objcopy",
RANLIB="${_BINPREFIX}ranlib",
SIZETOOL="${_BINPREFIX}size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES'
)
if get_systype() == "darwin_x86_64":
env.Replace(
_BINPREFIX="arm-linux-gnueabihf-"
)
#
# Target: Build executable program
#
target_bin = env.BuildProgram()
#
# Target: Print binary size
#
target_size = env.Alias("size", target_bin, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Define targets
#
Default([target_bin])

View File

@ -0,0 +1,49 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Builder for Linux Linux i686 / 32-bit
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
_BINPREFIX="",
AR="${_BINPREFIX}ar",
AS="${_BINPREFIX}as",
CC="${_BINPREFIX}gcc",
CXX="${_BINPREFIX}g++",
OBJCOPY="${_BINPREFIX}objcopy",
RANLIB="${_BINPREFIX}ranlib",
SIZETOOL="${_BINPREFIX}size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES'
)
if get_systype() == "darwin_x86_64":
env.Replace(
_BINPREFIX="i586-pc-linux-"
)
#
# Target: Build executable program
#
target_bin = env.BuildProgram()
#
# Target: Print binary size
#
target_size = env.Alias("size", target_bin, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Define targets
#
Default([target_bin])

View File

@ -0,0 +1,49 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Builder for Linux Linux x64_64 / 64-bit
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
_BINPREFIX="",
AR="${_BINPREFIX}ar",
AS="${_BINPREFIX}as",
CC="${_BINPREFIX}gcc",
CXX="${_BINPREFIX}g++",
OBJCOPY="${_BINPREFIX}objcopy",
RANLIB="${_BINPREFIX}ranlib",
SIZETOOL="${_BINPREFIX}size",
SIZEPRINTCMD='"$SIZETOOL" $SOURCES'
)
if get_systype() == "darwin_x86_64":
env.Replace(
_BINPREFIX="x86_64-pc-linux-"
)
#
# Target: Build executable program
#
target_bin = env.BuildProgram()
#
# Target: Print binary size
#
target_size = env.Alias("size", target_bin, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Define targets
#
Default([target_bin])

View File

@ -76,6 +76,19 @@ PLATFORM_PACKAGES = {
("gcc-arm-embedded", "https://launchpad.net/gcc-arm-embedded"),
("GDB", "http://www.gnu.org/software/gdb/")
],
"toolchain-gccarmlinuxgnueabi": [
("GCC for Linux ARM GNU EABI", "https://gcc.gnu.org"),
("GDB", "http://www.gnu.org/software/gdb/")
],
"toolchain-gccmingw32": [
("MinGW", "http://www.mingw.org")
],
"toolchain-gcclinux32": [
("GCC for Linux i686", "https://gcc.gnu.org")
],
"toolchain-gcclinux64": [
("GCC for Linux x86_64", "https://gcc.gnu.org")
],
"toolchain-xtensa": [
("xtensa-gcc", "https://github.com/jcmvbkbc/gcc-xtensa"),
("GDB", "http://www.gnu.org/software/gdb/")
@ -90,9 +103,6 @@ PLATFORM_PACKAGES = {
"tool-micronucleus": [
("Micronucleus", "https://github.com/micronucleus/micronucleus")
],
"toolchain-gccmingw32": [
("MinGW", "http://www.mingw.org")
],
"tool-bossac": [
("BOSSA CLI", "https://sourceforge.net/projects/b-o-s-s-a/")
],

View File

@ -0,0 +1,32 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
from platformio.util import get_systype
class Linux_armPlatform(BasePlatform):
"""
Linux ARM is a Unix-like and mostly POSIX-compliant computer
operating system (OS) assembled under the model of free and open-source
software development and distribution.
Using host OS (Mac OS X, Linux ARM) you can build native application
for Linux ARM platform.
http://platformio.org/#!/platforms/linux_arm
"""
PACKAGES = {
"toolchain-gccarmlinuxgnueabi": {
"alias": "toolchain",
"default": True
}
}
def __init__(self):
if "linux_arm" in get_systype():
del self.PACKAGES['toolchain-gccarmlinuxgnueabi']
BasePlatform.__init__(self)

View File

@ -0,0 +1,32 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
from platformio.util import get_systype
class Linux_i686Platform(BasePlatform):
"""
Linux i686 (32-bit) is a Unix-like and mostly POSIX-compliant
computer operating system (OS) assembled under the model of free and
open-source software development and distribution.
Using host OS (Mac OS X or Linux 32-bit) you can build native
application for Linux i686 platform.
http://platformio.org/#!/platforms/linux_i686
"""
PACKAGES = {
"toolchain-gcclinux32": {
"alias": "toolchain",
"default": True
}
}
def __init__(self):
if get_systype() == "linux_i686":
del self.PACKAGES['toolchain-gcclinux32']
BasePlatform.__init__(self)

View File

@ -0,0 +1,32 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
from platformio.util import get_systype
class Linux_x86_64Platform(BasePlatform):
"""
Linux x86_64 (64-bit) is a Unix-like and mostly POSIX-compliant
computer operating system (OS) assembled under the model of free and
open-source software development and distribution.
Using host OS (Mac OS X or Linux 64-bit) you can build native
application for Linux x86_64 platform.
http://platformio.org/#!/platforms/linux_i686
"""
PACKAGES = {
"toolchain-gcclinux64": {
"alias": "toolchain",
"default": True
}
}
def __init__(self):
if get_systype() == "linux_x86_64":
del self.PACKAGES['toolchain-gcclinux64']
BasePlatform.__init__(self)