diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2006-02-22 20:05:55 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2006-02-22 20:05:55 +0000 |
commit | 0a39d41a42ecf2dbf17ab337e495220871d8e29a (patch) | |
tree | c6c3053f01627fd6d6356771bfdba7d883fd5cce | |
parent | fef48d8b7c84ae1052076f4171dbea56ce6cf95e (diff) | |
download | MPC-0a39d41a42ecf2dbf17ab337e495220871d8e29a.tar.gz |
ChangeLogTag: Wed Feb 22 20:06:00 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 45 | ||||
-rwxr-xr-x | combine_dsw.pl | 3 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 27 | ||||
-rw-r--r-- | modules/VC6WorkspaceCreator.pm | 3 | ||||
-rw-r--r-- | modules/WinProjectBase.pm | 37 | ||||
-rw-r--r-- | templates/bmake.mpd | 19 | ||||
-rw-r--r-- | templates/bmakecommon.mpt | 2 | ||||
-rw-r--r-- | templates/bmakedll.mpt | 2 | ||||
-rw-r--r-- | templates/bmakedllexe.mpt | 2 | ||||
-rw-r--r-- | templates/bmakelibexe.mpt | 2 | ||||
-rw-r--r-- | templates/make.mpd | 20 | ||||
-rw-r--r-- | templates/makedll.mpt | 5 |
12 files changed, 126 insertions, 41 deletions
@@ -1,3 +1,48 @@ +Wed Feb 22 20:06:00 UTC 2006 Chad Elliott <elliott_c@ociweb.com> + + * combine_dsw.pl: + + Support combining .vcw files too. They are almost identical to + .dsw files. + + * modules/ProjectCreator.pm: + + Removed the $rmesc parameter from the generated_filenames() and + generated_filename_arrys() methods. We will always remove the + escape sequences from the generated file names. In the one place + where the escapes are needed, we use escape_regex_special() to + ensure that the whole file name (including the path) is escaped. + + * modules/VC6WorkspaceCreator.pm: + + Sort the projects so that the generated workspace will be + deterministic. + + * modules/WinProjectBase.pm: + + Modified translate_directory() to remove the current working + directory from the directory passed in and then limit the length + of that to avoid issues with maximum directory/file length on + NTFS. + + * templates/bmake.mpd: + * templates/bmakecommon.mpt: + * templates/bmakedll.mpt: + * templates/bmakedllexe.mpt: + * templates/bmakelibexe.mpt: + + Support building with VCL. Also, add the custom_type libpath + setting to the PATH variable. + + * templates/make.mpd: + * templates/makedll.mpt: + + Added support for visibility attributes. They are off by default, + so set the 'visibility' template variable to 1 to then them on. + Also, when generating the clean target, clean the extra + directories relative to the output location of the makefile + target. + Tue Feb 21 18:14:21 2006 Steve Huston <shuston@riverace.com> * templates/vc8.mpd: Put .lib files with .dll files in $(OutDir). diff --git a/combine_dsw.pl b/combine_dsw.pl index a2c78e9a..454c260f 100755 --- a/combine_dsw.pl +++ b/combine_dsw.pl @@ -38,6 +38,7 @@ sub usageAndExit { " [-u] <output file> <input files...>\n\n", "-u Each input file will be removed after successful ", "combination\n\n", + "NOTE: This script will work for vcw's too.\n\n", "Combine multiple dsw's into a single dsw. You can use ", "MPC to generate\n", "dynamic projects and then generate static projects using ", @@ -93,7 +94,7 @@ if (open($oh, ">$tmp")) { if (open($fh, $input)) { my($in_global) = 0; while(<$fh>) { - if (/Microsoft\s+Developer\s+Studio/) { + if (/Microsoft\s+(Developer\s+Studio|eMbedded\s+Visual)/) { if ($msident == 0) { $msident = 1; print $oh $_; diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index 2f75e394..96391ae8 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -1981,7 +1981,6 @@ sub generated_filename_arrays { my($type) = shift; my($tag) = shift; my($file) = shift; - my($rmesc) = shift; my($noext) = shift; my(@array) = (); my(@pearr) = $self->get_pre_keyword_array('pre_extension', @@ -2032,21 +2031,15 @@ sub generated_filename_arrays { ## Loop through creating all of the possible file names foreach my $pe (@pearr) { push(@array, []); - if ($rmesc) { - $pe =~ s/\\\././g; - } + $pe =~ s/\\\././g; foreach my $pf (@pfarr) { - if ($rmesc) { - $pf =~ s/\\\././g; - } + $pf =~ s/\\\././g; if ($noext) { push(@{$array[$#array]}, "$dir$pf$base$pe"); } else { foreach my $ext (@exts) { - if ($rmesc) { - $ext =~ s/\\\././g; - } + $ext =~ s/\\\././g; push(@{$array[$#array]}, "$dir$pf$base$pe$ext"); } } @@ -2065,11 +2058,10 @@ sub generated_filenames { my($type) = shift; my($tag) = shift; my($file) = shift; - my($rmesc) = shift; my($noext) = shift; my(@files) = (); my(@array) = $self->generated_filename_arrays($part, $type, $tag, - $file, $rmesc, $noext); + $file, $noext); foreach my $array (@array) { push(@files, @$array); @@ -2105,7 +2097,7 @@ sub add_generated_files { my(@added) = (); foreach my $file (@$arr) { foreach my $gen ($self->generated_filenames($file, $gentype, $tag, - "$file$wanted", 1, 1)) { + "$file$wanted", 1)) { $self->list_generated_file($gentype, $tag, \@added, $gen, $file); } } @@ -2620,7 +2612,7 @@ sub generate_default_components { $part = $self->escape_regex_special($part); my(@files) = $self->generated_filenames($part, $gentype, - $tag, $input, 1); + $tag, $input); if ($#copy != -1) { my($found) = 0; foreach my $file (@files) { @@ -2738,7 +2730,8 @@ sub generated_source_listed { my($oext) = $wanted; $oext =~ s/\\//g; foreach my $re ($self->generated_filenames($ifile, $gent, - $tag, "$i$oext", 0)) { + $tag, "$i$oext")) { + $re = $self->escape_regex_special($re); if ($val =~ /$re$/) { return 1; } @@ -2880,7 +2873,7 @@ sub list_generated_file { ## $file because they couldn't possibly match if they weren't. if (length(basename($gen)) <= $blen) { foreach my $re ($self->generated_filenames($gen, $gentype, - $tag, $input, 1)) { + $tag, $input)) { if ($re =~ /$file(.*)?$/) { my($created) = $re; if (defined $ofile) { @@ -3248,7 +3241,7 @@ sub check_custom_output { my(@outputs) = (); foreach my $array ($self->generated_filename_arrays($cinput, $based, - $type, $ainput, 1)) { + $type, $ainput)) { foreach my $built (@$array) { if (@$comps == 0) { push(@outputs, $built); diff --git a/modules/VC6WorkspaceCreator.pm b/modules/VC6WorkspaceCreator.pm index c4c63966..7e0952e3 100644 --- a/modules/VC6WorkspaceCreator.pm +++ b/modules/VC6WorkspaceCreator.pm @@ -63,11 +63,12 @@ sub pre_workspace { sub write_comps { my($self) = shift; my($fh) = shift; + my($gen) = shift; my($projects) = $self->get_projects(); my($pjs) = $self->get_project_info(); my($crlf) = $self->crlf(); - foreach my $project (@$projects) { + foreach my $project (sort { $gen->file_sorter($a, $b) } @$projects) { my($name) = $$pjs{$project}->[0]; my($deps) = $self->get_validated_ordering($project); diff --git a/modules/WinProjectBase.pm b/modules/WinProjectBase.pm index 43b3ead0..4ff55777 100644 --- a/modules/WinProjectBase.pm +++ b/modules/WinProjectBase.pm @@ -13,6 +13,12 @@ package WinProjectBase; use strict; # ************************************************************ +# Data Section +# ************************************************************ + +my($max_win_env) = 'MPC_MAX_WIN_FILE_LENGTH'; + +# ************************************************************ # Subroutine Section # ************************************************************ @@ -32,9 +38,40 @@ sub translate_directory { my($self) = shift; my($dir) = shift; + ## Call the base class version $dir = $self->DirectoryManager::translate_directory($dir); + + ## Remove the current working directory from $dir (if it is contained) + my($cwd) = $self->slash_to_backslash($self->getcwd()); + my($cwdl) = length($cwd); + if (index($dir, $cwd) == 0) { + $dir = substr($dir, $cwdl + 1); + } + + ## Change drive letters and $() macros $dir =~ s/^([A-Z]):/$1/i; $dir =~ s/\$\(([^\)]+)\)/$1/g; + + ## We need to make sure that we do not exceed the maximum file name + ## limitation (including the cwd (- c:\) and object file name). So, we + ## check the total length against a predetermined "acceptable" value. + ## This acceptable value is modifiable through the environment. + my($maxenv) = $ENV{$max_win_env}; + my($maxlen) = (defined $maxenv && $maxenv =~ /^\d+$/ ? $maxenv : 128) + 3; + my($dirlen) = length($dir); + my($diff) = ($cwdl + $dirlen + 1) - $maxlen; + + if ($diff > 0) { + if ($diff > $dirlen) { + $dir = substr($dir, $dirlen - 1); + } + else { + $dir = substr($dir, $diff); + } + while($dir =~ s/^\\//) { + } + } + return $dir; } diff --git a/templates/bmake.mpd b/templates/bmake.mpd index 8b073716..301a65be 100644 --- a/templates/bmake.mpd +++ b/templates/bmake.mpd @@ -37,6 +37,14 @@ CG_CFLAGS = -vG CG_LIB = cg32.lib !endif +<%if(use_vcl)%> +STARTUP_LETTER = <%if(exename)%>w<%else%><%startup_letter%><%endif%> +<%else%> +VCL_CFLAGS = -D_NO_VCL +STARTUP_LETTER = <%startup_letter%> +<%endif%> +STARTUP_OBJ = c0$(STARTUP_LETTER)32$(UC_MAIN)$(OBJ_EXT) + <%foreach(compilers)%> <%fornotlast("!ifdef")%><%forlast("!else #")%> <%uc(compiler)%> OBJ_EXT = <%obj_ext%> @@ -133,7 +141,6 @@ PCH_CFLAGS = \ <%endif%> CFLAGS = \ - $(PCH_CFLAGS) \ <%foreach(cc_flags)%> <%cc_flags%> \ <%endfor%> @@ -159,7 +166,8 @@ CFLAGS = \ <%foreach(includes)%> -I"<%include%>" \ <%endfor%> - $(DUMMY_VALUE_NOT_ENDING_IN_BACKSLASH) + $(PCH_CFLAGS) \ + $(VCL_CFLAGS) <%marker(macros)%> <%if(exename)%> @@ -169,7 +177,7 @@ all: $(OUTPUTDIR)$(NAME)$(EXE_EXT)<%if(postbuild)%> __postbuild__<%endif%> $(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE) @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)" $(LINK) @&&! - $(EXEFLAGS) $(LFLAGS) <%startup_obj%>$(UC_MAIN)$(OBJ_EXT) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE) + $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE) ! <%endif%> @@ -180,7 +188,7 @@ all: $(OUTPUTDIR)$(NAME)$(DLL_EXT)<%if(postbuild)%> __postbuild__<%endif%> $(OUTPUTDIR)$(NAME)$(DLL_EXT): $(OBJFILES) $(RESOURCE) @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)" $(LINK) @&&! - $(DLLFLAGS) $(LFLAGS) <%startup_obj%>$(UC_MAIN)$(OBJ_EXT) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE) + $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE) ! <%endif%> @@ -204,6 +212,9 @@ all:<%if(postbuild)%> __postbuild__<%endif%> <%if(custom_types)%> GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%> <%foreach(custom_types)%> +<%if(custom_type->libpath)%> +PATH = $(PATH);<%custom_type->libpath%> +<%endif%> <%foreach(custom_type->input_files)%> <%if(custom_type->input_file->output_files)%> <%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(" ")%><%endfor%>: <%custom_type->input_file%><%if(custom_type->input_file->dependencies)%> <%custom_type->input_file->dependencies%><%endif%> diff --git a/templates/bmakecommon.mpt b/templates/bmakecommon.mpt index edd566e4..3e266423 100644 --- a/templates/bmakecommon.mpt +++ b/templates/bmakecommon.mpt @@ -7,7 +7,7 @@ conditional_include "common" // then the template needs to be modified to support that compilers = cbx bcc configurations = Debug Release -common_defines = WIN32 _WINDOWS _NO_VCL +common_defines = WIN32 _WINDOWS common_libs = import32$(LIB_EXT) cw32mti.lib ws2_32.lib common_flags = -a8 unicode_flags = -WU diff --git a/templates/bmakedll.mpt b/templates/bmakedll.mpt index 5d5cf40d..ac2c2706 100644 --- a/templates/bmakedll.mpt +++ b/templates/bmakedll.mpt @@ -3,7 +3,7 @@ conditional_include "bmakecommon" -startup_obj = c0d32 +startup_letter = d use_lib_modifier = 1 Release { diff --git a/templates/bmakedllexe.mpt b/templates/bmakedllexe.mpt index 9d12f62f..93c8a763 100644 --- a/templates/bmakedllexe.mpt +++ b/templates/bmakedllexe.mpt @@ -3,7 +3,7 @@ conditional_include "bmakecommon" -startup_obj = c0x32 +startup_letter = x use_exe_modifier = Release { diff --git a/templates/bmakelibexe.mpt b/templates/bmakelibexe.mpt index 846a388e..ee0c6210 100644 --- a/templates/bmakelibexe.mpt +++ b/templates/bmakelibexe.mpt @@ -3,7 +3,7 @@ conditional_include "bmakecommon" -startup_obj = c0x32 +startup_letter = x use_exe_modifier = Release { diff --git a/templates/make.mpd b/templates/make.mpd index 828cb636..a5866259 100644 --- a/templates/make.mpd +++ b/templates/make.mpd @@ -23,7 +23,7 @@ CPU = <%cpu%> <%if(pic)%> PICFLAGS = <%pic%> <%endif%> -CPPFLAGS = $(PICFLAGS) $(GENFLAGS)<%if(compile_flags)%> <%compile_flags%><%endif%><%if(cpu)%> -DCPU=$(CPU)<%endif%><%if(tempincopt)%> <%tempincopt%>$(TEMPINCDIR)<%endif%><%if(compilerflags)%> <%compilerflags%><%endif%><%if(build64bit && compilerflags64)%> <%compilerflags64%><%endif%><%if(pch_source && pchsupport)%><%foreach(pch_defines)%> -D<%pch_define%><%endfor%><%endif%><%if(extracppflags)%> <%extracppflags%><%endif%><%if(includes)%><%foreach(includes)%> -I"<%include%>"<%endfor%><%endif%><%if(macros)%><%foreach(macros)%> -D<%macro%><%endfor%><%endif%> +CPPFLAGS = <%if(visibility && visopt)%><%visopt%> <%endif%>$(PICFLAGS) $(GENFLAGS)<%if(compile_flags)%> <%compile_flags%><%endif%><%if(cpu)%> -DCPU=$(CPU)<%endif%><%if(tempincopt)%> <%tempincopt%>$(TEMPINCDIR)<%endif%><%if(compilerflags)%> <%compilerflags%><%endif%><%if(build64bit && compilerflags64)%> <%compilerflags64%><%endif%><%if(pch_source && pchsupport)%><%foreach(pch_defines)%> -D<%pch_define%><%endfor%><%endif%><%if(extracppflags)%> <%extracppflags%><%endif%><%if(includes)%><%foreach(includes)%> -I"<%include%>"<%endfor%><%endif%><%if(macros)%><%foreach(macros)%> -D<%macro%><%endfor%><%endif%> OBJEXT = <%obj_ext%> OUTPUT_OPTION = <%output_option(-o \"$@\")%> COMPILE.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) <%compile_option("-c")%> @@ -77,8 +77,7 @@ AREXT = <%lib_ext%> LIB = $(LTARGETDIR)$(LIBPREFIX)<%staticname%>$(LIBSUFFIX)$(AREXT) <%endif%> <%endif%> -<%if(dll_ext)%> -<%if(sharedname)%> +<%if(dll_ext && sharedname)%> SOEXT = <%dll_ext%> SHTARGETDIR = <%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%slash%><%targetoutdir%> <%if(version && versupport)%> @@ -89,7 +88,6 @@ SHLIB = $(SHTARGETDIR)$(LIBPREFIX)<%sharedname%>$(LIBSUFFIX)$(SOEXT) SHFLAGS = <%shflags%> <%endif%> <%endif%> -<%endif%> SRC =<%if(pch_source && pchsupport)%> <%pch_source%><%endif%> <%source_files%> LINK.cc = $(LD) $(LDFLAGS) <%if(dynamicflags)%> @@ -131,8 +129,7 @@ $(BIN): $(BTARGETDIR)<%if(tempinc)%> $(TEMPINCDIR)<%endif%><%if(prelink)%> <%tar $(LINK.cc) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION) <%endif%> -<%if(dll_ext)%> -<%if(sharedname)%> +<%if(dll_ext && sharedname)%> all:<%if(version && versupport)%> $(SHLIB).<%version%><%endif%> $(SHLIB)<%if(postbuild)%> __postbuild__<%endif%> <%if(dllout)%> @@ -151,11 +148,6 @@ $(SHLIB)<%if(version && versupport)%>.<%version%><%endif%>: $(SHTARGETDIR) <%if( <%else%> <%foreach(platforms)%><%if(dld)%><%dld%> $(LDFLAGS)<%else%>$(LINK.cc)<%endif%><%endfor%> $(SHFLAGS) $(OBJS) $(LDLIBS) $(OUTPUT_OPTION) <%endif%> -<%else%> -<%if(staticname)%> -all: $(LIB)<%if(postbuild)%> __postbuild__<%endif%> -<%endif%> -<%endif%> <%else%> <%if(staticname)%> @@ -264,11 +256,11 @@ clean: -$(RM) <%pch_header%><%pchext%> <%endif%> <%if(clean)%> - -$(RM) <%clean%> + -$(RM) <%clean%><%if(sharedname)%><%foreach(dir, clean)%> $(SHTARGETDIR)<%dir%><%endfor%><%endif%><%if(staticname || sharedname)%><%foreach(dir, clean)%> $(LTARGETDIR)<%dir%><%endfor%><%endif%><%if(exename)%><%foreach(dir, clean)%> $(BTARGETDIR)<%dir%><%endfor%><%endif%> <%endif%> realclean: clean - -$(RM) <%if(exename)%>$(BIN)<%else%><%if(version && versupport)%>$(SHLIB).<%version%> <%endif%>$(SHLIB) $(LIB)<%endif%> + -$(RM) <%if(exename)%>$(BIN)<%else%><%if(dll_ext && sharedname && version && versupport)%>$(SHLIB).<%version%> <%endif%>$(SHLIB) $(LIB)<%endif%> <%if(custom_types)%> -$(RM) $(GENERATED_DIRTY) <%endif%> @@ -279,7 +271,6 @@ __postbuild__: <%endif%> <%marker(local)%> -<%if(dependencies)%> #---------------------------------------------------------------------------- # Dependencies #---------------------------------------------------------------------------- @@ -294,6 +285,7 @@ depend: @-: <%endif%> +<%if(dependencies)%> include $(DEPENDENCIES) <%endif%> <%endfor%> diff --git a/templates/makedll.mpt b/templates/makedll.mpt index aba6a75a..3dd68d57 100644 --- a/templates/makedll.mpt +++ b/templates/makedll.mpt @@ -34,6 +34,7 @@ build64bit = 1 pchext = .gch versupport = 1 dependencies = 1 +visibility = // *********************************************************************** // Configuration Section @@ -100,6 +101,7 @@ gcc { platforms = linux pchcreate = "-o " pchnobj = 1 + visopt = -fvisibility=hidden -fvisibility-inlines-hidden } Intel { @@ -107,6 +109,7 @@ Intel { pic = -fPIC shflags = -shared platforms = linux + visopt = -fvisibility=hidden } SunCC { @@ -121,6 +124,7 @@ SunCC { pchuse = -xpch=use: pchstop = -xpchstop= pchext = .Cpch + visopt = -xldscope=hidden } aCC { @@ -143,6 +147,7 @@ xlC_r { platforms = aix pchcreate = -qgenpcomp= pchuse = -qusepcomp= + dependencies = } SGICC { |