Skip to content

Commit

Permalink
Build adjustments for Peepcoin-QT/Peepcoind - All OS
Browse files Browse the repository at this point in the history
Build adjustments for Peepcoin-QT/Peepcoind - All OS
  • Loading branch information
lyricidal committed May 30, 2018
1 parent 9c53126 commit 1c82f21
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 183 deletions.
25 changes: 15 additions & 10 deletions Peepcoin-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,26 @@ lessThan(QT_MAJOR_VERSION, 5): win32: QMAKE_LFLAGS *= -static
# use: qmake "USE_LITESTAKE=1"
# This feature implements a delay between hashing so the CPU usage is reduced.
# Checkout HyperStake - Project for more details
contains(USE_LITESTAKE,1){
message(Building with Litestake feature)
DEFINES += USE_LITESTAKE
}else{
# use: qmake "USE_LITESTAKE=1"
# This feature implements a delay between hashing so the CPU usage is reduced.
# Checkout HyperStake - Project for more details
contains(USE_LITESTAKE,0){
message(Building without Litestake feature)
}else{
message(Building with Litestake feature)
DEFINES += USE_LITESTAKE
}
contains(USE_GUITESTING,1){
message(Building beta GUI elements)
contains(USE_GUITESTING,0){
message(Building without GUI elements)
}else{
message(Building with GUI elements)
DEFINES += USE_GUITESTING
}
contains(USE_STAKECOMBINATION,1){
message(Building with Stakecombination feature)
DEFINES += USE_STAKECOMBINATION
contains(USE_STAKECOMBINATION,0){
message(Building without Stakecombination feature)
}else{
message(Building without Stakecombination feautre)
message(Building with Stakecombination feautre)
DEFINES += USE_STAKECOMBINATION
}
# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
Expand Down
174 changes: 35 additions & 139 deletions doc/build-msw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ software written by Thomas Bernard.
See readme-qt.rst for instructions on building Peepcoin QT, the
graphical user interface.

Dependencies
------------
Libraries you need to download separately and build:

default path download
OpenSSL C:\deps\openssl-1.0.2n http://www.openssl.org/source/
Berkeley DB C:\deps\db-4.8.30.NC http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost C:\deps\boost-1.64.0 http://www.boost.org/users/download/
miniupnpc C:\deps\miniupnpc http://miniupnp.tuxfamily.org/files/

Their licenses:
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
miniupnpc New (3-clause) BSD license

Versions used in this release:
OpenSSL 1.0.2n
Berkeley DB 4.8.30.NC
Boost 1.64.0
miniupnpc 1.6

WINDOWS BUILD NOTES
===================
# PeepCoin-TheCoinForThePeople
Expand All @@ -26,7 +48,6 @@ Virtual Box + Win10 Eval Edition
(make sure no PATH variables are set besides the default one from windows)



## 1. MSYS + MINGW

### MYSYS
Expand Down Expand Up @@ -78,7 +99,7 @@ gcc version 4.9.2 (i686-posix-dwarf-rev1, Built by MinGW-W64 project)

I used a folder for all dependencies C:\deps

### OpenSSL 1.0.1J:
### OpenSSL 1.0.2n:

https://www.openssl.org/source/old/1.0.2/openssl-1.0.2n.tar.gz

Expand Down Expand Up @@ -174,16 +195,16 @@ make

Depending which version you want to use you have to add the path to PATH before compiling the wallet

## Qt 5.6.1 (Required for 4k fixes)
## Qt 5.7.1 (v5.6.1+ Required for 4k fixes)

Get the following submodule for Qt 5.6.1 from https://download.qt.io/archive/qt/5.6/5.6.1/submodules/:
Get the following submodule for Qt 5.7.1 from https://download.qt.io/archive/qt/5.7/5.7.1/submodules/:
```
https://download.qt.io/archive/qt/5.6/5.6.1/submodules/qttools-opensource-src-5.6.1.zip
https://download.qt.io/archive/qt/5.7/5.7.1/submodules/qttools-opensource-src-5.7.1.zip

https://download.qt.io/archive/qt/5.6/5.6.1/submodules/qtbase-opensource-src-5.6.1.zip
https://download.qt.io/archive/qt/5.7/5.7.1/submodules/qtbase-opensource-src-5.7.1.zip
```

Place both in C:\Qt and rename qtbase... to 5.6.1
Place both in C:\Qt and rename qtbase... to 5.7.1

Use the Windows command prompt:

Expand All @@ -192,20 +213,20 @@ set INCLUDE=C:\deps\libpng-1.6.16;C:\deps\openssl-1.0.2n\include

set LIB=C:\deps\libpng-1.6.16\.libs;C:\deps\openssl-1.0.2n

cd C:\Qt\5.6.1
cd C:\Qt\5.7.1

configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-openvg -openssl -no audio-backend -nomake tools -nomake examples -nomake tests -I c:\deps\openssl-1.0.2n\include -no-directwrite
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -no-icu -no-gif -no-libjpeg -no-freetype -no-angle -no-openvg -no-audio-backend -nomake tools -nomake examples -nomake tests -no-directwrite -openssl-linked -I c:\deps\openssl-1.0.2n\include -L c:\deps\openssl-1.0.2n OPENSSL_LIBS="-lssl -lcrypto -lgdi32"

(Configure could maybe use tweaking but got it to build. Please note the make *install* below as it's required as a workaround)

mingw32-make install
mingw32-make
```

Now watch out which Qt version you want to use, this example uses Qt 5.6.1
Now watch out which Qt version you want to use, this example uses Qt 5.7.1
```
set PATH=%PATH%;C:\Qt\5.6.1\bin
set PATH=%PATH%;C:\Qt\5.7.1\bin

cd C:\Qt\qttools-opensource-src-5.6.1
cd C:\Qt\qttools-opensource-src-5.7.1

qmake qttools.pro

Expand All @@ -214,137 +235,12 @@ mingw32-make

```

## Qt 5.3.2

Get the following submodule for Qt 5.3.2 from https://download.qt.io/archive/qt/5.3/5.3.2/submodules/:
```
https://download.qt.io/archive/qt/5.3/5.3.2/submodules/qttools-opensource-src-5.3.2.zip

https://download.qt.io/archive/qt/5.3/5.3.2/submodules/qtbase-opensource-src-5.3.2.zip
```

Place both in C:\Qt and rename qtbase... to 5.3.2

Use the Windows command promt:

```
set INCLUDE=C:\deps\libpng-1.6.16;C:\deps\openssl-1.0.2n\include

set LIB=C:\deps\libpng-1.6.16\.libs;C:\deps\openssl-1.0.2n

cd C:\Qt\5.3.2

configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug

mingw32-make
```

Now watch out which Qt version you want to use, this example uses Qt 5.3.2
```
set PATH=%PATH%;C:\Qt\5.3.2\bin

cd C:\Qt\qttools-opensource-src-5.3.2

qmake qttools.pro

mingw32-make
```


### 4. Compile

Go to the Peepcoin github folder, use the command promt ( use set PATH=%PATH%;C:\Qt\5.3.2\bin if its a new prompt):
```

qmake "USE_UPNP=-" Peepcoin-qt.pro
qmake USE_QRCODE=1

make -f Makefile.Release
```

### ERRORS:

If you get an ./build\net.o:net.cpp:(.text+0x76bc): undefined reference to `_imp__FreeUPNPUrls' error:
delete the build-folder, delete release folder, open Makefile.Release with text-editior/notepad++/whatever
and add under DEFINES
```
-DMINIUPNP_STATICLIB
```

Then again make qmake and make


### Current state

Wallet can be compiled without UPNP-Support, otherwise an error is thrown.


OLD BUILD NOTES BELOW
Compilers Supported
-------------------
TODO: What works?
Note: releases are cross-compiled using mingw running on Linux.


Dependencies
------------
Libraries you need to download separately and build:

default path download
OpenSSL \openssl-1.0.1b-mgw http://www.openssl.org/source/
Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost-1.47.0-mgw http://www.boost.org/users/download/
miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/

Their licenses:
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
miniupnpc New (3-clause) BSD license

Versions used in this release:
OpenSSL 1.0.1b
Berkeley DB 4.8.30.NC
Boost 1.47.0
miniupnpc 1.6


OpenSSL
-------
MSYS shell:
un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377)
change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe'

cd /c/openssl-1.0.1b-mgw
./config
make

Berkeley DB
-----------
MSYS shell:
cd /c/db-4.8.30.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make

Boost
-----
DOS prompt:
downloaded boost jam 3.1.18
cd \boost-1.47.0-mgw
bjam toolset=gcc --build-type=complete stage

MiniUPnPc
---------
UPnP support is optional, make with USE_UPNP= to disable it.

MSYS shell:
cd /c/miniupnpc-1.6-mgw
make -f Makefile.mingw
mkdir miniupnpc
cp *.h miniupnpc/

Peepcoin
-------
DOS prompt:
cd \peepcoin\src
mingw32-make -f makefile.mingw
strip peepcoind.exe
51 changes: 50 additions & 1 deletion doc/build-osx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,57 @@ OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic
software written by Eric Young (eay@cryptsoft.com) and UPnP software written by
Thomas Bernard.

Homebrew (current updated build steps)
- Install Homebrew - http://brew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Mac OS X peepcoind build instructions
- Install Xcode and Accept License - allow it to install command line tools

-Install Git
brew install git

- Install Berkley DB 4.8
brew install berkeley-db4

- Install OpenSSL
brew install openssl

- Install Boost
brew install boost@1.60
brew link boost@1.60 -force
(also testing with boost@1.57 for wallet.dat issue)

- Install QT
brew install qt5
brew link qt5 -force

- Install QREncode
brew install libqrencode

- Install WGet
brew install wget

- Download, compile, install Miniupnpc
wget -O miniupnpc.tar.gz http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.20150206.tar.gz
tar xvzf miniupnpc.tar.gz
mv miniupnpc-1.9.20150206 miniupnpc
cd miniupnpc
make -f Makefile upnpc-static
sudo INSTALLPREFIX=/usr/local make install

- Clone DAPSCoin GitHub
https://github.com/DAPSCoin/PeepCoin-TheCoinForThePeople.git

- Change to PeepCoin-TheCoinForThePeople directory
cd PeepCoin-TheCoinForThePeople/src

- Build Peepcoind
qmake RELEASE=1 STATIC=1
make
strip peepcoind

-----------------------------------------
Old Mac OS X peepcoind build instructions
Laszlo Hanyecz <solar@heliacal.net>
Douglas Huff <dhuff@jrbobdobbs.org>

Expand Down
8 changes: 4 additions & 4 deletions doc/build-unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ To Build
--------
From a fresh terminal:

Clone Latest Repo
- Clone Latest Repo
git clone https://github.com/DAPSCoin/PeepCoin-TheCoinForThePeople.git
(This should download the latest official repo to a PeepCoin-TheCoinForThePeople folder)

Build Headless peepcoin (peepcoind):
- Build Headless peepcoin (peepcoind):
cd PeepCoin-TheCoinForThePeople/src
(change in to the Peepcoin Source folder)

make -f makefile.unix RELEASE=1 USE_LITESTAKE=1 USE_STAKECOMBINATION=1 USE_GUITESTING=1
make -f makefile.unix RELEASE=1 STATIC=1
strip peepcoind

Build Qt GUI Wallet (peepcoin-qt)
- Build Qt GUI Wallet (peepcoin-qt)
cd ..
(if using the same terminal, brings you back to Peepcoin root folder)
qmake RELEASE=1 USE_QRCODE=1 USE_LITESTAKE=1 USE_STAKECOMBINATION=1 USE_GUITESTING=1
Expand Down
11 changes: 1 addition & 10 deletions src/makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LIBS= \
-l ssl \
-l crypto

DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -USE_LITESTAKE -USE_STAKECOMBINATION
DEBUGFLAGS=-g
CFLAGS=-mthreads -O3 -msse2 -w -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat
Expand All @@ -41,15 +41,6 @@ ifneq (${USE_UPNP}, -)
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
endif

# This feature implements a delay between hashing so the CPU usage is reduced.
# Checkout HyperStake - Project for more details
ifdef USE_LITESTAKE
DEFS += -USE_LITESTAKE
endif
ifdef USE_STAKECOMBINATION
DEFS += -USE_STAKECOMBINATION
endif

LIBS += -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi

# TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are
Expand Down
Loading

0 comments on commit 1c82f21

Please sign in to comment.