[Libreoffice-commits] .: basic/Library_sb.mk configure.in set_soenv.in solenv/gbuild

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Aug 11 03:54:27 PDT 2011


 basic/Library_sb.mk               |    2 -
 configure.in                      |    5 ++
 set_soenv.in                      |    1 
 solenv/gbuild/CppunitTest.mk      |    2 +
 solenv/gbuild/Library.mk          |    2 +
 solenv/gbuild/LinkTarget.mk       |   69 +++++++++++++++++++++++++++++++++++---
 solenv/gbuild/StaticLibrary.mk    |    2 +
 solenv/gbuild/TargetLocations.mk  |    2 +
 solenv/gbuild/platform/unxgcc.mk  |   24 +++++++++++++
 solenv/gbuild/platform/windows.mk |   19 ++++++++++
 10 files changed, 123 insertions(+), 5 deletions(-)

New commits:
commit 3da919bb4060f22675a23811fa1a63c1511d2484
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Aug 11 12:33:07 2011 +0200

    Implement AsmObject in gbuild (Windows only for now, stub for unxgcc).
    
    This fixes the build of 'basic' on Windows.

diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk
index ee96f71..ce6a72a 100644
--- a/basic/Library_sb.mk
+++ b/basic/Library_sb.mk
@@ -168,7 +168,7 @@ $(eval $(call gb_Library_add_exception_objects,sb,\
 endif
 endif
 ifeq ($(GUI)$(COM)$(CPU),WNTMSCI)
-$(eval $(call gb_Library_add_exception_objects,sb,\
+$(eval $(call gb_Library_add_asmobjects,sb,\
 	basic/source/runtime/wnt-x86 \
 ))
 endif
diff --git a/configure.in b/configure.in
index 841bb98..0b44e89 100755
--- a/configure.in
+++ b/configure.in
@@ -6538,6 +6538,7 @@ AC_SUBST(GNUCP)
 dnl ***************************************
 dnl testing assembler path
 dnl ***************************************
+ML_EXE=""
 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
     if test "$CL_X64" = ""; then
         assembler=ml.exe
@@ -6552,6 +6553,7 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
     if test -x "$with_asm_home/$assembler"; then
         AC_MSG_CHECKING([$assembler assembler path])
         AC_MSG_RESULT([$with_asm_home/$assembler])
+        ML_EXE="$with_asm_home/$assembler"
     else
         AC_PATH_PROG(ML_EXE, $assembler)
         if test -z "$ML_EXE"; then
@@ -6559,11 +6561,13 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
                 with_asm_home=$with_cl_home/$assembler_bin
                 AC_MSG_RESULT([found])
+                ML_EXE="$with_cl_home/$assembler_bin/$assembler"
             else
                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
             fi
         else
             with_asm_home="ASM_IN_PATH"
+            ML_EXE="$assembler"
         fi
     fi
 else
@@ -6571,6 +6575,7 @@ else
 fi
 ASM_HOME="$with_asm_home"
 AC_SUBST(ASM_HOME)
+AC_SUBST(ML_EXE)
 
 dnl ===================================================================
 dnl We need zip and unzip
diff --git a/set_soenv.in b/set_soenv.in
index 1227ef4..7e4441f 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1490,6 +1490,7 @@ ToFile( "ANT_LIB",           PathFormat("@ANT_LIB@"), "e" );
 ToFile( "ANT",               PathFormat("@ANT@"), "e" );
 ToFile( "JDKLIB",            $JAVA_LIB,          "e" );
 ToFile( "ASM_PATH",          $ASM_PATH,          "e" );
+ToFile( "ML_EXE",            "@ML_EXE@",         "e" );
 ToFile( "FRAMEWORKSHOME",    $FRAMEWORKSHOME,    "e" );
 ToFile( "Empty",             $empty,             "n" );
 
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 8f28cd4..e24060c 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -168,6 +168,8 @@ $(eval $(foreach method,\
 	add_objcobjects \
 	add_objcxxobject \
 	add_objcxxobjects \
+	add_asmobject \
+	add_asmobjects \
 	add_package_headers \
 	add_precompiled_header \
 	add_sdi_headers \
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 7a79ad8..5232369 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -113,6 +113,8 @@ $(eval $(foreach method,\
 	add_objcobjects \
 	add_objcxxobject \
 	add_objcxxobjects \
+	add_asmobject \
+	add_asmobjects \
 	add_exception_objects \
 	add_noexception_objects \
 	add_generated_cxxobjects \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index c8005ed..d644fdd 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -47,9 +47,9 @@ endif
 # Overview of dependencies and tasks of LinkTarget
 #
 # target                      task                         depends on
-# LinkTarget                  linking                      CObject CxxObject GenCxxObject ObjCObject ObjCxxObject
+# LinkTarget                  linking                      AsmObject CObject CxxObject GenCxxObject ObjCObject ObjCxxObject
 #                                                          LinkTarget/headers
-# LinkTarget/dep              joined dep file              CObject/dep CxxObject/dep GenCxxObject/dep ObjCObject/dep ObjCxxObject/dep
+# LinkTarget/dep              joined dep file              AsmObject/dep CObject/dep CxxObject/dep GenCxxObject/dep ObjCObject/dep ObjCxxObject/dep
 #                                                          | LinkTarget/headers
 # LinkTarget/headers          all headers available        LinkTarget/external_headers PCH
 #                              including own generated     own generated headers
@@ -63,11 +63,14 @@ endif
 # ObjCObject                  objective c compile          | LinkTarget/headers
 # ObjCxxObject                objective c++ compile        | LinkTarget/headers
 #
+# AsmObject                   asm compile                  | LinkTarget
+#
 # CObject/dep                 dependencies                 these targets generate empty dep files
 # CxxObject/dep               dependencies                 that are populated upon compile
 # GenCxxObject/dep            dependencies
 # ObjCObject/dep            dependencies
 # ObjCxxObject/dep            dependencies
+# AsmObject/dep               dependencies
 
 # LinkTarget/headers means gb_LinkTarget_get_headers_target etc.
 # dependencies prefixed with | are build-order only dependencies
@@ -271,6 +274,34 @@ gb_ObjCObject_ObjCObject =
 
 
 
+# AsmObject class
+
+gb_AsmObject_REPOS := $(gb_REPOS)
+
+# defined by platform
+#  gb_AsmObject_get_source (.asm on Windows, .s elsewhere)
+#  gb_AsmObject__command
+
+define gb_AsmObject__rules
+$$(call gb_AsmObject_get_target,%) : $$(call gb_AsmObject_get_source,$(1),%)
+	$$(call gb_AsmObject__command,$$@,$$*,$$<,$$(call gb_AsmObject_get_dep_target,$$*))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$$(call gb_AsmObject_get_dep_target,%) : $$(call gb_AsmObject_get_target,%)
+	$$(if $$(wildcard $$@),touch $$@,\
+	  $$(call gb_Object__command_dep,$$@,$$(call gb_AsmObject_get_target,$$*)))
+endif
+
+endef
+
+$(foreach repo,$(gb_AsmObject_REPOS),$(eval $(call gb_AsmObject__rules,$(repo))))
+
+$(call gb_AsmObject_get_dep_target,%) :
+	$(eval $(call gb_Output_error,Unable to find asm file $(call gb_AsmObject_get_source,,$*) in the repositories: $(gb_AsmObject_REPOS)))
+
+gb_AsmObject_AsmObject =
+
+
 # LinkTarget class
 
 gb_LinkTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
@@ -295,6 +326,8 @@ $(call gb_LinkTarget_get_clean_target,%) :
 		$(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_dep_target,$(object))) \
 		$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
 		$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object))) \
+		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
+		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_dep_target,$(object))) \
 		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
 		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
 		$(call gb_LinkTarget_get_target,$*) \
@@ -318,7 +351,8 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
 		$(foreach object,$(5),$(call gb_ObjCObject_get_dep_target,$(object)))\
 		$(foreach object,$(6),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
-		 $(foreach object,$(7),$(call gb_GenCxxObject_get_dep_target,$(object)))\
+		$(foreach object,$(7),$(call gb_AsmObject_get_dep_target,$(object)))\
+		$(foreach object,$(8),$(call gb_GenCxxObject_get_dep_target,$(object)))\
 		) && \
 	cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
 	rm -f $${RESPONSEFILE}
@@ -331,6 +365,7 @@ TEMPFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
 	$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
 	$(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \
 	$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
+	$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
 	$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object)))) && \
 $(if $(EXTRAOBJECTLISTS),cat $(EXTRAOBJECTLISTS) >> $${TEMPFILE} && ) \
 mv $${TEMPFILE} $(call gb_LinkTarget_get_objects_list,$(2)) 
