--- clang-2.6.orig/debian/copyright +++ clang-2.6/debian/copyright @@ -0,0 +1,89 @@ +This package was debianized by Arthur Loiret on +Sun, 10 Nov 2007 12:32:05 +0200. + +It was downloaded from http://llvm.org/releases/download.html + + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + 14 rue de Plaisance, 75014 Paris, France + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2007 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== +Copyrights and Licenses for Third Party Software Distributed with LLVM: +============================================================================== +The LLVM software contains code written by third parties. Such software will +have its own individual LICENSE.TXT file in the directory in which it appears. +This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License +applies to all code in the LLVM Distribution, and nothing in any of the +other licenses gives permission to use the names of the LLVM Team or the +University of Illinois to endorse or promote products derived from this +Software. + +The following pieces of software have additional or alternate copyrights, +licenses, and/or restrictions: + +Program Directory +------- --------- +System Library llvm/lib/System +Compiler Driver llvm/tools/llvmc +Autoconf llvm/autoconf + llvm/projects/ModuleMaker/autoconf + llvm/projects/sample/autoconf + --- clang-2.6.orig/debian/logwatch.sh +++ clang-2.6/debian/logwatch.sh @@ -0,0 +1,104 @@ +#! /bin/sh + +# script to trick the build daemons and output something, if there is +# still test/build activity + +# $1: primary file to watch. if there is activity on this file, we do nothing +# $2+: files to watch to look for activity despite no output in $1 +# if the files are modified or are newly created, then the message +# is printed on stdout. +# if nothing is modified, don't output anything (so the buildd timeout +# hits). + +pidfile=logwatch.pid +timeout=3600 +message='\nlogwatch still running\n' + +usage() +{ + echo >&2 "usage: `basename $0` [-p ] [-t ] [-m ]" + echo >&2 " [ ...]" + exit 1 +} + +while [ $# -gt 0 ]; do + case $1 in + -p) + pidfile=$2 + shift + shift + ;; + -t) + timeout=$2 + shift + shift + ;; + -m) + message="$2" + shift + shift + ;; + -*) + usage + ;; + *) + break + esac +done + +[ $# -gt 0 ] || usage + +logfile="$1" +shift +otherlogs="$@" + +cleanup() +{ + rm -f $pidfile + exit 0 +} + +#trap cleanup 0 1 3 15 + +echo $$ > $pidfile + +update() +{ + _logvar=$1 + _othervar=$2 + + # logfile may not exist yet + if [ -r $logfile ]; then + _logtail="`tail -10 $logfile | md5sum` $f" + else + _logtail="does not exist: $logfile" + fi + eval $_logvar="'$_logtail'" + + _othertails='' + for f in $otherlogs; do + if [ -r $f ]; then + _othertails="$_othertails `tail -10 $f | md5sum` $f" + else + _othertails="$_othertails does not exist: $f" + fi + done + eval $_othervar="'$_othertails'" +} + +update logtail othertails +while true; do + sleep $timeout + update newlogtail newothertails + if [ "$logtail" != "$newlogtail" ]; then + # there is still action in the primary logfile. do nothing. + logtail="$newlogtail" + elif [ "$othertails" != "$newothertails" ]; then + # there is still action in the other log files, so print the message + /bin/echo -e $message + othertails="$newothertails" + else + # nothing changed in the other log files. maybe a timeout ... + : + fi +done --- clang-2.6.orig/debian/rules +++ clang-2.6/debian/rules @@ -0,0 +1,37 @@ +#!/usr/bin/make -f + +include debian/rules.d/vars.mk + +ifneq (,$(findstring llvm,$(PKGSOURCE))) + ifneq (,$(findstring llvm-gcc-,$(PKGSOURCE))) + gcc_version := $(shell echo $(PKGSOURCE) | cut -d'-' -f3) + endif + include debian/packages.d/$(PKGSOURCE).mk +else + tools := clang #vmkit + include debian/packages.d/tools.mk +endif + +patchdirs += $(D)/debian/patches +$(foreach build,$(builds),$(eval \ + $(build)_builddir ?= build-$(build))) +ifeq (,$(strip $(tarball))) + srcdir := . +else + ifeq (,$(strip $(srcdir))) + $(error undefined srcdir) + endif +endif + +include debian/rules.d/control.mk +include debian/rules.d/unpack.mk +include debian/rules.d/build.mk +include debian/rules.d/binary.mk + +clean: + $(RM) -r $(stampdir) $(foreach build,$(builds),$($(build)_builddir)) +ifneq (,$(strip $(tarball))) + $(RM) -r $(srcdir) +endif + +.PHONY: clean --- clang-2.6.orig/debian/compat +++ clang-2.6/debian/compat @@ -0,0 +1 @@ +6 --- clang-2.6.orig/debian/llvm.binfmt +++ clang-2.6/debian/llvm.binfmt @@ -0,0 +1,3 @@ +package llvm +interpreter /usr/bin/lli +magic llvc --- clang-2.6.orig/debian/control +++ clang-2.6/debian/control @@ -0,0 +1,54 @@ +Source: clang +Section: devel +Priority: optional +Maintainer: LLVM Packaging Team +Uploaders: Arthur Loiret , Pierre Habouzit +Build-Depends: debhelper (>= 6.0.0), flex, bison, dejagnu, tcl8.4, expect, + autoconf, automake1.9, perl, libtool, doxygen, chrpath, texinfo, + sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9), + ocaml-nox (>= 3.11.2), ocaml-best-compilers | ocaml-nox, dh-ocaml (>= 0.9.1), + lsb-release, llvm-dev (>= 2.6-6), llvm-source (>= 2.6-6) +Build-Conflicts: oprofile +Standards-Version: 3.8.4 +Homepage: http://www.llvm.org/ + +Package: clang +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: llvm-dev +Description: Low-Level Virtual Machine (LLVM), C language family frontend + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + Clang project is a new C, C++, Objective C and Objective C++ front-end + for the LLVM compiler. Some of its goals include the following: + . + End-User Features: + . + * Fast compiles and low memory use + * Expressive diagnostics (examples) + * GCC compatibility + . + Utility and Applications: + . + * Modular library based architecture + * Support diverse clients (refactoring, static analysis, code + generation, etc) + * Allow tight integration with IDEs + * Use the LLVM 'BSD' License + . + Internal Design and Implementation: + . + * A real-world, production quality compiler + * A simple and hackable code base + * A single unified parser for C, Objective C, C++, and Objective C++ + * Conformance with C/C++/ObjC and their variants + --- clang-2.6.orig/debian/changelog +++ clang-2.6/debian/changelog @@ -0,0 +1,25 @@ +clang (2.6-3) unstable; urgency=low + + * Merge from llvm 2.6-8. + * debian/patches/0002-Fix-utils.patch: Add, fix clang-cc's path. Thanks to + Christian Ohm for the patch! Closes: #571648. + * debian/debhelper.in/clang.install: Install sorttable.js and scanview.css + in /usr/lib/clang/1.0/utils/. + + -- Arthur Loiret Fri, 12 Mar 2010 10:17:03 +0000 + +clang (2.6-2) unstable; urgency=low + + * Merge from llvm 2.6-6: + - debian/debhelper.in/clang.install: Ship scan-build and ccc-analyzer. + Closes: 568499. + + -- Arthur Loiret Fri, 26 Feb 2010 11:02:51 +0000 + +clang (2.6-1) unstable; urgency=low + + * Initial release, based on llvm-2.6 packaging. Closes: #459325. + * Use for example `clang -emit-llvm -c file.c && llvm-ld file.o'. + + -- Arthur Loiret Sun, 06 Dec 2009 18:33:53 +0000 + --- clang-2.6.orig/debian/debhelper.in/libllvm-ocaml-dev.dirs +++ clang-2.6/debian/debhelper.in/libllvm-ocaml-dev.dirs @@ -0,0 +1 @@ +@OCAML_STDLIB_DIR@/METAS --- clang-2.6.orig/debian/debhelper.in/llvm-examples.links +++ clang-2.6/debian/debhelper.in/llvm-examples.links @@ -0,0 +1,3 @@ +@PF@/build/Makefile.common usr/share/doc/llvm-examples/Makefile.common +@PF@/build/Makefile.config usr/share/doc/llvm-examples/Makefile.config +@PF@/build/Makefile.rules usr/share/doc/llvm-examples/Makefile.rules --- clang-2.6.orig/debian/debhelper.in/llvm-examples.dirs +++ clang-2.6/debian/debhelper.in/llvm-examples.dirs @@ -0,0 +1 @@ +usr/share/doc/llvm-examples --- clang-2.6.orig/debian/debhelper.in/llvm-runtime.postinst +++ clang-2.6/debian/debhelper.in/llvm-runtime.postinst @@ -0,0 +1,9 @@ +#!/bin/sh -e + +if test "$1" = "configure"; then + if test -x /usr/sbin/update-binfmts; then + update-binfmts --import llvm.binfmt || true + fi +fi + +#DEBHELPER# --- clang-2.6.orig/debian/debhelper.in/llvm-runtime.links +++ clang-2.6/debian/debhelper.in/llvm-runtime.links @@ -0,0 +1 @@ +@PF@/bin/lli /usr/bin/lli --- clang-2.6.orig/debian/debhelper.in/llvm-snapshot.install +++ clang-2.6/debian/debhelper.in/llvm-snapshot.install @@ -0,0 +1,13 @@ +debian/@TMP@/@PF@/bin/* @PF@/bin/ +debian/@TMP@/@PF@/lib/* @PF@/lib/ +debian/@TMP@/@PF@/include/* @PF@/include/ + +debian/@TMP@/@PF@/docs/llvm/html usr/share/doc/llvm-snapshot/ +debian/@TMP@/@PF@/docs/llvm/ps usr/share/doc/llvm-snapshot/ + +@BUILD@/Makefile.common @PF@/build/ +@BUILD@/Makefile.config @PF@/build/ +@BUILD@/config.status @PF@/build/ +Makefile.rules @PF@/build/ +configure @PF@/build/ +autoconf/ @PF@/build/ --- clang-2.6.orig/debian/debhelper.in/llvm-dev.install +++ clang-2.6/debian/debhelper.in/llvm-dev.install @@ -0,0 +1,17 @@ +debian/@TMP@/@PF@/lib/* @PF@/lib/ +debian/@TMP@/@PF@/include/* usr/include/ + +@BUILD@/Makefile.common @PF@/build/ +@BUILD@/Makefile.config @PF@/build/ +@BUILD@/config.status @PF@/build/ +Makefile.rules @PF@/build/ +configure @PF@/build/ +autoconf/ @PF@/build/ + +utils/vim/llvm.vim usr/share/vim/vimcurrent/syntax +utils/vim/tablegen.vim usr/share/vim/vimcurrent/syntax + +utils/emacs/emacs.el usr/share/emacs/site-lisp/llvm/ +utils/emacs/llvm-mode.el usr/share/emacs/site-lisp/llvm/ +utils/emacs/tablegen-mode.el usr/share/emacs/site-lisp/llvm/ + --- clang-2.6.orig/debian/debhelper.in/llvm-dev.dirs +++ clang-2.6/debian/debhelper.in/llvm-dev.dirs @@ -0,0 +1,5 @@ +@PF@/lib +@PF@/build +usr/share/doc/llvm-dev +usr/share/vim/vimcurrent/syntax +usr/share/emacs/site-lisp/llvm --- clang-2.6.orig/debian/debhelper.in/clang.install +++ clang-2.6/debian/debhelper.in/clang.install @@ -0,0 +1,8 @@ +debian/@TMP@/@PF@/lib/clang @PF@/lib/ +debian/@TMP@/@PF@/bin/clang @PF@/bin/ +tools/clang/utils/scan-build @PF@/bin/ +tools/clang/utils/ccc-analyzer @PF@/bin/ +debian/@TMP@/@PF@/share/man/man1/clang.1 usr/share/man/man1/ + +tools/clang/utils/sorttable.js @PF@/lib/clang/1.0/utils/ +tools/clang/utils/scanview.css @PF@/lib/clang/1.0/utils/ --- clang-2.6.orig/debian/debhelper.in/libllvm-ocaml-dev.install +++ clang-2.6/debian/debhelper.in/libllvm-ocaml-dev.install @@ -0,0 +1,2 @@ +debian/@TMP@/@OCAML_STDLIB_DIR@/llvm @OCAML_STDLIB_DIR@/ +debian/@TMP@/@PF@/docs/llvm/ocamldoc/html usr/share/doc/libllvm-ocaml-dev/ --- clang-2.6.orig/debian/debhelper.in/llvm-runtime.prerm +++ clang-2.6/debian/debhelper.in/llvm-runtime.prerm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +if test "$1" = "remove"; then + if test -x /usr/sbin/update-binfmts; then + update-binfmts --package llvm \ + --remove llvm /usr/bin/lli || true + fi +fi + +#DEBHELPER# + --- clang-2.6.orig/debian/debhelper.in/libllvm-ocaml-dev.doc-base +++ clang-2.6/debian/debhelper.in/libllvm-ocaml-dev.doc-base @@ -0,0 +1,8 @@ +Document: libllvm-ocaml-dev-ocamldoc-api-reference +Title: Llvm OCamldoc API Reference +Abstract: API reference manual for libllvm-ocaml-dev (generated via OCamldoc) +Section: Programming/OCaml + +Format: HTML +Index: /usr/share/doc/libllvm-ocaml-dev/html/index.html +Files: /usr/share/doc/libllvm-ocaml-dev/html/* --- clang-2.6.orig/debian/debhelper.in/llvm-runtime.manpages +++ clang-2.6/debian/debhelper.in/llvm-runtime.manpages @@ -0,0 +1 @@ +debian/@TMP@/@PF@/share/man/man1/lli.* --- clang-2.6.orig/debian/debhelper.in/llvm-doc.dirs +++ clang-2.6/debian/debhelper.in/llvm-doc.dirs @@ -0,0 +1 @@ +usr/share/doc/llvm-doc --- clang-2.6.orig/debian/debhelper.in/llvm-examples.examples +++ clang-2.6/debian/debhelper.in/llvm-examples.examples @@ -0,0 +1 @@ +examples/* --- clang-2.6.orig/debian/debhelper.in/llvm.install +++ clang-2.6/debian/debhelper.in/llvm.install @@ -0,0 +1 @@ +debian/@TMP@/@PF@/bin/* @PF@/bin/ --- clang-2.6.orig/debian/debhelper.in/llvm.manpages +++ clang-2.6/debian/debhelper.in/llvm.manpages @@ -0,0 +1 @@ +debian/@TMP@/@PF@/share/man/man1/* --- clang-2.6.orig/debian/debhelper.in/llvm-runtime.install +++ clang-2.6/debian/debhelper.in/llvm-runtime.install @@ -0,0 +1,2 @@ +debian/@TMP@/@PF@/bin/lli @PF@/bin/ +debian/llvm.binfmt usr/share/binfmts/ --- clang-2.6.orig/debian/debhelper.in/clang.links +++ clang-2.6/debian/debhelper.in/clang.links @@ -0,0 +1,2 @@ +usr/share/man/man1/clang.1.gz usr/share/man/man1/llvm-clang.1.gz +@PF@/bin/clang @PF@/bin/llvm-clang --- clang-2.6.orig/debian/debhelper.in/libllvm-ocaml-dev.META +++ clang-2.6/debian/debhelper.in/libllvm-ocaml-dev.META @@ -0,0 +1,63 @@ +description = "Low Level Virtual Machine bindings" +version = "@UVERSION@" + +directory = "+llvm" + +archive(byte) = "llvm.cma" +archive(native) = "llvm.cmxa" +linkopts = "-cclib -lstdc++ -cclib -lllvm" + +package "executionengine" +( + requires = "llvm" + version = "@UVERSION@" + archive(native) = "llvm_executionengine.cmxa" + archive(byte) = "llvm_executionengine.cma" + linkopts = "-cclib -lllvm_executionengine" +) + +package "target" +( + requires = "llvm" + version = "@UVERSION@" + archive(native) = "llvm_target.cmxa" + archive(byte) = "llvm_target.cma" + linkopts = "-cclib -lllvm_target" +) + +package "scalar_opts" +( + requires = "llvm llvm.target" + version = "@UVERSION@" + archive(native) = "llvm_scalar_opts.cmxa" + archive(byte) = "llvm_scalar_opts.cma" + linkopts = "-cclib -lllvm_scalar_opts" +) + +package "analysis" +( + requires = "llvm" + version = "@UVERSION@" + archive(native) = "llvm_analysis.cmxa" + archive(byte) = "llvm_analysis.cma" + linkopts = "-cclib -lllvm_analysis" +) + +package "bitwriter" +( + requires = "llvm" + version = "@UVERSION@" + archive(native) = "llvm_bitwriter.cmxa" + archive(byte) = "llvm_bitwriter.cma" + linkopts = "-cclib -lllvm_bitwriter" +) + +package "bitreader" +( + requires = "llvm llvm.bitwriter" + version = "@UVERSION@" + archive(native) = "llvm_bitreader.cmxa" + archive(byte) = "llvm_bitreader.cma" + linkopts = "-cclib -lllvm_bitreader" +) + --- clang-2.6.orig/debian/debhelper.in/llvm.dirs +++ clang-2.6/debian/debhelper.in/llvm.dirs @@ -0,0 +1,6 @@ +@PF@/bin +usr/bin +usr/include +usr/share/man/man1 +etc/llvm +usr/share/binfmts --- clang-2.6.orig/debian/debhelper.in/llvm-gcc-4.2.install +++ clang-2.6/debian/debhelper.in/llvm-gcc-4.2.install @@ -0,0 +1 @@ +debian/@TMP@/@PF@ --- clang-2.6.orig/debian/debhelper.in/llvm-doc.install +++ clang-2.6/debian/debhelper.in/llvm-doc.install @@ -0,0 +1,2 @@ +debian/@TMP@/@PF@/docs/llvm/html usr/share/doc/llvm-doc/ +debian/@TMP@/@PF@/docs/llvm/ps usr/share/doc/llvm-doc/ --- clang-2.6.orig/debian/debhelper.in/llvm.links +++ clang-2.6/debian/debhelper.in/llvm.links @@ -0,0 +1 @@ +# AUTOGENERATED in debian/rules.d/build.mk. --- clang-2.6.orig/debian/control.in/llvm-doc +++ clang-2.6/debian/control.in/llvm-doc @@ -0,0 +1,18 @@ +Package: llvm-doc +Section: doc +Architecture: all +Depends: ${misc:Depends} +Description: Low-Level Virtual Machine (LLVM), documentation + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package contains all documentation (extensive). + --- clang-2.6.orig/debian/control.in/source +++ clang-2.6/debian/control.in/source @@ -0,0 +1,14 @@ +Source: @PKGSOURCE@ +Section: devel +Priority: optional +Maintainer: LLVM Packaging Team +Uploaders: Arthur Loiret , Pierre Habouzit +Build-Depends: debhelper (>= 6.0.0), flex, bison, dejagnu, tcl8.4, expect, + autoconf, automake1.9, perl, libtool, doxygen, chrpath, texinfo, + sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9), + ocaml-nox (>= 3.11.2), ocaml-best-compilers | ocaml-nox, dh-ocaml (>= 0.9.1), + lsb-release @BUILDDEPS@ +Build-Conflicts: oprofile +Standards-Version: 3.8.4 +Homepage: http://www.llvm.org/ + --- clang-2.6.orig/debian/control.in/llvm-dev +++ clang-2.6/debian/control.in/llvm-dev @@ -0,0 +1,21 @@ +Package: llvm-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, llvm (= ${binary:Version}) +Provides: llvm-libs +Conflicts: llvm-libs +Replaces: llvm-libs, llvm (<< 2.2-3) +Description: Low-Level Virtual Machine (LLVM), libraries and headers + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the libraries and headers to develop applications + using llvm. + --- clang-2.6.orig/debian/control.in/clang +++ clang-2.6/debian/control.in/clang @@ -0,0 +1,40 @@ +Package: clang +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: llvm-dev +Description: Low-Level Virtual Machine (LLVM), C language family frontend + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + Clang project is a new C, C++, Objective C and Objective C++ front-end + for the LLVM compiler. Some of its goals include the following: + . + End-User Features: + . + * Fast compiles and low memory use + * Expressive diagnostics (examples) + * GCC compatibility + . + Utility and Applications: + . + * Modular library based architecture + * Support diverse clients (refactoring, static analysis, code + generation, etc) + * Allow tight integration with IDEs + * Use the LLVM 'BSD' License + . + Internal Design and Implementation: + . + * A real-world, production quality compiler + * A simple and hackable code base + * A single unified parser for C, Objective C, C++, and Objective C++ + * Conformance with C/C++/ObjC and their variants + --- clang-2.6.orig/debian/control.in/llvm +++ clang-2.6/debian/control.in/llvm @@ -0,0 +1,28 @@ +Package: llvm +Architecture: any +Suggests: llvm-doc +Depends: llvm-runtime (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: llvm-dev +Description: Low-Level Virtual Machine (LLVM) + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + The strengths of the LLVM infrastructure are its extremely + simple design (which makes it easy to understand and use), + source-language independence, powerful mid-level optimizer, automated + compiler debugging support, extensibility, and its stability and + reliability. LLVM is currently being used to host a wide variety of + academic research projects and commercial projects. LLVM includes C + and C++ front-ends (based on GCC 4.0.1), a front-end for a Forth-like + language (Stacker), a young scheme front-end, and Java support is + in development. LLVM can generate code for X86, SparcV9, PowerPC, + or it can emit C code. + --- clang-2.6.orig/debian/control.in/llvm-gcc +++ clang-2.6/debian/control.in/llvm-gcc @@ -0,0 +1,22 @@ +Package: llvm-gcc-@GCC_VERSION@ +Architecture: i386 amd64 +Depends: llvm-dev (>= @UVERSION@), llvm (>= @UVERSION@), ${shlibs:Depends}, ${misc:Depends} +Provides: llvm-gcc, llvm-cfe +Suggests: gcc-@GCC_VERSION@-doc +Description: Low-Level Virtual Machine (LLVM), C/C++ front-end + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This is only a utility package that contains the C/C++ front-end + used by the compiler, and was created in order to reduce the overall + size of the compiler package itself. Please install the 'llvm' + package to install the actual compiler. + --- clang-2.6.orig/debian/control.in/llvm-source +++ clang-2.6/debian/control.in/llvm-source @@ -0,0 +1,17 @@ +Package: llvm-source +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Low-Level Virtual Machine (LLVM), source code + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package contains the llvm source code. + --- clang-2.6.orig/debian/control.in/libllvm-ocaml-dev +++ clang-2.6/debian/control.in/libllvm-ocaml-dev @@ -0,0 +1,20 @@ +Package: libllvm-ocaml-dev +Section: ocaml +Architecture: any +Suggests: llvm-doc +Depends: ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}, llvm-dev (= ${binary:Version}) +Provides: ${ocaml:Provides} +Description: Low-Level Virtual Machine (LLVM) bindings for OCaml + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the OCaml bindings to develop applications using llvm. + --- clang-2.6.orig/debian/control.in/llvm-runtime +++ clang-2.6/debian/control.in/llvm-runtime @@ -0,0 +1,20 @@ +Package: llvm-runtime +Architecture: any +Depends: binfmt-support, ${shlibs:Depends}, ${misc:Depends} +Conflicts: llvm (<< 2.6-7) +Replaces: llvm (<< 2.6-7) +Description: Low-Level Virtual Machine (LLVM), bytecode interpreter + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the minimal required to execute programs in LLVM + format. + --- clang-2.6.orig/debian/control.in/llvm-snapshot +++ clang-2.6/debian/control.in/llvm-snapshot @@ -0,0 +1,18 @@ +Package: llvm-snapshot +Architecture: any +Suggests: llvm-doc +Depends: binfmt-support, ${shlibs:Depends}, ${misc:Depends} +Description: a SNAPSHOT of the Low-Level Virtual Machine (LLVM) + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package is a SNAPSHOT taken from the upstream SVN. + --- clang-2.6.orig/debian/control.in/llvm-examples +++ clang-2.6/debian/control.in/llvm-examples @@ -0,0 +1,19 @@ +Package: llvm-examples +Section: doc +Architecture: all +Depends: ${misc:Depends}, llvm-dev (>= ${source:Version}), llvm-dev (<< ${source:Version}+c~) +Description: Low-Level Virtual Machine (LLVM), examples + The Low-Level Virtual Machine (LLVM) is a collection of libraries and + tools that make it easy to build compilers, optimizers, Just-In-Time + code generators, and many other compiler-related programs. LLVM + uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package contains examples for using LLVM, both in developing + extensions to LLVM and in using it to compile code. + --- clang-2.6.orig/debian/patches/0002-Fix-utils.patch +++ clang-2.6/debian/patches/0002-Fix-utils.patch @@ -0,0 +1,72 @@ +--- + ccc-analyzer | 2 +- + scan-build | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/tools/clang/utils/scan-build ++++ b/tools/clang/utils/scan-build +@@ -82,7 +82,7 @@ + ##----------------------------------------------------------------------------## + + # First, look for 'clang-cc' in libexec. +-my $ClangCCSB = Cwd::realpath("$RealBin/libexec/clang-cc"); ++my $ClangCCSB = Cwd::realpath("/usr/lib/clang/1.0/clang-cc"); + # Second, look for 'clang-cc' in the same directory as scan-build. + if (!defined $ClangCCSB || ! -x $ClangCCSB) { + $ClangCCSB = Cwd::realpath("$RealBin/clang-cc"); +@@ -98,7 +98,7 @@ + my $ClangCC = $ClangCCSB; + + # Now find 'clang' +-my $ClangSB = Cwd::realpath("$RealBin/bin/clang"); ++my $ClangSB = Cwd::realpath("/usr/bin/clang"); + if (!defined $ClangSB || ! -x $ClangSB) { + $ClangSB = Cwd::realpath("$RealBin/clang"); + } +@@ -423,7 +423,7 @@ + + my $Dir = shift; + +- my $JS = Cwd::realpath("$RealBin/sorttable.js"); ++ my $JS = Cwd::realpath("/usr/lib/clang/1.0/utils/sorttable.js"); + + DieDiag("Cannot find 'sorttable.js'.\n") + if (! -r $JS); +@@ -433,7 +433,7 @@ + DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n") + if (! -r "$Dir/sorttable.js"); + +- my $CSS = Cwd::realpath("$RealBin/scanview.css"); ++ my $CSS = Cwd::realpath("/usr/lib/clang/1.0/utils/scanview.css"); + + DieDiag("Cannot find 'scanview.css'.\n") + if (! -r $CSS); +@@ -1196,7 +1196,7 @@ + # Set the appropriate environment variables. + SetHtmlEnv(\@ARGV, $HtmlDir); + +-my $Cmd = Cwd::realpath("$RealBin/libexec/ccc-analyzer"); ++my $Cmd = Cwd::realpath("/usr/bin/ccc-analyzer"); + if (!defined $Cmd || ! -x $Cmd) { + $Cmd = Cwd::realpath("$RealBin/ccc-analyzer"); + DieDiag("Executable 'ccc-analyzer' does not exist at '$Cmd'\n") if(! -x $Cmd); +@@ -1271,7 +1271,7 @@ + if ($ViewResults and -r "$HtmlDir/index.html") { + Diag "Analysis run complete.\n"; + Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n"; +- my $ScanView = Cwd::realpath("$RealBin/scan-view"); ++ my $ScanView = Cwd::realpath("/usr/bin/scan-view"); + if (! -x $ScanView) { $ScanView = "scan-view"; } + exec $ScanView, "$HtmlDir"; + } +--- a/tools/clang/utils/ccc-analyzer ++++ b/tools/clang/utils/ccc-analyzer +@@ -395,7 +395,7 @@ + + # Determine what clang-cc executable to use. + my $ClangCC = $ENV{'CLANG_CC'}; +-if (!defined $ClangCC) { $ClangCC = 'clang-cc'; } ++if (!defined $ClangCC) { $ClangCC = '/usr/lib/clang/1.0/clang-cc'; } + + # Get the HTML output directory. + my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'}; --- clang-2.6.orig/debian/patches/0001-Fix-paths.patch +++ clang-2.6/debian/patches/0001-Fix-paths.patch @@ -0,0 +1,64 @@ +--- + tools/clang-cc/Makefile | 4 +++- + lib/Driver/ToolChains.cpp | 9 ++++++--- + tools/clang-cc/clang-cc.cpp | 5 +++++ + 3 files changed, 14 insertions(+), 4 deletions(-) + +--- a/tools/clang/tools/clang-cc/Makefile ++++ b/tools/clang/tools/clang-cc/Makefile +@@ -27,6 +27,8 @@ + + # clang-cc lives in a special location; we can get away with this + # because nothing else gets installed from here. +-PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/libexec ++#PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/libexec ++ ++PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/lib/clang/1.0 + + include $(LLVM_SRC_ROOT)/Makefile.rules +--- a/tools/clang/lib/Driver/ToolChains.cpp ++++ b/tools/clang/lib/Driver/ToolChains.cpp +@@ -311,8 +311,12 @@ + Generic_GCC::Generic_GCC(const HostInfo &Host, const llvm::Triple& Triple) + : ToolChain(Host, Triple) + { +- std::string Path(getHost().getDriver().Dir); +- Path += "/../libexec"; ++ std::string Path; ++ ++ Path = getHost().getDriver().Dir + "/../lib/clang/1.0"; ++ getProgramPaths().push_back(Path); ++ ++ Path = getHost().getDriver().Dir + "/../libexec"; + getProgramPaths().push_back(Path); + + getProgramPaths().push_back(getHost().getDriver().Dir); +@@ -495,7 +499,6 @@ + + Linux::Linux(const HostInfo &Host, const llvm::Triple& Triple) + : Generic_GCC(Host, Triple) { +- getFilePaths().push_back(getHost().getDriver().Dir + "/../lib/clang/1.0/"); + getFilePaths().push_back("/lib/"); + getFilePaths().push_back("/usr/lib/"); + +--- a/tools/clang/tools/clang-cc/clang-cc.cpp ++++ b/tools/clang/tools/clang-cc/clang-cc.cpp +@@ -1204,6 +1204,7 @@ + + Init.AddDefaultEnvVarPaths(Lang); + ++#if 0 + // Add the clang headers, which are relative to the clang binary. + llvm::sys::Path MainExecutablePath = + llvm::sys::Path::GetMainExecutable(Argv0, +@@ -1223,6 +1224,10 @@ + Init.AddPath(MainExecutablePath.c_str(), InitHeaderSearch::System, + false, false, false, true /*ignore sysroot*/); + } ++#else ++ Init.AddPath("/usr/lib/clang/1.0/include", InitHeaderSearch::System, ++ false, false, false, true /*ignore sysroot*/); ++#endif + + if (!nostdinc) + Init.AddDefaultSystemIncludePaths(Lang); --- clang-2.6.orig/debian/rules.d/control.mk +++ clang-2.6/debian/rules.d/control.mk @@ -0,0 +1,20 @@ +ifneq (,$(strip $(BUILDDEPS))) + BUILDDEPS :=, $(BUILDDEPS) +endif + +packages := $(foreach build,$(builds),$($(build)_packages)) +packages += $(extra_packages) + +debian/control: + @echo Regenerating control file... + sed -e "s/@PKGSOURCE@/$(PKGSOURCE)/g" \ + -e "s/ *@BUILDDEPS@/$(BUILDDEPS)/g" \ + -e "s/@UVERSION@/$(UVERSION)/g" \ + -e "s/@GCC_VERSION@/$(gcc_version)/g" \ + $@.in/source $(addprefix $@.in/,$(packages)) > $@ + +control: debian/control + +clean: control + +.PHONY: clean control debian/control --- clang-2.6.orig/debian/rules.d/vars.mk +++ clang-2.6/debian/rules.d/vars.mk @@ -0,0 +1,41 @@ +DISTRIBUTION := $(shell dpkg-parsechangelog | grep ^Distribution | sed -e 's/^Distribution: //') +PKGSOURCE := $(shell dpkg-parsechangelog | grep ^Source | sed -e 's/^Source: //') +VERSION := $(shell dpkg-parsechangelog | grep ^Version | sed -e 's/^Version: //') +UVERSION := $(shell echo $(VERSION) | cut -d'~' -f1 | cut -d'-' -f1) +OS := $(shell lsb_release -is) +PF := /usr/lib/llvm +D := $(CURDIR) + +# for llvm-gcc and tools +dev_version := $(UVERSION)-6 + +$(foreach var,$(shell dpkg-architecture | sed -e 's/=/?=/'),$(eval $(var))) + +stampdir := $(D)/debian/stamps +$(foreach target,control unpack patch configure build check install binary, \ + $(eval $(target)-stamp := $(stampdir)/$(target)-stamp)) + +packages_arch := $(strip $(shell dh_listpackages -a 2>/dev/null)) +packages_indep := $(strip $(shell dh_listpackages -i 2>/dev/null)) +packages_all := $(packages_arch) $(packages_indep) + +NJOBS := 1 +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +else + # disabled + ifeq (0,1) + NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1) + NJOBS := $(shell if test $(NCPUS) -gt 1; then echo `expr $(NCPUS) + 1`; \ + else echo $(NCPUS); fi) + endif +endif + +include /usr/share/ocaml/ocamlvars.mk + +# global shared confargs +confargs := \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --with-pic --enable-pic --enable-optimized --enable-libffi \ + --with-ocaml-libdir=$(OCAML_STDLIB_DIR)/llvm + --- clang-2.6.orig/debian/rules.d/binary.mk +++ clang-2.6/debian/rules.d/binary.mk @@ -0,0 +1,68 @@ +binary-indep binary-arch: $(build-stamp) $(install-stamp) +binary-arch: $(addprefix $(binary-stamp)-,$(packages_arch)) +binary-indep: $(addprefix $(binary-stamp)-,$(packages_indep)) +binary: binary-arch binary-indep + # TODO: list installed nowhere files + +$(foreach build,$(builds),$(foreach package,$($(build)_packages),$(eval \ +tmp-$(package) := tmp-$(build)))) + +$(foreach build,$(builds),$(foreach package,$($(build)_packages),$(eval \ +build-$(package) := $($(build)_builddir)))) + +debhelper-%: + $(foreach f,$(notdir $(wildcard $(D)/debian/debhelper.in/$*.*)),\ + sed -e "s;@PF@;$(PF);g" \ + -e "s;@TMP@;$(tmp-$*);g" \ + -e "s;@BUILD@;$(build-$*);g" \ + -e "s;@UVERSION@;$(UVERSION);g" \ + -e "s;@GCC_VERSION@;$(GCC_VERSION);g" \ + -e "s;@LLVM_VERSION@;$(LLVM_VERSION);g" \ + -e "s;@OCAML_STDLIB_DIR@;$(OCAML_STDLIB_DIR);g" \ + $(D)/debian/debhelper.in/$f > $(D)/debian/$f &&) : + +clean: clean-debhelper +clean-debhelper: clean-common + $(RM) $(addprefix debian/,$(notdir $(wildcard $(D)/debian/debhelper.in/*))) + +.PHONY: clean clean-debhelper + +$(foreach build,$(builds),$(foreach package,$($(build)_packages),$(eval \ +dependency-$(package): $(install-stamp)-$(build)))) + +$(foreach package,$(extra_packages),$(eval \ +dependency-$(package): $(patch-stamp))) + +$(binary-stamp)-%: dependency-% debhelper-% + @echo Building package: $* + dh_testdir + dh_testroot + dh_installchangelogs -p$* + dh_installdocs -p$* + dh_installexamples -p$* + dh_installman -p$* + dh_installmime -p$* + dh_installdirs -p$* + dh_install -p$* + for dir in lib libexec bin ; \ + do for i in $$(find $(D)/debian/$*/$(PF)/$$dir 2>/dev/null || echo -n) ; \ + do if objdump -p $$i 2>/dev/null | grep RPATH 2>&1 >/dev/null ; \ + then echo "Removing hardcoded path library from $$i" ; \ + chrpath -d $$i || true ; \ + fi ; \ + done ; \ + done + $(call $*_extra_binary) + dh_link -p$* + dh_strip -p$* + dh_compress -p$* + dh_fixperms -p$* + dh_installdeb -p$* + dh_shlibdeps -p$* + dh_ocaml -p$* + dh_gencontrol -p$* + dh_md5sums -p$* + dh_builddeb -p$* + touch $@ + +.PHONY: binary binary-arch binary-indep debhelper-% --- clang-2.6.orig/debian/rules.d/unpack.mk +++ clang-2.6/debian/rules.d/unpack.mk @@ -0,0 +1,50 @@ +unpack: $(unpack-stamp) +$(unpack-stamp): $(addprefix $(unpack-stamp)-,$(tarball)) + mkdir -p $(@D) + touch $@ + +$(unpack-stamp)-%: + test -d $(stampdir) || mkdir $(stampdir) + if ! test -z "$(tarball)" ; then \ + $(RM) -r $(srcdir) ; \ + case $(tarball) in \ + *.bz2) tar -x --bzip2 -f $(tarpath);; \ + *.gz) tar -x --gzip -f $(tarpath);; \ + *.lzma) lzcat $(tarpath) | tar -x -f -;; \ + *) false;; \ + esac ; \ + fi + $(call $(PKGSOURCE)_extra_unpack) + touch $@ + +patches := $(foreach patchdir,$(patchdirs),$(wildcard $(patchdir)/*.patch)) + +patches_rev := # nothing +$(foreach patch,$(patches),$(eval patches_rev := $(patch) $(patches_rev))) + +patch: $(patch-stamp) +$(patch-stamp): $(unpack-stamp) + test -d $(stampdir)/patches || mkdir -p $(stampdir)/patches + cd $(srcdir) && for patch in $(patches) ; do \ + if ! test -f $(stampdir)/patches/$$(echo $$patch | tr "/" "_") ; \ + then echo "Applying patch: $$patch" && patch -p1 < $$patch && \ + touch $(stampdir)/patches/$$(echo $$patch | tr "/" "_") ; \ + fi ; \ + done + touch $@ + +unpatch: + test -d $(stampdir)/patches || mkdir -p $(stampdir)/patches + test -z "$(tarball)" || (test -d $(srcdir) || mkdir $(srcdir)) + cd $(srcdir) && for patch in $(patches_rev) ; do \ + if test -f $(stampdir)/patches/$$(echo $$patch | tr "/" "_") ; \ + then echo "Reverting patch: $$patch" && patch -p1 -R < $$patch && \ + $(RM) $(stampdir)/patches/$$(echo $$patch | tr "/" "_") ; \ + fi ; \ + done + $(RM) -r $(stampdir)/patches + $(RM) $(patch-stamp) + +clean: unpatch + +.PHONY: clean unpack patch unpatch --- clang-2.6.orig/debian/rules.d/build.mk +++ clang-2.6/debian/rules.d/build.mk @@ -0,0 +1,63 @@ +configure: $(configure-stamp) +$(configure-stamp): $(addprefix $(configure-stamp)-,$(builds)) + touch $@ + +build: $(build-stamp) +$(build-stamp): $(addprefix $(build-stamp)-,$(builds)) + touch $@ + +check: $(check-stamp) +$(check-stamp): $(addprefix $(check-stamp)-,$(builds)) + touch $@ + +install: $(install-stamp) +$(install-stamp): $(addprefix $(install-stamp)-,$(builds)) + touch $@ + +clean: clean-common +clean-common: + dh_testdir + dh_testroot + dh_clean + $(RM) -r $(D)/debian/tmp-* + $(RM) $(D)/test/Bindings/Ocaml/*.cm[io] + $(RM) $(D)/debian/log-check-* $(D)/debian/logwatch-*.pid + $(RM) $(D)/log-* $(D)/missing + +.PHONY: configure build install check clean clean-common + +# GENERIC ------------------- +$(configure-stamp)-%: $(unpack-stamp) $(patch-stamp) + -mkdir -p $($*_builddir) 2>/dev/null + cd $($*_builddir) && \ + ../$(srcdir)/configure $($*_confargs) + $(call $*_extra_configure) + touch $@ +$(build-stamp)-%: $(configure-stamp)-% + $(MAKE) -j$(NJOBS) -C $($*_builddir) $($*_MAKEOPTS) + $(call $*_extra_build) + touch $@ +$(check-stamp)-%: $(build-stamp)-% + # TODO: fix logwatch script +# chmod +x $(D)/debian/logwatch.sh && \ +# (debian/logwatch.sh -t 900 -p $(D)/debian/logwatch-$*.pid \ +# -m '\ntestsuite still running ...\n' \ +# $($*_builddir)/test/testrun.log \ +# &) + if test "x$($*_check)" = "xyes" ; then \ + $(MAKE) -C $($*_builddir) $($*_MAKECHECKOPTS) check || true ; \ + fi + $(call $*_extra_check) + touch $@ +$(install-stamp)-%: $(build-stamp)-% $(check-stamp)-% + $(MAKE) -C $($*_builddir) $($*_MAKEOPTS) install DESTDIR=$(D)/debian/tmp-$* + # Fix links that point to install directory + find $(D)/debian/tmp-$* -type l | while read i ; \ + do \ + L=$$(readlink $$i) ; \ + L=$${L##$(D)/debian/tmp-$*} ; \ + ln -sf $$L $$i ; \ + done + $(call $*_extra_install) + touch $@ + --- clang-2.6.orig/debian/packages.d/llvm.mk +++ clang-2.6/debian/packages.d/llvm.mk @@ -0,0 +1,86 @@ +builds := llvm + +# packages which don't need the builds +extra_packages := llvm-source + +ifneq (,$(findstring $(DEB_HOST_GNU_CPU),ia64 mips mipsel)) + $(error unsupported processor) +endif + +llvm_packages := llvm llvm-runtime llvm-dev \ + libllvm-ocaml-dev llvm-doc llvm-examples + +llvm_confargs := $(confargs) \ + --prefix=$(PF) --disable-assertions + +llvm_MAKEOPTS := $(MAKEOPTS) \ + VERBOSE=1 OPTIMIZE_OPTION=" -O2" \ + DebianOpts="-DLLVM_DEBIAN_INFO='\" ($(OS) $(VERSION))\"'" + +# run testsuite +llvm_check := yes + +llvm_MAKECHECKOPTS := $(llvm_MAKEOPTS) \ + PATH="$(D)/build-llvm/Release-Asserts/bin:$(srcdir)/test/Scripts:/usr/bin:/bin" + +define llvm_extra_binary + if test "x$*" = "xllvm" ; then \ + find $(D)/debian/$* -type f -name "lli*" | xargs $(RM) ; \ + $(RM) $(D)/debian/$*.links ; \ + for i in $$(ls $(D)/debian/$*/$(PF)/bin); do \ + echo "$(PF)/bin/$$i usr/bin/$$i" >> $(D)/debian/$*.links ; \ + done ; \ + sed -r 's/^(my\s+\$$LLVM_SRC_ROOT\s+=\s+q)\{(.*)\}\;$$/\1\{$(subst /,\/,$(PF))\/build\}\;/' \ + -i $(D)/debian/$*/$(PF)/bin/llvm-config ; \ + sed -r 's/^(my\s+\$$LLVM_OBJ_ROOT\s+=\s+q)\{(.*)\}\;$$/\1\{$(subst /,\/,$(PF))\/build\}\;/' \ + -i $(D)/debian/$*/$(PF)/bin/llvm-config ; \ + if test "x$($*_check)" = "xyes" ; then \ + install -m 0644 $(D)/build-llvm/test/testrun.sum \ + $(D)/debian/$*/usr/share/doc/$*/ ; \ + echo >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "Compiler version: $(shell $(DEB_HOST_GNU_TYPE)-gcc -dumpversion) (GCC)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "Platform: $(DEB_HOST_GNU_TYPE)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "configure flags: $(llvm_confargs)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + gzip -9nf $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + fi ; \ + fi +endef + +define llvm-dev_extra_binary + if test "x$*" = "xllvm-dev" ; then\ + sed -r 's/^(LLVM_SRC_ROOT\s+\:\=\s+\$$\(shell cd).*\; \$$\(PWD\)\)$$/\1 $(subst /,\/,$(PF))\/build \; \$$\(PWD\)\)/' \ + -i $(D)/debian/$*/$(PF)/build/Makefile.config ; \ + sed -r 's/^(LLVM_OBJ_ROOT\s+\:\=\s+\$$\(shell cd).*\; \$$\(PWD\)\)$$/\1 $(subst /,\/,$(PF))\/build \; \$$\(PWD\)\)/' \ + -i $(D)/debian/$*/$(PF)/build/Makefile.config ; \ + sed -r "s/^(ac_pwd\=)'.*'$$/\1'$(subst /,\/,$(PF))\/build'/" \ + -i $(D)/debian/$*/$(PF)/build/config.status ; \ + chmod 644 $(D)/debian/$*/$(PF)/build/Makefile* ; \ + find $(D)/debian/$* -type f -name "LICENSE.TXT" | xargs $(RM) ; \ + cp $(D)/utils/vim/README $(D)/debian/$*/usr/share/doc/$*/README.vim ; \ + cp $(D)/utils/emacs/README $(D)/debian/$*/usr/share/doc/$*/README.emacs ; \ + sed -r 's/path-to-llvm\/utils\/emacs/\/usr\/share\/emacs\/site-lisp\/llvm/' \ + -i $(D)/debian/$*/usr/share/doc/$*/README.emacs ; \ + fi +endef + +define llvm-source_extra_binary + if test "x$*" = "xllvm-source" ; then \ + $(RM) -r $(D)/debian/$*/usr/src/llvm ; \ + mkdir -p $(D)/debian/$*/usr/src/llvm ; \ + cp -f ../$(PKGSOURCE)_$(UVERSION).orig.tar.gz \ + $(D)/debian/$*/usr/src/llvm/$(PKGSOURCE)-$(UVERSION).tar.gz ; \ + gunzip $(D)/debian/$*/usr/src/llvm/$(PKGSOURCE)-$(UVERSION).tar.gz ; \ + lzma $(D)/debian/$*/usr/src/llvm/$(PKGSOURCE)-$(UVERSION).tar ; \ + cp -r $(D)/debian/patches $(D)/debian/$*/usr/src/llvm/ ; \ + fi +endef + +define libllvm-ocaml-dev_extra_binary + if test "x$*" = "xlibllvm-ocaml-dev" ; then \ + cp $(D)/debian/$*.META $(D)/debian/$*/$(OCAML_STDLIB_DIR)/METAS/ ; \ + fi +endef + --- clang-2.6.orig/debian/packages.d/llvm-gcc-4.2.mk +++ clang-2.6/debian/packages.d/llvm-gcc-4.2.mk @@ -0,0 +1,31 @@ +builds := llvm-gcc + +BUILDDEPS := llvm-dev (>= $(dev_version)) + +llvm-gcc_packages := llvm-gcc + +llvm-gcc_confargs := $(confargs) \ + --prefix=$(PF)/gcc-$(gcc_version) --enable-llvm=$(PF) \ + --enable-languages=c,c++ --program-prefix=llvm- \ + --enable-threads --disable-nls --disable-shared \ + --disable-multilib + +check_archs := amd64 i386 +ifneq (,$(filter $(DEB_HOST_ARCH),$(check_archs))) + llvm-gcc_check := yes +endif + +tarpath := $(firstword $(wildcard $(D)/llvm-gcc-$(gcc_version)-$(UVERSION)*.tar.* \ + /usr/src/llvm/llvm-gcc-$(gcc_version)-$(UVERSION)*.tar.*)) +tarball := $(notdir $(tarpath)) +srcdir := $(subst -dfsg,,$(subst .tar$(suffix $(tarball)),,$(tarball))) + +define llvm-gcc-4.2_extra_binary + if test "x$*" = "xllvm-gcc-4.2" ; then \ + $(RM) $(D)/debian/$*.links ; \ + for i in $$(ls $(D)/debian/tmp-llvm-gcc/$(PF)/gcc-$(gcc_version)/bin); do \ + echo "$(PF)/gcc-$(gcc_version)/bin/$$i usr/bin/$$i" >> $(D)/debian/$*.links ; \ + done ; \ + fi +endef + --- clang-2.6.orig/debian/packages.d/tools.mk +++ clang-2.6/debian/packages.d/tools.mk @@ -0,0 +1,32 @@ +builds := $(PKGSOURCE) + +ifeq (,$(filter $(PKGSOURCE),$(tools))) + $(error unsupported tool) +endif + +BUILDDEPS := llvm-dev (>= $(dev_version)), llvm-source (>= $(dev_version)) +PF := /usr + +patchdirs := /usr/src/llvm/patches + +$(PKGSOURCE)_packages := $(PKGSOURCE) + +$(PKGSOURCE)_confargs := $(confargs) \ + --prefix=$(PF) --disable-assertions + +$(PKGSOURCE)_MAKEOPTS := $(MAKEOPTS) \ + VERBOSE=1 OPTIMIZE_OPTION=" -O2" \ + DebianOpts="-DLLVM_DEBIAN_INFO='\" ($(OS) $(VERSION))\"'" \ + ONLY_TOOLS="$(PKGSOURCE)" + +tarpath := $(firstword $(wildcard $(D)/llvm-$(UVERSION)*.tar.* \ + /usr/src/llvm/llvm-$(UVERSION)*.tar.*)) +tarball := $(notdir $(tarpath)) +srcdir := $(subst -dfsg,,$(subst .tar$(suffix $(tarball)),,$(tarball))) + +define $(PKGSOURCE)_extra_unpack + for tool in $(notdir $(wildcard $(D)/tools/*)) ; do \ + ln -sf $(D)/tools/$$tool $(D)/$(srcdir)/tools/$$tool ; \ + done +endef + --- clang-2.6.orig/debian/packages.d/llvm-snapshot.mk +++ clang-2.6/debian/packages.d/llvm-snapshot.mk @@ -0,0 +1,47 @@ +builds := llvm + +PF := /usr/lib/llvm-snapshot + +llvm_packages := llvm-snapshot + +llvm_confargs := $(confargs) \ + --prefix=$(PF) + +llvm_MAKEOPTS := $(MAKEOPTS) \ + VERBOSE=1 OPTIMIZE_OPTION=" -O2" \ + DebianOpts="-DLLVM_DEBIAN_INFO='\" ($(OS) $(VERSION))\"'" + +# run testsuite +llvm_check := yes + +llvm_MAKECHECKOPTS := $(llvm_MAKEOPTS) \ + PATH="$(D)/build-llvm/Release/bin:$(srcdir)/test/Scripts:/usr/bin:/bin" + +define llvm-snapshot_extra_binary + if test "x$*" = "xllvm-snapshot" ; then \ + sed -r 's/^(my\s+\$$LLVM_SRC_ROOT\s+=\s+q)\{(.*)\}\;$$/\1\{$(subst /,\/,$(PF))\/build\}\;/' \ + -i $(D)/debian/$*/$(PF)/bin/llvm-config ; \ + sed -r 's/^(my\s+\$$LLVM_OBJ_ROOT\s+=\s+q)\{(.*)\}\;$$/\1\{$(subst /,\/,$(PF))\/build\}\;/' \ + -i $(D)/debian/$*/$(PF)/bin/llvm-config ; \ + sed -r 's/^(LLVM_SRC_ROOT\s+\:\=\s+\$$\(shell cd).*\; \$$\(PWD\)\)$$/\1 $(subst /,\/,$(PF))\/build \; \$$\(PWD\)\)/' \ + -i $(D)/debian/$*/$(PF)/build/Makefile.config ; \ + sed -r 's/^(LLVM_OBJ_ROOT\s+\:\=\s+\$$\(shell cd).*\; \$$\(PWD\)\)$$/\1 $(subst /,\/,$(PF))\/build \; \$$\(PWD\)\)/' \ + -i $(D)/debian/$*/$(PF)/build/Makefile.config ; \ + sed -r "s/^(ac_pwd\=)'.*'$$/\1'$(subst /,\/,$(PF))\/build'/" \ + -i $(D)/debian/$*/$(PF)/build/config.status ; \ + find $(D)/debian/$* -type f -name "LICENSE.TXT" | xargs $(RM) ; \ + if test "x$($*_check)" = "xyes" ; then \ + install -m 0644 $(D)/build-llvm/test/testrun.sum \ + $(D)/debian/$*/usr/share/doc/$*/ ; \ + echo >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "Compiler version: $(shell $(DEB_HOST_GNU_TYPE)-gcc -dumpversion) (GCC)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "Platform: $(DEB_HOST_GNU_TYPE)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + echo "configure flags: $(llvm_confargs)" \ + >> $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + gzip -9nf $(D)/debian/$*/usr/share/doc/$*/testrun.sum ; \ + fi ; \ + fi +endef +