Skip to content

Commit f978c0c

Browse files
kevkevinpaljanus
authored andcommitted
doc: Updating docs from autotools to cmake
replaced --enable-debug with -DCMAKE_BUILD_TYPE=Debug in developer-notes replaced --enable-multiprocess with -DWITH_MULTIPROCESS=ON replaced --disable-zmq with -DWITH_ZMQ=OFF
1 parent 2f266b6 commit f978c0c

13 files changed

+38
-43
lines changed

contrib/devtools/test_deterministic_coverage.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if ! command -v gcovr > /dev/null; then
8181
fi
8282

8383
if [[ ! -e ${TEST_BGL_BINARY} ]]; then
84-
echo "Error: Executable ${TEST_BGL_BINARY} not found. Run \"./configure --enable-lcov\" and compile."
84+
echo "Error: Executable ${TEST_BGL_BINARY} not found. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and compile."
8585
exit 1
8686
fi
8787

@@ -90,7 +90,7 @@ get_file_suffix_count() {
9090
}
9191

9292
if [[ $(get_file_suffix_count gcno) == 0 ]]; then
93-
echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"./configure --enable-lcov\" and re-compile."
93+
echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and re-compile."
9494
exit 1
9595
fi
9696

@@ -115,7 +115,7 @@ while [[ ${TEST_RUN_ID} -lt ${N_TEST_RUNS} ]]; do
115115
fi
116116
rm "${TEST_OUTPUT_TEMPFILE}"
117117
if [[ $(get_file_suffix_count gcda) == 0 ]]; then
118-
echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"./configure --enable-lcov\" and re-compile."
118+
echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"cmake -B build -DCMAKE_BUILD_TYPE=Coverage\" and re-compile."
119119
exit 1
120120
fi
121121
GCOVR_TEMPFILE=$(mktemp)