@@ -344,7 +379,7 @@ $(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%)
 ifeq ($(gb_FULLDEPS),$(true))
 $(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_dep_target,%)
 $(call gb_LinkTarget_get_dep_target,%) : | $(call gb_LinkTarget_get_headers_target,%)
-	$(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCOBJECTS),$(OBJCXXOBJECTS),$(GENCXXOBJECTS))
+	$(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCOBJECTS),$(OBJCXXOBJECTS),$(ASMOBJECTS),$(GENCXXOBJECTS))
 endif
 
 # Ok, this is some dark voodoo: When declaring a linktarget with
@@ -422,6 +457,8 @@ $(call gb_LinkTarget_get_target,$(1)) : OBJCOBJECTS :=
 $(call gb_LinkTarget_get_clean_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS :=
 $(call gb_LinkTarget_get_clean_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : ASMOBJECTS :=
+$(call gb_LinkTarget_get_clean_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS :=
 $(call gb_LinkTarget_get_headers_target,$(1)) \
 $(call gb_LinkTarget_get_target,$(1)) : T_CFLAGS := $$(gb_LinkTarget_CFLAGS) $(CFLAGS)
@@ -458,6 +495,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS :=
 $(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS := 
 $(call gb_LinkTarget_get_dep_target,$(1)) : OBJCOBJECTS :=
 $(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : ASMOBJECTS :=
 $(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXOBJECTS :=
 $(call gb_LinkTarget_get_dep_target,$(1)) : T_CFLAGS := $$(gb_LinkTarget_CFLAGS) $(CFLAGS)
 $(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
@@ -731,6 +769,25 @@ endif
 
 endef
 
+define gb_LinkTarget_add_asmobject
+$(call gb_LinkTarget_get_target,$(1)) : ASMOBJECTS += $(2)
+$(call gb_LinkTarget_get_clean_target,$(1)) : ASMOBJECTS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $(call gb_AsmObject_get_target,$(2))
+$(call gb_AsmObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : ASMOBJECTS += $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_AsmObject_get_dep_target,$(2))
+endif
+
+ifeq ($(gb_CHECKOBJECTOWNER),$(true))
+gb_LinkTarget_OBJECTOWNER += $(call gb_AsmObject_get_target,$(2)):$(1)
+gb_LinkTarget_OBJECTS +=  $(call gb_AsmObject_get_target,$(2))
+endif
+
+endef
+
 define gb_LinkTarget_add_generated_cxx_object
 $(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS += $(2)
 $(call gb_LinkTarget_get_clean_target,$(1)) : GENCXXOBJECTS += $(2)
@@ -795,6 +852,10 @@ define gb_LinkTarget_add_objcxxobjects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_objcxxobject,$(1),$(obj),$(3)))
 endef
 
+define gb_LinkTarget_add_asmobjects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_asmobject,$(1),$(obj),$(3)))
+endef
+
 define gb_LinkTarget_add_noexception_objects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_noexception_object,$(1),$(obj)))
 endef
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index 841f70c..88295cc 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -87,6 +87,8 @@ $(eval $(foreach method,\
 	add_cxxobjects \
 	add_objcxxobject \
 	add_objcxxobjects \
+	add_asmobject \
+	add_asmobjects \
 	add_exception_objects \
 	add_noexception_objects \
 	add_generated_cxxobjects \
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index d92a0e7..eb3b583 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -58,6 +58,7 @@ endef
 # workdir target patterns
 
 gb_AllLangResTarget_get_target = $(WORKDIR)/AllLangRes/$(1)
+gb_AsmObject_get_target = $(WORKDIR)/AsmObject/$(1).o
 gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o
 gb_ComponentTarget_get_target = $(WORKDIR)/ComponentTarget/$(1).component
 gb_ComponentTarget_get_inbuild_target = $(WORKDIR)/ComponentTarget/$(1).inbuild.component
@@ -161,6 +162,7 @@ $(eval $(call gb_Helper_make_dep_targets,\
 	CxxObject \
 	ObjCObject \
 	ObjCxxObject \
+	AsmObject \
 	GenCxxObject \
 	LinkTarget \
 	SrsPartTarget \
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index e30c522..3c330c7 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -224,6 +224,28 @@ $(call gb_Helper_abbreviate_dirs,\
 endef
 
 
+# AsmObject class
+
+gb_AsmObject_get_source = $(1)/$(2).s
+
+# $(call gb_AsmObject__command,object,relative-source,source,dep-file)
+define gb_AsmObject__command
+$(call gb_Output_announce,$(2),$(true),ASM,3)
+$(call gb_Helper_abbreviate_dirs,\
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
+	echo "FIXME: Building assembler with gcc not yet implemented." && exit 1
+	#$(gb_CC) \
+	#	$(DEFS) \
+	#	$(T_CFLAGS) \
+	#	-c $(3) \
+	#	-o $(1) \
+	#	-MMD -MT $(1) \
+	#	-MF $(4) \
+	#	-I$(dir $(3)) \
+	#	$(INCLUDE))
+endef
+
+
 # LinkTarget class
 
 define gb_LinkTarget__get_rpath_for_layer
@@ -260,6 +282,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(T_LDFLAGS) \
 		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
 		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
 		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
 		$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
 		-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
@@ -274,6 +297,7 @@ $(call gb_Helper_abbreviate_dirs,\
 	$(gb_AR) -rsu $(1) \
 		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
 		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
 		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
 		$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \
 		$(if $(findstring s,$(MAKEFLAGS)),2> /dev/null))
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index 7442b45..83cbf24 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -76,6 +76,10 @@ gb_RCDEFS := \
 gb_RCFLAGS := \
 	 -V
 
+# FIXME: When porting to Windows64, we should use only:
+# /c /Cp
+gb_AFLAGS := /c /Cp /coff /safeseh
+
 gb_CFLAGS := \
 	-Gd \
 	-GR \
@@ -347,6 +351,20 @@ $(call gb_Helper_abbreviate_dirs_native,\
 		-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(1),$(call gb_NoexPrecompiledHeader,$(2)),$(realpath $(3)))
 endef
 
+# AsmObject class
+
+gb_AsmObject_get_source = $(1)/$(2).asm
+
+define gb_AsmObject__command
+$(call gb_Output_announce,$(2),$(true),ASM,3)
+$(call gb_Helper_abbreviate_dirs_native,\
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
+	$(ML_EXE) $(gb_AFLAGS) -D$(COM) /Fo$(1) $(3)) && \
+	echo "$(1) : $(realpath $(3))" > $(4)
+$(call gb_Object__command_deponcompile,$(1),$(4),$(3),,,)
+endef
+
+
 # LinkTarget class
 
 gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
@@ -369,6 +387,7 @@ $(call gb_Helper_abbreviate_dirs_native,\
 		$(call gb_Helper_convert_native,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
 		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
 		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+		$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
 		$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \
 		$(PCHOBJS) $(NATIVERES))) && \
 	$(gb_LINK) \


More information about the Libreoffice-commits mailing list