mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
new package: add package 'llvm'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
168f769d5a
commit
b0424af78c
66
packages/devel/llvm-host/build
Executable file
66
packages/devel/llvm-host/build
Executable file
@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
$SCRIPTS/unpack llvm
|
||||
|
||||
setup_toolchain host
|
||||
|
||||
if [ "$TARGET_ARCH" = i386 ]; then
|
||||
ARCH=x86
|
||||
elif [ "$TARGET_ARCH" = x86_64 ]; then
|
||||
ARCH=x86_64
|
||||
fi
|
||||
|
||||
LLVM_DIR=`ls -d $BUILD/llvm-[0-9]*`
|
||||
|
||||
cd $LLVM_DIR
|
||||
|
||||
cd autoconf
|
||||
aclocal --force --verbose -I m4
|
||||
autoconf --force --verbose -I m4 -o ../configure
|
||||
cd ..
|
||||
|
||||
mkdir -p .build-host && cd .build-host
|
||||
|
||||
../configure --prefix=$ROOT/$TOOLCHAIN \
|
||||
--enable-polly \
|
||||
--enable-optimized \
|
||||
--disable-profiling \
|
||||
--disable-assertions \
|
||||
--disable-expensive-checks \
|
||||
--disable-debug-runtime \
|
||||
--disable-debug-symbols \
|
||||
--enable-jit \
|
||||
--disable-docs \
|
||||
--disable-doxygen \
|
||||
--enable-threads \
|
||||
--enable-pthreads \
|
||||
--enable-pic \
|
||||
--enable-shared \
|
||||
--enable-embed-stdcxx \
|
||||
--enable-timestamps \
|
||||
--enable-targets=$ARCH \
|
||||
|
||||
make
|
||||
make install
|
36
packages/devel/llvm-host/meta
Normal file
36
packages/devel/llvm-host/meta
Normal file
@ -0,0 +1,36 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="llvm"
|
||||
PKG_VERSION=""
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://llvm.org/"
|
||||
PKG_URL=""
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="ccache"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/lang"
|
||||
PKG_SHORTDESC="llvm: Low Level Virtual Machine"
|
||||
PKG_LONGDESC="Low-Level Virtual Machine (LLVM) is a compiler infrastructure designed for compile-time, link-time, run-time, and "idle-time" optimization of programs from arbitrary programming languages. It currently supports compilation of C, Objective-C, and C++ programs, using front-ends derived from GCC 4.0, GCC 4.2, and a custom new front-end, "clang". It supports x86, x86-64, ia64, PowerPC, and SPARC, with support for Alpha and ARM under development."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
67
packages/devel/llvm/build
Executable file
67
packages/devel/llvm/build
Executable file
@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
# llvm fails to build with LTO support
|
||||
strip_lto
|
||||
|
||||
if [ "$TARGET_ARCH" = i386 ]; then
|
||||
ARCH=x86
|
||||
elif [ "$TARGET_ARCH" = x86_64 ]; then
|
||||
ARCH=x86_64
|
||||
fi
|
||||
|
||||
LLVM_DIR=`ls -d $BUILD/llvm-[0-9]*`
|
||||
|
||||
cd $LLVM_DIR
|
||||
|
||||
mkdir -p .build-target && cd .build-target
|
||||
|
||||
../configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--enable-polly \
|
||||
--enable-optimized \
|
||||
--disable-profiling \
|
||||
--disable-assertions \
|
||||
--disable-expensive-checks \
|
||||
--disable-debug-runtime \
|
||||
--disable-debug-symbols \
|
||||
--enable-jit \
|
||||
--disable-docs \
|
||||
--disable-doxygen \
|
||||
--enable-threads \
|
||||
--enable-pthreads \
|
||||
--enable-pic \
|
||||
--enable-shared \
|
||||
--enable-embed-stdcxx \
|
||||
--enable-timestamps \
|
||||
--enable-targets=$ARCH \
|
||||
|
||||
TBLGEN="$ROOT/$TOOLCHAIN/bin/tblgen" \
|
||||
TCLSH="$ROOT/$TOOLCHAIN/bin/tclsh" \
|
||||
make
|
||||
|
||||
TBLGEN="$ROOT/$TOOLCHAIN/bin/tblgen" \
|
||||
TCLSH="$ROOT/$TOOLCHAIN/bin/tclsh" \
|
||||
$MAKEINSTALL
|
27
packages/devel/llvm/install
Executable file
27
packages/devel/llvm/install
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
mkdir -p $INSTALL/usr/lib
|
||||
cp -P $PKG_BUILD/.build-target/Release/lib/libLLVM-*.so $INSTALL/usr/lib
|
||||
|
36
packages/devel/llvm/meta
Normal file
36
packages/devel/llvm/meta
Normal file
@ -0,0 +1,36 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="llvm"
|
||||
PKG_VERSION="2.9"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://llvm.org/"
|
||||
PKG_URL="http://llvm.org/releases/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tgz"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="toolchain llvm-host"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/lang"
|
||||
PKG_SHORTDESC="llvm: Low Level Virtual Machine"
|
||||
PKG_LONGDESC="Low-Level Virtual Machine (LLVM) is a compiler infrastructure designed for compile-time, link-time, run-time, and "idle-time" optimization of programs from arbitrary programming languages. It currently supports compilation of C, Objective-C, and C++ programs, using front-ends derived from GCC 4.0, GCC 4.2, and a custom new front-end, "clang". It supports x86, x86-64, ia64, PowerPC, and SPARC, with support for Alpha and ARM under development."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
105
packages/devel/llvm/patches/llvm-2.9-cross.patch
Normal file
105
packages/devel/llvm/patches/llvm-2.9-cross.patch
Normal file
@ -0,0 +1,105 @@
|
||||
diff -Naur llvm-2.9-old/autoconf/configure.ac llvm-2.9-new/autoconf/configure.ac
|
||||
--- llvm-2.9-old/autoconf/configure.ac 2011-03-25 00:56:32.000000000 -0700
|
||||
+++ llvm-2.9-new/autoconf/configure.ac 2011-05-05 13:33:38.000000000 -0700
|
||||
@@ -384,6 +384,10 @@
|
||||
AC_CHECK_PROG(BUILD_CXX, c++, c++, , , /usr/ucb/c++)
|
||||
fi
|
||||
fi
|
||||
+ AC_SUBST(BUILD_CPPFLAGS)
|
||||
+ AC_SUBST(BUILD_CFLAGS)
|
||||
+ AC_SUBST(BUILD_CXXFLAGS)
|
||||
+ AC_SUBST(BUILD_LDFLAGS)
|
||||
else
|
||||
AC_SUBST(LLVM_CROSS_COMPILING, [0])
|
||||
fi
|
||||
diff -Naur llvm-2.9-old/autoconf/m4/build_exeext.m4 llvm-2.9-new/autoconf/m4/build_exeext.m4
|
||||
--- llvm-2.9-old/autoconf/m4/build_exeext.m4 2008-09-26 10:27:58.000000000 -0700
|
||||
+++ llvm-2.9-new/autoconf/m4/build_exeext.m4 2011-05-05 12:29:10.000000000 -0700
|
||||
@@ -18,7 +18,7 @@
|
||||
fi
|
||||
fi
|
||||
test -z "$BUILD_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
||||
- ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
|
||||
+ ac_build_link='${BUILD_CC-cc} -o conftest $BUILD_CFLAGS $BUILD_CPPFLAGS $BUILD_LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
|
||||
rm -f conftest*
|
||||
echo 'int main () { return 0; }' > conftest.$ac_ext
|
||||
ac_cv_build_exeext=
|
||||
diff -Naur llvm-2.9-old/Makefile llvm-2.9-new/Makefile
|
||||
--- llvm-2.9-old/Makefile 2010-11-29 10:16:10.000000000 -0800
|
||||
+++ llvm-2.9-new/Makefile 2011-05-05 13:35:06.000000000 -0700
|
||||
@@ -104,37 +104,6 @@
|
||||
DIRS := $(filter-out unittests, $(DIRS))
|
||||
endif
|
||||
|
||||
-# If we're cross-compiling, build the build-hosted tools first
|
||||
-ifeq ($(LLVM_CROSS_COMPILING),1)
|
||||
-all:: cross-compile-build-tools
|
||||
-
|
||||
-clean::
|
||||
- $(Verb) rm -rf BuildTools
|
||||
-
|
||||
-cross-compile-build-tools:
|
||||
- $(Verb) if [ ! -f BuildTools/Makefile ]; then \
|
||||
- $(MKDIR) BuildTools; \
|
||||
- cd BuildTools ; \
|
||||
- unset CFLAGS ; \
|
||||
- unset CXXFLAGS ; \
|
||||
- $(PROJ_SRC_DIR)/configure --build=$(BUILD_TRIPLE) \
|
||||
- --host=$(BUILD_TRIPLE) --target=$(BUILD_TRIPLE); \
|
||||
- cd .. ; \
|
||||
- fi; \
|
||||
- (unset SDKROOT; \
|
||||
- $(MAKE) -C BuildTools \
|
||||
- BUILD_DIRS_ONLY=1 \
|
||||
- UNIVERSAL= \
|
||||
- ENABLE_OPTIMIZED=$(ENABLE_OPTIMIZED) \
|
||||
- ENABLE_PROFILING=$(ENABLE_PROFILING) \
|
||||
- ENABLE_COVERAGE=$(ENABLE_COVERAGE) \
|
||||
- DISABLE_ASSERTIONS=$(DISABLE_ASSERTIONS) \
|
||||
- ENABLE_EXPENSIVE_CHECKS=$(ENABLE_EXPENSIVE_CHECKS) \
|
||||
- CFLAGS= \
|
||||
- CXXFLAGS= \
|
||||
- ) || exit 1;
|
||||
-endif
|
||||
-
|
||||
# Include the main makefile machinery.
|
||||
include $(LLVM_SRC_ROOT)/Makefile.rules
|
||||
|
||||
diff -Naur llvm-2.9-old/Makefile.config.in llvm-2.9-new/Makefile.config.in
|
||||
--- llvm-2.9-old/Makefile.config.in 2010-12-28 19:59:14.000000000 -0800
|
||||
+++ llvm-2.9-new/Makefile.config.in 2011-05-05 12:25:34.000000000 -0700
|
||||
@@ -113,6 +113,10 @@
|
||||
# call if we're cross-compiling).
|
||||
BUILD_CC=@BUILD_CC@
|
||||
BUILD_CXX=@BUILD_CXX@
|
||||
+BUILD_CPPFLAGS=@BUILD_CPPFLAGS@
|
||||
+BUILD_CFLAGS=@BUILD_CFLAGS@
|
||||
+BUILD_CXXFLAGS=@BUILD_CXXFLAGS@
|
||||
+BUILD_LDFLAGS=@BUILD_LDFLAGS@
|
||||
|
||||
# Triple for configuring build tools when cross-compiling
|
||||
BUILD_TRIPLE=@build@
|
||||
diff -Naur llvm-2.9-old/Makefile.rules llvm-2.9-new/Makefile.rules
|
||||
--- llvm-2.9-old/Makefile.rules 2011-03-24 23:26:58.000000000 -0700
|
||||
+++ llvm-2.9-new/Makefile.rules 2011-05-05 12:24:42.000000000 -0700
|
||||
@@ -647,15 +647,15 @@
|
||||
$(CPP.BaseFlags)
|
||||
|
||||
ifeq ($(BUILD_COMPONENT), 1)
|
||||
- Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
|
||||
+ Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts) -c
|
||||
- Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
|
||||
+ Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(BUILD_CXXFLAGS) \
|
||||
$(CPPFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts) -c
|
||||
- Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
|
||||
+ Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(BUILD_CPPFLAGS) $(TargetCommonOpts) \
|
||||
$(CompileCommonOpts) $(CXX.Flags) -E
|
||||
- Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
|
||||
- $(LD.Flags) $(LDFLAGS) \
|
||||
+ Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(BUILD_CXXFLAGS) \
|
||||
+ $(LD.Flags) $(BUILD_LDFLAGS) \
|
||||
$(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
|
||||
else
|
||||
Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
|
Loading…
x
Reference in New Issue
Block a user