[llvm-commits] CVS: llvm/Makefile.rules
Reid Spencer
reid at x10sys.com
Mon Aug 7 16:12:36 PDT 2006
Changes in directory llvm:
Makefile.rules updated: 1.392 -> 1.393
---
Log message:
For PR780: http://llvm.org/PR780 :
1. Change the usage of LOADABLE_MODULE so that it implies all the things
necessary to make a loadable module. This reduces the user's burdern to
get a loadable module correctly built.
2. Document the usage of LOADABLE_MODULE in the MakefileGuide
3. Adjust the makefile for lib/Transforms/Hello to use the new specification
for building loadable modules
4. Adjust the sample project to not attempt to build a shared library for
its little library. This was just wasteful and not instructive at all.
---
Diffs of the changes: (+27 -14)
Makefile.rules | 41 +++++++++++++++++++++++++++--------------
1 files changed, 27 insertions(+), 14 deletions(-)
Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.392 llvm/Makefile.rules:1.393
--- llvm/Makefile.rules:1.392 Thu Jul 27 13:19:51 2006
+++ llvm/Makefile.rules Mon Aug 7 18:12:15 2006
@@ -323,12 +323,17 @@
# Adjust LD.Flags and Libtool.Flags depending on the kind of library that is
# to be built. Note that if LOADABLE_MODULE is specified then the resulting
-# shared library can be opened with dlopen
+# shared library can be opened with dlopen. Also, LOADABLE_MODULE implies
+# several other things so we force them to be defined/on.
+ifdef LOADABLE_MODULE
+ SHARED_LIBRARY := 1
+ DONT_BUILD_RELINKED := 1
+ LINK_LIBS_IN_SHARED := 1
+ LD.Flags += -module
+endif
+
ifdef SHARED_LIBRARY
LD.Flags += -rpath $(LibDir)
- ifdef LOADABLE_MODULE
- LD.Flags += -module
- endif
else
LibTool.Flags += --tag=disable-shared
endif
@@ -425,10 +430,12 @@
BCCompile.CXX = $(LLVMGXXWITHPATH) $(CPP.Flags) $(CompileCommonOpts) \
$(CXX.Flags)
Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -E
-Link = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
- $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags) $(Strip)
-Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
- $(CXX.Flags) $(CompileCommonOpts) $(Relink.Flags)
+Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
+ $(LD.Flags) $(Strip)
+LTLink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Link)
+Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
+ $(Relink.Flags)
+LTRelink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Relink)
LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \
$(Install.Flags)
ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
@@ -772,15 +779,21 @@
all-local:: $(LibName.LA)
ifdef LINK_LIBS_IN_SHARED
+ifdef LOADABLE_MODULE
+SharedLibKindMessage := "Lodable Module"
+else
+SharedLibKindMessage := "Shared Library"
+endif
$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
- $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
- $(Verb) $(Link) -o $@ $(ObjectsLO) \
- $(ProjLibsOptions) $(LLVMLibsOptions)
+ $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
+ $(LIBRARYNAME)$(SHLIBEXT)
+ $(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \
+ $(LLVMLibsOptions)
$(Verb) $(LTInstall) $@ $(LibDir)
else
$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
$(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
- $(Verb) $(Link) -o $@ $(ObjectsLO)
+ $(Verb) $(LTLink) -o $@ $(ObjectsLO)
$(Verb) $(LTInstall) $@ $(LibDir)
endif
@@ -884,7 +897,7 @@
$(LibName.O): $(ObjectsO) $(LibDir)/.dir
$(Echo) Linking $(BuildMode) Object Library $(notdir $@)
- $(Verb) $(Relink) -o $@ $(ObjectsO)
+ $(Verb) $(LTRelink) -o $@ $(ObjectsO)
clean-local::
ifneq ($(strip $(LibName.O)),)
@@ -983,7 +996,7 @@
$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
- $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
+ $(Verb) $(LTLink) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
$(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
$(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
$(StripWarnMsg)
More information about the llvm-commits
mailing list