Commit
Using multiple outputs we can easily build static libraries. This is a proposal to always statically link things. Needs testing & discussion before merging. /cc @orivej @nlewo @xeji
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
preConfigureHooks+=(_multioutConfig) | ||
preFixupHooks+=(_multioutDocs) | ||
preFixupHooks+=(_multioutDevs) | ||
preFixupHooks+=(_multioutStatic) | ||
postFixupHooks+=(_multioutPropagateDev) | ||
|
||
# Assign the first string containing nonempty variable to the variable named $1 | ||
|
@@ -37,6 +38,9 @@ _overrideFirst outputInclude "$outputDev" | |
# so-libs are often among the main things to keep, and so go to $out | ||
_overrideFirst outputLib "lib" "out" | ||
|
||
# statically linked libraries | ||
_overrideFirst outputStatic "static" "lib" "out" | ||
|
||
_overrideFirst outputDoc "doc" "out" | ||
_overrideFirst outputDevdoc "devdoc" REMOVE # documentation for developers | ||
# man and info pages are small and often useful to distribute with binaries | ||
|
@@ -73,6 +77,7 @@ _multioutConfig() { | |
--docdir=${!outputDoc}/share/doc/${shareDocName} \ | ||
--libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ | ||
--localedir=${!outputLib}/share/locale \ | ||
--enable-static \ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
orivej
Contributor
|
||
$configureFlags" | ||
|
||
installFlags="\ | ||
|
@@ -164,6 +169,11 @@ _multioutDevs() { | |
done | ||
} | ||
|
||
_multioutStatic() { | ||
if [ "$outputs" = "out" ] || [ -z "${moveToStatic-1}" ]; then return; fi; | ||
find lib -name "*.a" -exec moveToOutput "{}" "${!outputStatic}" | ||
This comment has been minimized.
Sorry, something went wrong.
orivej
Contributor
|
||
} | ||
|
||
# Make the "dev" propagate other outputs needed for development. | ||
_multioutPropagateDev() { | ||
if [ "$outputs" = "out" ]; then return; fi; | ||
|
AFAIK sometimes this disables building shared libraries, and some projects do not support building the shared and the static libraries simultaneously.