Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
3117db55
Commit
3117db55
authored
9 years ago
by
gershomb
Browse files
Options
Downloads
Patches
Plain Diff
Use extra-prog-path in running build-type configure
parent
b8c25f06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/Distribution/Simple.hs
+21
-30
21 additions, 30 deletions
Cabal/Distribution/Simple.hs
with
21 additions
and
30 deletions
Cabal/Distribution/Simple.hs
+
21
−
30
View file @
3117db55
...
...
@@ -66,8 +66,12 @@ import Distribution.PackageDescription.Parse
import
Distribution.PackageDescription.Configuration
(
flattenPackageDescription
)
import
Distribution.Simple.Program
(
defaultProgramConfiguration
,
addKnownPrograms
,
builtinPrograms
,
restoreProgramConfiguration
,
reconfigurePrograms
)
(
defaultProgramConfiguration
,
builtinPrograms
,
restoreProgramConfiguration
)
import
Distribution.Simple.Program.Db
import
Distribution.Simple.Program.Find
import
Distribution.Simple.Program.Run
import
Distribution.Simple.Program.Types
import
Distribution.Simple.PreProcess
(
knownSuffixHandlers
,
PPSuffixHandler
)
import
Distribution.Simple.Setup
import
Distribution.Simple.Command
...
...
@@ -91,9 +95,8 @@ import Distribution.Simple.Haddock (haddock, hscolour)
import
Distribution.Simple.Utils
(
die
,
notice
,
info
,
warn
,
setupMessage
,
chattyTry
,
defaultPackageDesc
,
defaultHookedPackageDesc
,
rawSystemExitWithEnv
,
cabalVersion
,
topHandler
)
import
Distribution.System
(
OS
(
..
),
buildOS
)
cabalVersion
,
topHandler
)
import
Distribution.Utils.NubList
import
Distribution.Verbosity
import
Language.Haskell.Extension
import
Distribution.Version
...
...
@@ -106,10 +109,7 @@ import System.Environment(getArgs, getProgName)
import
System.Directory
(
removeFile
,
doesFileExist
,
doesDirectoryExist
,
removeDirectoryRecursive
)
import
System.Exit
(
exitWith
,
ExitCode
(
..
))
import
System.IO.Error
(
isDoesNotExistError
)
import
Control.Exception
(
throwIO
)
import
Distribution.Compat.Environment
(
getEnvironment
)
import
Distribution.Compat.Exception
(
catchIO
)
import
Control.Monad
(
when
)
import
Data.Foldable
(
traverse_
)
...
...
@@ -626,7 +626,6 @@ autoconfUserHooks
runConfigureScript
::
Verbosity
->
Bool
->
ConfigFlags
->
LocalBuildInfo
->
IO
()
runConfigureScript
verbosity
backwardsCompatHack
flags
lbi
=
do
env
<-
getEnvironment
let
programConfig
=
withPrograms
lbi
(
ccProg
,
ccFlags
)
<-
configureCCompiler
verbosity
programConfig
...
...
@@ -636,32 +635,24 @@ runConfigureScript verbosity backwardsCompatHack flags lbi = do
-- to ccFlags
-- We don't try and tell configure which ld to use, as we don't have
-- a way to pass its flags too
let
env'
=
appendToEnvironment
(
"CFLAGS"
,
unwords
ccFlags
)
env
let
extraPath
=
fromNubList
$
configProgramPathExtra
flags
let
cflagsEnv
=
maybe
(
unwords
ccFlags
)
(
++
(
" "
++
unwords
ccFlags
))
$
lookup
"CFLAGS"
env
pathEnv
=
maybe
(
intercalate
";"
extraPath
)
((
intercalate
";"
extraPath
++
";"
)
++
)
$
lookup
"PATH"
env
overEnv
=
(
"CFLAGS"
,
Just
cflagsEnv
)
:
[(
"PATH"
,
Just
pathEnv
)
|
not
(
null
extraPath
)]
args'
=
args
++
[
"--with-gcc="
++
ccProg
]
handleNoWindowsSH
$
rawSystemExitWithEnv
verbosity
"sh"
args'
env'
shProg
=
simpleProgram
"sh"
progDb
=
modifyProgramSearchPath
(
\
p
->
map
ProgramSearchPathDir
extraPath
++
p
)
emptyProgramDb
shConfiguredProg
<-
lookupProgram
shProg
`
fmap
`
configureProgram
verbosity
shProg
progDb
case
shConfiguredProg
of
Just
sh
->
runProgramInvocation
verbosity
(
programInvocation
(
sh
{
programOverrideEnv
=
overEnv
})
args'
)
Nothing
->
die
notFoundMsg
where
args
=
"./configure"
:
configureArgs
backwardsCompatHack
flags
appendToEnvironment
(
key
,
val
)
[]
=
[(
key
,
val
)]
appendToEnvironment
(
key
,
val
)
(
kv
@
(
k
,
v
)
:
rest
)
|
key
==
k
=
(
key
,
v
++
" "
++
val
)
:
rest
|
otherwise
=
kv
:
appendToEnvironment
(
key
,
val
)
rest
handleNoWindowsSH
action
|
buildOS
/=
Windows
=
action
|
otherwise
=
action
`
catchIO
`
\
ioe
->
if
isDoesNotExistError
ioe
then
die
notFoundMsg
else
throwIO
ioe
notFoundMsg
=
"The package has a './configure' script. This requires a "
++
"Unix compatibility toolchain such as MinGW+MSYS or Cygwin."
notFoundMsg
=
"The package has a './configure' script. If you are on Windows, This requires a "
++
"Unix compatibility toolchain such as MinGW+MSYS or Cygwin. "
++
"If you are not on Windows, ensure that an 'sh' command is discoverable in your path."
getHookedBuildInfo
::
Verbosity
->
IO
HookedBuildInfo
getHookedBuildInfo
verbosity
=
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment