Getting a new gcc-wrapper on the way. After gnat-wrapper, I introduce
ghdl-wrapper. I made the gcc-4.3.4 expression allow the 'vhdl' language through ghdl. The ghdl developer recommends this gcc version; maybe it would work with gcc-4.4. If not this ghdl version, maybe next versions. svn path=/nixpkgs/branches/stdenv-updates/; revision=19071
This commit is contained in:
@@ -124,6 +124,8 @@ postInstall() {
|
||||
ln -sfn g++ $i
|
||||
fi
|
||||
done
|
||||
|
||||
eval "$postInstallGhdl"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ stdenv, fetchurl, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
|
||||
, langJava ? false
|
||||
, langVhdl ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
@@ -14,6 +15,7 @@
|
||||
, binutilsCross ? null
|
||||
, libcCross ? null
|
||||
, crossStageStatic ? true
|
||||
, gnat ? null
|
||||
}:
|
||||
|
||||
assert langTreelang -> bison != null && flex != null;
|
||||
@@ -22,6 +24,8 @@ assert cross != null -> profiledCompiler == false && enableMultilib == true;
|
||||
assert (cross != null && crossStageStatic) -> (langCC == false && langFortran
|
||||
== false && langTreelang == false);
|
||||
|
||||
assert langVhdl -> gnat != null;
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
@@ -46,6 +50,10 @@ let
|
||||
"-stage-final";
|
||||
crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
|
||||
|
||||
ghdlSrc = fetchurl {
|
||||
url = "http://ghdl.free.fr/ghdl-0.28.tar.bz2";
|
||||
sha256 = "0l3ah3zw2yhr9rv9d5ck1cinsf11r28m6bzl2sdibngl2bgc2jsf";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
@@ -75,7 +83,8 @@ stdenv.mkDerivation ({
|
||||
[./pass-cxxcpp.patch ./libmudflap-cpp.patch]
|
||||
++ optional noSysDirs ./no-sys-dirs.patch
|
||||
++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch
|
||||
++ optional langJava ./java-jvgenmain-link.patch;
|
||||
++ optional langJava ./java-jvgenmain-link.patch
|
||||
++ optional langVhdl ./ghdl-ortho-cflags.patch;
|
||||
|
||||
inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
|
||||
binutilsCross libcCross;
|
||||
@@ -86,6 +95,7 @@ stdenv.mkDerivation ({
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optional (boehmgc != null) boehmgc)
|
||||
++ (optionals (cross != null) [binutilsCross])
|
||||
++ (optionals (langVhdl != null) [gnat])
|
||||
;
|
||||
|
||||
configureFlags = "
|
||||
@@ -100,6 +110,7 @@ stdenv.mkDerivation ({
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langJava "java"
|
||||
++ optional langTreelang "treelang"
|
||||
++ optional langVhdl "vhdl"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -108,6 +119,23 @@ stdenv.mkDerivation ({
|
||||
";
|
||||
#Above I added a hack on making the build different than the host.
|
||||
|
||||
postUnpack = if langVhdl then ''
|
||||
tar xvf ${ghdlSrc}
|
||||
mv ghdl-*/vhdl gcc*/gcc
|
||||
rm -Rf ghdl-*
|
||||
'' else "";
|
||||
|
||||
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
|
||||
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
|
||||
# content of that .cf to that value. This way ghdl does not complain on
|
||||
# the installed object files from the basic libraries (ieee, ...)
|
||||
postInstallGhdl = if langVhdl then ''
|
||||
pushd $out
|
||||
find . -name "*.cf" -exec \
|
||||
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
|
||||
popd
|
||||
'' else "";
|
||||
|
||||
# Needed for the cross compilation to work
|
||||
AR = "ar";
|
||||
LD = "ld";
|
||||
|
||||
36
pkgs/development/compilers/gcc-4.3/ghdl-ortho-cflags.patch
Normal file
36
pkgs/development/compilers/gcc-4.3/ghdl-ortho-cflags.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
|
||||
index 8f481df..681ac59 100644
|
||||
--- a/gcc/vhdl/Make-lang.in
|
||||
+++ b/gcc/vhdl/Make-lang.in
|
||||
@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
|
||||
AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
|
||||
-I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
|
||||
-I$(AGCC_GCCSRC_DIR)/libcpp/include
|
||||
-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
|
||||
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS)
|
||||
|
||||
AGCC_LOCAL_OBJS=ortho-lang.o
|
||||
|
||||
@@ -140,7 +140,7 @@ ghdl$(exeext): force
|
||||
|
||||
# Ghdl libraries.
|
||||
ghdllib: ghdl$(exeext) $(GCC_PASSES) force
|
||||
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
|
||||
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
|
||||
|
||||
# Build hooks:
|
||||
|
||||
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
|
||||
index d754c6c..07abc4a 100644
|
||||
--- a/gcc/vhdl/Makefile.in
|
||||
+++ b/gcc/vhdl/Makefile.in
|
||||
@@ -80,7 +80,8 @@ T_CPPFLAGS =
|
||||
X_ADAFLAGS =
|
||||
T_ADAFLAGS =
|
||||
|
||||
-ADAC = $(CC)
|
||||
+# Never use the bootstrapped compiler, as it may not be built for ada
|
||||
+ADAC = gcc
|
||||
|
||||
ECHO = echo
|
||||
CHMOD = chmod
|
||||
Reference in New Issue
Block a user