Skip to content

Commit be42d89

Browse files
committed
Correcting some errors and
also hoping these changes will make things easier to read. modified: README.md modified: READMEcmake.md modified: READMEwin-msys2.md
1 parent ae3271a commit be42d89

File tree

3 files changed

+50
-46
lines changed

3 files changed

+50
-46
lines changed

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,10 @@ For the full options list , do:
196196
/path/to/code/configure --help
197197

198198
By default configure compiles and uses libdwarf.a.
199-
With `--enable-shared` appended to the configure step,
200-
both libdwarf.a and libdwarf.so
201-
are built and the runtimes built will reference libdwarf.so.
199+
With `--enable-shared --disable-sttic"
200+
appended to the configure step,
201+
libdwarf.so is built and the runtimes
202+
built will reference libdwarf.so.
202203

203204
If you get a build failure that mentions
204205
something about test/ and missing .Po object files
@@ -210,12 +211,6 @@ necessary.
210211
See:
211212
https://www.gnu.org/savannah-checkouts/gnu/automake/history/automake-history.html#Dependency-Tracking-Evolution
212213

213-
With
214-
215-
--enable-shared --disable-static
216-
217-
appended to the configure command
218-
libdwarf.so is built and used. libdwarf.a is not built.
219214

220215
Other options of possible interest:
221216

@@ -227,27 +222,17 @@ Other options of possible interest:
227222
Sanity checking:
228223

229224
gcc has some checks that can be done at runtime.
230-
-fsanitize=undefined is turned on by --enable-sanitize
225+
-fsanitize=undefined is turned on for
226+
configure by --enable-sanitize
231227

232228
### Options to meson on Windows (Msys2)
233229

234-
All libdwarf builds are automatically shared object (dll)
235-
builds as of 0.8.0.
236-
237-
With
238-
239-
--default-library static
240-
241-
on the meson command line
242-
one can build libdwarf as an archive and dwarfdump and the
243-
programs built will use the static library.
244-
245-
The default is shared and can be explicitly
246-
chosen by:
230+
As of 0.8.0 meson builds default to be
231+
shared-library builds.
232+
the default can be explicity chosen with:
247233

248234
--default-library shared
249235

250-
Has the same meson setup reporting as on Linux (above).
251236

252237
### Options to configure on Windows (Msys2)
253238

@@ -257,6 +242,8 @@ If you need static libdwarf.a use meson or cmake.
257242

258243
Has the same meson setup reporting as on Linux (above).
259244

245+
See READMEwin-msys2.md
246+
260247
### Distributing via configure/autotools
261248

262249
When ready to create a new source distribution do
@@ -266,6 +253,13 @@ a build and then
266253

267254
# INCOMPATIBILITIES. Changes to interfaces
268255

256+
### Comparing libdwarf-0.9.0 to libdwarf-0.8.0
257+
258+
New interfaces allow full support for
259+
Mach-O (Apple) universal binaries:
260+
dwarf_init_path_a(), dwarf_init_path_dl_a(), and
261+
dwarf_get_universalbinary_count().
262+
269263
### Comparing libdwarf-0.8.0 to libdwarf-0.7.0
270264

271265
The default build (with meson) is shared-library.

READMEcmake.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cmake on Unix/linux/MacOS/FreeBSD/OpenBSD
22
Created 26 April 2019
3-
Updated 6 October 2023
3+
Updated 7 October 2023
44

55
Consider switching entirely to meson for your build.
66

@@ -13,7 +13,12 @@ cmake builds a static library: libdwarf.a
1313
For cmake, ignore the autogen.sh
1414
script in the base source directory.
1515

16-
By default cmake builds just libdwarf and dwarfdump.
16+
By default cmake builds just libdwarf and dwarfdump
17+
and libdwarf is a static (archive) library.
18+
To switch to a shared library output with cmake add
19+
the following to the cmake command:
20+
21+
-DBUILD_SHARED=YES -DBUILD_NON_SHARED=NO
1722

1823
Lets assume the base directory of the the libdwarf source in a
1924
directory named 'code' inside the directory '/path/to/' Always

READMEwin-msys2.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#USING MSYS2 (WINDOWS) CMAKE, MESON, CONFIGURE
22

3-
Created 6 October 2023
3+
Created 7 October 2023
44

55
msys2 provides an environment much like posix/unix/linux
66
with programs precompiled for use on windows
@@ -17,34 +17,42 @@ library libdwarf.a is not supported. A static
1717
libdwarf.a can be built with meson or cmake.
1818

1919
### Shared library builds
20-
All libdwarf builds are automatically shared object (dll)
21-
builds as of 0.8.0.
20+
Libdwarf builds from configure
21+
and cmake are static (archive) library builds
22+
by default.
23+
Meson builds to a shared library by default.
2224

23-
With
25+
On msys2 with cmake one can generate a shared library
26+
build with:
27+
28+
-DBUILD_SHARED=YEs -DBUILD_NON_SHARED=NO
2429

25-
--default-library static
2630

27-
on the meson command line
31+
With the following on the meson command line
2832
one can build libdwarf as an archive and dwarfdump and the
2933
programs built will use the static library.
3034

31-
The default is shared and can be explicitly
35+
--default-library static
36+
37+
38+
The meson default is shared and can be explicitly
3239
chosen by:
3340

3441
--default-library shared
3542

36-
Has the same meson setup reporting as on Linux (above).
37-
3843
configure will only allow generation of shared library
3944
builds, while for cmake and meson one can choose
40-
wither to build a shared library or an archive library
45+
whether to build a shared library or a static (archive) library
4146
(libdwarf.a).
4247

48+
On msys2 with configure one gets a shared library build with:
49+
50+
--enable-shared --disable-static
4351

4452
### NOTE on linking against libdwarf.a
4553

4654
If you are are linking code against a static
47-
library libdwarf.a you must arrange to define the
55+
library libdwarf.a you must arrange to define the
4856
macro LIBDWARF_STATIC in compiling your code that
4957
does a #include "libdwarf.h".
5058

@@ -86,30 +94,27 @@ building and testing all the build mechanisms:
8694
pacman -S mingw-w64-x86_64-cmake
8795
pacnam -S mingw-w64-x86_64-python3-pip
8896

89-
To create a distribution
97+
To create a distribution one needs xz:
9098
pacman -S mingw-w64-x86_64-xz
9199

92100
to list packages
93101
pacman -Q
94102
to remove packages
95103
pacman -R <packagename>
96104

97-
## cmake specific
105+
## Ninja speed
106+
98107
cmake will generate ninja makefiles by default, add
99108
'-G "Unix Makefiles"' to the cmake command line to
100109
generate makefiles for gnu make, but we suggest you
101110
use "-G Ninja" for speed and clarity..
102111

103-
Use
104-
-DBUILD_SHARED:BOOL=TRUE \
105-
-DBUILD_NON_SHARED:BOOL=FALSE
106-
on the cmake command
107-
to be consistent with normal Windows use.
112+
## Set a Prefix for test installs
108113

109114
To get a usable set of executables
110115
set a prefix (for cmake,
111-
-DCMAKE_INSTALL_PREFIX=/c/msys64/usr),
112-
presuming the bin directory
116+
-DCMAKE_INSTALL_PREFIX=$HOME/bin
117+
presuming the bin directory
113118
is something in your $PATH in msys2.
114119
Set an appropriate prefix whichever
115120
build tool you use.

0 commit comments

Comments
 (0)