diff options
author | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
commit | 06ec1c089519ef3249464aa09eadf03a8db93a39 (patch) | |
tree | 85b2eb6d8ba6ca95e18e1ff82151224cb14106f6 /solenv | |
parent | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (diff) | |
parent | 3f899eae02eaad0b967de749fe09b869ba93ad6d (diff) |
Merge branch 'master' into feature/killsdf
Conflicts:
Repository.mk
RepositoryFixes.mk
connectivity/prj/build.lst
extensions/prj/build.lst
filter/prj/build.lst
fpicker/prj/build.lst
l10ntools/StaticLibrary_transex.mk
saxon/build.xml
shell/prj/build.lst
solenv/gbuild/AllLangResTarget.mk
solenv/gbuild/Configuration.mk
solenv/gbuild/UI.mk
ucb/source/ucp/webdav/webdavcontent.cxx
Diffstat (limited to 'solenv')
46 files changed, 1409 insertions, 983 deletions
diff --git a/solenv/CustomTarget_concat-deps.mk b/solenv/CustomTarget_concat-deps.mk new file mode 100644 index 000000000000..1f138c59b8ab --- /dev/null +++ b/solenv/CustomTarget_concat-deps.mk @@ -0,0 +1,26 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CustomTarget_CustomTarget,solenv/concat-deps)) + +$(call gb_CustomTarget_get_target,solenv/concat-deps) : \ + $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps + +$(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps : \ + $(SRCDIR)/solenv/bin/concat-deps.c \ + | $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/.dir + $(call gb_Output_announce,solenv/concat-deps,$(true),GCC,1) +ifeq ($(COM_FOR_BUILD),MSC) + # on cygwin force the use of gcc + gcc -O2 $< -o $@ +else + $(CC_FOR_BUILD) -O2 $< -o $@ +endif + +# vim: set noet sw=4 ts=4: diff --git a/solenv/Module_solenv.mk b/solenv/Module_solenv.mk index d107f9a6d1a9..54db397a088f 100644 --- a/solenv/Module_solenv.mk +++ b/solenv/Module_solenv.mk @@ -33,6 +33,13 @@ $(eval $(call gb_Module_add_targets,solenv,\ Package_minor \ )) +ifeq ($(CROSS_COMPILING),$(false)) +$(eval $(call gb_Module_add_targets,solenv,\ + CustomTarget_concat-deps \ + Package_concat-deps \ +)) +endif + ifeq ($(GUI),UNX) ifneq ($(OS),IOS) ifneq ($(OS),ANDROID) diff --git a/solenv/Package_concat-deps.mk b/solenv/Package_concat-deps.mk new file mode 100644 index 000000000000..9d6319d18c48 --- /dev/null +++ b/solenv/Package_concat-deps.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Package_Package,solenv_concat-deps,$(call gb_CustomTarget_get_workdir,solenv/concat-deps))) + +$(eval $(call gb_Package_add_file,solenv_concat-deps,bin/concat-deps,concat-deps)) + +# vim: set noet sw=4 ts=4: diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl index b754f1665e02..c8e62ee91171 100755 --- a/solenv/bin/build.pl +++ b/solenv/bin/build.pl @@ -1901,11 +1901,10 @@ sub run_job { { return 1 if (! $path =~ /prj$/ ); mkpath("$workdir/Logs"); - my $gbuild_flags = '-j' . $ENV{GMAKE_MODULE_PARALLELISM}; + my $gbuild_flags = '-j' . $ENV{PARALLELISM}; my $gbuild_target = 'all slowcheck'; if ($registered_name =~ /tail_build\/prj$/ ) { - $gbuild_flags = '-j' . $ENV{GMAKE_PARALLELISM}; $gbuild_target = $ENV{gb_TAILBUILDTARGET}; } $gbuild_flags .= ' ' . $ENV{GMAKE_OPTIONS}; diff --git a/solenv/bin/callcatcher.Makefile b/solenv/bin/callcatcher.Makefile index b0164efebf18..e6d262a541f2 100644 --- a/solenv/bin/callcatcher.Makefile +++ b/solenv/bin/callcatcher.Makefile @@ -24,9 +24,9 @@ include $(SOLARENV)/gbuild/gbuild.mk findunusedcode: cd instsetoo_native && unset MAKEFLAGS && \ - $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM) + $(SOLARENV)/bin/build.pl -P$(PARALLELISM) --all -- -P$(PARALLELISM) ooinstall -l $(DEVINSTALLDIR)/opt - $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post subsequentcheck + $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post subsequentcheck callanalyse \ $(WORKDIR)/LinkTarget/*/* \ */$(OUTPATH)/bin/* \ diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 81a47929a266..813c39dd7be9 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -97,9 +97,11 @@ #ifdef __windows #define FILE_O_RDONLY _O_RDONLY #define FILE_O_BINARY _O_BINARY +#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */ #else /* not windaube */ #define FILE_O_RDONLY O_RDONLY #define FILE_O_BINARY 0 +#define PATHNCMP strncmp #endif /* not windaube */ #ifndef TRUE @@ -111,7 +113,7 @@ int internal_boost = 0; static char* base_dir; -static char* out_dir; +static char* work_dir; #ifdef __GNUC__ #define clz __builtin_clz @@ -711,18 +713,12 @@ static inline void eat_space(char ** token) } /* - * Find substring in bounded length string - */ -static inline const char *find_substr(const char *key, int key_len, - const char *substr, int substr_len) -{ -} - -/* * Prune LibreOffice specific duplicate dependencies to improve * gnumake startup time, and shrink the disk-space footprint. */ -static inline int elide_dependency(const char* key, int key_len, int *boost_count) +static inline int +elide_dependency(const char* key, int key_len, + int *boost_count, const char **unpacked_end) { #if 0 { @@ -736,28 +732,52 @@ static inline int elide_dependency(const char* key, int key_len, int *boost_coun #endif /* .hdl files are always matched by .hpp */ - if (key_len > 4 && !strncmp(key + key_len - 4, ".hdl", 4)) + if (key_len > 4 && !PATHNCMP(key + key_len - 4, ".hdl", 4)) return 1; /* boost brings a plague of header files */ - if (internal_boost) + int i; + int boost = 0; + int unpacked = 0; + /* walk down path elements */ + for (i = 0; i < key_len - 1; i++) { - int i; - int hit = 0; - /* walk down path elements */ - for (i = 0; i < key_len - 1; i++) + if (key[i] == '/') { - if (key[i] == '/') + if (internal_boost) { - if (!strncmp(key + i + 1, "solver/", 7)) - hit++; - if (hit > 0 && !strncmp(key + i + 1, "inc/external/boost/", 19)) + if (0 == boost) + { + if (!PATHNCMP(key + i + 1, "solver/", 7)) + { + boost++; + continue; + } + } + else if (!PATHNCMP(key + i + 1, "inc/external/boost/", 19)) { if (boost_count) (*boost_count)++; return 1; } } + if (0 == unpacked) + { + if (!PATHNCMP(key + i + 1, "workdir/", 8)) + { + unpacked = 1; + continue; + } + } + else + { + if (!PATHNCMP(key + i + 1, "UnpackedTarball/", 16)) + { + if (unpacked_end) + *unpacked_end = strchr(key + i + 17, '/'); + return 1; + } + } } } @@ -765,13 +785,23 @@ static inline int elide_dependency(const char* key, int key_len, int *boost_coun } /* - * We collapse tens of internal boost headers to a single one, such + * We collapse tens of internal boost headers to the unpacked target, such * that you can re-compile / install boost and all is well. */ static void emit_single_boost_header(void) { -#define BOOST_HEADER "/inc/external/boost/bind.hpp" - fprintf(stdout, "%s" BOOST_HEADER " ", out_dir); +#define BOOST_TARGET "/UnpackedTarball/boost.done" + fprintf(stdout, "%s" BOOST_TARGET " ", work_dir); +} + +static void emit_unpacked_target(char const*const token, char const*const end) +{ + /* is there some obvious way to printf N characters that i'm missing? */ + size_t size = end - token + 1; + char tmp[size]; + snprintf(tmp, size, "%s", token); + fputs(tmp, stdout); + fputs(".done ", stdout); } /* prefix paths to absolute */ @@ -780,19 +810,34 @@ static inline void print_fullpaths(char* line) char* token; char* end; int boost_count = 0; + const char * unpacked_end = 0; /* end of UnpackedTarget match (if any) */ + /* for UnpackedTarget the target is GenC{,xx}Object, dont mangle! */ + int target_seen = 0; token = line; eat_space(&token); while (*token) { end = token; - while (*end && (' ' != *end) && ('\t' != *end)) { + /* hard to believe that in this day and age drive letters still exist */ + if (*end && (':' == *(end+1)) && + (('\\' == *(end+2)) || ('/' == *(end+2))) && isalpha(*end)) + { + end = end + 3; /* only one cross, err drive letter per filename */ + } + while (*end && (' ' != *end) && ('\t' != *end) && (':' != *end)) { ++end; } int token_len = end - token; - if(elide_dependency(token, token_len, &boost_count)) + if (target_seen && + elide_dependency(token, token_len, &boost_count, &unpacked_end)) { - if (boost_count == 1) + if (unpacked_end) + { + emit_unpacked_target(token, unpacked_end); + unpacked_end = 0; + } + else if (boost_count == 1) emit_single_boost_header(); else { @@ -803,22 +848,38 @@ static inline void print_fullpaths(char* line) end = token + 2; } } - else if(*token == ':' || *token == '\\' || *token == '/' || - *token == '$' || ':' == token[1]) - { - fwrite(token, token_len, 1, stdout); - fputc(' ', stdout); - } else { - fwrite(token, end - token, 1, stdout); + if (fwrite(token, token_len, 1, stdout) != 1) + abort(); fputc(' ', stdout); } token = end; eat_space(&token); + if (!target_seen) + { + if (':' == *token) + { + target_seen = 1; + fputc(':', stdout); + ++token; + eat_space(&token); + } + } } } +static inline char * eat_space_at_end(char * end) +{ + assert('\0' == *end); + char * real_end = end - 1; + while (' ' == *real_end || '\t' == *real_end || '\n' == *real_end + || ':' == *real_end) + { /* eat colon and whitespace at end */ + --real_end; + } + return real_end; +} static int _process(struct hash* dep_hash, char* fn) { @@ -842,6 +903,12 @@ off_t size; { base = cursor_out = cursor = end = buffer; end += size; + + /* first eat unneeded space at the beginning of file + */ + while(cursor < end && (*cursor == ' ' || *cursor == '\\')) + ++cursor; + while(cursor < end) { if(*cursor == '\\') @@ -874,9 +941,9 @@ off_t size; * these are the one for which we want to filter * duplicate out */ - int key_len = cursor_out - base; - if(!elide_dependency(base,key_len - 1, NULL) && - hash_store(dep_hash, base, key_len)) + int key_len = eat_space_at_end(cursor_out) - base; + if (!elide_dependency(base,key_len + 1, NULL, NULL) + && hash_store(dep_hash, base, key_len)) { /* DO NOT modify base after it has been added as key by hash_store */ @@ -890,6 +957,7 @@ off_t size; print_fullpaths(base); putc('\n', stdout); } + last_ns = ' '; // cannot hurt to reset it } cursor += 1; base = cursor_out = cursor; @@ -900,6 +968,7 @@ off_t size; * i.e not a complete rule yet */ *cursor_out++ = *cursor++; + continuation = 0; // cancel current one (empty lines!) } } else @@ -918,7 +987,9 @@ off_t size; { if(last_ns == ':') { - if(hash_store(dep_hash, base, (int)(cursor_out - base))) + int key_len = eat_space_at_end(cursor_out) - base; + if (!elide_dependency(base,key_len + 1, NULL, NULL) && + hash_store(dep_hash, base, key_len)) { puts(base); putc('\n', stdout); @@ -967,7 +1038,7 @@ const char *env_str; _usage(); return 1; } - if(get_var(&base_dir, "SRCDIR") || get_var(&out_dir, "OUTDIR")) + if(get_var(&base_dir, "SRCDIR") || get_var(&work_dir, "WORKDIR")) return 1; env_str = getenv("SYSTEM_BOOST"); diff --git a/solenv/bin/create-tags b/solenv/bin/create-tags index 0388928d6aac..79cbb0d0312d 100755 --- a/solenv/bin/create-tags +++ b/solenv/bin/create-tags @@ -11,6 +11,6 @@ fi omnicppoptions="--c++-kinds=+p --fields=+iaS --extra=+q" ctags -h "+.hdl.hrc" --langmap=c:+.hdl.hrc.src $omnicppoptions \ - --languages=-HTML,Java \ - -R --exclude=`echo ${INPATH} | sed 's/\./\\\./g'` --exclude=binfilter --exclude=solver \ + --languages=-HTML,Java,JavaScript \ + -R --exclude=`echo ${INPATH} | sed 's/\./\\\./g'` --exclude=solver \ --exclude=clone --exclude=install --totals=yes --sort=foldcase * diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo index c6e6a2b040b8..da2e72033396 100755 --- a/solenv/bin/linkoo +++ b/solenv/bin/linkoo @@ -5,6 +5,8 @@ use strict; use File::stat; use File::Copy; +use File::Find; +use File::Spec::Functions qw[splitdir catdir]; #************************************************************************* # @@ -54,6 +56,7 @@ export STAR_RESOURCEPATH=$thisdir/resource export SAL_DISABLE_FLOATGRAB=1 export G_SLICE=always-malloc export MALLOC_CHECK_=2 +export MALLOC_PERTURB_=153 export OOO_DISABLE_RECOVERY=1 export SAL_ALLOW_LINKOO_SYMLINKS=1 '; @@ -73,10 +76,6 @@ if ($ENV{'OS'} eq 'MACOSX') { print "FIXME: linkoo currently does not work on Mac OS X\n"; exit(0); } -if ($TARGET eq 'wntgcci.pro') { - $windows = 1; - $copy = 1; -} # process options for my $a (@ARGV) { @@ -110,8 +109,8 @@ if ($usage || !defined $OOO_INSTALL || !defined $OOO_BUILD) { exit (1); } -substr ($OOO_INSTALL, 0, 1) eq '/' || die "linkoo requires absolute paths ($OOO_INSTALL does not qualify)"; -substr ($OOO_BUILD, 0, 1) eq '/' || die "linkoo requires absolute paths ($OOO_BUILD does not qualify)"; +File::Spec->file_name_is_absolute($OOO_INSTALL) || die "linkoo requires absolute paths ($OOO_INSTALL does not qualify)"; +File::Spec->file_name_is_absolute($OOO_BUILD) || die "linkoo requires absolute paths ($OOO_BUILD does not qualify)"; -d $OOO_INSTALL || die "No such directory $OOO_INSTALL"; -w $OOO_INSTALL || die "You need write access to $OOO_INSTALL"; @@ -119,6 +118,10 @@ substr ($OOO_BUILD, 0, 1) eq '/' || die "linkoo requires absolute paths ($OOO_ ($TARGET, $LIBVER, $LANG) = sniff_target ($OOO_BUILD); +if ($TARGET =~ /^wntgcci/ || $TARGET =~ /^wntmsci[0-9]+/) { + $windows = 1; + $copy = 1; +} # setup global variables my $brand_program_dir = 'program'; @@ -300,24 +303,35 @@ sub scan_one_dir($$$$) } } -sub scan_and_link_files($$$) +sub get_modules($$) { my $build_path = shift; - my $installed_files = shift; my $target = shift; my @modules = (); my $dirh_toplevel; opendir ($dirh_toplevel, $build_path) || die "Can't open '$build_path': $!"; - while (my $subdir = readdir ($dirh_toplevel)) { - $subdir =~ m/\./ && next; # eg. vcl.old, - $subdir eq 'solver' && next; # skip solver dir itself - my $test = "$build_path/$subdir/$target"; - -d $test || next; - push @modules, $test; + while ( my $subdir = readdir ($dirh_toplevel) ) + { + $subdir =~ m/\./ && next; # eg. vcl.old, + $subdir eq 'solver' && next; # skip solver dir itself + my $test = "$build_path/$subdir/$target"; + -d $test || next; + push @modules, $test; } closedir ($dirh_toplevel); + return \@modules; +} + +sub scan_and_link_files($$$) +{ + my $build_path = shift; + my $installed_files = shift; + my $target = shift; + + my @modules = get_modules( $build_path, $target ); + # Scan the old-style module/$target/lib directories ... my %build_files; for my $module (@modules) { @@ -427,6 +441,68 @@ sub link_pagein_files() print "\n"; } +sub link_ui_files() +{ + # First find all the en-US .ui files installed + my @files = (); + + find( sub + { + if ( $File::Find::dir !~ /\/res\// && $_ =~ /\.ui$/ ) + { + push( @files, $File::Find::name ); + } + }, $OOO_INSTALL ); + + my @modules = get_modules( $OOO_BUILD, $TARGET ); + + # Search the files in the source tree + for my $dest ( @files ) + { + my @dest_dirs = splitdir( $dest ); + my $module_dir = @dest_dirs[-3]; + + my $name = @dest_dirs[-1]; + my $nb_dirs = @dest_dirs - 2; + my $dest_dir = catdir( @dest_dirs[0..$nb_dirs] ); + + # Find out the file to link to in the source tree + my $modulepath = ""; + my $nb_segments = 3; + if ( $dest =~ /\/modules\// ) + { + # Handle the modules/* cases + if ( $module_dir =~ /^sw/ || $module_dir eq "sglobal" ) { $modulepath = "sw/uiconfig"; } + elsif ( $module_dir eq "smath" ) { $modulepath = "starmath/uiconfig"; } + elsif ( $module_dir eq "simpress" || $module_dir eq "sdraw" ) { $modulepath = "sd/uiconfig"; } + elsif ( $module_dir eq "scalc" ) { $modulepath = "sc/uiconfig"; } + elsif ( $module_dir =~ /^db/ ) { $modulepath = "dbaccess/uiconfig"; } + elsif ( $module_dir eq "BasicIDE" ) { $modulepath = "basctl/uiconfig/basicide"; $nb_segments = 2; } + elsif ( $module_dir eq "schart" ) { $modulepath = "chart2/uiconfig"; $nb_segments = 2; } + elsif ( $module_dir eq "tubes" ) { $modulepath = "tubes/uiconfig"; } + elsif ( $module_dir eq "StartModule" ) { $modulepath = "framework/uiconfig/startmodule"; $nb_segments = 2; } + } + else + { + $nb_segments = 2; + # Handle the <module>/ui/ cases + my $module = $module_dir; + if ( $module_dir eq "sfx" ) { $module = "sfx2"; } + elsif ( $module_dir eq "svt" ) { $module = "svtools"; } + elsif ( $module_dir eq "sw" ) { $module = "sw"; $nb_segments = 3; } + + $modulepath = "$module/uiconfig"; + } + my $subpath = catdir( @dest_dirs[-$nb_segments..-2] ); + my $src_dir = "$OOO_BUILD/$modulepath/$subpath"; + + if ( -e "$src_dir/$name" ) + { + do_link ( $src_dir, $dest_dir, $name, $name ); + } + } +} + evilness ('undo'); my $installed_files = build_installed_list ($OOO_INSTALL); @@ -434,6 +510,7 @@ my $installed_files = build_installed_list ($OOO_INSTALL); scan_and_link_files ($OOO_BUILD, $installed_files, $TARGET); link_gdb_py(); link_pagein_files(); +link_ui_files(); if (!-f "$OOO_INSTALL/" . $brand_program_dir . "/ooenv") { my $ooenv; diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index 9ce5bd62bb6c..15fbdb286cdf 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -702,7 +702,7 @@ sub replace_setup_variables if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680" - my $buildidstring = join( '-', split( ' ', `$ENV{'SRC_ROOT'}/g -s log -n 1 --pretty=format:"%h "` )); + my $buildidstring = join( '-', split( ' ', `git log -n 1 --pretty=format:"%h "` )); if ($? || !$buildidstring) { $buildidstring = $localbuild . $localminor . "(Build:" . $installer::globals::buildid . ")"; } diff --git a/solenv/gbuild/CliAssembly.mk b/solenv/gbuild/CliAssembly.mk index e3a87bdf52ae..f8c6fdb8a729 100644 --- a/solenv/gbuild/CliAssembly.mk +++ b/solenv/gbuild/CliAssembly.mk @@ -56,11 +56,13 @@ define gb_CliAssemblyTarget__command $(call gb_Output_announce,$(2),$(true),AL ,2) $(call gb_Helper_abbreviate_dirs,\ al \ - -out:$(1) \ + -nologo \ + -out:$(CLI_ASSEMBLY_OUTFILE) \ -version:$(CLI_ASSEMBLY_VERSION) \ -keyfile:$(call gb_Helper_windows_path,$(CLI_ASSEMBLY_KEYFILE)) \ -link:$(CLI_ASSEMBLY_CONFIGFILE) \ - $(if $(CLI_ASSEMBLY_PLATFORM),-platform:$(CLI_ASSEMBLY_PLATFORM)) \ + $(if $(CLI_ASSEMBLY_PLATFORM),-platform:$(CLI_ASSEMBLY_PLATFORM)) && \ + touch $(1) \ ) endef @@ -73,23 +75,29 @@ $(dir $(call gb_CliAssemblyTarget_get_target,%))%/.dir : $(call gb_CliAssemblyTarget_get_target,%) : $(if $(strip $(CLI_ASSEMBLY_VERSION)),,$(call gb_Output_error,assembly version not set)) $(if $(strip $(CLI_ASSEMBLY_CONFIGFILE)),,$(call gb_Output_error,assembly configuration file not set)) + $(if $(strip $(CLI_ASSEMBLY_OUTFILE)),,$(call gb_Output_error,assembly name not set)) $(call gb_CliAssemblyTarget__command,$@,$*,$<) +$(call gb_CliAssemblyTarget_get_assembly_target,%) : + touch $@ + .PHONY : $(call gb_CliAssemblyTarget_get_clean_target,%) $(call gb_CliAssemblyTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),AL ,2) $(call gb_Helper_abbreviate_dirs,\ - rm -f $(call gb_CliAssemblyTarget_get_target,$*) \ + rm -f $(call gb_CliAssemblyTarget_get_target,$*) $(CLI_ASSEMBLY_OUTFILE) \ ) # Create a CLI assembly define gb_CliAssemblyTarget_CliAssemblyTarget $(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_CONFIGFILE := $(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_KEYFILE := $(gb_CliAssemblyTarget_KEYFILE_DEFAULT) +$(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_OUTFILE := $(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_PLATFORM := $(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_VERSION := -$(call gb_CliAssemblyTarget_get_target,$(1)) : $$(CLI_ASSEMBLY_KEYFILE) +$(call gb_CliAssemblyTarget_get_clean_target,$(1)) : CLI_ASSEMBLY_OUTFILE := + $(call gb_CliAssemblyTarget_get_target,$(1)) :| $(dir $(call gb_CliAssemblyTarget_get_target,$(1))).dir endef @@ -102,6 +110,15 @@ endef define gb_CliAssemblyTarget_set_keyfile $(call gb_CliAssemblyTarget_get_target,$(1)) : CLI_ASSEMBLY_KEYFILE := $(2) +$(call gb_CliAssemblyTarget_get_target,$(1)) : $(2) + +endef + +define gb_CliAssemblyTarget_set_name +$(call gb_CliAssemblyTarget_get_target,$(1)) \ +$(call gb_CliAssemblyTarget_get_clean_target,$(1)) : \ + CLI_ASSEMBLY_OUTFILE := $(call gb_CliAssemblyTarget_get_assembly_target,$(2)) +$(call gb_CliAssemblyTarget_get_assembly_target,$(2)) : $(call gb_CliAssemblyTarget_get_target,$(1)) endef @@ -142,9 +159,14 @@ $(call gb_CliAssembly_get_clean_target,$(1)) : $(call gb_Package_get_clean_targe endef +define gb_CliAssembly__add_file +$(call gb_Package_add_file,$(1)_assembly,bin/$(notdir $(2)),$(subst $(WORKDIR)/,,$(2))) + +endef + define gb_CliAssembly__set_configfile_impl $(call gb_CliAssemblyTarget_set_configfile,$(1),$(2)) -$(call gb_Package_add_file,$(1)_assembly,bin/$(notdir $(2)),$(subst $(WORKDIR)/,,$(2))) +$(call gb_CliAssembly__add_file,$(1),$(2)) endef @@ -171,7 +193,8 @@ endef define gb_CliAssembly_set_policy $(call gb_CliAssemblyTarget_set_version,$(1),$(3)) -$(call gb_Package_add_file,$(1)_assembly,bin/$(2)$(gb_CliAssembly_POLICYEXT),$(subst $(WORKDIR)/,,$(call gb_CliAssemblyTarget_get_target,$(1)))) +$(call gb_CliAssemblyTarget_set_name,$(1),$(2)) +$(call gb_CliAssembly__add_file,$(1),$(call gb_CliAssemblyTarget_get_assembly_target,$(2))) endef diff --git a/solenv/gbuild/CliLibrary.mk b/solenv/gbuild/CliLibrary.mk index 9cf6bd577b21..6b3a4efc944f 100644 --- a/solenv/gbuild/CliLibrary.mk +++ b/solenv/gbuild/CliLibrary.mk @@ -13,6 +13,7 @@ gb_CliLibraryTarget_EXT := $(gb_CliAssembly_POLICYEXT) gb_CliLibraryTarget_CSCFLAGS := \ -noconfig \ + -nologo \ gb_CliLibraryTarget_CSCFLAGS_DEBUG := \ -checked+ \ @@ -40,6 +41,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(CLI_CSCFLAGS) \ -target:library \ -out:$(1) \ + -keyfile:$(call gb_Helper_windows_path,$(CLI_KEYFILE)) \ -reference:System.dll \ $(foreach assembly,$(CLI_ASSEMBLIES),-reference:$(assembly)) \ $(CLI_SOURCES) \ @@ -70,6 +72,7 @@ define gb_CliLibraryTarget_CliLibraryTarget $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_ASSEMBLIES := $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_SOURCES := $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_CSCFLAGS := +$(call gb_CliLibraryTarget_get_target,$(1)) : CLI_KEYFILE := $(call gb_CliLibraryTarget_get_target,$(1)) :| $(dir $(call gb_CliLibraryTarget_get_target,$(1))).dir @@ -147,6 +150,7 @@ $(call gb_CliAssembly_set_configfile,$(1),$(2)) endef define gb_CliLibrary_set_keyfile +$(call gb_CliLibraryTarget_get_target,$(1)) : CLI_KEYFILE := $(2) $(call gb_CliAssembly_set_keyfile,$(1),$(2)) endef diff --git a/solenv/gbuild/Configuration.mk b/solenv/gbuild/Configuration.mk index a5d202b33b3a..1d9ceacbd9ed 100644 --- a/solenv/gbuild/Configuration.mk +++ b/solenv/gbuild/Configuration.mk @@ -95,7 +95,7 @@ endef $(call gb_XcsTarget_get_target,%) : \ $(gb_XcsTarget_XSLT_SchemaVal) $(gb_XcsTarget_XSLT_Sanity) \ $(gb_XcsTarget_XSLT_SchemaTrim) $(gb_XcsTarget_DTD_Schema) - $(call gb_XcsTarget__command,$@,$*,$(call gb_Helper_symlinked_native,$(filter %.xcs,$^))) + $(call gb_XcsTarget__command,$@,$*,$(filter %.xcs,$^)) $(call gb_XcsTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),XCS,1) @@ -142,7 +142,7 @@ endef $(call gb_XcuDataTarget_get_target,%) : $(gb_XcuDataTarget_XSLT_DataVal) \ $(gb_XcuTarget_XSLT_AllLang) $(gb_XcuDataTarget_DTD_ComponentUpdate) - $(call gb_XcuDataTarget__command,$@,$*,$(call gb_Helper_symlinked_native,$(filter %.xcu,$^))) + $(call gb_XcuDataTarget__command,$@,$*,$(filter %.xcu,$^)) $(call gb_XcuDataTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),XCU,2) @@ -185,7 +185,7 @@ $(call gb_Helper_abbreviate_dirs,\ endef $(call gb_XcuModuleTarget_get_target,%) : $(gb_XcuTarget_XSLT_AllLang) - $(call gb_XcuModuleTarget__command,$@,$*,$(call gb_Helper_symlinked_native,$(filter %.xcu,$^)),$(filter %.xcs,$^)) + $(call gb_XcuModuleTarget__command,$@,$*,$(filter %.xcu,$^),$(filter %.xcs,$^)) $(call gb_XcuModuleTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),XCU,3) @@ -303,7 +303,7 @@ $(call gb_Helper_abbreviate_dirs,\ endef $(call gb_XcuResTarget_get_target,%) : $(gb_XcuTarget_XSLT_AllLang) - $(call gb_XcuResTarget__command,$@,$*,$(call gb_Helper_symlinked_native,$(filter %.xcu,$^))) + $(call gb_XcuResTarget__command,$@,$*,$(filter %.xcu,$^)) $(call gb_XcuResTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),XCU,6) @@ -399,6 +399,7 @@ $(call gb_Configuration_get_clean_target,$(1)) : \ $(call gb_XcuDataTarget_get_clean_target,$(2)/$(3)) $(call gb_XcuDataTarget_get_target,$(2)/$(3)) : \ $(call gb_Configuration__get_source,$(1),$(2)/$(3)) \ + $(call gb_Configuration_get_preparation_target,$(1)) \ $(call gb_XcsTarget_for_XcuTarget,$(3)) $(call gb_XcuDataTarget_get_target,$(2)/$(3)) : XCUFILE := $(3) $(call gb_XcuDataTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3) @@ -431,6 +432,7 @@ $(call gb_Configuration_get_clean_target,$(1)) : \ $(call gb_XcuModuleTarget_get_clean_target,$(2)/$(3)) $(call gb_XcuModuleTarget_get_target,$(2)/$(3)) : \ $(call gb_XcuDataSource_for_XcuModuleTarget,$(1),$(2)/$(3)) \ + $(call gb_Configuration_get_preparation_target,$(1)) \ $(call gb_XcsTarget_for_XcuModuleTarget,$(3)) $(call gb_XcuModuleTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3) ifeq ($(strip $(gb_Configuration_NODELIVER_$(1))),) @@ -518,4 +520,12 @@ $(call gb_Configuration_get_preparation_target,$(1)) : $(call gb_Configuration_g endef +# apparently extensions package the XcuMergeTarget directly... +# trivial convenience function to get the right file: +ifeq ($(gb_WITH_LANG),) +gb_XcuFile_for_extension = $(call gb_Configuration__get_source,,$(1)) +else +gb_XcuFile_for_extension = $(call gb_XcuMergeTarget_get_target,$(1)) +endif + # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index f4145dc297bc..3267696c753b 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -102,7 +102,7 @@ $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktarg endef define gb_CppunitTest__CppunitTest_impl -$(call gb_LinkTarget_LinkTarget,$(2)) +$(call gb_LinkTarget_LinkTarget,$(2),CppunitTest_$(1)) $(call gb_LinkTarget_set_targettype,$(2),CppunitTest) $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS)) $(call gb_LinkTarget_add_defs,$(2),\ diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 8c178175ad4f..fab3be92e39d 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -37,11 +37,6 @@ $(call gb_Executable_get_clean_target,%) : rm -f $(call gb_Executable_get_target,$*) \ $(AUXTARGETS)) -$(call gb_Executable_get_target,%) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_Executable_Executable ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN))) $$(eval $$(call gb_Output_info,Currently known executables: $(sort $(gb_Executable_KNOWN)),ALL)) @@ -52,12 +47,13 @@ $(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT)) endef define gb_Executable__Executable_impl -$(call gb_LinkTarget_LinkTarget,$(2)) +$(call gb_LinkTarget_LinkTarget,$(2),Executable_$(1)) $(call gb_LinkTarget_set_targettype,$(2),Executable) $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS)) $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(dir $(call gb_Executable_get_target,$(1))).dir $(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) +$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_Executable_platform,$(1),$(2)) $$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) @@ -68,6 +64,15 @@ define gb_Executable_set_targettype_gui $(call gb_LinkTarget_get_target,Executable/$(1)$(gb_Executable_EXT)) : TARGETGUI := $(2) endef +# The auxtarget is delivered via the rule in Package.mk. +# gb_Executable_add_auxtarget executable outdirauxtarget +define gb_Executable_add_auxtarget +$(call gb_LinkTarget_add_auxtarget,$(call gb_Executable_get_linktargetname,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))))/$(notdir $(2))) +$(call gb_Executable_get_target,$(1)) : $(2) +$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(1))))/$(notdir $(2)) +$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS += $(2) + +endef define gb_Executable_forward_to_Linktarget gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Executable_get_linktargetname,$$(1)),$$(2),$$(3),Executable_$$(1)) diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk index 281bac89420a..eee1232eccf5 100644 --- a/solenv/gbuild/Extension.mk +++ b/solenv/gbuild/Extension.mk @@ -41,6 +41,10 @@ $$(eval $$(call gb_Module_register_target,$(call gb_Extension_get_target,$(1)),$ endef +define gb_Extension_set_license +$(call gb_ExtensionTarget_set_license,$(1),$(2)) +endef + define gb_Extension_add_file $(call gb_ExtensionTarget_add_file,$(1),$(2),$(3)) @@ -122,6 +126,11 @@ $(call gb_ExtensionTarget_add_helptreefile,$(1),$(2),$(3),$(4),$(5)) endef +define gb_Extension_use_unpacked +$(call gb_ExtensionTarget_use_unpacked,$(1),$(2)) + +endef + define gb_Extension_use_package $(call gb_ExtensionTarget_use_package,$(1),$(2)) diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk index bc00c11a8c2f..63dbc4d244f7 100644 --- a/solenv/gbuild/ExtensionTarget.mk +++ b/solenv/gbuild/ExtensionTarget.mk @@ -30,6 +30,8 @@ # platform # gb_ExtensionTarget_LICENSEFILE_DEFAULT +gb_ExtensionTarget__get_preparation_target = $(WORKDIR)/ExtensionTarget/$(1).prepare + gb_ExtensionTarget_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q) gb_ExtensionTarget_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex) gb_ExtensionTarget_XRMEXCOMMAND := \ @@ -77,9 +79,15 @@ $(call gb_ExtensionTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),OXT,3) $(call gb_Helper_abbreviate_dirs,\ rm -f -r $(call gb_ExtensionTarget_get_workdir,$*) && \ - rm -f $(call gb_ExtensionTarget_get_target,$*) \ + rm -f $(call gb_ExtensionTarget__get_preparation_target,$*) \ + $(call gb_ExtensionTarget_get_target,$*) \ ) +# preparation target to delay adding files produced by e.g. UnpackedTarball +$(call gb_ExtensionTarget__get_preparation_target,%) : + $(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $@) && touch $@) + ifeq ($(strip $(gb_WITH_LANG)),) $(call gb_ExtensionTarget_get_workdir,%)/description.xml : $(call gb_Output_announce,$*/description.xml,$(true),CPY,3) @@ -95,7 +103,7 @@ $(call gb_ExtensionTarget_get_workdir,%)/description.xml : $(gb_ExtensionTarget_ mkdir -p $(call gb_ExtensionTarget_get_workdir,$*) && \ $(gb_ExtensionTarget_XRMEXCOMMAND) \ -p $(PRJNAME) \ - -i $(call gb_Helper_symlinked_native,$(filter %.xml,$^)) \ + -i $(filter %.xml,$^) \ -o $@ \ -m $${MERGEINPUT} \ -l all) && \ @@ -112,9 +120,9 @@ $(call gb_ExtensionTarget_get_target,%) : \ mkdir -p $(call gb_ExtensionTarget_get_rootdir,$*)/META-INF \ $(if $(LICENSE),$(call gb_ExtensionTarget_get_rootdir,$*)/registration) && \ $(call gb_ExtensionTarget__subst_platform,$(call gb_ExtensionTarget_get_workdir,$*)/description.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/description.xml) && \ - $(call gb_ExtensionTarget__subst_platform,$(LOCATION)/manifest.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/META-INF/manifest.xml) && \ + $(call gb_ExtensionTarget__subst_platform,$(LOCATION)/META-INF/manifest.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/META-INF/manifest.xml) && \ $(if $(LICENSE),cp -f $(LICENSE) $(call gb_ExtensionTarget_get_rootdir,$*)/registration &&) \ - $(if $(and $(gb_WITH_LANG),$(DESCRIPTION)),cp $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ + $(if $(and $(gb_ExtensionTarget_TRANS_LANGS),$(DESCRIPTION)),cp $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ cd $(call gb_ExtensionTarget_get_rootdir,$*) && \ $(gb_ExtensionTarget_ZIPCOMMAND) -rX --filesync \ $(call gb_ExtensionTarget_get_target,$*) \ @@ -124,6 +132,8 @@ $(call gb_ExtensionTarget_get_target,%) : \ # register target and clean target # add deliverable # add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk) +# +# gb_ExtensionTarget_ExtensionTarget extension srcdir define gb_ExtensionTarget_ExtensionTarget $(call gb_ExtensionTarget_get_target,$(1)) : DESCRIPTION := $(call gb_ExtensionTarget_get_target,$(1)) : FILES := META-INF description.xml @@ -131,7 +141,11 @@ $(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(call gb_ExtensionTarget_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2) $(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(PLATFORMID) $(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) -$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml +$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : \ + $(SRCDIR)/$(2)/description.xml +$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml :| \ + $(call gb_ExtensionTarget__get_preparation_target,$(1)) + ifneq ($(strip $(gb_WITH_LANG)),) $(call gb_ExtensionTarget_get_target,$(1)) : \ POFILES := $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) @@ -151,6 +165,14 @@ $(call gb_ExtensionTarget_get_target,$(1)) : $(gb_ExtensionTarget_LICENSEFILE_DE endef +define gb_ExtensionTarget_add_license +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += registration +$(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(2) +$(call gb_ExtensionTarget_get_target,$(1)) : $(2) +$(2) :| $(call gb_ExtensionTarget__get_preparation_target,$(1)) + +endef + # Use the default description file define gb_ExtensionTarget_use_default_description $(call gb_ExtensionTarget_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt) @@ -169,6 +191,7 @@ endef define gb_ExtensionTarget_add_file $(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2) $(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) +$(3) :| $(call gb_ExtensionTarget__get_preparation_target,$(1)) $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) mkdir -p $$(dir $$@) && \ cp -f $(if $(4),$(4),$(3)) $$@ @@ -224,6 +247,8 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \ $(gb_POLOCATION)/$(4)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po endif $(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) \ + :| $(call gb_ExtensionTarget__get_preparation_target,$(1)) $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \ $(gb_ExtensionTarget_PROPMERGETARGET) $$(call gb_Output_announce,$(2),$(true),PRP,3) @@ -404,12 +429,21 @@ define gb_ExtensionTarget__add_compiled_help_dependency_onelang $(call gb_ExtensionTarget_get_target,$(1)) : FILES += help/$(2) $(call gb_ExtensionTarget_get_target,$(1)) : \ $(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(2).done +$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(2).done \ + :| $(call gb_ExtensionTarget__get_preparation_target,$(1)) endef +define gb_ExtensionTarget_use_unpacked +$(call gb_ExtensionTarget__get_preparation_target,$(1)) \ + :| $(call gb_UnpackedTarball_get_final_target,$(2)) + +endef + define gb_ExtensionTarget_use_package -$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_Package_get_target,$(2)) +$(call gb_ExtensionTarget__get_preparation_target,$(1)) \ + :| $(call gb_Package_get_target,$(2)) endef diff --git a/solenv/gbuild/ExternalPackage.mk b/solenv/gbuild/ExternalPackage.mk index f24a2caeed87..c69d3ade2f7d 100644 --- a/solenv/gbuild/ExternalPackage.mk +++ b/solenv/gbuild/ExternalPackage.mk @@ -18,6 +18,9 @@ # previous version, so the delivered headers will not be updated. # # Uff, I hope this is at least partially understandable :-) +# +# Note: An ExternalPackage object can be used in functions that expect a +# Package (e.g., gb_LinkTarget_use_package(s)). $(dir $(call gb_ExternalPackage_get_target,%)).dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk index 4527fcfc0545..5d53511d6ca4 100644 --- a/solenv/gbuild/Jar.mk +++ b/solenv/gbuild/Jar.mk @@ -96,7 +96,6 @@ $(call gb_Jar_get_target,$(1)) : PACKAGEROOTS := $(call gb_Jar_get_target,$(1)) : PACKAGEDIRS := $(call gb_Jar_get_target,$(1)) : PACKAGEFILES := $(call gb_JavaClassSet_JavaClassSet,$(call gb_Jar_get_classsetname,$(1))) -$(call gb_JavaClassSet_add_classpath,$(call gb_Jar_get_classsetname,$(1)),$(value XCLASSPATH)) $(eval $(call gb_Module_register_target,$(call gb_Jar_get_outdir_target,$(1)),$(call gb_Jar_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Jar_get_outdir_target,$(1)),$(call gb_Jar_get_target,$(1)),$(1)) $(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Jar_get_target,$(1)) diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index 8dbc1bfe0090..fbe87fd27c38 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -67,7 +67,7 @@ $(call gb_JunitTest_get_target,%) : $(CLEAN_CMD) define gb_JunitTest_JunitTest -$(call gb_JunitTest_get_target,$(1)) : T_CP := $(if $(value XCLASSPATH),$$(value XCLASSPATH)$$(gb_CLASSPATHSEP))$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(OUTDIR)/lib +$(call gb_JunitTest_get_target,$(1)) : T_CP := $(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(OUTDIR)/lib $(call gb_JunitTest_get_target,$(1)) : CLASSES := $(eval $(call gb_JunitTest_JunitTest_platform,$(1))) diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index d07fe24292e0..bb799114901c 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -48,25 +48,18 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) : rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \ $(AUXTARGETS)) -# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows -$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_Library_Library ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS))) $$(eval $$(call gb_Output_info,Currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) $$(eval $$(call gb_Output_error,Library $(1) must be registered in Repository.mk)) endif -$(call gb_Library_get_target,$(1)) : AUXTARGETS := $(call gb_Library_get_target,$(1)) : SOVERSION := $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1))) endef define gb_Library__Library_impl -$(call gb_LinkTarget_LinkTarget,$(2)) +$(call gb_LinkTarget_LinkTarget,$(2),Library_$(1)) $(call gb_LinkTarget_set_targettype,$(2),Library) $(call gb_LinkTarget_add_libs,$(2),$(gb_STDLIBS)) $(call gb_LinkTarget_add_defs,$(2),\ @@ -76,18 +69,35 @@ $(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1)) $(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(dir $(call gb_Library_get_target,$(1))).dir $(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) +$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1))) $$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) endef +# Custom definition that does not simply forward to LinkTarget, +# because there are cases where the auxtargets are not delivered to solver... +# The auxtarget is delivered via the rule in Package.mk. +# gb_Library_add_auxtarget library outdirauxtarget +define gb_Library_add_auxtarget +$(call gb_LinkTarget_add_auxtarget,$(call gb_Library_get_linktargetname,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2))) +$(call gb_Library_get_target,$(1)) : $(2) +$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2)) +$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2) + +endef + +define gb_Library_add_auxtargets +$(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux))) + +endef + define gb_Library__set_soversion_script $(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktargetname,$(1)),$(2),$(3)) $(call gb_Library_get_target,$(1)) : SOVERSION := $(2) -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : \ - AUXTARGETS += $(call gb_Library_get_target,$(1)).$(2) +$(call gb_Library_add_auxtarget,$(1),$(call gb_Library_get_target,$(1)).$(2)) + endef # for libraries that maintain stable ABI: set SOVERSION and version script diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 617fc562bb2e..e63892bcb274 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -38,21 +38,28 @@ # enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined] gb_LinkTarget__debug_enabled = \ - $(and $(if $(filter -$(1),$(ENABLE_DEBUG_FOR)),,$(true)),\ + $(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\ $(or $(gb_Module_CURRENTMODULE_DEBUG_ENABLED),\ - $(filter $(1),$(ENABLE_DEBUG_FOR)))) + $(filter $(1),$(ENABLE_DEBUGINFO_FOR)))) # debug flags, if ENABLE_DEBUG is set and the LinkTarget is named -# in the list of libraries of ENABLE_DEBUG_FOR +# in the list of libraries of ENABLE_DEBUGINFO_FOR gb_LinkTarget__get_debugcflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) gb_LinkTarget__get_debugcxxflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS),$(gb_COMPILEROPTFLAGS)) +# similar for LDFLAGS, use linker optimization flags in non-debug case, +# but moreover strip debug from libraries for which debuginfo is not wanted +# (some libraries reuse .o files from other libraries, notably unittests) +gb_LinkTarget__get_stripldflags=$(if $(strip $(CFLAGS)$(CXXFLAGS)$(OBJCFLAGS)$(OBJCXXFLAGS)$(LDFLAGS)),,$(gb_LINKERSTRIPDEBUGFLAGS)) +gb_LinkTarget__get_debugldflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),,$(gb_LINKEROPTFLAGS) $(call gb_LinkTarget__get_stripldflags,$(1))) + # generic cflags/cxxflags to use (optimization flags, debug flags) # user supplied CFLAGS/CXXFLAGS override default debug/optimization flags gb_LinkTarget__get_cflags=$(if $(CFLAGS),$(CFLAGS),$(call gb_LinkTarget__get_debugcflags,$(1))) gb_LinkTarget__get_objcflags=$(if $(OBJCFLAGS),$(OBJCFLAGS),$(call gb_LinkTarget__get_debugcflags,$(1))) gb_LinkTarget__get_cxxflags=$(if $(CXXFLAGS),$(CXXFLAGS),$(call gb_LinkTarget__get_debugcxxflags,$(1))) gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(call gb_LinkTarget__get_debugcxxflags,$(1))) +gb_LinkTarget__get_ldflags=$(if $(LDFLAGS),$(LDFLAGS),$(call gb_LinkTarget__get_debugldflags,$(1))) # Overview of dependencies and tasks of LinkTarget # @@ -114,6 +121,9 @@ gb_Object__command_dep = \ $(call gb_Output_error,gb_Object__command_dep is only for gb_FULLDEPS) endif +# This one only exists to force .c/.cxx "rebuilds" when running a compiler tool. +.PHONY: force_compiler_tool_run +force_compiler_tool_run: # CObject class @@ -121,8 +131,13 @@ gb_CObject_get_source = $(1)/$(2).c # defined by platform # gb_CObject__command +ifneq ($(COMPILER_PLUGIN_TOOL),) +$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) force_compiler_tool_run + $(call gb_CObject__tool_command,$*,$<) +else $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(call gb_CObject__command,$@,$*,$<,$(call gb_CObject_get_dep_target,$*)) +endif ifeq ($(gb_FULLDEPS),$(true)) $(call gb_CObject_get_dep_target,%) : @@ -138,8 +153,13 @@ gb_CxxObject_get_source = $(1)/$(2).cxx # defined by platform # gb_CxxObject__command +ifneq ($(COMPILER_PLUGIN_TOOL),) +$(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%) force_compiler_tool_run + $(call gb_CxxObject__tool_command,$*,$<) +else $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%) $(call gb_CxxObject__command,$@,$*,$<,$(call gb_CxxObject_get_dep_target,$*)) +endif ifeq ($(gb_FULLDEPS),$(true)) $(call gb_CxxObject_get_dep_target,%) : @@ -252,6 +272,11 @@ gb_ObjCxxObject_get_source = $(1)/$(2).mm # defined by platform # gb_ObjCxxObject__command +ifneq ($(COMPILER_PLUGIN_TOOL),) +$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) force_compiler_tool_run + $(call gb_ObjCxxObject__tool_command,$*,$<) +else + $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(call gb_ObjCxxObject__command,$@,$*,$<,$(call gb_ObjCxxObject_get_dep_target,$*)) @@ -261,6 +286,7 @@ $(call gb_ObjCxxObject_get_dep_target,%) : $(call gb_Object__command_dep,$@,$(call gb_ObjCxxObject_get_target,$*))) endif +endif # ObjCObject class @@ -270,6 +296,11 @@ gb_ObjCObject_get_source = $(1)/$(2).m # defined by platform # gb_ObjCObject__command +ifneq ($(COMPILER_PLUGIN_TOOL),) +$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) force_compiler_tool_run + $(call gb_ObjCObject__tool_command,$*,$<) +else + $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(call gb_ObjCObject__command,$@,$*,$<,$(call gb_ObjCObject_get_dep_target,$*)) @@ -279,6 +310,7 @@ $(call gb_ObjCObject_get_dep_target,%) : $(call gb_Object__command_dep,$@,$(call gb_ObjCObject_get_target,$*))) endif +endif # AsmObject class @@ -310,7 +342,6 @@ endef # gb_LinkTarget_CXXFLAGS # gb_LinkTarget_LDFLAGS # gb_LinkTarget_INCLUDE -# gb_LinkTarget_INCLUDE_STL .PHONY : $(call gb_LinkTarget_get_clean_target,%) $(call gb_LinkTarget_get_clean_target,%) : @@ -355,7 +386,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(foreach object,$(8),$(call gb_GenCObject_get_dep_target,$(object))) \ $(foreach object,$(9),$(call gb_GenCxxObject_get_dep_target,$(object))) \ ) && \ - $(SOLARENV)/bin/concat-deps $${RESPONSEFILE} > $(1)) && \ + $(call gb_Executable_get_target_for_build,concat-deps) $${RESPONSEFILE} > $(1)) && \ rm -f $${RESPONSEFILE} endef @@ -482,8 +513,7 @@ $(call gb_LinkTarget_get_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $$ $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE) $(call gb_LinkTarget_get_headers_target,$(1)) \ -$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL) -$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(LDFLAGS) +$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(call gb_LinkTarget__get_ldflags,$(2)) $(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS := $(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS := $(call gb_LinkTarget_get_target,$(1)) : LIBS := @@ -515,7 +545,6 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : T_OBJCFLAGS := $$(gb_LinkTarget_OBJC $(call gb_LinkTarget_get_dep_target,$(1)) : T_YACCFLAGS := $$(gb_LinkTarget_YYACFLAGS) $(YACCFLAGS) $(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $$(call gb_LinkTarget_rtl_defs,$(1)) $(CPPFLAGS) $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE) -$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL) $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS := @@ -533,7 +562,6 @@ define gb_LinkTarget_set_soversion_script $(call gb_LinkTarget_get_target,$(1)) : $(3) $(call gb_LinkTarget_get_target,$(1)) : SOVERSION := $(2) $(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(3) -$(call gb_LinkTarget_add_auxtargets,$(1),$(call gb_LinkTarget_get_target,$(1)).$(2)) endef @@ -627,25 +655,24 @@ endif endef define gb_LinkTarget_set_include_stl -$(call gb_LinkTarget_get_headers_target,$(1)) \ -$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $(2) -ifeq ($(gb_FULLDEPS),$(true)) -$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $(2) -endif - +$$(call gb_Output_error,\ + gb_LinkTarget_set_include_stl: removed, why is anybody calling it?) endef define gb_LinkTarget_add_ldflags $(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS += $(2) + endef # real use in RepositoryExternal.mk define gb_LinkTarget_set_ldflags $(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $(2) + endef define gb_LinkTarget_add_libs $(call gb_LinkTarget_get_target,$(1)) : LIBS += $(2) + endef # remove platform specific standard libraries for linktarget $(1) @@ -653,6 +680,7 @@ endef # exceptional cases this disable method may be used define gb_LinkTarget_disable_standard_system_libs $(call gb_LinkTarget_get_target,$(1)) : LIBS := $$(filter-out $$(gb_STDLIBS),$$(LIBS)) + endef define gb_LinkTarget_add_api @@ -1019,6 +1047,12 @@ define gb_LinkTarget_add_generated_cobjects $(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3),$(4))) endef +#only useful for building x64 libraries on windows +define gb_LinkTarget_add_x64_generated_cobjects +$(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3),$(4))) +$(foreach obj,$(2),$(eval $(call gb_GenCObject_get_target,$(obj)) : COBJECT_X64 := YES)) +endef + define gb_LinkTarget_add_generated_cxxobjects $(foreach obj,$(2),$(call gb_LinkTarget_add_generated_cxx_object,$(1),$(obj),$(3))) endef @@ -1034,16 +1068,19 @@ endef define gb_LinkTarget_set_targettype $(call gb_LinkTarget_get_target,$(1)) \ $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(2) + endef define gb_LinkTarget_set_x64 $(call gb_LinkTarget_get_target,$(1)) \ $(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(2) + endef define gb_LinkTarget_set_dlltarget $(call gb_LinkTarget_get_clean_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2) + endef define gb_LinkTarget_set_auxtargets @@ -1051,11 +1088,22 @@ $$(call gb_Output_error,\ gb_LinkTarget_set_auxtargets: use gb_LinkTarget_add_auxtargets instead.) endef -define gb_LinkTarget_add_auxtargets +# Add a file that is built by the LinkTarget command and define +# a dummy touch rule for it so it can be tracked via dependencies. +# gb_LinkTarget_add_auxtarget linktarget auxtarget +define gb_LinkTarget_add_auxtarget +$(2) : $(call gb_LinkTarget_get_target,$(1)) + touch $$@ + $(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS += $(2) endef +define gb_LinkTarget_add_auxtargets +$(foreach aux,$(2),$(call gb_LinkTarget_add_auxtarget,$(1),$(aux))) + +endef + define gb_LinkTarget__add_internal_headers $(call gb_LinkTarget_get_headers_target,$(1)) : $(2) $(2) :| $(call gb_LinkTarget_get_external_headers_target,$(1)) @@ -1088,6 +1136,7 @@ endef define gb_LinkTarget_add_sdi_headers $(call gb_LinkTarget__add_internal_headers,$(1),$(foreach sdi,$(2),$(call gb_SdiTarget_get_target,$(sdi)))) $(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach sdi,$(2),$(call gb_SdiTarget_get_clean_target,$(sdi))) + endef define gb_LinkTarget_add_external_headers @@ -1112,6 +1161,14 @@ $(call gb_LinkTarget_get_external_headers_target,$(1)) :| $(call gb_UnpackedTarb endef +# Use artifacts from ExternalProject (i. e. configure) of an external project +# example in expat: StaticLibrary depends on ExternalProject outcome +define gb_LinkTarget_use_external_project +$(call gb_LinkTarget_get_external_headers_target,$(1)) :| $(call gb_ExternalProject_get_target,$(2)) + +endef + + # this forwards to functions that must be defined in RepositoryExternal.mk. # $(eval $(call gb_LinkTarget_use_external,library,external)) define gb_LinkTarget_use_external diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk index 17fc857e81dc..97f1a81262a0 100644 --- a/solenv/gbuild/Module.mk +++ b/solenv/gbuild/Module.mk @@ -190,8 +190,8 @@ showmodules : # enable if: no "-MODULE/" defined AND ["all" defined OR "MODULE/" defined] gb_Module__debug_enabled = \ - $(and $(if $(filter -$(1)/,$(ENABLE_DEBUG_FOR)),,$(true)),\ - $(filter all $(1)/,$(ENABLE_DEBUG_FOR))) + $(and $(if $(filter -$(1)/,$(ENABLE_DEBUGINFO_FOR)),,$(true)),\ + $(filter all $(1)/,$(ENABLE_DEBUGINFO_FOR))) define gb_Module_Module gb_Module_ALLMODULES += $(1) diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index a09f720db995..4c68af6e82e5 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -42,28 +42,22 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \ $(AUXTARGETS)) -# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows -$(gb_StaticLibrary_OUTDIRLOCATION)/%$(gb_StaticLibrary_PLAINEXT) : - $(call gb_Helper_abbreviate_dirs,\ - $(call gb_Deliver_deliver,$<,$@) \ - $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target)))) - define gb_StaticLibrary_StaticLibrary ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS))) $$(eval $$(call gb_Output_info,Currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL)) $$(eval $$(call gb_Output_error,Static library $(1) must be registered in Repository.mk)) endif -$(call gb_StaticLibrary_get_target,$(1)) : AUXTARGETS := $(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(1))) endef define gb_StaticLibrary__StaticLibrary_impl -$(call gb_LinkTarget_LinkTarget,$(2)) +$(call gb_LinkTarget_LinkTarget,$(2),StaticLibrary_$(1)) $(call gb_LinkTarget_set_targettype,$(2),StaticLibrary) $(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ | $(dir $(call gb_StaticLibrary_get_target,$(1))).dir $(call gb_StaticLibrary_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2)) +$(call gb_StaticLibrary_get_clean_target,$(1)) : AUXTARGETS := $(call gb_StaticLibrary_StaticLibrary_platform,$(1),$(2)) $$(eval $$(call gb_Module_register_target,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_StaticLibrary_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) @@ -88,6 +82,7 @@ $(eval $(foreach method,\ add_x64_generated_exception_objects \ add_noexception_objects \ add_generated_cobjects \ + add_x64_generated_cobjects \ add_generated_cxxobjects \ add_generated_exception_objects \ add_cflags \ @@ -120,6 +115,7 @@ $(eval $(foreach method,\ use_package \ use_packages \ use_unpacked \ + use_external_project \ use_static_libraries \ add_sdi_headers \ set_warnings_not_errors \ diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 11ca2a01c632..1bdece6e5f77 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -83,7 +83,8 @@ gb_AsmObject_get_target = $(WORKDIR)/AsmObject/$(1).o gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o gb_GenCObject_get_target = $(WORKDIR)/GenCObject/$(1).o gb_CliAssembly_get_target = $(WORKDIR)/CliAssembly/$(1).done -gb_CliAssemblyTarget_get_target = $(WORKDIR)/CliAssemblyTarget/$(1)$(gb_CliAssemblyTarget_POLICYEXT) +gb_CliAssemblyTarget_get_target = $(WORKDIR)/CliAssemblyTarget/$(1).done +gb_CliAssemblyTarget_get_assembly_target = $(WORKDIR)/CliAssemblyTarget/$(1)$(gb_CliAssemblyTarget_POLICYEXT) gb_CliConfigTarget_get_target = $(WORKDIR)/CliConfigTarget/$(1).config gb_CliLibraryTarget_get_target = $(WORKDIR)/CliLibraryTarget/$(1)$(gb_CliLibraryTarget_EXT) gb_CliNativeLibraryTarget_get_external_target = $(WORKDIR)/CliNativeLibraryTarget/$(1).external @@ -179,6 +180,7 @@ gb_UnoApiPartTarget_get_target = $(WORKDIR)/UnoApiPartTarget/$(1) gb_UnpackedTarball_get_dir = $(WORKDIR)/UnpackedTarball/$(1) gb_UnpackedTarball_get_pristine_dir = $(WORKDIR)/UnpackedTarball/$(1).org gb_UnpackedTarball_get_final_target = $(WORKDIR)/UnpackedTarball/$(1).update +# NOTE: the .done target is hardcoded in solenv/bin/concat-deps.c ! gb_UnpackedTarball_get_target = $(WORKDIR)/UnpackedTarball/$(1).done gb_UnpackedTarball_get_preparation_target = $(WORKDIR)/UnpackedTarball/$(1).prepare gb_UnpackedTarget_get_target = $(WORKDIR)/UnpackedTarget/$(1) diff --git a/solenv/gbuild/UI.mk b/solenv/gbuild/UI.mk index 9540c159b4fa..73c69c5b3f3d 100644 --- a/solenv/gbuild/UI.mk +++ b/solenv/gbuild/UI.mk @@ -12,7 +12,7 @@ gb_UILocalizeTarget_WORKDIR := $(WORKDIR)/UILocalizeTarget gb_UILocalizeTarget_TARGET := $(call gb_Executable_get_target_for_build,uiex) -gb_UILocalizeTarget_COMMAND := $(gb_Helper_set_ldpath) $(gb_UILocalizeTarget_TARGET) +gb_UILocalizeTarget_COMMAND := $(gb_Helper_set_ld_path) $(gb_UILocalizeTarget_TARGET) define gb_UILocalizeTarget__command $(call gb_Output_announce,$(2),$(true),UIX,1) @@ -50,7 +50,7 @@ $(call gb_UILocalizeTarget_get_target,$(1)) : UI_FILE := $(SRCDIR)/$(2).ui $(call gb_UILocalizeTarget_get_target,$(1)) : UI_LANG := $(3) $(call gb_UILocalizeTarget_get_target,$(1)) : $(foreach lang,$(gb_UITarget_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(dir $(2))).po) -$(call gb_UILocalizeTarget_get_target,$(1)) : $$(UI_FILE) +$(call gb_UILocalizeTarget_get_target,$(1)) : $(SRCDIR)/$(2).ui $(call gb_UILocalizeTarget_get_target,$(1)) :| $(dir $(call gb_UILocalizeTarget_get_target,$(1))).dir endef @@ -159,7 +159,7 @@ $$(eval $$(call gb_Module_register_target,$(call gb_UI_get_target,$(1)),$(call g endef # gb_UI__get_outdir_filename target file lang? -gb_UI__get_outdir_filename = xml/uiconfig/$(1)/ui/$(if $(3),res/$(3)/)$(notdir $(2)).ui +gb_UI__get_outdir_filename = xml/uiconfig/$(1)/ui/$(if $(3),res/$(3)/)$(notdir $(2))$(if $(3),,.ui) # gb_UI__add_uifile target package destfile srcfile lang? define gb_UI__package_uifile diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 98734ab34b75..d5da154f318d 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -143,7 +143,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\ $(foreach idl,$(patsubst %.idl,%,$(3)),$(call gb_UnoApiPartTarget_get_dep_target,$(idl)))) && \ - $(SOLARENV)/bin/concat-deps $${RESPONSEFILE} > $(1)) && \ + $(call gb_Executable_get_target_for_build,concat-deps) $${RESPONSEFILE} > $(1)) && \ rm -f $${RESPONSEFILE} endef diff --git a/solenv/gbuild/UnpackedTarball.mk b/solenv/gbuild/UnpackedTarball.mk index 73123622c2d4..55113c248b07 100644 --- a/solenv/gbuild/UnpackedTarball.mk +++ b/solenv/gbuild/UnpackedTarball.mk @@ -73,6 +73,9 @@ $(call gb_UnpackedTarget_get_target,%).tgz : $(call gb_UnpackedTarget_get_target,%).zip : $(call gb_UnpackedTarget__command,unzip,$@,$*) +$(call gb_UnpackedTarget_get_target,%).oxt : + $(call gb_UnpackedTarget__command,unzip,$@,$*) + .PHONY : $(call gb_UnpackedTarget_get_clean_target,%) $(call gb_UnpackedTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),UPK,1) @@ -177,6 +180,7 @@ $(call gb_UnpackedTarball_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),PAT,2) $(call gb_Helper_abbreviate_dirs,\ rm -rf \ + $(call gb_UnpackedTarball_get_final_target,$*) \ $(call gb_UnpackedTarball_get_target,$*) \ $(call gb_UnpackedTarball_get_preparation_target,$*) \ $(call gb_UnpackedTarball_get_dir,$*) \ diff --git a/solenv/gbuild/WinResTarget.mk b/solenv/gbuild/WinResTarget.mk index cb683c2b5eb6..62e4bbf63ae9 100644 --- a/solenv/gbuild/WinResTarget.mk +++ b/solenv/gbuild/WinResTarget.mk @@ -36,7 +36,7 @@ $(call gb_WinResTarget_get_target,%) : $(call gb_WinResTarget__command,$@,$*,$<) $(call gb_WinResTarget_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),RES,3) + $(call gb_Output_announce,$*,$(false),RC ,3) $(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_WinResTarget_get_target,$*) \ $(call gb_WinResTarget_get_dep_target,$*)) diff --git a/solenv/gbuild/Zip.mk b/solenv/gbuild/Zip.mk index a7239cd6477f..715b495ce9e4 100644 --- a/solenv/gbuild/Zip.mk +++ b/solenv/gbuild/Zip.mk @@ -128,4 +128,10 @@ $(call gb_Zip_get_target,$(1)) : gb_Zip_ZIPCOMMAND += $(2) endef +define gb_Zip_use_unpacked +$(call gb_Zip__get_preparation_target,$(1)) \ + :| $(call gb_UnpackedTarball_get_final_target,$(2)) + +endef + # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/gbuild.help.txt b/solenv/gbuild/gbuild.help.txt index b6707ebd8ff0..e2c427d4d956 100644 --- a/solenv/gbuild/gbuild.help.txt +++ b/solenv/gbuild/gbuild.help.txt @@ -48,16 +48,16 @@ AVAILABLE TARGETS environement set. (see gb_SIDE) INTERACTIVE VARIABLES: - DEBUG / debug If not empty, build with DBGLEVEL=1 (see below). - ENABLE_SYMBOLS / enable_symbols - If not empty, build with debugging information. - Automatically enabled by DEBUG/debug. + DEBUG / debug If not empty, build as with --enable-debug. DBGLEVEL / dbglevel If not empty, force the debug level to the specified value. The debug level is passed to the source code through OSL_DEBUG_LEVEL macro. - 0 = no debug - 1 = debugging information + no optimizations + 0 = no debug (as with --disable-debug) + 1 = debugging information + no optimizations (as with --enable-debug) + (Note that levels higher than 2 are used only by obsolete debugging + features. Use SAL_INFO/SAL_WARN with a specific area for extra debug + output in new code.) 2 = degugging information + no optimizations + extra debug output. OSL_TRACE starts being active on this level. diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 0f73a7422ed7..521d4bd38e57 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -80,59 +80,47 @@ endif include $(GBUILDDIR)/Output.mk - -ifneq ($(strip $(PRODUCT)$(product)),) -gb_PRODUCT := $(true) -else -gb_PRODUCT := $(false) -endif - gb_TIMELOG := 0 ifneq ($(strip $(TIMELOG)$(timelog)),) gb_TIMELOG := 1 endif +# This used to be PRODUCT="" (for the same meaning as ENABLE_DBGUTIL="TRUE"), +# but the product meaning is now only confusing. +ifneq ($(ENABLE_DBGUTIL),) +gb_ENABLE_DBGUTIL := $(true) +else +gb_ENABLE_DBGUTIL := $(false) +endif + gb_DEBUGLEVEL := 0 ifneq ($(strip $(DEBUG)),) gb_DEBUGLEVEL := 1 +# make DEBUG=true should force -g ifeq ($(origin DEBUG),command line) -ENABLE_DEBUG_FOR := all +ENABLE_DEBUGINFO_FOR := all endif endif ifneq ($(strip $(debug)),) gb_DEBUGLEVEL := 1 ifeq ($(origin debug),command line) -ENABLE_DEBUG_FOR := all +ENABLE_DEBUGINFO_FOR := all endif endif -ifeq ($(gb_PRODUCT),$(false)) +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) gb_DEBUGLEVEL := 1 endif ifneq ($(strip $(DBGLEVEL)),) gb_DEBUGLEVEL := $(strip $(DBGLEVEL)) ifeq ($(origin DBGLEVEL),command line) -ENABLE_DEBUG_FOR := all +ENABLE_DEBUGINFO_FOR := all endif endif ifneq ($(strip $(dbglevel)),) gb_DEBUGLEVEL := $(strip $(dbglevel)) ifeq ($(origin dbglevel),command line) -ENABLE_DEBUG_FOR := all -endif -endif - -ifeq ($(or $(ENABLE_SYMBOLS),$(enable_symbols)),FALSE) -gb_SYMBOL := $(false) -else -ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)),) -gb_SYMBOL := $(true) -else -ifneq ($(gb_DEBUGLEVEL),0) -gb_SYMBOL := $(true) -else -gb_SYMBOL := $(false) -endif +ENABLE_DEBUGINFO_FOR := all endif endif @@ -244,7 +232,7 @@ gb_GLOBALDEFS := \ $(gb_CPUDEFS) \ -ifeq ($(gb_PRODUCT),$(false)) +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) gb_GLOBALDEFS += -DDBG_UTIL \ ifneq ($(COM),MSC) diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk index c7d40d34bed9..5ef325b896f8 100644 --- a/solenv/gbuild/platform/IOS_ARM_GCC.mk +++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk @@ -103,7 +103,7 @@ $(call gb_Helper_abbreviate_dirs,\ -MMD -MT $(1) \ -MP -MF $(4) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE)) + $(INCLUDE)) endef # ObjCObject class @@ -121,7 +121,7 @@ $(call gb_Helper_abbreviate_dirs,\ -MMD -MT $(call gb_ObjCObject_get_target,$(2)) \ -MP -MF $(call gb_ObjCObject_get_dep_target,$(2)) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE)) + $(INCLUDE)) endef @@ -132,13 +132,6 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) -ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CFLAGS += -g -gb_LinkTarget_CXXFLAGS += -g -gb_LinkTarget_OBJCXXFLAGS += -g -gb_LinkTarget_OBJCFLAGS += -g -endif - define gb_LinkTarget__get_liblinkflags $(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \ $(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT)) @@ -176,6 +169,7 @@ endef define gb_LinkTarget__command_staticlink $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk index 46f4e70d2462..f1e7d28a942c 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -117,10 +117,7 @@ gb_STDLIBS := \ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) -ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += $(GGDB2) -gb_LinkTarget_CFLAGS += $(GGDB2) -endif +gb_DEBUG_CFLAGS := -g -fno-inline gb_LinkTarget_INCLUDE +=\ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ @@ -164,19 +161,21 @@ $(call gb_Helper_abbreviate_dirs,\ $(LIBS) \ -Wl$(COMMA)-Map$(COMMA)$(dir $(1))$(notdir $(basename $(DLLTARGET)).map) \ -Wl$(COMMA)--out-implib$(COMMA)$(1) \ - -o $(dir $(1))/$(notdir $(DLLTARGET)))) + -o $(dir $(1))/$(notdir $(DLLTARGET))) \ + $(if $(findstring s,$(MAKEFLAGS)),> /dev/null)) endef define gb_LinkTarget__command_staticlinklibrary $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ - $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) + $(if $(findstring s,$(MAKEFLAGS)),> /dev/null)) endef define gb_LinkTarget__command @@ -262,14 +261,12 @@ gb_Library_ILIBEXT := .lib define gb_Library_Library_platform $(call gb_LinkTarget_set_dlltarget,$(2),$(3)) -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.dll,%.map,$(3)) \ -) - $(call gb_Library_get_target,$(1)) :| $(OUTDIR)/bin/.dir -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.map,$(3))) +$(call gb_Library_add_auxtargets,$(1), \ + $(OUTDIR)/bin/$(notdir $(3)) \ + $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.map,$(3))) \ +) $(call gb_Library_add_default_nativeres,$(1),$(1)/default) @@ -336,6 +333,7 @@ define gb_CppunitTest_CppunitTest_platform $(call gb_LinkTarget_set_dlltarget,$(2),$(3)) $(call gb_LinkTarget_add_auxtargets,$(2),\ + $(3) \ $(patsubst %.dll,%.map,$(3)) \ ) @@ -346,7 +344,7 @@ endef gb_WinResTarget_POSTFIX :=.o define gb_WinResTarget__command -$(call gb_Output_announce,$(2),$(true),RES,3) +$(call gb_Output_announce,$(2),$(true),RC ,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(gb_RC) \ @@ -362,7 +360,7 @@ $(eval $(call gb_Helper_make_dep_targets,\ ifeq ($(gb_FULLDEPS),$(true)) define gb_WinResTarget__command_dep -$(call gb_Output_announce,RES:$(2),$(true),DEP,1) +$(call gb_Output_announce,RC:$(2),$(true),DEP,1) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(OUTDIR_FOR_BUILD)/bin/makedepend \ diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index 151327eb0d5b..56795d7d9029 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -26,712 +26,11 @@ # #************************************************************************* -# set tmpdir to some mixed case path, suitable for native tools -gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp)) - -# please make generic Windows modifications to windows.mk -include $(GBUILDDIR)/platform/windows.mk - -gb_CC := cl -gb_CXX := cl -gb_LINK := link -gb_AWK := awk -gb_CLASSPATHSEP := ; -gb_RC := rc -gb_YACC := bison - -# use CC/CXX if they are nondefaults -ifneq ($(origin CC),default) -gb_CC := $(CC) -gb_GCCP := $(CC) -endif -ifneq ($(origin CXX),default) -gb_CXX := $(CXX) -endif - gb_CPPU_ENV := msci - -gb_COMPILERDEFS := \ - -DMSC \ - -D_CRT_NON_CONFORMING_SWPRINTFS \ - -D_CRT_NONSTDC_NO_DEPRECATE \ - -D_CRT_SECURE_NO_DEPRECATE \ - -D_MT \ - -D_DLL \ - -DBOOST_MEM_FN_ENABLE_CDECL \ - -DCPPU_ENV=$(gb_CPPU_ENV) \ - -DM1500 \ - gb_CPUDEFS := -D_X86_=1 -gb_RCDEFS := \ - -DWINVER=0x0400 \ - -DWIN32 \ - -gb_RCFLAGS := \ - -V - -gb_AFLAGS := /c /Cp - -gb_CFLAGS := \ - -Gd \ - -GR \ - -Gs \ - -GS \ - -MD \ - -nologo \ - -Wall \ - -wd4005 \ - -wd4061 \ - -wd4127 \ - -wd4180 \ - -wd4189 \ - -wd4191 \ - -wd4217 \ - -wd4242 \ - -wd4244 \ - -wd4245 \ - -wd4250 \ - -wd4251 \ - -wd4255 \ - -wd4275 \ - -wd4290 \ - -wd4294 \ - -wd4350 \ - -wd4355 \ - -wd4365 \ - -wd4503 \ - -wd4505 \ - -wd4511 \ - -wd4512 \ - -wd4514 \ - -wd4555 \ - -wd4611 \ - -wd4619 \ - -wd4625 \ - -wd4626 \ - -wd4640 \ - -wd4668 \ - -wd4675 \ - -wd4686 \ - -wd4692 \ - -wd4706 \ - -wd4710 \ - -wd4711 \ - -wd4373 \ - -wd4738 \ - -wd4786 \ - -wd4800 \ - -wd4820 \ - -wd4826 \ - -wd4917 \ - -Zc:forScope,wchar_t- \ - -Zm500 \ - -gb_CXXFLAGS := \ - -Gd \ - -GR \ - -Gs \ - -GS \ - -Gy \ - -MD \ - -nologo \ - -Wall \ - -wd4005 \ - -wd4061 \ - -wd4127 \ - -wd4180 \ - -wd4189 \ - -wd4191 \ - -wd4217 \ - -wd4242 \ - -wd4244 \ - -wd4245 \ - -wd4250 \ - -wd4251 \ - -wd4265 \ - -wd4275 \ - -wd4290 \ - -wd4294 \ - -wd4350 \ - -wd4351 \ - -wd4355 \ - -wd4365 \ - -wd4435 \ - -wd4503 \ - -wd4505 \ - -wd4511 \ - -wd4512 \ - -wd4514 \ - -wd4555 \ - -wd4611 \ - -wd4619 \ - -wd4625 \ - -wd4626 \ - -wd4628 \ - -wd4640 \ - -wd4668 \ - -wd4675 \ - -wd4686 \ - -wd4692 \ - -wd4706 \ - -wd4710 \ - -wd4711 \ - -wd4373 \ - -wd4738 \ - -wd4786 \ - -wd4800 \ - -wd4820 \ - -wd4826 \ - -wd4917 \ - -wd4996 \ - -Zc:forScope,wchar_t- \ - -Zm500 \ - -gb_STDLIBS := \ - advapi32.lib \ - -ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) -gb_CFLAGS_WERROR := -WX -DLIBO_WERROR -gb_CXXFLAGS_WERROR := -WX -DLIBO_WERROR -endif - -ifeq ($(MERGELIBS),TRUE) -gb_CFLAGS += -DLIBO_MERGELIBS -gb_CXXFLAGS += -DLIBO_MERGELIBS -endif - -gb_LinkTarget_EXCEPTIONFLAGS := \ - -DEXCEPTIONS_ON \ - -EHa \ - -gb_LinkTarget_NOEXCEPTIONFLAGS := \ - -DEXCEPTIONS_OFF \ - -gb_LinkTarget_LDFLAGS := \ - $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-nologo,) \ - -MANIFEST \ - $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ - -gb_DEBUG_CFLAGS := -Zi - -# this does not use CFLAGS so it is not overridable -ifneq ($(ENABLE_CRASHDUMP),) -gb_CFLAGS+=-Zi -gb_CXXFLAGS+=-Zi -endif - -ifeq ($(gb_SYMBOL),$(true)) -gb_CFLAGS+=-Zi -gb_CXXFLAGS+=-Zi -endif - -gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy- -gb_COMPILERNOOPTFLAGS := -Od - -ifeq ($(gb_FULLDEPS),$(true)) -gb_COMPILERDEPFLAGS := -showIncludes -define gb_create_deps -| $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]} -endef -else -gb_COMPILERDEPFLAGS := -define gb_create_deps -endef -endif - -gb_COMPILER_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL) - -# Helper class - -gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin -gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin - -gb_Helper_set_ld_path := PATH="$${PATH}:$(shell cygpath -u $(OUTDIR)/bin)" - -# Convert path to file URL. -define gb_Helper_make_url -file:///$(strip $(1)) -endef - -# for source files in non-core repositories, the cygwin symlink is not -# understood by native tools, so find the real path to the file -define gb_Helper_symlinked_native -$(shell cygpath -m $(realpath $(1))) -endef - -# YaccTarget class - -define gb_YaccTarget__command -$(call gb_Output_announce,$(2),$(true),YAC,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(3)) && \ - $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) - -endef - -# CObject class - -# $(call gb_CObject__command,object,relative-source,source,dep-file) -define gb_CObject__command -$(call gb_Output_announce,$(2).c,$(true),C ,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ - unset INCLUDE && \ - $(gb_CC) \ - $(DEFS) \ - $(if $(filter Library,$(TARGETTYPE)),$(gb_COMPILER_LTOFLAGS)) \ - $(T_CFLAGS) \ - $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ - -Fd$(PDBFILE) \ - $(gb_COMPILERDEPFLAGS) \ - -I$(dir $(3)) \ - $(INCLUDE) \ - -c $(3) \ - -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3)) -endef - - -# CxxObject class - -# $(call gb_CxxObject__command,object,relative-source,source,dep-file) -define gb_CxxObject__command -$(call gb_Output_announce,$(2).cxx,$(true),CXX,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ - unset INCLUDE && \ - $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \ - $(DEFS) \ - $(if $(filter Library,$(TARGETTYPE)),$(gb_COMPILER_LTOFLAGS)) \ - $(T_CXXFLAGS) \ - $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ - -Fd$(PDBFILE) \ - $(gb_COMPILERDEPFLAGS) \ - -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE) \ - $(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \ - -c $(3) \ - -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(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,\ - mkdir -p $(dir $(1)) $(dir $(4)) && \ - "$(ML_EXE)" $(gb_AFLAGS) -D$(COM) /Fo$(1) $(3)) && \ - echo "$(1) : $(3)" > $(4) -endef - - -# LinkTarget class - -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) - -gb_LinkTarget_INCLUDE :=\ - $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ - $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ - -gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) - -gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb - -# avoid fatal error LNK1170 for Library_merged -define gb_LinkTarget_MergedResponseFile -cut -f -1000 -d ' ' $${RESPONSEFILE} > $${RESPONSEFILE}.1 && \ -cut -f 1001- -d ' ' $${RESPONSEFILE} >> $${RESPONSEFILE}.1 && \ -mv $${RESPONSEFILE}.1 $${RESPONSEFILE} && -endef - -define gb_LinkTarget__command -$(call gb_Output_announce,$(2),$(true),LNK,4) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) && \ - rm -f $(1) && \ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \ - $(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,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ - $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ - $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \ - $(NATIVERES)) && \ - $(if $(filter $(call gb_Library_get_linktargetname,merged),$(2)),$(call gb_LinkTarget_MergedResponseFile)) \ - unset INCLUDE && \ - $(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \ - $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ - $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \ - $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ - $(if $(filter YES,$(TARGETGUI)), -SUBSYSTEM:WINDOWS, -SUBSYSTEM:CONSOLE) \ - $(if $(filter YES,$(LIBRARY_X64)), -MACHINE:X64, -MACHINE:IX86) \ - $(if $(filter YES,$(LIBRARY_X64)), -LIBPATH:$(OUTDIR)/lib/x64 -LIBPATH:$(COMPATH)/lib/amd64 -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64 \ - $(if $(filter 80,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/win8/um/x64,),) \ - $(T_LDFLAGS) \ - @$${RESPONSEFILE} \ - $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \ - $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \ - $(LIBS) \ - $(if $(filter-out StaticLibrary,$(TARGETTYPE)),user32.lib) \ - $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \ - $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) \ - $(if $(filter Library,$(TARGETTYPE)),; if [ -f $(DLLTARGET).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(DLLTARGET).manifest -outputresource:$(DLLTARGET)\;2; fi) \ - $(if $(filter Executable,$(TARGETTYPE)),; if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;1; fi) \ - ; exit $$RC) -endef - -define gb_LinkTarget_use_system_win32_libs -$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),$(lib).lib)) -endef - -# Flags common for PE executables (EXEs and DLLs) -gb_Windows_PE_TARGETTYPEFLAGS := \ - -release \ - -opt:noref \ - -incremental:no \ - -debug \ - -nxcompat \ - -dynamicbase \ - -# Library class - - -gb_Library_DEFS := -D_DLL -gb_Library_TARGETTYPEFLAGS := \ - -DLL \ - $(gb_Windows_PE_TARGETTYPEFLAGS) - -ifeq ($(ENABLE_LTO),TRUE) -gb_Library_TARGETTYPEFLAGS += -LTCG -endif - -gb_Library_get_rpath := - -gb_Library_SYSPRE := i -gb_Library_PLAINEXT := .lib - -gb_Library_LAYER := \ - $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ - $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ - $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ - $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ - $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ - $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ - $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \ - $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ - $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ - $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ - -gb_Library_FILENAMES :=\ - $(foreach lib,$(gb_Library_KNOWNLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ - -gb_Library_DLLEXT := .dll -gb_Library_MAJORVER := 3 -gb_Library_RTEXT := MSC$(gb_Library_DLLEXT) -gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_DLLEXT) -gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) -gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) -gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) - -gb_Library_DLLFILENAMES :=\ - $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ - $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ - $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ - $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ - $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ - $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ - $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ - $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ - $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ - $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ - -define gb_Library_Library_platform -$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) - -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ - $(3).manifest \ - $(call gb_LinkTarget_get_pdbfile,$(2)) \ - $(patsubst %.dll,%.pdb,$(3)) \ - $(patsubst %.dll,%.ilk,$(3)) \ -) - -$(if $(filter $(gb_MERGEDLIBS),$(1)),,\ -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))) - -ifneq ($(ENABLE_CRASHDUMP),) -$(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \ - $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \ - $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \ - -endif - -$(call gb_Library_add_default_nativeres,$(1),$(1)/default) - -$(if $(filter $(gb_MERGEDLIBS),$(1)),,$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1))) - -$(call gb_LinkTarget_get_target,$(2)) \ -$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) - -endef - -define gb_Library_add_default_nativeres -$(call gb_WinResTarget_WinResTarget_init,$(2)) -$(call gb_WinResTarget_set_rcfile,$(2),solenv/inc/shlinfo) -$(call gb_WinResTarget_add_defs,$(2),\ - -DVERVARIANT="$(BUILD)" \ - -DRES_APP_VENDOR="$(OOO_VENDOR)" \ - -DORG_NAME="$(call gb_Library_get_dllname,$(1))"\ - -DINTERNAL_NAME="$(subst $(gb_Library_DLLEXT),,$(call gb_Library_get_dllname,$(1)))" \ - -DADDITIONAL_VERINFO1="" \ - -DADDITIONAL_VERINFO2="" \ - -DADDITIONAL_VERINFO3="" \ -) -$(call gb_Library_add_nativeres,$(1),$(2)) -$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(2)) - -endef - -define gb_LinkTarget_add_nativeres -$(call gb_LinkTarget_get_target,$(1)) : $(call gb_WinResTarget_get_target,$(2)) -$(call gb_LinkTarget_get_target,$(1)) : NATIVERES += $(call gb_WinResTarget_get_target,$(2)) - -endef - -define gb_Library_get_dllname -$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES))) -endef - - -# StaticLibrary class - -gb_StaticLibrary_TARGETTYPEFLAGS := -LIB -gb_StaticLibrary_SYSPRE := -gb_StaticLibrary_PLAINEXT := .lib - -gb_StaticLibrary_FILENAMES := \ - $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ - -define gb_StaticLibrary_StaticLibrary_platform -$(call gb_LinkTarget_get_target,$(2)) \ -$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) - -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(call gb_LinkTarget_get_pdbfile,$(2)) \ -) - -endef - -# Executable class - -gb_Executable_EXT := .exe -gb_Executable_EXT_for_build := .exe -gb_Executable_TARGETTYPEFLAGS := $(gb_Windows_PE_TARGETTYPEFLAGS) - -gb_Executable_get_rpath := - -define gb_Executable_Executable_platform -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \ - $(call gb_LinkTarget_get_pdbfile,$(2)) \ - $(call gb_LinkTarget_get_target,$(2)).manifest \ -) - -$(call gb_Executable_get_target,$(1)) \ -$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest -$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest,$(1)) - -$(call gb_LinkTarget_get_target,$(2)) \ -$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE := $(call gb_LinkTarget_get_pdbfile,$(2)) -$(call gb_LinkTarget_get_target,$(2)) : TARGETGUI := - -endef - -# CppunitTest class - -gb_CppunitTest_DEFS := -D_DLL -# cppunittester.exe is in the cppunit subdirectory of ${OUTDIR}/bin, -# thus it won't find its DLLs unless ${OUTDIR}/bin is added to PATH. -gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path) - -gb_CppunitTest_SYSPRE := itest_ -gb_CppunitTest_EXT := .lib -gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR) -gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT) -gb_CppunitTest_get_libfilename = test_$(1).dll - -define gb_CppunitTest_CppunitTest_platform -$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) - -$(call gb_LinkTarget_add_auxtargets,$(2),\ - $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ - $(3).manifest \ - $(patsubst %.dll,%.pdb,$(3)) \ - $(call gb_LinkTarget_get_pdbfile,$(2)) \ - $(patsubst %.dll,%.ilk,$(3)) \ -) - -$(call gb_LinkTarget_get_target,$(2)) \ -$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) - -endef - -# JunitTest class - -gb_defaultlangiso := en-US -gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip - -ifeq ($(OOO_TEST_SOFFICE),) - - -# Work around Windows problems with long pathnames (see issue 50885) by -# installing into the temp directory instead of the module output tree (in which -# case $(target).instpath contains the path to the temp installation, -# which is removed after smoketest); can be removed once issue 50885 is fixed; -# on other platforms, a single installation to solver is created in -# smoketestoo_native. - -# for now, no dependency on $(shell ls $(gb_smoketest_instset)) -# because that doesn't work before the instset is built -# and there is not much of a benefit anyway (gbuild not knowing about smoketest) -define gb_JunitTest_JunitTest_platform_longpathname_hack -$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath -$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath) - -$(call gb_JunitTest_get_target,$(1)).instpath : - INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \ - && unzip -d "$$$${INST_DIR}" $$(gb_smoketest_instset) \ - && mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\ - && mkdir -p $$(dir $$@) \ - && echo "$$$${INST_DIR}" > $$@ - -endef -else # OOO_TEST_SOFFICE -gb_JunitTest_JunitTest_platform_longpathname_hack = -endif # OOO_TEST_SOFFICE - -define gb_JunitTest_JunitTest_platform -$(call gb_JunitTest_get_target,$(1)) : DEFS := \ - -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/program/soffice.exe}" \ - -Dorg.openoffice.test.arg.env=PATH="$$$$PATH" \ - -Dorg.openoffice.test.arg.user=file:///$(call gb_JunitTest_get_userdir,$(1)) - -endef - -# SrsPartTarget class - -ifeq ($(gb_FULLDEPS),$(true)) -define gb_SrsPartTarget__command_dep -$(call gb_Helper_abbreviate_dirs,\ - $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ - $(INCLUDE) \ - $(DEFS) \ - $(2) \ - -f - \ - | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ - -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ - -v OUTDIR=$(OUTDIR)/ \ - -v WORKDIR=$(WORKDIR)/ \ - -v SRCDIR=$(SRCDIR)/ \ - > $(call gb_SrsPartTarget_get_dep_target,$(1))) -endef -else -gb_SrsPartTarget__command_dep = -endif - -# WinResTarget class - -gb_WinResTarget_POSTFIX :=.res - -define gb_WinResTarget__command -$(call gb_Output_announce,$(2),$(true),RES,1) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) && \ - $(gb_RC) \ - $(DEFS) $(FLAGS) \ - $(INCLUDE) \ - -Fo$(1) \ - $(RCFILE) ) -endef - -$(eval $(call gb_Helper_make_dep_targets,\ - WinResTarget \ -)) - -ifeq ($(gb_FULLDEPS),$(true)) -define gb_WinResTarget__command_dep -$(call gb_Output_announce,RES:$(2),$(true),DEP,1) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) && \ - $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ - $(INCLUDE) \ - $(DEFS) \ - $(RCFILE) \ - -f - \ - | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ - -v OBJECTFILE=$(3) \ - -v OUTDIR=$(OUTDIR)/ \ - -v WORKDIR=$(WORKDIR)/ \ - -v SRCDIR=$(SRCDIR)/ \ - > $(1)) -endef -else -gb_WinResTarget__command_dep = -endif - -# InstallModuleTarget class - -define gb_InstallModuleTarget_InstallModuleTarget_platform -$(call gb_InstallModuleTarget_add_defs,$(1),\ - $(gb_CPUDEFS) \ - $(gb_OSDEFS) \ - -DCOMID=MSC \ - -DCOMNAME=$(if $(filter INTEL,$(CPUNAME)),msci,mscx) \ - $(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \ -) - -endef - -# ScpConvertTarget class - -define gb_ScpConvertTarget_ScpConvertTarget_platform -$(call gb_ScpConvertTarget_get_target,$(1)) :| $(OUTDIR)/bin/msi-encodinglist.txt -$(call gb_ScpConvertTarget_get_target,$(1)) : SCP_FLAGS := -t $(OUTDIR)/bin/msi-encodinglist.txt - -endef - -# InstallScript class - -gb_InstallScript_EXT := .inf - -# CliAssemblyTarget class - -gb_CliAssemblyTarget_POLICYEXT := $(gb_Library_DLLEXT) -gb_CliAssemblyTarget_get_dll = $(OUTDIR)/bin/$(1)$(gb_CliAssemblyTarget_POLICYEXT) - -# ExtensionTarget class - -gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt - -# UnpackedTarget class - -gb_UnpackedTarget_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION)) - -# UnoApiHeadersTarget class - -ifeq ($(DISABLE_DYNLOADING),TRUE) -gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) -else -gb_UnoApiHeadersTarget_select_variant = $(2) -endif +include $(GBUILDDIR)/platform/com_MSC_defs.mk -# Python -gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload" +include $(GBUILDDIR)/platform/com_MSC_class.mk # vim: set noet sw=4: diff --git a/solenv/gbuild/platform/WNT_X86_64_MSC.mk b/solenv/gbuild/platform/WNT_X86_64_MSC.mk new file mode 100644 index 000000000000..7a54dcbecba9 --- /dev/null +++ b/solenv/gbuild/platform/WNT_X86_64_MSC.mk @@ -0,0 +1,36 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +gb_CPPU_ENV := msc6 +gb_CPUDEFS := -D_AMD64_=1 + +include $(GBUILDDIR)/platform/com_MSC_defs.mk + +include $(GBUILDDIR)/platform/com_MSC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk index 4b8886470d8b..526c18cc4eab 100644 --- a/solenv/gbuild/platform/android.mk +++ b/solenv/gbuild/platform/android.mk @@ -10,11 +10,8 @@ ifeq ($(DISABLE_DYNLOADING),TRUE) # Link with -lgnustl_static gb_STDLIBS := \ - gnustl_static - -gb_Library_PLAINLIBS_NONE := \ - android \ - gnustl_static \ + -lgnustl_static \ + -lm else # Link almost everything with -lgnustl_shared @@ -71,12 +68,6 @@ gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) -gb_Library_PLAINLIBS_NONE += \ - jpeg \ - m \ - pthread \ - z \ - endif # Prefix UNO library filenames with "lib" diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index aa00267222f0..9f2d15ddea5c 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -38,13 +38,10 @@ $(call gb_Output_announce,$(2),$(true),ASM,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ $(gb_CC) \ - $(DEFS) \ - $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(T_CFLAGS) \ -c $(3) \ - -o $(1) \ - -I$(dir $(3)) \ - $(INCLUDE)) && \ + -o $(1)) \ + $(INCLUDE) && \ echo "$(1) : $(3)" > $(4) endef @@ -55,6 +52,7 @@ define gb_CObject__command $(call gb_Output_announce,$(2).c,$(true),C ,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ + $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \ $(gb_CC) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ @@ -71,6 +69,22 @@ $(call gb_Helper_abbreviate_dirs,\ ) endef +# Used to run a compiler plugin tool. +# $(call gb_CObject__tool_command,relative-source,source) +define gb_CObject__tool_command +$(call gb_Output_announce,$(1).c,$(true),C ,3) +$(call gb_Helper_abbreviate_dirs,\ + ICECC=no \ + $(gb_CC) \ + $(DEFS) \ + $(T_CFLAGS) \ + -c $(2) \ + -I$(dir $(2)) \ + $(INCLUDE) \ + $(gb_COMPILER_PLUGINS) \ + ) +endef + # CxxObject class # $(call gb_CxxObject__command,object,relative-source,source,dep-file) @@ -78,6 +92,7 @@ define gb_CxxObject__command $(call gb_Output_announce,$(2).cxx,$(true),CXX,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ + $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \ $(gb_CXX) \ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ @@ -89,11 +104,27 @@ $(call gb_Helper_abbreviate_dirs,\ -o $(1) \ $(gb_cxx_dep_generation_options) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE) \ + $(INCLUDE) \ $(gb_cxx_dep_copy) \ ) endef +# Used to run a compiler plugin tool. +# $(call gb_CxxObject__tool_command,relative-source,source) +define gb_CxxObject__tool_command +$(call gb_Output_announce,$(1).cxx,$(true),CXX,3) +$(call gb_Helper_abbreviate_dirs,\ + ICECC=no \ + $(gb_CXX) \ + $(DEFS) \ + $(T_CXXFLAGS) \ + -c $(2) \ + -I$(dir $(2)) \ + $(INCLUDE) \ + $(gb_COMPILER_PLUGINS) \ + ) +endef + define gb_SrsPartTarget__command_dep $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && cd $(SRCDIR) && \ diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 0cc32b52505b..2fa302360aba 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -85,6 +85,14 @@ ifneq ($(HAVE_THREADSAFE_STATICS),TRUE) gb_CXXFLAGS_COMMON += -fno-threadsafe-statics endif +ifeq ($(strip $(gb_GCOV)),YES) +gb_CFLAGS_COMMON += -fprofile-arcs -ftest-coverage +gb_CXXFLAGS_COMMON += -fprofile-arcs -ftest-coverage +gb_LinkTarget_LDFLAGS += -fprofile-arcs -lgcov +gb_COMPILERDEFAULTOPTFLAGS := -O0 +endif + + ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) @@ -110,7 +118,7 @@ gb_LinkTarget_EXCEPTIONFLAGS := \ -DEXCEPTIONS_ON \ -fexceptions -ifeq ($(gb_PRODUCT),$(true)) +ifeq ($(gb_ENABLE_DBGUTIL),$(false)) # Clang doesn't have this option ifeq ($(HAVE_GCC_FNO_ENFORCE_EH_SPECS),TRUE) gb_LinkTarget_EXCEPTIONFLAGS += \ @@ -150,13 +158,19 @@ gb_DEBUG_CFLAGS := $(GGDB2) $(FINLINE_LIMIT0) $(FNO_INLINE) gb_DEBUG_CXXFLAGS := $(FNO_DEFAULT_INLINE) -gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) -gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) +gb_LinkTarget_INCLUDE := $(subst -I. , ,$(SOLARINC)) ifeq ($(COM_GCC_IS_CLANG),TRUE) -gb_COMPILER_PLUGINS :=-Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/compileplugin.so -Xclang -add-plugin -Xclang loplugin +ifeq ($(COMPILER_PLUGIN_TOOL),) +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/plugin.so -Xclang -add-plugin -Xclang loplugin +else +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(SRCDIR)/compilerplugins/obj/plugin.so -Xclang -plugin -Xclang loplugin -Xclang -plugin-arg-loplugin -Xclang $(COMPILER_PLUGIN_TOOL) +endif +# extra EF variable to make the command line shorter (just like is done with $(SRCDIR) etc.) +gb_COMPILER_PLUGINS_SETUP := EF=$(SRCDIR)/sal/inc/sal/log-areas.dox && ICECC_EXTRAFILES=$$EF CCACHE_EXTRAFILES=$$EF else gb_COMPILER_PLUGINS := +gb_COMPILER_PLUGINS_SETUP := endif # Executable class @@ -187,8 +201,6 @@ define gb_Helper_make_url file://$(strip $(1)) endef -gb_Helper_symlinked_native = $(1) - gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk new file mode 100644 index 000000000000..d0b3cfc78817 --- /dev/null +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -0,0 +1,514 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Convert path to file URL. +define gb_Helper_make_url +file:///$(strip $(1)) +endef + +# YaccTarget class + +define gb_YaccTarget__command +$(call gb_Output_announce,$(2),$(true),YAC,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(3)) && \ + $(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) + +endef + +# CObject class + +# $(call gb_CObject__command,object,relative-source,source,dep-file) +define gb_CObject__command +$(call gb_Output_announce,$(2).c,$(true),C ,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && \ + unset INCLUDE && \ + $(if $(filter YES,$(COBJECT_X64)), $(CXX_X64_BINARY), $(gb_CC)) \ + $(DEFS) \ + $(if $(filter Library,$(TARGETTYPE)),$(gb_COMPILER_LTOFLAGS)) \ + $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ + -Fd$(PDBFILE) \ + $(gb_COMPILERDEPFLAGS) \ + -I$(dir $(3)) \ + $(INCLUDE) \ + $(if $(filter YES,$(COBJECT_X64)), -U_X86_ -D_AMD64_,) \ + -c $(3) \ + -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3)) +endef + + +# CxxObject class + +# $(call gb_CxxObject__command,object,relative-source,source,dep-file) +define gb_CxxObject__command +$(call gb_Output_announce,$(2).cxx,$(true),CXX,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && \ + unset INCLUDE && \ + $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \ + $(DEFS) \ + $(if $(filter Library,$(TARGETTYPE)),$(gb_COMPILER_LTOFLAGS)) \ + $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ + -Fd$(PDBFILE) \ + $(gb_COMPILERDEPFLAGS) \ + -I$(dir $(3)) \ + $(INCLUDE) \ + $(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \ + -c $(3) \ + -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(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,\ + mkdir -p $(dir $(1)) $(dir $(4)) && \ + "$(ML_EXE)" $(gb_AFLAGS) -D$(COM) /Fo$(1) $(3)) && \ + echo "$(1) : $(3)" > $(4) +endef + + +# LinkTarget class + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) + +gb_LinkTarget_INCLUDE :=\ + $(subst -I. , ,$(SOLARINC)) \ + $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ + +gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb + +# avoid fatal error LNK1170 for Library_merged +define gb_LinkTarget_MergedResponseFile +cut -f -1000 -d ' ' $${RESPONSEFILE} > $${RESPONSEFILE}.1 && \ +cut -f 1001- -d ' ' $${RESPONSEFILE} >> $${RESPONSEFILE}.1 && \ +mv $${RESPONSEFILE}.1 $${RESPONSEFILE} && +endef + +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \ + $(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,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \ + $(NATIVERES)) && \ + $(if $(filter $(call gb_Library_get_linktargetname,merged),$(2)),$(call gb_LinkTarget_MergedResponseFile)) \ + unset INCLUDE && \ + $(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \ + $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ + $(if $(filter YES,$(TARGETGUI)), -SUBSYSTEM:WINDOWS, -SUBSYSTEM:CONSOLE) \ + $(if $(filter YES,$(LIBRARY_X64)), -MACHINE:X64) \ + $(if $(filter YES,$(LIBRARY_X64)), -LIBPATH:$(OUTDIR)/lib/x64 -LIBPATH:$(COMPATH)/lib/amd64 -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64 \ + $(if $(filter 80,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/win8/um/x64,),) \ + $(T_LDFLAGS) \ + @$${RESPONSEFILE} \ + $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))) \ + $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \ + $(LIBS) \ + $(if $(filter-out StaticLibrary,$(TARGETTYPE)),user32.lib) \ + $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \ + $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) \ + $(if $(filter Library,$(TARGETTYPE)),; if [ -f $(DLLTARGET).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(DLLTARGET).manifest -outputresource:$(DLLTARGET)\;2; fi) \ + $(if $(filter Executable,$(TARGETTYPE)),; if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(1).manifest -outputresource:$(1)\;1; fi) \ + ; exit $$RC) +endef + +define gb_LinkTarget_use_system_win32_libs +$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),$(lib).lib)) +endef + +# Flags common for PE executables (EXEs and DLLs) +gb_Windows_PE_TARGETTYPEFLAGS := \ + -release \ + -opt:noref \ + -incremental:no \ + -debug \ + -nxcompat \ + -dynamicbase \ + +# Library class + + +gb_Library_DEFS := -D_DLL +gb_Library_TARGETTYPEFLAGS := \ + -DLL \ + $(gb_Windows_PE_TARGETTYPEFLAGS) + +ifeq ($(ENABLE_LTO),TRUE) +gb_Library_TARGETTYPEFLAGS += -LTCG +endif + +gb_Library_get_rpath := + +gb_Library_SYSPRE := i +gb_Library_PLAINEXT := .lib + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +gb_Library_FILENAMES :=\ + $(foreach lib,$(gb_Library_KNOWNLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + +gb_Library_DLLEXT := .dll +gb_Library_MAJORVER := 3 +gb_Library_RTEXT := MSC$(gb_Library_DLLEXT) +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_DLLEXT) +gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) +gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT) +gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT) + +gb_Library_DLLFILENAMES :=\ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ + $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + +# An assembly is a special kind of library for CLI +define gb_Library_Assembly +$(call gb_Library_Library,$(1)) +$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : NATIVERES := + +endef + +define gb_Library_Library_platform +$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ + $(3).manifest \ + $(call gb_LinkTarget_get_pdbfile,$(2)) \ +) + +$(if $(filter $(gb_MERGEDLIBS),$(1)),,\ +$(call gb_Library_add_auxtarget,$(1),$(OUTDIR)/bin/$(notdir $(3)))) + +ifneq ($(ENABLE_CRASHDUMP),) +$(call gb_Library_add_auxtargets,$(1),\ + $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \ + $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \ +) +else +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.dll,%.pdb,$(3)) \ + $(patsubst %.dll,%.ilk,$(3)) \ +) +endif + +$(call gb_Library_add_default_nativeres,$(1),$(1)/default) + +$(if $(filter $(gb_MERGEDLIBS),$(1)),,$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1))) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) + +endef + +define gb_Library_add_default_nativeres +$(call gb_WinResTarget_WinResTarget_init,$(2)) +$(call gb_WinResTarget_set_rcfile,$(2),solenv/inc/shlinfo) +$(call gb_WinResTarget_add_defs,$(2),\ + -DVERVARIANT="$(BUILD)" \ + -DRES_APP_VENDOR="$(OOO_VENDOR)" \ + -DORG_NAME="$(call gb_Library_get_dllname,$(1))"\ + -DINTERNAL_NAME="$(subst $(gb_Library_DLLEXT),,$(call gb_Library_get_dllname,$(1)))" \ + -DADDITIONAL_VERINFO1="" \ + -DADDITIONAL_VERINFO2="" \ + -DADDITIONAL_VERINFO3="" \ +) +$(call gb_Library_add_nativeres,$(1),$(2)) +$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(2)) + +endef + +define gb_LinkTarget_add_nativeres +$(call gb_LinkTarget_get_target,$(1)) : $(call gb_WinResTarget_get_target,$(2)) +$(call gb_LinkTarget_get_target,$(1)) : NATIVERES += $(call gb_WinResTarget_get_target,$(2)) + +endef + +define gb_Library_get_dllname +$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES))) +endef + + +# StaticLibrary class + +gb_StaticLibrary_TARGETTYPEFLAGS := -LIB +gb_StaticLibrary_SYSPRE := +gb_StaticLibrary_PLAINEXT := .lib + +gb_StaticLibrary_FILENAMES := \ + $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \ + +define gb_StaticLibrary_StaticLibrary_platform +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(call gb_LinkTarget_get_pdbfile,$(2)) \ +) + +endef + +# Executable class + +gb_Executable_EXT := .exe +gb_Executable_EXT_for_build := .exe +gb_Executable_TARGETTYPEFLAGS := $(gb_Windows_PE_TARGETTYPEFLAGS) + +gb_Executable_get_rpath := + +define gb_Executable_Executable_platform +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \ + $(call gb_LinkTarget_get_pdbfile,$(2)) \ +) + +$(call gb_Executable_add_auxtarget,$(1),$(call gb_Executable_get_target,$(1)).manifest) +$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest,$(1)) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE := $(call gb_LinkTarget_get_pdbfile,$(2)) +$(call gb_LinkTarget_get_target,$(2)) : TARGETGUI := + +endef + +# CppunitTest class + +gb_CppunitTest_DEFS := -D_DLL +# cppunittester.exe is in the cppunit subdirectory of ${OUTDIR}/bin, +# thus it won't find its DLLs unless ${OUTDIR}/bin is added to PATH. +gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path) + +gb_CppunitTest_SYSPRE := itest_ +gb_CppunitTest_EXT := .lib +gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR) +gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT) +gb_CppunitTest_get_libfilename = test_$(1).dll + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_set_dlltarget,$(2),$(3)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \ + $(3) \ + $(3).manifest \ + $(patsubst %.dll,%.pdb,$(3)) \ + $(call gb_LinkTarget_get_pdbfile,$(2)) \ + $(patsubst %.dll,%.ilk,$(3)) \ +) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) + +endef + +# JunitTest class + +gb_defaultlangiso := en-US +gb_smoketest_instset := $(SRCDIR)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(gb_defaultlangiso)/OOo_*_install-arc_$(gb_defaultlangiso).zip + +ifeq ($(OOO_TEST_SOFFICE),) + + +# Work around Windows problems with long pathnames (see issue 50885) by +# installing into the temp directory instead of the module output tree (in which +# case $(target).instpath contains the path to the temp installation, +# which is removed after smoketest); can be removed once issue 50885 is fixed; +# on other platforms, a single installation to solver is created in +# smoketestoo_native. + +# for now, no dependency on $(shell ls $(gb_smoketest_instset)) +# because that doesn't work before the instset is built +# and there is not much of a benefit anyway (gbuild not knowing about smoketest) +define gb_JunitTest_JunitTest_platform_longpathname_hack +$(call gb_JunitTest_get_target,$(1)) : $(call gb_JunitTest_get_target,$(1)).instpath +$(call gb_JunitTest_get_target,$(1)) : CLEAN_CMD = $(call gb_Helper_abbreviate_dirs,rm -rf `cat $$@.instpath` $$@.instpath) + +$(call gb_JunitTest_get_target,$(1)).instpath : + INST_DIR=$$$$(cygpath -m `mktemp -d -t testinst.XXXXXX`) \ + && unzip -d "$$$${INST_DIR}" $$(gb_smoketest_instset) \ + && mv "$$$${INST_DIR}"/OOo_*_install-arc_$$(gb_defaultlangiso) "$$$${INST_DIR}"/opt\ + && mkdir -p $$(dir $$@) \ + && echo "$$$${INST_DIR}" > $$@ + +endef +else # OOO_TEST_SOFFICE +gb_JunitTest_JunitTest_platform_longpathname_hack = +endif # OOO_TEST_SOFFICE + +define gb_JunitTest_JunitTest_platform +$(call gb_JunitTest_get_target,$(1)) : DEFS := \ + -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/program/soffice.exe}" \ + -Dorg.openoffice.test.arg.env=PATH="$$$$PATH" \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) + +endef + +# SrsPartTarget class + +ifeq ($(gb_FULLDEPS),$(true)) +define gb_SrsPartTarget__command_dep +$(call gb_Helper_abbreviate_dirs,\ + $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ + $(INCLUDE) \ + $(DEFS) \ + $(2) \ + -f - \ + | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ + -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \ + -v OUTDIR=$(OUTDIR)/ \ + -v WORKDIR=$(WORKDIR)/ \ + -v SRCDIR=$(SRCDIR)/ \ + > $(call gb_SrsPartTarget_get_dep_target,$(1))) +endef +else +gb_SrsPartTarget__command_dep = +endif + +# WinResTarget class + +gb_WinResTarget_POSTFIX :=.res + +define gb_WinResTarget__command +$(call gb_Output_announce,$(2),$(true),RC ,1) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + $(gb_RC) \ + $(DEFS) $(FLAGS) \ + $(INCLUDE) \ + -Fo$(1) \ + $(RCFILE) ) +endef + +$(eval $(call gb_Helper_make_dep_targets,\ + WinResTarget \ +)) + +ifeq ($(gb_FULLDEPS),$(true)) +define gb_WinResTarget__command_dep +$(call gb_Output_announce,RC:$(2),$(true),DEP,1) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ + $(INCLUDE) \ + $(DEFS) \ + $(RCFILE) \ + -f - \ + | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \ + -v OBJECTFILE=$(3) \ + -v OUTDIR=$(OUTDIR)/ \ + -v WORKDIR=$(WORKDIR)/ \ + -v SRCDIR=$(SRCDIR)/ \ + > $(1)) +endef +else +gb_WinResTarget__command_dep = +endif + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=MSC \ + -DCOMNAME=$(if $(filter INTEL,$(CPUNAME)),msci,mscx) \ + $(if $(filter TRUE,$(SOLAR_JAVA)),-DSOLAR_JAVA) \ +) + +endef + +# ScpConvertTarget class + +define gb_ScpConvertTarget_ScpConvertTarget_platform +$(call gb_ScpConvertTarget_get_target,$(1)) :| $(OUTDIR)/bin/msi-encodinglist.txt +$(call gb_ScpConvertTarget_get_target,$(1)) : SCP_FLAGS := -t $(OUTDIR)/bin/msi-encodinglist.txt + +endef + +# InstallScript class + +gb_InstallScript_EXT := .inf + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := $(gb_Library_DLLEXT) +gb_CliAssemblyTarget_get_dll = $(OUTDIR)/bin/$(1)$(gb_CliAssemblyTarget_POLICYEXT) + +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION)) + +# UnoApiHeadersTarget class + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# Python +gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload" + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk new file mode 100644 index 000000000000..dc2c9833f5e4 --- /dev/null +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -0,0 +1,243 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# set tmpdir to some mixed case path, suitable for native tools +gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp)) + +# please make generic Windows modifications to windows.mk +include $(GBUILDDIR)/platform/windows.mk + +gb_CC := cl +gb_CXX := cl +gb_LINK := link +gb_AWK := awk +gb_CLASSPATHSEP := ; +gb_RC := rc +gb_YACC := bison + +# use CC/CXX if they are nondefaults +ifneq ($(origin CC),default) +gb_CC := $(CC) +gb_GCCP := $(CC) +endif +ifneq ($(origin CXX),default) +gb_CXX := $(CXX) +endif + +gb_COMPILERDEFS := \ + -DMSC \ + -D_CRT_NON_CONFORMING_SWPRINTFS \ + -D_CRT_NONSTDC_NO_DEPRECATE \ + -D_CRT_SECURE_NO_DEPRECATE \ + -D_MT \ + -D_DLL \ + -DBOOST_MEM_FN_ENABLE_CDECL \ + -DCPPU_ENV=$(gb_CPPU_ENV) \ + -DM1500 \ + +gb_RCDEFS := \ + -DWINVER=0x0400 \ + -DWIN32 \ + +gb_RCFLAGS := \ + -V + +gb_AFLAGS := /c /Cp + +gb_CFLAGS := \ + -Gd \ + -GR \ + -Gs \ + -GS \ + -MD \ + -nologo \ + -Wall \ + -wd4005 \ + -wd4061 \ + -wd4127 \ + -wd4180 \ + -wd4189 \ + -wd4191 \ + -wd4217 \ + -wd4242 \ + -wd4244 \ + -wd4245 \ + -wd4250 \ + -wd4251 \ + -wd4255 \ + -wd4275 \ + -wd4290 \ + -wd4294 \ + -wd4350 \ + -wd4355 \ + -wd4365 \ + -wd4503 \ + -wd4505 \ + -wd4511 \ + -wd4512 \ + -wd4514 \ + -wd4555 \ + -wd4611 \ + -wd4619 \ + -wd4625 \ + -wd4626 \ + -wd4640 \ + -wd4668 \ + -wd4675 \ + -wd4686 \ + -wd4692 \ + -wd4706 \ + -wd4710 \ + -wd4711 \ + -wd4373 \ + -wd4738 \ + -wd4786 \ + -wd4800 \ + -wd4820 \ + -wd4826 \ + -wd4917 \ + -Zc:forScope,wchar_t- \ + -Zm500 \ + +gb_CXXFLAGS := \ + -Gd \ + -GR \ + -Gs \ + -GS \ + -Gy \ + -MD \ + -nologo \ + -Wall \ + -wd4005 \ + -wd4061 \ + -wd4127 \ + -wd4180 \ + -wd4189 \ + -wd4191 \ + -wd4217 \ + -wd4242 \ + -wd4244 \ + -wd4245 \ + -wd4250 \ + -wd4251 \ + -wd4265 \ + -wd4275 \ + -wd4290 \ + -wd4294 \ + -wd4350 \ + -wd4351 \ + -wd4355 \ + -wd4365 \ + -wd4435 \ + -wd4503 \ + -wd4505 \ + -wd4511 \ + -wd4512 \ + -wd4514 \ + -wd4555 \ + -wd4611 \ + -wd4619 \ + -wd4625 \ + -wd4626 \ + -wd4628 \ + -wd4640 \ + -wd4668 \ + -wd4675 \ + -wd4686 \ + -wd4692 \ + -wd4706 \ + -wd4710 \ + -wd4711 \ + -wd4373 \ + -wd4738 \ + -wd4786 \ + -wd4800 \ + -wd4820 \ + -wd4826 \ + -wd4917 \ + -wd4996 \ + -Zc:forScope,wchar_t- \ + -Zm500 \ + +gb_STDLIBS := \ + advapi32.lib \ + +ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) +gb_CFLAGS_WERROR := -WX -DLIBO_WERROR +gb_CXXFLAGS_WERROR := -WX -DLIBO_WERROR +endif + +ifeq ($(MERGELIBS),TRUE) +gb_CFLAGS += -DLIBO_MERGELIBS +gb_CXXFLAGS += -DLIBO_MERGELIBS +endif + +gb_LinkTarget_EXCEPTIONFLAGS := \ + -DEXCEPTIONS_ON \ + -EHa \ + +gb_LinkTarget_NOEXCEPTIONFLAGS := \ + -DEXCEPTIONS_OFF \ + +gb_LinkTarget_LDFLAGS := \ + $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-nologo,) \ + -MANIFEST \ + $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ + +gb_DEBUG_CFLAGS := -Zi + +# this does not use CFLAGS so it is not overridable +ifneq ($(ENABLE_CRASHDUMP),) +gb_CFLAGS+=-Zi +gb_CXXFLAGS+=-Zi +endif + +gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy- +gb_COMPILERNOOPTFLAGS := -Od + +ifeq ($(gb_FULLDEPS),$(true)) +gb_COMPILERDEPFLAGS := -showIncludes +define gb_create_deps +| $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]} +endef +else +gb_COMPILERDEPFLAGS := +define gb_create_deps +endef +endif + +gb_COMPILER_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL) + +# Helper class + +gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin +gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin + +gb_Helper_set_ld_path := PATH="$${PATH}:$(shell cygpath -u $(OUTDIR)/bin)" + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index c013bf57ab96..f6a75b6d8c96 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -118,7 +118,7 @@ $(call gb_Helper_abbreviate_dirs,\ -MMD -MT $(1) \ -MP -MF $(4) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE)) + $(INCLUDE)) endef # ObjCObject class @@ -137,7 +137,7 @@ $(call gb_Helper_abbreviate_dirs,\ -MMD -MT $(1) \ -MP -MF $(4) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE)) + $(INCLUDE)) endef @@ -165,13 +165,6 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) -ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CFLAGS += -g -gb_LinkTarget_CXXFLAGS += -g -gb_LinkTarget_OBJCFLAGS += -g -gb_LinkTarget_OBJCXXFLAGS += -g -endif - define gb_LinkTarget__get_layer $(if $(filter Executable,$(1)),\ $$(call gb_Executable_get_layer,$(2)),\ @@ -226,6 +219,7 @@ endef define gb_LinkTarget__command_staticlink $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ @@ -369,7 +363,7 @@ define gb_JunitTest_JunitTest_platform $(call gb_JunitTest_get_target,$(1)) : DEFS := \ -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(DEVINSTALLDIR)/opt/LibreOffice.app/Contents/MacOS/soffice}" \ -Dorg.openoffice.test.arg.env=DYLD_LIBRARY_PATH"$$$${DYLD_LIBRARY_PATH+=$$$$DYLD_LIBRARY_PATH}" \ - -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ endef diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 2abac87c6b4c..52c7a0f49b09 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -78,7 +78,7 @@ gb_CXXFLAGS := \ -Wno-non-virtual-dtor \ # enable debug STL -ifeq ($(gb_PRODUCT),$(false)) +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) gb_COMPILERDEFS += \ -D_GLIBCXX_DEBUG \ @@ -152,9 +152,14 @@ else gb_LINKEROPTFLAGS := -Wl,-O1 endif -gb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline +gb_DEBUG_CFLAGS := -ggdb2 -finline-limit=0 -fno-inline -fno-default-inline +ifneq ($(gb_DEBUGLEVEL),0) +gb_COMPILEROPTFLAGS := +else gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) +endif + gb_COMPILERNOOPTFLAGS := -O0 # LinkTarget class @@ -174,11 +179,6 @@ gb_LinkTarget__RPATHS := \ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += -ggdb2 -gb_LinkTarget_CFLAGS += -ggdb2 -endif - # note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 # we want to use @$(extraobjectlist) in the long run define gb_LinkTarget__command_dynamiclink @@ -204,6 +204,7 @@ endef define gb_LinkTarget__command_staticlink $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ @@ -347,7 +348,7 @@ endif define gb_JunitTest_JunitTest_platform $(call gb_JunitTest_get_target,$(1)) : DEFS := \ -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \ - -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ -Dorg.openoffice.test.arg.postprocesscommand=$(GBUILDDIR)/platform/unxgcc_gdbforjunit.sh \ -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ @@ -360,7 +361,7 @@ define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=`mktemp` && \ printf ". $(DEVINSTALLDIR)/opt/program/ooenv\\n" > $${OFFICESCRIPT} && \ printf "gdb --tui $(DEVINSTALLDIR)/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ -printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=file://$(DEVINSTALLDIR)/\"" >> $${OFFICESCRIPT} && \ +printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(call gb_Helper_make_url,$(DEVINSTALLDIR)/)\"" >> $${OFFICESCRIPT} && \ printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \ $(SHELL) $${OFFICESCRIPT} && \ rm $${OFFICESCRIPT} diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 2b0612080a3b..87e57a8a556e 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -83,7 +83,7 @@ gb_COMPILERDEFS += \ endif # enable debug STL -ifeq ($(gb_PRODUCT),$(false)) +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) gb_COMPILERDEFS += \ -D_GLIBCXX_DEBUG \ @@ -153,9 +153,16 @@ else gb_LINKEROPTFLAGS := -Wl,-O1 endif +ifneq ($(gb_DEBUGLEVEL),0) +gb_COMPILEROPTFLAGS := +else gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) +endif + gb_COMPILERNOOPTFLAGS := -O0 +gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S + # LinkTarget class define gb_LinkTarget__get_rpath_for_layer @@ -173,11 +180,6 @@ gb_LinkTarget__RPATHS := \ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) -ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += $(GGDB2) -gb_LinkTarget_CFLAGS += $(GGDB2) -endif - # note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 # we want to use @$(extraobjectlist) in the long run define gb_LinkTarget__command_dynamiclink @@ -207,6 +209,7 @@ endef define gb_LinkTarget__command_staticlink $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ + rm -f $(1) && \ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ @@ -343,7 +346,7 @@ endif define gb_JunitTest_JunitTest_platform $(call gb_JunitTest_get_target,$(1)) : DEFS := \ -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \ - -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ -Dorg.openoffice.test.arg.postprocesscommand=$(GBUILDDIR)/platform/unxgcc_gdbforjunit.sh \ -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ @@ -356,7 +359,7 @@ define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=`mktemp` && \ printf 'if [ -e $(DEVINSTALLDIR)/opt/program/ooenv ]; then . $(DEVINSTALLDIR)/opt/program/ooenv; fi\n' > $${OFFICESCRIPT} && \ printf "gdb $(DEVINSTALLDIR)/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ -printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=file://$(DEVINSTALLDIR)/\"" >> $${OFFICESCRIPT} && \ +printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=$(call gb_Helper_make_url,$(DEVINSTALLDIR)/)\"" >> $${OFFICESCRIPT} && \ $(SHELL) $${OFFICESCRIPT} && \ rm $${OFFICESCRIPT} endef diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk index f705d5f0b8fb..d6c7f9e40905 100644 --- a/solenv/inc/libs.mk +++ b/solenv/inc/libs.mk @@ -187,12 +187,6 @@ ZLIB3RDLIB=-lz .ELSE ZLIB3RDLIB=-lzlib .ENDIF -.IF "$(SYSTEM_MINIZIP)"=="YES" -MINIZIP3RDLIB=$(MINIZIP_LIBS) -.ELSE -# internally, minizip is included in zlib -MINIZIP3RDLIB= -.ENDIF JPEG3RDLIB=-ljpeg .IF "$(SYSTEM_DB)" == "YES" BERKELEYLIB=-l$(DB_LIB) @@ -250,24 +244,6 @@ REDLANDLIB=$(REDLAND_LIBS) REDLANDLIB=-lrdf .ENDIF -# #110743# -# For BinFilters, some libs were added. -# - -BFSVXLIB=-lbf_svx$(DLLPOSTFIX) -BFSCHLIB=-lbf_ysch -BFSMLIB=-lbf_ysm -BFSCLIB=-lbf_sclib -BFSDLIB=-lbf_sdlib -BFSWLIB=-lbf_swlib -BFOFALIB=-lbf_ofa$(DLLPOSTFIX) -LEGACYSMGRLIB=-llegacy_binfilters$(DLLPOSTFIX) -BFXMLOFFLIB=-lbf_xo$(DLLPOSTFIX) -BFGOODIESLIB=-lbf_go$(DLLPOSTFIX) -BFBASICLIB=-lbf_sb$(DLLPOSTFIX) -BFSO3LIB=-lbf_so$(DLLPOSTFIX) -BFSVTOOLLIB=-lbf_svt$(DLLPOSTFIX) - # # USED_%NAME%_LIBS # Variablen, in denen in gueltiger Reihenfolge ALLE Libraries, @@ -482,24 +458,6 @@ REDLANDLIB = librdf.lib JVMFWKLIB = ijvmfwk.lib -# #110743# -# For BinFilters, some libs were added. -# - -BFSVXLIB=bf_svx.lib -BFSCHLIB=bf_ysch.lib -BFSMLIB=bf_ysm.lib -BFSCLIB=bf_sclib.lib -BFSDLIB=bf_sdlib.lib -BFSWLIB=bf_swlib.lib -BFOFALIB=bf_ofa.lib -BFXMLOFFLIB=ibf_xo.lib -BFGOODIESLIB=bf_go.lib -BFBASICLIB=bf_sb.lib -BFSO3LIB=bf_so.lib -LEGACYSMGRLIB=ilegacy_binfilters.lib -BFSVTOOLLIB=bf_svt.lib - APP3RDLIB= $(LIBPRE) app.lib SAMPLE3RDLIB= $(LIBPRE) sample.lib HNJLIB*=libhnj.lib diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index b9db9fd38b56..6ab521137d30 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -146,7 +146,7 @@ CDEFSDEBUG= CDEFSDBGUTIL= CDEFSOPT= -CFLAGS= +#CFLAGS= CFLAGSCALL= CFLAGSCXX= CFLAGSCC= @@ -227,7 +227,7 @@ PASCAL= BFLAGS= COBFLAGS= CPPFLAGS= -CXXFLAGS= +#CXXFLAGS= FFLAGS= PFLAGS= RFLAGS= @@ -1040,14 +1040,21 @@ CDEFS+= -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) CDEFS+= -DSUPD=$(UPD) # flags to enable build with symbols; required for crashdump feature -.IF ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || ("$(ENABLE_SYMBOLS)"!="" && "$(ENABLE_SYMBOLS)"!="FALSE") +.IF ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || ("$(ENABLE_DEBUG)"!="" && "$(ENABLE_DEBUG)"!="FALSE") # if debug is enabled, this may enable less debug info than debug, so rely just on debug .IF "$(debug)" == "" CFLAGSENABLESYMBOLS_CC_ONLY*=$(CFLAGSENABLESYMBOLS) CFLAGSCXX+=$(CFLAGSENABLESYMBOLS) CFLAGSCC+=$(CFLAGSENABLESYMBOLS_CC_ONLY) .ENDIF # "$(DEBUG)" == "" -.ENDIF # ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || "$(ENABLE_SYMBOLS)"!="" +.ENDIF # ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || "$(ENABLE_DEBUG)"!="" + +.IF "$(CFLAGS)"!="" +CFLAGSCC+=$(CFLAGS) +.ENDIF +.IF "$(CXXFLAGS)"!="" +CFLAGSCXX+=$(CXXFLAGS) +.ENDIF .IF "$(profile)"!="" CDEFS+= $(CDEFSPROF) diff --git a/solenv/inc/wntmsc.mk b/solenv/inc/wntmsc.mk index ef6e58978020..f87822dc3298 100644 --- a/solenv/inc/wntmsc.mk +++ b/solenv/inc/wntmsc.mk @@ -93,6 +93,7 @@ CFLAGS+=-c -nologo -Gs $(NOLOGO) CDEFS+= -D_X86_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_SCL_SECURE_NO_WARNINGS .ELSE CDEFS+= -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS -D_SCL_SECURE_NO_WARNINGS +BUILD64=1 .ENDIF .IF "$(product)" != "" @@ -195,7 +196,7 @@ CFLAGSWERRCC=-WX -DLIBO_WERROR # Once all modules on this platform compile without warnings, set # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see # settings.mk): -MODULES_WITH_WARNINGS := binfilter +MODULES_WITH_WARNINGS := CDEFS+=-DWIN32 -D_MT -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 .IF "$(COMEX)" == "11" |