Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
6338a1cc
Commit
6338a1cc
authored
Oct 11, 2015
by
Edward Z. Yang
Browse files
Rename PACKAGE_KEY and LIB_NAME in build system.
Signed-off-by:
Edward Z. Yang
<
ezyang@cs.stanford.edu
>
parent
b92a51f5
Changes
8
Hide whitespace changes
Inline
Side-by-side
compiler/ghc.mk
View file @
6338a1cc
...
...
@@ -441,11 +441,11 @@ ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
compiler_stage1_MUNGED_VERSION
=
$(
subst
.
$(ProjectPatchLevel)
,,
$(ProjectVersion)
)
define
compiler_PACKAGE_MAGIC
compiler_stage1_VERSION
=
$(compiler_stage1_MUNGED_VERSION)
compiler_stage1_
PACKAGE_KEY
=
$(
subst
.
$(ProjectPatchLevel)
,,
$(compiler_stage1_
PACKAGE_KEY
)
)
compiler_stage1_
LIB_NAME
=
$(
subst
.
$(ProjectPatchLevel)
,,
$(compiler_stage1_
LIB_NAME
)
)
compiler_stage1_
COMPONENT_ID
=
$(
subst
.
$(ProjectPatchLevel)
,,
$(compiler_stage1_
COMPONENT_ID
)
)
compiler_stage1_
COMPONENT_ID
=
$(
subst
.
$(ProjectPatchLevel)
,,
$(compiler_stage1_
COMPONENT_ID
)
)
endef
# NB: the
PACKAGE_KEY
munging has no effect for new-style unit ids
# NB: the
COMPONENT_ID
munging has no effect for new-style unit ids
# (which indeed, have nothing version like in them, but are important for
# old-style unit ids which do.) The subst operation is idempotent, so
# as long as we do it at least once we should be good.
...
...
configure.ac
View file @
6338a1cc
...
...
@@ -160,9 +160,9 @@ FP_COMPARE_VERSIONS([$GhcVersion],[-gt],[7.7],
AC_SUBST(CMM_SINK_BOOTSTRAP_IS_NEEDED)
FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.9],
SUPPORTS_
PACKAGE_KEY
=NO,
SUPPORTS_
PACKAGE_KEY
=YES)
AC_SUBST(SUPPORTS_
PACKAGE_KEY
)
SUPPORTS_
COMPONENT_ID
=NO,
SUPPORTS_
COMPONENT_ID
=YES)
AC_SUBST(SUPPORTS_
COMPONENT_ID
)
# GHC is passed to Cabal, so we need a native path
if test "${WithGhc}" != ""
...
...
mk/config.mk.in
View file @
6338a1cc
...
...
@@ -461,7 +461,7 @@ GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
CMM_SINK_BOOTSTRAP_IS_NEEDED
=
@CMM_SINK_BOOTSTRAP_IS_NEEDED@
SUPPORTS_
PACKAGE_KEY
=
@SUPPORTS_
PACKAGE_KEY
@
SUPPORTS_
COMPONENT_ID
=
@SUPPORTS_
COMPONENT_ID
@
#-----------------------------------------------------------------------------
# C compiler
...
...
rules/build-package-way.mk
View file @
6338a1cc
...
...
@@ -23,13 +23,13 @@ $(call hs-objs,$1,$2,$3)
# The .a/.so library file, indexed by two different sets of vars:
# the first is indexed by the dir, distdir and way
# the second is indexed by the package id, distdir and way
$1_$2_$3_LIB_FILE
=
libHS
$$
(
$1_$2_
LIB_NAME
)
$$
(
$3_libsuf
)
$1_$2_$3_LIB_FILE
=
libHS
$$
(
$1_$2_
COMPONENT_ID
)
$$
(
$3_libsuf
)
$1_$2_$3_LIB
=
$1
/
$2
/build/
$$
(
$1_$2_$3_LIB_FILE
)
$$($1_$2_
LIB_NAME
)_$2_$3_LIB
=
$$
(
$1_$2_$3_LIB
)
$$($1_$2_
COMPONENT_ID
)_$2_$3_LIB
=
$$
(
$1_$2_$3_LIB
)
ifeq
"$$(HostOS_CPP)" "mingw32"
ifneq
"$$($1_$2_dll0_HS_OBJS)" ""
$1_$2_$3_LIB0_ROOT
=
HS
$$
(
$1_$2_
LIB_NAME
)
-0
$$
(
$3_libsuf
)
$1_$2_$3_LIB0_ROOT
=
HS
$$
(
$1_$2_
COMPONENT_ID
)
-0
$$
(
$3_libsuf
)
$1_$2_$3_LIB0_NAME
=
lib
$$
(
$1_$2_$3_LIB0_ROOT
)
$1_$2_$3_LIB0
=
$1
/
$2
/build/
$$
(
$1_$2_$3_LIB0_NAME
)
endif
...
...
@@ -42,7 +42,7 @@ endif
# Really we should use a consistent scheme for distdirs, but in the
# meantime we work around it by defining ghc-<ver>_dist-install_way_LIB:
ifeq
"$$($1_PACKAGE) $2" "ghc stage2"
$$($1_$2_
LIB_NAME
)_dist-install_$3_LIB
=
$$
(
$1_$2_$3_LIB
)
$$($1_$2_
COMPONENT_ID
)_dist-install_$3_LIB
=
$$
(
$1_$2_$3_LIB
)
endif
# All the .a/.so library file dependencies for this library.
...
...
@@ -50,8 +50,8 @@ endif
# The $(subst stage2,dist-install,..) is needed due to Note
# [inconsistent distdirs].
#
# NB: Use DEP_
LIB_NAME
S for the /directory/ parameter.
$1_$2_$3_DEPS_LIBS
=
$
$(
foreach
dep,
$$
(
$1_$2_DEP_
LIB_NAME
S
)
,
$$
(
$
$(dep)
_
$(
subst
stage2,dist-install,
$2
)
_
$3_LIB
))
# NB: Use DEP_
COMPONENT_ID
S for the /directory/ parameter.
$1_$2_$3_DEPS_LIBS
=
$
$(
foreach
dep,
$$
(
$1_$2_DEP_
COMPONENT_ID
S
)
,
$$
(
$
$(dep)
_
$(
subst
stage2,dist-install,
$2
)
_
$3_LIB
))
$1_$2_$3_NON_HS_OBJS
=
$$
(
$1_$2_$3_CMM_OBJS
)
$$
(
$1_$2_$3_C_OBJS
)
$$
(
$1_$2_$3_S_OBJS
)
$$
(
$1_$2_EXTRA_OBJS
)
$1_$2_$3_ALL_OBJS
=
$$
(
$1_$2_$3_HS_OBJS
)
$$
(
$1_$2_$3_NON_HS_OBJS
)
...
...
@@ -136,7 +136,7 @@ ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
$1_$2_GHCI_LIB
=
$$
(
$1_$2_dyn_LIB
)
else
ifeq
"$3" "v"
$1_$2_GHCI_LIB
=
$1
/
$2
/build/HS
$$
(
$1_$2_
LIB_NAME
)
.
$$
(
$3_osuf
)
$1_$2_GHCI_LIB
=
$1
/
$2
/build/HS
$$
(
$1_$2_
COMPONENT_ID
)
.
$$
(
$3_osuf
)
ifeq
"$$($1_$2_BUILD_GHCI_LIB)" "YES"
# Don't put bootstrapping packages in the bindist
ifneq
"$4" "0"
...
...
rules/build-package.mk
View file @
6338a1cc
...
...
@@ -133,7 +133,7 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \
# If dyn libs are not being built then $$($1_$2_dyn_LIB) will just
# expand to the empty string, and be ignored.
$1_$2_PROGRAM_DEP_LIB
=
$$
(
$1_$2_v_LIB
)
$$
(
$1_$2_dyn_LIB
)
$$($1_$2_
LIB_NAME
)_$2_PROGRAM_DEP_LIB
=
$$
(
$1_$2_PROGRAM_DEP_LIB
)
$$($1_$2_
COMPONENT_ID
)_$2_PROGRAM_DEP_LIB
=
$$
(
$1_$2_PROGRAM_DEP_LIB
)
# C and S files are possibly built the "dyn" way.
ifeq
"$$(BuildSharedLibs)" "YES"
...
...
rules/build-prog.mk
View file @
6338a1cc
...
...
@@ -189,7 +189,7 @@ ifneq "$$(BINDIST)" "YES"
# The quadrupled $'s here are because the _<way>_LIB variables aren't
# necessarily set when this part of the makefile is read
$1/$2/build/tmp/$$($1_$2_PROG) $1/$2/build/tmp/$$($1_$2_PROG).dll
:
\
$$(foreach dep
,
$$($1_$2_DEP_
LIB_NAME
S)
,
\
$$(foreach dep
,
$$($1_$2_DEP_
COMPONENT_ID
S)
,
\
$$(if $$(filter ghc%
,
$$(dep))
,
\
$(if $(filter 0
,
$3)
,
$$(compiler_stage1_PROGRAM_DEP_LIB)
,
\
$(if $(filter 1
,
$3)
,
$$(compiler_stage2_PROGRAM_DEP_LIB)
,
\
...
...
@@ -241,7 +241,7 @@ $1/$2/build/tmp/$$($1_$2_PROG)-wrapper.c: driver/utils/dynwrapper.c | $$$$(dir $
echo
'#include <Windows.h>'
>>
$$
@
echo
'#include "Rts.h"'
>>
$$
@
echo
'LPTSTR path_dirs[] = {'
>>
$$
@
$
$(
foreach
p,
$$
(
$1_$2_TRANSITIVE_DEP_
LIB_NAME
S
)
,
$
$(
call
make-command,echo
' TEXT("/../lib/$$p"
)
$
$(comma)
'
>>
$$
@
))
$
$(
foreach
p,
$$
(
$1_$2_TRANSITIVE_DEP_
COMPONENT_ID
S
)
,
$
$(
call
make-command,echo
' TEXT("/../lib/$$p"
)
$
$(comma)
'
>>
$$
@
))
echo
' TEXT("/../lib/"),'
>>
$$
@
echo
' NULL};'
>>
$$
@
echo
'LPTSTR progDll = TEXT("../lib/$$($1_$2_PROG).dll");'
>>
$$
@
...
...
rules/distdir-way-opts.mk
View file @
6338a1cc
...
...
@@ -81,19 +81,19 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
# $1_$2_$3_MOST_HC_OPTS is also passed to C compilations when we use
# GHC as the C compiler.
ifeq
"$(SUPPORTS_
PACKAGE_KEY
)" "NO"
ifeq
"$(SUPPORTS_
COMPONENT_ID
)" "NO"
ifeq
"$4" "0"
$4_USE_
PACKAGE_KEY
=
NO
$4_USE_
COMPONENT_ID
=
NO
endif
endif
$1_$2_$4_DEP_OPTS
=
\
$
$(
foreach
pkg,
$$
(
$1_$2_DEP_IPIDS
)
,-package-id
$
$(pkg)
)
ifeq
"$($4_USE_
PACKAGE_KEY
)" "NO"
$4_THIS_
PACKAGE_KEY
=
-package-name
ifeq
"$($4_USE_
COMPONENT_ID
)" "NO"
$4_THIS_
COMPONENT_ID
=
-package-name
else
$4_THIS_
PACKAGE_KEY
=
-this-package-key
$4_THIS_
COMPONENT_ID
=
-this-package-key
endif
$1_$2_$3_MOST_HC_OPTS
=
\
...
...
@@ -103,7 +103,7 @@ $1_$2_$3_MOST_HC_OPTS = \
$$
(
$1_HC_OPTS
)
\
$$
(
$1_$2_HC_PKGCONF
)
\
$
$(
if
$$
(
$1_$2_PROG
)
,,
\
$
$(
if
$$
(
$1_PACKAGE
)
,
$$
(
$4_THIS_
PACKAGE_KEY
)
$$
(
$1_$2_PACKAGE_KEY
)))
\
$
$(
if
$$
(
$1_PACKAGE
)
,
$$
(
$4_THIS_
COMPONENT_ID
)
$$
(
$1_$2_COMPONENT_ID
)))
\
$
$(
if
$$
(
$1_PACKAGE
)
,-hide-all-packages
)
\
-i
$
$(
if
$$
(
$1_$2_HS_SRC_DIRS
)
,
$
$(
foreach
dir
,
$$
(
$1_$2_HS_SRC_DIRS
)
,-i
$1
/
$
$(dir)
)
,-i
$1
)
\
-i
$1
/
$2
/build
-i
$1
/
$2
/build/autogen
\
...
...
@@ -185,11 +185,11 @@ ifneq "$4" "0"
ifeq
"$$(TargetElf)" "YES"
$1_$2_$3_GHC_LD_OPTS
+=
\
-fno-use-rpaths
\
$
$(
foreach
d,
$$
(
$1_$2_TRANSITIVE_DEP_
LIB_NAME
S
)
,-optl-Wl
$
$(comma)
-rpath
-optl-Wl
$
$(comma)
'$$$$ORIGIN/../$$d'
)
-optl-Wl
,-zorigin
$
$(
foreach
d,
$$
(
$1_$2_TRANSITIVE_DEP_
COMPONENT_ID
S
)
,-optl-Wl
$
$(comma)
-rpath
-optl-Wl
$
$(comma)
'$$$$ORIGIN/../$$d'
)
-optl-Wl
,-zorigin
else
ifeq
"$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS
+=
\
-fno-use-rpaths
\
$
$(
foreach
d,
$$
(
$1_$2_TRANSITIVE_DEP_
LIB_NAME
S
)
,-optl-Wl
$
$(comma)
-rpath
-optl-Wl
$
$(comma)
'@loader_path/../$$d'
)
$
$(
foreach
d,
$$
(
$1_$2_TRANSITIVE_DEP_
COMPONENT_ID
S
)
,-optl-Wl
$
$(comma)
-rpath
-optl-Wl
$
$(comma)
'@loader_path/../$$d'
)
endif
endif
endif
...
...
utils/ghc-cabal/Main.hs
View file @
6338a1cc
...
...
@@ -406,9 +406,9 @@ generate directory distdir dll0Modules config_args
allMods
=
mods
++
otherMods
let
xs
=
[
variablePrefix
++
"_VERSION = "
++
display
(
pkgVersion
(
package
pd
)),
-- TODO: move inside withLibLBI
variablePrefix
++
"_
PACKAGE_KEY
= "
++
display
(
localCompatPackageKey
lbi
),
variablePrefix
++
"_
COMPONENT_ID
= "
++
display
(
localCompatPackageKey
lbi
),
-- copied from mkComponentsLocalBuildInfo
variablePrefix
++
"_
LIB_NAME
= "
++
display
(
localComponentId
lbi
),
variablePrefix
++
"_
COMPONENT_ID
= "
++
display
(
localComponentId
lbi
),
variablePrefix
++
"_MODULES = "
++
unwords
mods
,
variablePrefix
++
"_HIDDEN_MODULES = "
++
unwords
otherMods
,
variablePrefix
++
"_SYNOPSIS ="
++
synopsis
pd
,
...
...
@@ -416,9 +416,9 @@ generate directory distdir dll0Modules config_args
variablePrefix
++
"_DEPS = "
++
unwords
deps
,
variablePrefix
++
"_DEP_IPIDS = "
++
unwords
dep_ipids
,
variablePrefix
++
"_DEP_NAMES = "
++
unwords
depNames
,
variablePrefix
++
"_DEP_
LIB_NAME
S = "
++
unwords
depLibNames
,
variablePrefix
++
"_DEP_
COMPONENT_ID
S = "
++
unwords
depLibNames
,
variablePrefix
++
"_TRANSITIVE_DEPS = "
++
unwords
transitiveDeps
,
variablePrefix
++
"_TRANSITIVE_DEP_
LIB_NAME
S = "
++
unwords
transitiveDepLibNames
,
variablePrefix
++
"_TRANSITIVE_DEP_
COMPONENT_ID
S = "
++
unwords
transitiveDepLibNames
,
variablePrefix
++
"_TRANSITIVE_DEP_NAMES = "
++
unwords
transitiveDepNames
,
variablePrefix
++
"_INCLUDE_DIRS = "
++
unwords
(
includeDirs
bi
),
variablePrefix
++
"_INCLUDES = "
++
unwords
(
includes
bi
),
...
...
Ben Gamari
🐢
@bgamari
mentioned in commit
4758a21d
·
Dec 18, 2015
mentioned in commit
4758a21d
mentioned in commit 4758a21d2a9441d5dadf9b40b578c2c8e55773e8
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment