ProjectBuilder.st
changeset 3321 08f3a7af6975
parent 3308 5cbec72e27fa
child 3332 37a32de127ba
equal deleted inserted replaced
3320:3a3e4ca40b7c 3321:08f3a7af6975
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2009 by eXept Software AG
     2  COPYRIGHT (c) 2009 by eXept Software AG
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   342 ! !
   340 ! !
   343 
   341 
   344 !ProjectBuilder methodsFor:'building/private'!
   342 !ProjectBuilder methodsFor:'building/private'!
   345 
   343 
   346 copyDLLsForLinkage
   344 copyDLLsForLinkage
   347     |targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes|
   345     |targetBuildDir preRequisites dllRelativeSourcePaths dllRelativeDestPaths|
   348 
   346 
   349     targetBuildDir := buildDirectory / package module / package directory.
   347     targetBuildDir := buildDirectory / package module / package directory.
   350 
   348 
   351     preRequisites := projectDefinitionClass allPreRequisites.
   349     preRequisites := projectDefinitionClass allPreRequisites.
   352     OperatingSystem isUNIXlike ifTrue:[
   350     OperatingSystem isUNIXlike ifTrue:[
   357                             ).
   355                             ).
   358     ].
   356     ].
   359 
   357 
   360     preRequisites do:[:eachPackageToFileout |
   358     preRequisites do:[:eachPackageToFileout |
   361         |packageId packageDef packageModule packageDirectory packageTargetDir
   359         |packageId packageDef packageModule packageDirectory packageTargetDir
   362          dllSource dllSourceDir libraryName dllRelativePathSource 
   360          dllSource dllSourceDir libraryName dllRelativePathSource
   363          dllRelativePathDest objDirSource objDirDest alternativeObjDirSource|
   361          dllRelativePathDest objDirSource objDirDest alternativeObjDirSource|
   364 
   362 
   365         packageId := eachPackageToFileout asPackageId.
   363         packageId := eachPackageToFileout asPackageId.
   366         packageModule := packageId module.
   364         packageModule := packageId module.
   367         packageDirectory := packageId directory.
   365         packageDirectory := packageId directory.
   384 "/            ].
   382 "/            ].
   385             (dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[
   383             (dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[
   386                 alternativeObjDirSource := self objDirForUsedCompiler:'vc'.
   384                 alternativeObjDirSource := self objDirForUsedCompiler:'vc'.
   387                 (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
   385                 (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
   388                     objDirSource := alternativeObjDirSource.
   386                     objDirSource := alternativeObjDirSource.
   389                     stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...' 
   387                     stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...'
   390                                                 bindWith:libraryName 
   388                                                 bindWith:libraryName
   391                                                 with:alternativeObjDirSource 
   389                                                 with:alternativeObjDirSource
   392                                                 with:(self class suiteNameOfCompiler:'vc'))
   390                                                 with:(self class suiteNameOfCompiler:'vc'))
   393                                             emphasizeAllWith:(#color -> Color red darkened)).
   391                                             emphasizeAllWith:(#color -> Color red darkened)).
   394                 ] ifFalse:[
   392                 ] ifFalse:[
   395                     alternativeObjDirSource := self objDirForUsedCompiler:'bcc'.
   393                     alternativeObjDirSource := self objDirForUsedCompiler:'bcc'.
   396                     (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
   394                     (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
   397                         objDirSource := alternativeObjDirSource.
   395                         objDirSource := alternativeObjDirSource.
   398                         stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...' 
   396                         stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...'
   399                                     bindWith:libraryName 
   397                                     bindWith:libraryName
   400                                     with:alternativeObjDirSource 
   398                                     with:alternativeObjDirSource
   401                                     with:(self class suiteNameOfCompiler:'bcc')).
   399                                     with:(self class suiteNameOfCompiler:'bcc')).
   402                     ]
   400                     ]
   403                 ].
   401                 ].
   404             ].
   402             ].
   405 
   403 
   406 "/            dllRelativePath := objDir,'/',(libraryName,'.dll').
   404 "/            dllRelativePath := objDir,'/',(libraryName,'.dll').
   407 "/            (dllSourceDir / dllRelativePath) exists 
   405 "/            (dllSourceDir / dllRelativePath) exists
   408             dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll').
   406             dllRelativeSourcePaths := Array with:(objDirSource,'\', libraryName, '.dll').
   409             dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll').
   407             dllRelativeDestPaths := Array with:(objDirDest,'\', libraryName, '.dll').
   410         ] ifFalse:[
   408         ] ifFalse:[
   411             dllRelativeSourcePathes := Array with:(libraryName,'.so').
   409             dllRelativeSourcePaths := Array with:(libraryName,'.so').
   412             dllRelativeDestPathes := Array with:(libraryName, '.so').
   410             dllRelativeDestPaths := Array with:(libraryName, '.so').
   413             (packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[
   411             (packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[
   414                 dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('XWorkstation.so').
   412                 dllRelativeSourcePaths := dllRelativeSourcePaths copyWith:('XWorkstation.so').
   415                 dllRelativeDestPathes := dllRelativeDestPathes copyWith:'XWorkstation.so'.
   413                 dllRelativeDestPaths := dllRelativeDestPaths copyWith:'XWorkstation.so'.
   416                 dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('GLXWorkstation.so').
   414                 dllRelativeSourcePaths := dllRelativeSourcePaths copyWith:('GLXWorkstation.so').
   417                 dllRelativeDestPathes := dllRelativeDestPathes copyWith:'GLXWorkstation.so'.
   415                 dllRelativeDestPaths := dllRelativeDestPaths copyWith:'GLXWorkstation.so'.
   418             ].
   416             ].
   419         ].
   417         ].
   420         dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath|
   418         dllRelativeSourcePaths with:dllRelativeDestPaths do:[:dllRelativeSourcePath :dllRelativeDestPath|
   421             |source dest|
   419             |source dest|
   422 
   420 
   423             source := dllSourceDir / dllRelativeSourcePath.
   421             source := dllSourceDir / dllRelativeSourcePath.
   424             source exists ifFalse:[
   422             source exists ifFalse:[
   425                 self activityNotification:'   skip missing file: ',source pathName.
   423                 self activityNotification:'   skip missing file: ',source pathName.
   430                  or:[source modificationTime >= dest modificationTime
   428                  or:[source modificationTime >= dest modificationTime
   431                  "/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ]
   429                  "/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ]
   432                 ]]) ifTrue:[
   430                 ]]) ifTrue:[
   433                     Transcript showCR:'updating ',dllRelativeDestPath.
   431                     Transcript showCR:'updating ',dllRelativeDestPath.
   434                     dest directory recursiveMakeDirectory.
   432                     dest directory recursiveMakeDirectory.
   435                     source copyTo:dest.    
   433                     source copyTo:dest.
   436                     self activityNotification:'    ',dest pathName
   434                     self activityNotification:'    ',dest pathName
   437                 ] ifFalse:[
   435                 ] ifFalse:[
   438                     Transcript showCR:'already up-to-date: ',dllRelativeDestPath.
   436                     Transcript showCR:'already up-to-date: ',dllRelativeDestPath.
   439                 ]
   437                 ]
   440             ]
   438             ]