doc/design/libraries.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| *libBGL_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. |
99
| *libBGL_kernel* | Consensus engine and support library used for validation by *libBGL_node*. |
1010
| *libBGLqt* | GUI functionality used by *BGL-qt* and *BGL-gui* executables. |
11-
| *libBGL_ipc* | IPC functionality used by *BGL-node*, *BGL-wallet*, *BGL-gui* executables to communicate when [`--enable-multiprocess`](multiprocess.md) is used. |
11+
| *libBGL_ipc* | IPC functionality used by *BGL-node*, *BGL-wallet*, *BGL-gui* executables to communicate when [`-DWITH_MULTIPROCESS=ON`](multiprocess.md) is used. |
1212
| *libBGL_node* | P2P and RPC server functionality used by *BGLd* and *BGL-qt* executables. |
1313
| *libBGL_util* | Home for common functionality shared by different executables and libraries. Similar to *libBGL_common*, but lower-level (see [Dependencies](#dependencies)). |
1414
| *libBGL_wallet* | Wallet functionality used by *BGLd* and *BGL-wallet* executables. |

doc/developer-notes.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ see [test/functional/](/test/functional) for tests that run in `-regtest` mode.
417417

418418
### DEBUG_LOCKORDER
419419

420-
BGL Core is a multi-threaded application, and deadlocks or other
421-
multi-threading bugs can be very difficult to track down. The `--enable-debug`
422-
configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
420+
Bitgesell Core is a multi-threaded application, and deadlocks or other
421+
multi-threading bugs can be very difficult to track down. The `-DCMAKE_BUILD_TYPE=Debug`
422+
build option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts
423423
run-time checks to keep track of which locks are held and adds warnings to the
424424
`debug.log` file if inconsistencies are detected.
425425

@@ -429,9 +429,8 @@ Defining `DEBUG_LOCKCONTENTION` adds a "lock" logging category to the logging
429429
RPC that, when enabled, logs the location and duration of each lock contention
430430
to the `debug.log` file.
431431

432-
The `--enable-debug` configure option adds `-DDEBUG_LOCKCONTENTION` to the
433-
compiler flags. You may also enable it manually for a non-debug build by running
434-
configure with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
432+
The `-DCMAKE_BUILD_TYPE=Debug` build option adds `-DDEBUG_LOCKCONTENTION` to the
433+
compiler flags. You may also enable it manually by building with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS,
435434
i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run BGLd.
436435

437436
You can then use the `-debug=lock` configuration option at BGLd startup or
@@ -579,7 +578,7 @@ cmake -B build -DSANITIZERS=thread
579578
If you are compiling with GCC you will typically need to install corresponding
580579
"san" libraries to actually compile with these flags, e.g. libasan for the
581580
address sanitizer, libtsan for the thread sanitizer, and libubsan for the
582-
undefined sanitizer. If you are missing required libraries, the configure script
581+
undefined sanitizer. If you are missing required libraries, the build
583582
will fail with a linker error when testing the sanitizer flags.
584583

585584
The test suite should pass cleanly with the `thread` and `undefined` sanitizers. You
@@ -595,7 +594,7 @@ See the CI config for more examples, and upstream documentation for more informa
595594
about any additional options.
596595

597596
Not all sanitizer options can be enabled at the same time, e.g. trying to build
598-
with `-DSANITIZERS=address,thread` will fail in the configure script as
597+
with `-DSANITIZERS=address,thread` will fail in the build as
599598
these sanitizers are mutually incompatible. Refer to your compiler manual to
600599
learn more about these options and which sanitizers are supported by your
601600
compiler.
@@ -619,7 +618,7 @@ The code is multi-threaded and uses mutexes and the
619618
Deadlocks due to inconsistent lock ordering (thread 1 locks `cs_main` and then
620619
`cs_wallet`, while thread 2 locks them in the opposite order: result, deadlock
621620
as each waits for the other to release its lock) are a problem. Compile with
622-
`-DDEBUG_LOCKORDER` (or use `--enable-debug`) to get lock order inconsistencies
621+
`-DDEBUG_LOCKORDER` (or use `-DCMAKE_BUILD_TYPE=Debug`) to get lock order inconsistencies
623622
reported in the `debug.log` file.
624623

625624
Re-architecting the core code so there are better-defined interfaces
@@ -1060,8 +1059,8 @@ bool Chainstate::PreciousBlock(BlockValidationState& state, CBlockIndex* pindex)
10601059
```
10611060
10621061
- Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential
1063-
deadlocks are introduced. As of 0.12, this is defined by default when
1064-
configuring with `--enable-debug`.
1062+
deadlocks are introduced. This is defined by default when
1063+
building with `-DCMAKE_BUILD_TYPE=Debug`.
10651064
10661065
- When using `LOCK`/`TRY_LOCK` be aware that the lock exists in the context of
10671066
the current scope, so surround the statement and the code that needs the lock

doc/multiprocess.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _This document describes usage of the multiprocess feature. For design informati
44

55
## Build Option
66

7-
On unix systems, the `--enable-multiprocess` build option can be passed to `./configure` to build new `bitcoin-node`, `bitcoin-wallet`, and `bitcoin-gui` executables alongside existing `bitcoind` and `bitcoin-qt` executables.
7+
On Unix systems, the `-DWITH_MULTIPROCESS=ON` build option can be passed to build the supplemental `bitcoin-node` and `bitcoin-gui` multiprocess executables.
88

99
## Debugging
1010

@@ -17,15 +17,15 @@ The multiprocess feature requires [Cap'n Proto](https://capnproto.org/) and [lib
1717
```
1818
cd <BITCOIN_SOURCE_DIRECTORY>
1919
make -C depends NO_QT=1 MULTIPROCESS=1
20-
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure
21-
make
22-
src/bitcoin-node -regtest -printtoconsole -debug=ipc
23-
BITCOIND=bitcoin-node test/functional/test_runner.py
20+
cmake -B build --toolchain=depends/x86_64-pc-linux-gnu/toolchain.cmake
21+
cmake --build build
22+
build/src/bitcoin-node -regtest -printtoconsole -debug=ipc
23+
BITCOIND=$(pwd)/build/src/bitcoin-node build/test/functional/test_runner.py
2424
```
2525

26-
The configure script will pick up settings and library locations from the depends directory, so there is no need to pass `--enable-multiprocess` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option).
26+
The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DWITH_MULTIPROCESS=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option).
2727

28-
Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) packages on your system, and just run `./configure --enable-multiprocess` without using the depends system. The configure script will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/chaincodelabs/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general.
28+
Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) packages on your system, and just run `cmake -B build -DWITH_MULTIPROCESS=ON` without using the depends system. The `cmake` build will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/chaincodelabs/libmultiprocess/blob/master/doc/install.md) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general.
2929

3030
## Usage
3131

doc/translation_process.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ We use automated scripts to help extract translations in both Qt, and non-Qt sou
1818

1919
To automatically regenerate the `BGL_en.ts` file, run the following commands:
2020
```sh
21-
cd src/
22-
make translate
21+
cmake -B build --preset dev-mode -DWITH_BDB=ON -DBUILD_GUI=ON
22+
cmake --build build --target translate
2323
```
2424

2525
**Example Qt translation**

doc/translation_strings_policy.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
Translation Strings Policy
2-
===========================
1+
# Translation Strings Policy
32

43
This document provides guidelines for internationalization of the BGL Core software.
54

6-
How to translate?
7-
------------------
5+
## How to translate?
86

97
To mark a message as translatable
108

@@ -14,8 +12,7 @@ To mark a message as translatable
1412

1513
No internationalization is used for e.g. developer scripts outside `src`.
1614

17-
Strings to be translated
18-
-------------------------
15+
## Strings to be translated
1916

2017
On a high level, these strings are to be translated:
2118

@@ -27,8 +24,7 @@ Do not translate technical or extremely rare errors.
2724
Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.
2825
This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`.
2926

30-
General recommendations
31-
------------------------
27+
## General recommendations
3228

3329
### Avoid unnecessary translation strings
3430

@@ -97,4 +93,4 @@ The second example reduces the number of pluralized words that translators have
9793

9894
During a string freeze (often before a major release), no translation strings are to be added, modified or removed.
9995

100-
This can be checked by executing `make translate` in the `src` directory, then verifying that `BGL_en.ts` remains unchanged.
96+
This can be checked by building the `translate` target with `cmake` ([instructions](translation_process.md)), then verifying that `BGL_en.ts` remains unchanged.

doc/zmq.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ operation.
4747
## Enabling
4848

4949
By default, the ZeroMQ feature is automatically compiled in if the
50-
necessary prerequisites are found. To disable, use --disable-zmq
50+
necessary prerequisites are found. To disable, use -DWITH_ZMQ=OFF
5151
during the *configure* step of building BGLd:
5252

53-
$ ./configure --disable-zmq (other options)
53+
$ cmake -B build -DWITH_ZMQ=OFF (other options)
5454

5555
To actually enable operation, one must set the appropriate options on
5656
the command line or in the configuration file.
@@ -91,7 +91,7 @@ For instance:
9191
Each PUB notification has a topic and body, where the header
9292
corresponds to the notification type. For instance, for the
9393
notification `-zmqpubhashtx` the topic is `hashtx` (no null
94-
terminator). These options can also be provided in bitcoin.conf.
94+
terminator). These options can also be provided in BGL.conf.
9595

9696
The topics are:
9797

@@ -163,7 +163,7 @@ Note that for `*block` topics, when the block chain tip changes,
163163
a reorganisation may occur and just the tip will be notified.
164164
It is up to the subscriber to retrieve the chain from the last known
165165
block to the new tip. Also note that no notification will occur if the tip
166-
was in the active chain--as would be the case after calling invalidateblock RPC.
166+
was in the active chain, as would be the case after calling the `invalidateblock` RPC.
167167
In contrast, the `sequence` topic publishes all block connections and
168168
disconnections.
169169

share/qt/extract_strings_qt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def parse_po(text):
5656
XGETTEXT=os.getenv('XGETTEXT', 'xgettext')
5757
if not XGETTEXT:
5858
print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)
59-
print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr)
59+
print('Please install package "gettext" and re-run \'cmake -B build\'.',file=sys.stderr)
6060
sys.exit(1)
6161
child = Popen([XGETTEXT,'--output=-','--from-code=utf-8','-n','--keyword=_'] + files, stdout=PIPE)
6262
(out, err) = child.communicate()

