clang: Add clang 3.4 recipe

This commit is contained in:
Alexander von Gluck IV
2014-01-23 21:06:06 +00:00
parent 7198c516fd
commit 0c9343db65
2 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
SUMMARY="A llvm front end compiler for C and C++"
DESCRIPTION="
Clang is an 'LLVM native' C/C++/Objective-C compiler, which aims to deliver \
amazingly fast compiles (e.g. about 3x faster than GCC when compiling \
Objective-C code in a debug configuration), extremely useful error and warning \
messages and to provide a platform for building great source level tools.
"
HOMEPAGE="http://www.llvm.org/"
LICENSE="UIUC"
COPYRIGHT="2003-2012 University of Illinois at Urbana-Champaign"
SRC_URI="http://llvm.org/releases/${portVersion}/llvm-${portVersion}.src.tar.gz"
CHECKSUM_MD5="46ed668a1ce38985120dbf6344cf6116"
SRC_URI_2="http://llvm.org/releases/${portVersion}/clang-${portVersion}.src.tar.gz"
CHECKSUM_MD5_2="b378f1e2c424e03289effc75268d3d2c"
REVISION="1"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
clang$secondaryArchSuffix = $portVersion
cmd:clang = $portVersion
cmd:clang++ = $portVersion
cmd:c_index_test = $portVersion
lib:libLTO = $portVersion
lib:libclang = $portVersion
lib:libprofile_rt = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:groff
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:make
cmd:python
cmd:sed
"
SOURCE_DIR="llvm-${portVersion}"
PATCHES="clang-${portVersion}.patchset"
BUILD()
{
mkdir -p tools/clang
cp -rd $sourceDir2/clang-${portVersion}/* tools/clang/
#cp -r /boot/system/data/libtool/config/. autoconf/
#cp -r /boot/system/data/libtool/config/. projects/sample/autoconf/
# Fix improper env paths
find . -type f -exec sed -i 's/\/usr\/bin\/env/\/bin\/env/g' "{}" \;
# Haiku C++ requires rtti in a lot of central system components
# such as Mesa
export REQUIRES_RTTI=1
# TODO: clang's build system seems to ignore doc / man / shared dirs?
runConfigure ./configure --enable-optimized
make $jobArgs
}
INSTALL()
{
mkdir -p $developDir
mkdir -p $docDir
make install-clang
# devel package
packageEntries devel \
$developDir
}
TEST()
{
make check
}
# ----- devel package -------------------------------------------------------
PROVIDES_devel="
clang${secondaryArchSuffix}_devel = $portVersion
"
REQUIRES_devel="
clang$secondaryArchSuffix == $portVersion base
"

View File

@@ -0,0 +1,25 @@
From 744634aa845c403f5a39b8257bbacd36dc1dd351 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Wed, 22 Jan 2014 05:04:31 +0000
Subject: [PATCH] haiku: fix Host.h for endian.h
---
include/llvm/Support/Host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h
index 28c4cc7..ab985a4 100644
--- a/include/llvm/Support/Host.h
+++ b/include/llvm/Support/Host.h
@@ -16,7 +16,7 @@
#include "llvm/ADT/StringMap.h"
-#if defined(__linux__) || defined(__GNU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
#include <endian.h>
#else
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
--
1.8.3.4