pkgs/build-support/cabal: unify all non-user-specified configure flags in the internal 'extraConfigureFlags' variable
This commit is contained in:
parent
726574a5e4
commit
26b192edcc
@ -86,13 +86,11 @@
|
|||||||
# pass the '--enable-split-objs' flag to cabal in the configure stage
|
# pass the '--enable-split-objs' flag to cabal in the configure stage
|
||||||
enableSplitObjs = true;
|
enableSplitObjs = true;
|
||||||
|
|
||||||
# configure flag to pass to enable/disable library profiling
|
extraConfigureFlags = [
|
||||||
libraryProfiling =
|
(stdenv.lib.enableFeature enableLibraryProfiling "library-profiling")
|
||||||
if enableLibraryProfiling then ["--enable-library-profiling"]
|
(stdenv.lib.enableFeature self.enableSplitObjs "split-objs")
|
||||||
else ["--disable-library-profiling"];
|
(stdenv.lib.enableFeature self.doCheck "tests")
|
||||||
|
];
|
||||||
# configure flag to pass to enable/disable object splitting
|
|
||||||
splitObjects = if self.enableSplitObjs then "--enable-split-objs" else "--disable-split-objs";
|
|
||||||
|
|
||||||
# compiles Setup and configures
|
# compiles Setup and configures
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
@ -106,19 +104,17 @@
|
|||||||
|
|
||||||
for p in $extraBuildInputs $propagatedNativeBuildInputs; do
|
for p in $extraBuildInputs $propagatedNativeBuildInputs; do
|
||||||
if [ -d "$p/include" ]; then
|
if [ -d "$p/include" ]; then
|
||||||
extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
|
extraConfigureFlags+=" --extra-include-dir=$p/include"
|
||||||
fi
|
fi
|
||||||
for d in lib{,64}; do
|
for d in lib{,64}; do
|
||||||
if [ -d "$p/$d" ]; then
|
if [ -d "$p/$d" ]; then
|
||||||
extraLibDirs="$extraLibDirs --extra-lib-dir=$p/$d"
|
extraConfigureFlags+=" --extra-lib-dir=$p/$d"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
test -z "$doCheck" || configureFlags+=" --enable-tests"
|
echo "configure flags: $extraConfigureFlags $configureFlags"
|
||||||
|
./Setup configure --verbose --prefix="$out" $extraConfigureFlags $configureFlags
|
||||||
echo "configure flags: $libraryProfiling $splitObjects $extraLibDirs $configureFlags"
|
|
||||||
./Setup configure --verbose --prefix="$out" $libraryProfiling $splitObjects $extraLibDirs $configureFlags
|
|
||||||
|
|
||||||
eval "$postConfigure"
|
eval "$postConfigure"
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user