Skip to content

Commit

Permalink
Update docs to point out LDFLAGS=--static for making fully statically…
Browse files Browse the repository at this point in the history
… linked binaries
  • Loading branch information
PhilipHazel committed Nov 24, 2023
1 parent e76eae6 commit 630b1cd
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 164 deletions.
20 changes: 17 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,18 @@ library. They are also documented in the pcre2build man page.
--disable-shared
--disable-static

(See also "Shared libraries on Unix-like systems" below.)
Setting --disable-shared ensures that PCRE2 libraries are built as static
libraries. The binaries that are then created as part of the build process
(for example, pcre2test and pcre2grep) are linked statically with one or more
PCRE2 libraries, but may also be dynamically linked with other libraries such
as libc. If you want these binaries to be fully statically linked, you can
set LDFLAGS like this:

LDFLAGS=--static ./configure --disable-shared

Note the two hyphens in --static. Of course, this works only if static
versions of all the relevant libraries are available for linking. See also
"Shared libraries" below.

. By default, only the 8-bit library is built. If you add --enable-pcre2-16 to
the "configure" command, the 16-bit library is also built. If you add
Expand Down Expand Up @@ -560,7 +571,10 @@ configuring it. For example:
./configure --prefix=/usr/gnu --disable-shared

Then run "make" in the usual way. Similarly, you can use --disable-static to
build only shared libraries.
build only shared libraries. Note, however, that when you build only static
libraries, binary programs such as pcre2test and pcre2grep may still be
dynamically linked with other libraries (for example, libc) unless you set
LDFLAGS to --static when running "configure".


Cross-compiling using autotools
Expand Down Expand Up @@ -933,4 +947,4 @@ The distribution should contain the files listed below.
Philip Hazel
Email local part: Philip.Hazel
Email domain: gmail.com
Last updated: 11 August 2023
Last updated: 24 November 2023
20 changes: 17 additions & 3 deletions doc/html/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,18 @@ library. They are also documented in the pcre2build man page.
--disable-shared
--disable-static

(See also "Shared libraries on Unix-like systems" below.)
Setting --disable-shared ensures that PCRE2 libraries are built as static
libraries. The binaries that are then created as part of the build process
(for example, pcre2test and pcre2grep) are linked statically with one or more
PCRE2 libraries, but may also be dynamically linked with other libraries such
as libc. If you want these binaries to be fully statically linked, you can
set LDFLAGS like this:

LDFLAGS=--static ./configure --disable-shared

Note the two hyphens in --static. Of course, this works only if static
versions of all the relevant libraries are available for linking. See also
"Shared libraries" below.

. By default, only the 8-bit library is built. If you add --enable-pcre2-16 to
the "configure" command, the 16-bit library is also built. If you add
Expand Down Expand Up @@ -560,7 +571,10 @@ configuring it. For example:
./configure --prefix=/usr/gnu --disable-shared

Then run "make" in the usual way. Similarly, you can use --disable-static to
build only shared libraries.
build only shared libraries. Note, however, that when you build only static
libraries, binary programs such as pcre2test and pcre2grep may still be
dynamically linked with other libraries (for example, libc) unless you set
LDFLAGS to --static when running "configure".


Cross-compiling using autotools
Expand Down Expand Up @@ -933,4 +947,4 @@ The distribution should contain the files listed below.
Philip Hazel
Email local part: Philip.Hazel
Email domain: gmail.com
Last updated: 11 August 2023
Last updated: 24 November 2023
16 changes: 14 additions & 2 deletions doc/html/pcre2build.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,19 @@ <h1>pcre2build man page</h1>
--disable-shared
--disable-static
</pre>
to the <b>configure</b> command.
to the <b>configure</b> command. Setting --disable-shared ensures that PCRE2
libraries are built as static libraries. The binaries that are then created as
part of the build process (for example, <b>pcre2test</b> and <b>pcre2grep</b>)
are linked statically with one or more PCRE2 libraries, but may also be
dynamically linked with other libraries such as <b>libc</b>. If you want these
binaries to be fully statically linked, you can set LDFLAGS like this:
<br>
<br>
LDFLAGS=--static ./configure --disable-shared
<br>
<br>
Note the two hyphens in --static. Of course, this works only if static versions
of all the relevant libraries are available for linking.
</P>
<br><a name="SEC5" href="#TOC1">UNICODE AND UTF SUPPORT</a><br>
<P>
Expand Down Expand Up @@ -630,7 +642,7 @@ <h1>pcre2build man page</h1>
</P>
<br><a name="SEC27" href="#TOC1">REVISION</a><br>
<P>
Last updated: 09 August 2023
Last updated: 24 November 2023
<br>
Copyright &copy; 1997-2023 University of Cambridge.
<br>
Expand Down
Loading

0 comments on commit 630b1cd

Please sign in to comment.