Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
array
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Vladislav Zavialov
array
Commits
9cfc836c
Commit
9cfc836c
authored
18 years ago
by
Ian Lynagh
Browse files
Options
Downloads
Patches
Plain Diff
Allow additional options to pass on to ./configure to be given
parent
2d20dbfd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Setup.hs
+23
-8
23 additions, 8 deletions
Setup.hs
configure.ac
+11
-0
11 additions, 0 deletions
configure.ac
with
34 additions
and
8 deletions
Setup.hs
+
23
−
8
View file @
9cfc836c
...
...
@@ -20,26 +20,35 @@ import System.Exit
main
::
IO
()
main
=
do
args
<-
getArgs
let
(
ghcArgs
,
args'
)
=
extractGhcArgs
args
let
hooks
=
defaultUserHooks
{
(
configureArgs
,
args''
)
=
extractConfigureArgs
args'
hooks
=
defaultUserHooks
{
confHook
=
add_extra_deps
$
confHook
defaultUserHooks
,
postConf
=
add_configure_options
configureArgs
$
postConf
defaultUserHooks
,
buildHook
=
add_ghc_options
ghcArgs
$
filter_modules_hook
$
buildHook
defaultUserHooks
,
instHook
=
filter_modules_hook
$
instHook
defaultUserHooks
}
withArgs
args'
$
defaultMainWithHooks
hooks
withArgs
args'
'
$
defaultMainWithHooks
hooks
extractGhcArgs
::
[
String
]
->
([
String
],
[
String
])
extractGhcArgs
args
extractGhcArgs
=
extractPrefixArgs
"--ghc-option="
extractConfigureArgs
::
[
String
]
->
([
String
],
[
String
])
extractConfigureArgs
=
extractPrefixArgs
"--configure-option="
extractPrefixArgs
::
String
->
[
String
]
->
([
String
],
[
String
])
extractPrefixArgs
prefix
args
=
let
f
[]
=
(
[]
,
[]
)
f
(
x
:
xs
)
=
case
f
xs
of
(
ghc
Args
,
otherArgs
)
->
case
removePrefix
"--ghc-option="
x
of
Just
ghc
Arg
->
(
ghcArg
:
ghc
Args
,
otherArgs
)
(
wanted
Args
,
otherArgs
)
->
case
removePrefix
prefix
x
of
Just
wanted
Arg
->
(
wantedArg
:
wanted
Args
,
otherArgs
)
Nothing
->
(
ghc
Args
,
x
:
otherArgs
)
(
wanted
Args
,
x
:
otherArgs
)
in
f
args
removePrefix
::
String
->
String
->
Maybe
String
...
...
@@ -51,6 +60,8 @@ removePrefix (x:xs) (y:ys)
type
Hook
a
=
PackageDescription
->
LocalBuildInfo
->
Maybe
UserHooks
->
a
->
IO
()
type
ConfHook
=
PackageDescription
->
ConfigFlags
->
IO
LocalBuildInfo
type
PostConfHook
=
Args
->
ConfigFlags
->
PackageDescription
->
LocalBuildInfo
->
IO
ExitCode
-- type PDHook = PackageDescription -> ConfigFlags -> IO ()
...
...
@@ -66,6 +77,10 @@ add_ghc_options args f pd lbi muhs x
pd'
=
pd
{
library
=
Just
lib'
}
f
pd'
lbi
muhs
x
add_configure_options
::
[
String
]
->
PostConfHook
->
PostConfHook
add_configure_options
args
f
as
cfs
pd
lbi
=
f
(
as
++
args
)
cfs
pd
lbi
filter_modules_hook
::
Hook
a
->
Hook
a
filter_modules_hook
f
pd
lbi
muhs
x
=
let
build_filter
=
case
compilerFlavor
$
compiler
lbi
of
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
11
−
0
View file @
9cfc836c
...
...
@@ -5,6 +5,17 @@ AC_CONFIG_SRCDIR([include/HsBase.h])
AC_CONFIG_HEADERS([include/HsBaseConfig.h])
AC_ARG_WITH([cc],
[C compiler],
[OLDPATH=$PATH
PATH=`dirname $withval`:$PATH
AC_PROG_CC(`basename $withval`)
PATH=$OLDPATH
CC=$withval],
[AC_PROG_CC()])
echo CC is $CC >&5
echo CC is $CC >&6
# do we have long longs?
AC_CHECK_TYPES([long long])
...
...
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