Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pbc,gmp and add readline #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
samples/node_modules
truebit-os

.*
!/.gitignore
4 changes: 2 additions & 2 deletions gmp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ cd gmp-6.1.2

sed -i '2igmp_asm_syntax_testing=no' configure

emconfigure ./configure --disable-assembly --disable-shared --prefix=$EMSCRIPTEN/system
emconfigure ./configure --disable-assembly --disable-shared --prefix=$EMSCRIPTEN/system --enable-cxx --host none

echo '#define HAVE_MEMSET 1' >> config.h
echo '#define HAVE_STRNLEN 1' >> config.h
echo '#define HAVE_VSNPRINTF 1' >> config.h

make -j 12
emmake make
make install

cd ..
Expand Down
9 changes: 9 additions & 0 deletions libntl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
wget http://www.shoup.net/ntl/ntl-10.5.0.tar.gz
tar xf ntl-10.5.0.tar.gz
cd ntl-10.5.0
cd src
emconfigure ./configure DEF_PREFIX=${HOME}/opt NTL_GMP_LIP=on
patch < makefile.ntl.patch
make -j 6
make install
2 changes: 1 addition & 1 deletion libpbc-configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AC_CONFIG_SRCDIR([./])
LT_INIT
#AC_CANONICAL_HOST

CFLAGS=
CFLAGS+="$CFLAGS"
default_fink_path=/sw
case $host_os in
darwin*)
Expand Down
6 changes: 3 additions & 3 deletions libpbc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz
tar xf pbc-0.5.14.tar.gz
cd pbc-0.5.14

CFLAGS="-L/usr/lib/ -L/usr/include/"
cp ../libpbc-configure.ac configure.ac
automake
autoconf
emconfigure ./configure --prefix=$EMSCRIPTEN/system --disable-shared
emmake make -j 12
emconfigure ./configure --prefix=$EMSCRIPTEN/system --disable-sharedi --host none
emmake make
emmake make install

cd ..
Expand Down
45 changes: 45 additions & 0 deletions makefile.ntl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
10c10,12
< CXX=g++
---
> CXX=em++
> CXXCC=g++
> GMPTARGET=$(HOME)/opt
14c16
< CXXFLAGS=-g -O2
---
> CXXFLAGS=-g -O2
18a21,22
> NTL_LONG_LONG_TYPE = unsigned long long
> NTL_ULONG_TO_LONG = unsigned long long
20,21c24
<
< AR=ar
---
> AR=emar
46c49
< DEF_PREFIX=/home/sme001/opt
---
> DEF_PREFIX=$(HOME)/opt
120c123
< WIZARD=on
---
> WIZARD=off
309,310c312,315
< $(COMPILE) MakeDescAux.cpp
< $(LINK) -o MakeDesc MakeDesc.cpp MakeDescAux.o $(LDLIBS)
---
> # $(COMPILE) MakeDescAux.cpp
> # $(LINK) -o MakeDesc MakeDesc.cpp MakeDescAux.o $(LDLIBS)
> $(CXCC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c MakeDescAux.cpp
> $(CXCC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o MakeDesc MakeDesc.cpp MakeDescAux.o $(LDLIBS)
319c324,325
< sh MakeGetTime "$(LINK)" "$(LDLIBS)"
---
> # sh MakeGetTime "$(LINK)" "$(LDLIBS)"
> sh MakeGetTime "g++ $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)" "$(LDLIBS)"
333c339,341
< $(LINK) $(GMP_OPT_INCDIR) -o gen_gmp_aux gen_gmp_aux.cpp $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS)
---
> # $(LINK) $(GMP_OPT_INCDIR) -o gen_gmp_aux gen_gmp_aux.cpp $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS)
> # ./gen_lip_gmp_aux > lip_gmp_aux_impl.h
> $(CXXCC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -I$(HOME)/opt/include -o gen_gmp_aux gen_gmp_aux.cpp -L/usr/lib/x86_64-linux-gnu/ $(GMP_OPT_LIB) $(LDLIBS)
15 changes: 10 additions & 5 deletions openssl.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh
#!/bin/bash

wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
tar xf openssl-1.1.0h.tar.gz
cd openssl-1.1.0h
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar xf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g

emconfigure ./Configure linux-generic64 --prefix=$EMSCRIPTEN/system
bash_cv_wcwidth_broken=no
bash_cv_signal_vintage=posix
ac_cv_lib_util_openpty=no
ac_cv_lib_dir_opendir=no

emconfigure ./Configure linux-generic64 --prefix=$EMSCRIPTEN/system no-threads no-shared

sed -i 's|^CROSS_COMPILE.*$|CROSS_COMPILE=|g' Makefile

Expand Down
21 changes: 21 additions & 0 deletions readline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
wget ftp://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz
tar xvf readline-8.0.tar.gz
cd readline-8.0

bash_cv_wcwidth_broken=no
bash_cv_signal_vintage=posix
ac_cv_lib_util_openpty=no
ac_cv_lib_dir_opendir=no

emconfigure ./configure --host none --prefix==$EMSCRIPTEN/system --disable-shared

echo '#define HAVE_MEMSET 1' >> config.h
echo '#define HAVE_STRNLEN 1' >> config.h
echo '#define HAVE_VSNPRINTF 1' >> config.h

emmake make
make install

cd ..
rm -rf readline-8.0