21
21
22
22
cd $BUILD_DIR /$dir_name
23
23
24
- MAKEFILE_CONF_GHDL=
25
- GHDL_LDLIBS=
26
- if [ $COMPILE_GHDL == " 1" ]
27
- then
28
- patch < $WORK_DIR /scripts/yosys_ghdl.diff
29
-
30
- mkdir -p frontends/ghdl
31
- cp -R ../$dir_name_gyp /src/* frontends/ghdl
32
- MAKEFILE_CONF_GHDL=$' ENABLE_GHDL := 1\n '
33
- MAKEFILE_CONF_GHDL+=" GHDL_DIR := $PACKAGE_DIR /$NAME "
34
-
35
- if [ $ARCH == " darwin" ]; then
36
- GHDL_LDLIBS=" $PACKAGE_DIR /$NAME /lib/libghdl.a $( tr -s ' \n' ' ' < $PACKAGE_DIR /$NAME /lib/libghdl.link) "
37
- elif [ ${ARCH: 0: 7} == " windows" ]; then
38
- GHDL_LDLIBS=" $( cygpath -m -a $PACKAGE_DIR /$NAME /lib/libghdl.a) $( cat $PACKAGE_DIR /$NAME /lib/libghdl.link | tr -s ' \n' ' ' | tr -s ' \\' ' /' ) "
39
- else
40
- GHDL_LDLIBS=" $PACKAGE_DIR /$NAME /lib/libghdl.a $( tr -s ' \n' ' ' < $PACKAGE_DIR /$NAME /lib/libghdl.link) "
24
+ patch < $WORK_DIR /scripts/yosys.diff
25
+
26
+ setup_ghdl-yosys-plugin () {
27
+ if [ $COMPILE_GHDL == " 1" ]
28
+ then
29
+ mkdir -p frontends/ghdl
30
+ cp -R ../$dir_name_gyp /src/* frontends/ghdl
31
+
32
+ echo ' ENABLE_GHDL := 1' >> Makefile.conf
33
+ echo " GHDL_DIR := $PACKAGE_DIR /$NAME " >> Makefile.conf
34
+ echo " GHDL_PREFIX := $PACKAGE_DIR /$NAME " >> Makefile.conf
41
35
fi
42
- fi
36
+ }
43
37
44
38
# -- Compile it
45
39
if [ $ARCH == " darwin" ]; then
46
40
OLDPATH=$PATH
47
41
export PATH=" /usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH "
48
42
$MAKE config-clang
49
- echo " $MAKEFILE_CONF_GHDL " >> Makefile.conf
43
+ setup_ghdl-yosys-plugin
50
44
gsed -r -i ' s/^(YOSYS_VER := [0-9]+\.[0-9]+\+[0-9]+).*$/\1 \(open-tool-forge build\)/;' Makefile
51
45
sed -i " " " s/-Wall -Wextra -ggdb/-w/;" Makefile
52
46
CXXFLAGS=" -std=c++11 $CXXFLAGS " make \
53
47
-j$J GIT_REV=" ${GIT_REV} " PRETTY=0 \
54
- LDLIBS=" -lm $GHDL_LDLIBS " \
48
+ LDLIBS=" -lm" \
55
49
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 ENABLE_ZLIB=0 ENABLE_ABC=1 \
56
50
ABCMKARGS=" CC=\" $CC \" CXX=\" $CXX \" OPTFLAGS=\" -O\" \
57
51
ARCHFLAGS=\" $ABC_ARCHFLAGS \" ABC_USE_NO_READLINE=1"
58
52
59
53
export PATH=$OLDPATH
60
54
elif [ ${ARCH: 0: 7} == " windows" ]; then
61
55
$MAKE config-msys2-64
62
- echo " $MAKEFILE_CONF_GHDL " >> Makefile.conf
56
+ setup_ghdl-yosys-plugin
63
57
sed -r -i ' s/^(YOSYS_VER := [0-9]+\.[0-9]+\+[0-9]+).*$/\1 \(open-tool-forge build\)/;' Makefile
64
58
$MAKE -j$J GIT_REV=" ${GIT_REV} " PRETTY=0 \
65
- LDLIBS=" -static -lstdc++ -lm $GHDL_LDLIBS " \
59
+ LDLIBS=" -static -lstdc++ -lm" \
66
60
ABCMKARGS=" CC=\" $CC \" CXX=\" $CXX \" LIBS=\" -static -lm\" OPTFLAGS=\" -O\" \
67
61
ARCHFLAGS=\" $ABC_ARCHFLAGS \" \
68
62
ABC_USE_NO_READLINE=1 \
@@ -74,14 +68,14 @@ elif [ ${ARCH:0:7} == "windows" ]; then
74
68
test_bin yosys-smtbmc$EXE
75
69
else
76
70
$MAKE config-gcc
77
- echo " $MAKEFILE_CONF_GHDL " >> Makefile.conf
71
+ setup_ghdl-yosys-plugin
78
72
sed -i " s/-Wall -Wextra -ggdb/-w/;" Makefile
79
73
sed -r -i ' s/^(YOSYS_VER := [0-9]+\.[0-9]+\+[0-9]+).*$/\1 \(open-tool-forge build\)/;' Makefile
80
74
# sed -i "s/LD = gcc$/LD = $CC/;" Makefile
81
75
# sed -i "s/CXX = gcc$/CXX = $CC/;" Makefile
82
76
# sed -i "s/LDFLAGS += -rdynamic/LDFLAGS +=/;" Makefile
83
77
$MAKE -j$J GIT_REV=" ${GIT_REV} " PRETTY=0 \
84
- LDLIBS=" -static -lstdc++ -lm $GHDL_LDLIBS -ldl" \
78
+ LDLIBS=" -static -lstdc++ -lm -ldl" \
85
79
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 ENABLE_ZLIB=0 ENABLE_ABC=1 \
86
80
ABCMKARGS=" CC=\" $CC \" CXX=\" $CXX \" LIBS=\" -static -lm -ldl -pthread\" \
87
81
OPTFLAGS=\" -O\" \
0 commit comments