Skip to content

Commit

Permalink
[build] Change darwin build flags to enable gdb debugging
Browse files Browse the repository at this point in the history
compile parrot_old static. use this for debugging with gdb.
keep -undefined dynamic_lookup only for dynamically loaded bundles.
honor cmdline flags for --ld and --link.

and move deletion of generated config and makefiles from archclean
to realclean/distclean. we want to delete all object and executables
only there.

See [GH #1096]
  • Loading branch information
Reini Urban committed Oct 8, 2014
1 parent 234386d commit d2ad859
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions config/gen/makefiles/root.in
Expand Up @@ -925,11 +925,11 @@ $(FRPTWO_DIR)/prt0.pbc$(O) : $(FRPTWO_DIR)/prt0.pbc.c \
$(INC_DIR)/config.h \
$(INC_DIR)/pbcversion.h

$(PARROTOLD) : $(FRP_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
$(PARROTOLD) : $(FRP_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT_STATIC) \
src/parrot_config$(O) src/longopt$(O) $(MINIPARROT)
$(LINK) @ld_out@$@ \
$(FRP_DIR)/main$(O) src/parrot_config$(O) src/longopt$(O) \
$(RPATH_BLIB) $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
$(LIBPARROT_STATIC) $(ICU_SHARED) $(C_LIBS) $(LINKFLAGS)
#IF(win32 and has_mt): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1

$(PARROT) : $(FRPTWO_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
Expand Down Expand Up @@ -2592,9 +2592,8 @@ prog-clean :
archclean: dynext-clean
$(RM_F) \
$(O_FILES) \
$(GEN_CONFIGS) \
$(GEN_MAKEFILES) \
$(PARROT) \
$(PARROTOLD) \
$(MINIPARROT) \
$(INSTALLABLEPARROT) \
$(INSTALLABLEDIS) \
Expand Down Expand Up @@ -2696,6 +2695,8 @@ test-clean :
# a failing step of cleaning, usually doesn't concern the following steps
realclean : clean
$(RM_RF) \
$(GEN_CONFIGS) \
$(GEN_MAKEFILES) \
$(CONFIGURE_GENERATED_FILES) \
cover_db

Expand Down
13 changes: 8 additions & 5 deletions config/init/hints/darwin.pm
Expand Up @@ -50,7 +50,7 @@ sub runstep {
$flags->{ccflags} .= '-Wno-long-double ';
}

$flags->{linkflags} .= " -undefined dynamic_lookup";
$flags->{linkflags} .= ""; # -undefined dynamic_lookup";

_probe_for_libraries($conf, $flags, 'fink');
_probe_for_libraries($conf, $flags, 'macports');
Expand All @@ -68,14 +68,14 @@ sub runstep {
osvers => $osvers,
ccflags => $flags->{ccflags},
ldflags => $flags->{ldflags},
ccwarn => "-Wno-shadow",
#ccwarn => "-Wno-shadow",
libs => $libs,
share_ext => '.dylib',
load_ext => '.bundle',
link => 'c++',
link => $flags->{link} || 'c++',
linkflags => $flags->{linkflags},
ld => 'c++',
ld_share_flags => '-dynamiclib -undefined dynamic_lookup',
ld => $flags->{ld} || 'c++',
ld_share_flags => '-dynamiclib',
ld_load_flags => '-undefined dynamic_lookup -bundle',
memalign => 'some_memalign',
has_dynamic_linking => 1,
Expand Down Expand Up @@ -303,6 +303,9 @@ the command-line options C<darwin_no_fink> and/or C<darwin_no_macports>.
The functionality is tested in F<t/steps/init/hints/darwin-01.t>.
Note that debugging with F<gdb> requires static linking (F<parrot_old>) and
no C<-undefined dynamic_lookup>
=cut

# Local Variables:
Expand Down

0 comments on commit d2ad859

Please sign in to comment.