Ticket #33821: base-create-dsym.patch

File base-create-dsym.patch, 6.0 KB (added by seanfarley (Sean Farley), 12 years ago)

new patch based off reviews from macports-dev

  • base/ChangeLog

    # HG changeset patch
    # User Sean Farley <sean@mcs.anl.gov>
    # Date 1335049331 18000
    # Node ID 526a427fdc16a55ee77fea3a7e270073e23f3eae
    # Parent  71c8c1a656994590cd629110ff1802fe29c44e4b
    base: add macports.conf variable create_dsym
    
    This variable creates the .dSYM bundle, thereby keeping all the debugging symbols, by running
    dsymutil. By default, create_dsym is set to 'no' and has no affect on current users. This can also
    be set via the command line, as follows:
    
    $ port -vs install PORT create_dsym=yes
    
    diff --git a/base/ChangeLog b/base/ChangeLog
    a b  
    101101      (raimue in r82760, r82761)
    102102
    103103    - Added 'buildfromsource' macports.conf setting, which allows permanently
    104104      selecting the behaviour of the -s or -b option. (jmr in r81540)
    105105
     106    - Added 'create_dsym' macports.conf setting, which allows building the
     107      .dSYM bundle with dsymutil
     108
    106109Release 2.0.4 (2012-02-25 by jmr)
    107110    - Added -locale option for reinplace (jeremyhu in r89839)
    108111
    109112    - Xcode 4.3 support: Change home directory for MacPorts user to
    110113      ${prefix}/var/macports/home.
  • base/doc/macports.conf.in

    diff --git a/base/doc/macports.conf.in b/base/doc/macports.conf.in
    a b  
    8989#portautoclean          yes
    9090
    9191# Set to yes if you don't want logs to be deleted after successful builds
    9292#keeplogs no
    9393
     94# Set to yes if you want .dSYM bundles to be created
     95#create_dsym no
     96
    9497# Rsync server to fetch MacPorts sources from. Note that this is only used
    9598# for selfupdate. The source(s) for the ports tree are set in sources.conf.
    9699# Known mirrors at time of writing (see https://trac.macports.org/wiki/Mirrors
    97100# for the current list):
    98101#   rsync.macports.org        - California, USA (master)
  • base/src/macports1.0/macports.tcl

    diff --git a/base/src/macports1.0/macports.tcl b/base/src/macports1.0/macports.tcl
    a b  
    4949        applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
    5050        macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
    5151        master_site_local patch_site_local archive_site_local buildfromsource \
    5252        revupgrade_autorun revupgrade_mode revupgrade_check_id_loadcmds \
    5353        host_blacklist preferred_hosts\
    54         packagemaker_path default_compiler"
     54        packagemaker_path default_compiler create_dsym"
    5555    variable user_options "submitter_name submitter_email submitter_key"
    5656    variable portinterp_options "\
    5757        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
    5858        registry.path registry.format user_home \
    5959        portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
    6060        rsync_server rsync_options rsync_dir startupitem_type startupitem_install place_worksymlink macportsuser \
    61         mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
     61        mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs create_dsym\
    6262        applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
    6363        os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target \
    6464        packagemaker_path default_compiler $user_options"
    6565
    6666    # deferred options are only computed when needed.
     
    580580    global macports::macosx_deployment_target
    581581    global macports::archivefetch_pubkeys
    582582    global macports::ping_cache
    583583    global macports::host_blacklisted
    584584    global macports::host_preferred
     585    global macports::create_dsym
    585586
    586587    # Set the system encoding to utf-8
    587588    encoding system utf-8
    588589
    589590    # set up platform info variables
     
    957958
    958959    if {![info exists macports::macosx_deployment_target]} {
    959960        set macports::macosx_deployment_target $macosx_version
    960961    }
    961962
     963    if {![info exists macports::create_dsym]} {
     964        set macports::create_dsym no
     965    }
     966
    962967    if {![info exists macports::revupgrade_autorun]} {
    963968        set macports::revupgrade_autorun yes
    964969    }
    965970    if {![info exists macports::revupgrade_mode]} {
    966971        set macports::revupgrade_mode "rebuild"
  • base/src/port1.0/portconfigure.tcl

    diff --git a/base/src/port1.0/portconfigure.tcl b/base/src/port1.0/portconfigure.tcl
    a b  
    693693        global configure.${tool} configure.${tool}_archflags
    694694    }
    695695    foreach flags {cflags cppflags cxxflags objcflags ldflags fflags f90flags fcflags} {
    696696        global configure.${flags} configure.universal_${flags}
    697697    }
    698    
     698
     699    if {[option create_dsym]} {
     700        foreach dsymflags {cflags cppflags cxxflags objcflags ldflags fflags f90flags fcflags} {
     701            configure.${dsymflags}-append "-g"
     702        }
     703    }
     704
    699705    if {[tbool use_autoreconf]} {
    700706        if {[catch {command_exec autoreconf} result]} {
    701707            return -code error "[format [msgcat::mc "%s failure: %s"] autoreconf $result]"
    702708        }
    703709    }
  • base/src/port1.0/portdestroot.tcl

    diff --git a/base/src/port1.0/portdestroot.tcl b/base/src/port1.0/portdestroot.tcl
    a b  
    151151    global UI_PREFIX destroot prefix subport startupitem.create destroot.violate_mtree
    152152    global applications_dir frameworks_dir destroot.keepdirs
    153153    global os.platform os.version
    154154    variable oldmask
    155155
     156    # create dsym bundle, if requested
     157    if {[option create_dsym]} {
     158        ui_debug "Generating the .dSYM bundles: find ${destroot}${prefix} -type f '(' -name '*.dylib' -or -name '*.so' ')' -exec dsymutil {} +"
     159        system -W ${destroot}${prefix} "find . -type f '(' -name '*.dylib' -or -name '*.so' ')' -exec dsymutil {} +"
     160    }
     161
    156162    # Create startup-scripts/items
    157163    if {[tbool startupitem.create]} {
    158164        package require portstartupitem 1.0
    159165        portstartupitem::startupitem_create
    160166    }