Adjust the compiler wrapper script to use pkgsrc's clang for CCVER=clang.
authorSascha Wildner <saw@online.de>
Tue, 23 Feb 2010 15:09:06 +0000 (16:09 +0100)
committerSascha Wildner <saw@online.de>
Tue, 23 Feb 2010 15:09:06 +0000 (16:09 +0100)
* Move the definitions for the SVN version to 'clangsvn'.

* Expand the compilers.conf(5) manual page a bit and give more (better)
  examples.

Thanks to Jim Chapman <cchapman8@cogeco.ca> for help with testing.

etc/defaults/compilers.conf
libexec/customcc/cc.sh
share/man/man5/compilers.conf.5

index 4501f7e..54cc1ad 100644 (file)
@@ -1,4 +1,11 @@
 # clang from SVN trunk
-clang_CC=/usr/local/bin/clang
+#
+clangsvn_CC=/usr/local/bin/clang
+clangsvn_CFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu89"
+clangsvn_VERSION=4.1.2
+
+# clang from pkgsrc
+#
+clang_CC=/usr/pkg/bin/clang
 clang_CFLAGS="-fno-color-diagnostics -Qunused-arguments -std=gnu89"
 clang_VERSION=4.1.2
index ac0daec..1829f56 100644 (file)
@@ -3,19 +3,27 @@
 CDIR=$(dirname $0)
 CNAME=$(basename $0)
 
-# XXX clang is called only for "cc" and "gcc" for now
+# XXX clang needs some special handling
+#
+# it is called only for "cc" and "gcc" and even then it could have been
+# run on c++ files
 #
 if [ "${CCVER}" = "clang" ]; then
        if [ "${CNAME}" = "cpp" ]; then
                exec ${CDIR}/../gcc41/cpp "$@"
        elif [ "${CNAME}" = "c++" -o "${CNAME}" = "g++" ]; then
                exec ${CDIR}/../gcc41/c++ "$@"
-       else
+       elif [ -z $beenhere ]; then
+               export beenhere=1
+               oldargs="$@"
+               export oldargs
                INCOPT="-nobuiltininc -nostdinc \
                    -isysroot @@INCPREFIX@@ \
                    -isystem /usr/include \
                    -isystem /usr/libdata/gcc41 \
                    -isystem /usr/include/c++/4.1"
+       elif [ "${CNAME}" = "cc" -o "${CNAME}" = "gcc" ]; then
+               exec ${CDIR}/../gcc41/cc $oldargs
        fi
 fi
 
index 84da401..4fa7167 100644 (file)
@@ -29,7 +29,7 @@
 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 11, 2009
+.Dd February 23, 2010
 .Os
 .Dt COMPILERS.CONF 5
 .Sh NAME
@@ -88,14 +88,26 @@ with
 .Pp
 Once configured the compiler can then be used like this:
 .Bd -literal -offset indent
-[build and install clang]
+env CCVER=clang make
+.Ed
+.Pp
+To build world and kernel, use the following instructions:
+.Bd -literal -offset indent
 cd /usr/src
-env WORLD_CCVER=clang make buildworld
+fetch http://leaf.dragonflybsd.org/~swildner/world_clang.diff
+patch -p1 <world_clang.diff
+env WORLD_CCVER=clang make -DNO_GCC44 buildworld
+env WORLD_CCVER=clang make buildkernel KERNCONF=MYCONF
 .Ed
 .Pp
 Currently, defaults are provided for
 .Nm clang
-(installed from SVN trunk).
+(installed from pkgsrc's
+.Pa lang/clang )
+and
+.Nm clangsvn
+(installed from SVN trunk as described in
+.Pa http://clang.llvm.org/get_started.html ) .
 .Sh FILES
 .Bl -tag -width ".Pa /etc/compilers.conf" -compact
 .It Pa /etc/compilers.conf