src/qt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ sudo apt-get install qtcreator
9999
#### Setup Qt Creator
100100

101101
1. Make sure you've installed all dependencies specified in your systems build instructions
102-
2. Follow the compile instructions for your system, run `./configure` with the `--enable-debug` flag
102+
2. Follow the compile instructions for your system, adding the `-DCMAKE_BUILD_TYPE=Debug` build flag
103103
3. Start Qt Creator. At the start page, do: `New` -> `Import Project` -> `Import Existing Project`
104104
4. Enter `BGL-qt` as the Project Name and enter the absolute path to `src/qt` as Location
105105
5. Check over the file selection, you may need to select the `forms` directory (necessary if you intend to edit *.ui files)

src/util/fs_helpers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <utility>
2323

2424
#ifndef WIN32
25-
// for posix_fallocate, in configure.ac we check if it is present after this
25+
// for posix_fallocate, in cmake/introspection.cmake we check if it is present after this
2626
#ifdef __linux__
2727

2828
#ifdef _POSIX_C_SOURCE

test/functional/test_runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def main():
483483

484484
if not enable_BGLd:
485485
print("No functional tests to run.")
486-
print("Rerun ./configure with --with-daemon and then make")
486+
print("Re-compile with the -DBUILD_DAEMON=ON build option")
487487
sys.exit(1)
488488

489489
# Build list of tests

test/lint/lint-spelling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
1515

1616
IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt'
17-
FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)build-aux/m4/", ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"]
17+
FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"]
1818
FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES]
1919

2020

test/util/test_runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66
"""Test framework for BGL utils.
77
8-
Runs automatically during `make check`.
8+
Runs automatically during `ctest --test-dir build/`.
99
1010
Can also be run manually."""
1111

0 commit comments

Comments
 (0)