diff -r -u parrot-current/config/gen/makefiles/parrot_embed_pl.in parrot-andy/config/gen/makefiles/parrot_embed_pl.in --- parrot-current/config/gen/makefiles/parrot_embed_pl.in 2009-05-22 07:51:05.000000000 -0400 +++ parrot-andy/config/gen/makefiles/parrot_embed_pl.in 2009-05-22 11:15:51.204928349 -0400 @@ -19,7 +19,7 @@ $config{PARROT} = '..@slash@..@slash@parrot@exe@'; $config{C_LIBS} = '@libs@'; $config{INCLUDE} = "$config{PARROTDIR}/include"; -#UNLESS(win32):$config{ALL_PARROT_LIBS} = "@libparrot_ldflags@ $config{C_LIBS} @linkflags@"; +#UNLESS(win32):$config{ALL_PARROT_LIBS} = "@libparrot_linkflags@ $config{C_LIBS} @linkflags@"; $config{ABS_PARROTDIR} = Cwd::realpath( File::Spec->rel2abs( $config{PARROTDIR} ) ); $config{LDDLFLAGS} = $Config{lddlflags}; @@ -36,7 +36,7 @@ 'PREREQ_PM' => { 'ExtUtils::CBuilder' => 0 }, #IF(win32): 'LIBS' => [ $config{C_LIBS} ], #ELSE: 'LIBS' => [ $config{ALL_PARROT_LIBS} ], -#IF(win32): 'OBJECT' => q|@libparrot_ldflags@ Embed@o@|, +#IF(win32): 'OBJECT' => q|@libparrot_linkflags@ Embed@o@|, 'INC' => "-I$config{INCLUDE}", 'PM' => { map { $_ => "blib/$_" } }, 'clean' => { FILES => '*.xs t/greet.pbc' }, diff -r -u parrot-current/config/gen/makefiles/pirc.in parrot-andy/config/gen/makefiles/pirc.in --- parrot-current/config/gen/makefiles/pirc.in 2009-05-22 07:51:05.000000000 -0400 +++ parrot-andy/config/gen/makefiles/pirc.in 2009-05-22 11:16:16.812928340 -0400 @@ -68,7 +68,7 @@ pirc$(EXE): $(OBJS) $(LINK) @ld_out@$@ \ $(OBJS) \ - @rpath_blib@ @libparrot_ldflags@ $(C_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC) + @rpath_blib@ @libparrot_linkflags@ $(C_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC) src/pirparser$(O): src/pirparser.c src/pirparser.h src/pirlexer$(O): src/pirlexer.c src/pirlexer.h diff -r -u parrot-current/config/gen/makefiles/root.in parrot-andy/config/gen/makefiles/root.in --- parrot-current/config/gen/makefiles/root.in 2009-05-22 09:37:24.957435038 -0400 +++ parrot-andy/config/gen/makefiles/root.in 2009-05-22 11:13:44.292934269 -0400 @@ -510,7 +510,7 @@ LIBPARROT := @libparrot@ #IF(has_icu):ICU_SHARED := @icu_shared@ -ALL_PARROT_LIBS := @libparrot_ldflags@ $(ICU_SHARED) $(C_LIBS) +ALL_PARROT_LIBS := @libparrot_linkflags@ $(ICU_SHARED) $(C_LIBS) # dynamic extensions DYNEXT_DIR := runtime/parrot/dynext diff -r -u parrot-current/config/init/hints/cygwin.pm parrot-andy/config/init/hints/cygwin.pm --- parrot-current/config/init/hints/cygwin.pm 2009-05-22 07:51:05.000000000 -0400 +++ parrot-andy/config/init/hints/cygwin.pm 2009-05-22 11:17:04.156928167 -0400 @@ -52,6 +52,8 @@ blib_dir => '.', libparrot_ldflags => '-L' . $build_dir . ' -lparrot', inst_libparrot_ldflags => '-L' . $bindir . ' -lparrot', + libparrot_linkflags => '-L' . $build_dir . ' -lparrot', + inst_libparrot_linkflags => '-L' . $bindir . ' -lparrot', ); # inet_aton needs to be defined on Cygwin. diff -r -u parrot-current/config/init/hints/mswin32.pm parrot-andy/config/init/hints/mswin32.pm --- parrot-current/config/init/hints/mswin32.pm 2009-05-22 07:51:05.000000000 -0400 +++ parrot-andy/config/init/hints/mswin32.pm 2009-05-22 11:18:38.796928795 -0400 @@ -109,7 +109,9 @@ # If we are building shared, need to include dynamic libparrot.lib, otherwise # the static libparrot.lib. + # Unclear if it's needed both for ld and link. $conf->data->set( libparrot_ldflags => "\"$build_dir\\libparrot.lib\"" ); + $conf->data->set( libparrot_linkflags => "\"$build_dir\\libparrot.lib\"" ); # 'link' needs to be link.exe, not cl.exe. # This makes 'link' and 'ld' the same. @@ -247,6 +249,8 @@ ld_share_flags => '-shared ', libparrot_ldflags => "\"$build_dir\\libparrot.dll\"", inst_libparrot_ldflags => "\"$bindir\\libparrot.dll\"", + libparrot_linkflags => "\"$build_dir\\libparrot.dll\"", + inst_libparrot_linkflags => "\"$bindir\\libparrot.dll\"", ncilib_link_extra => 'src/libnci_test.def', sym_export => '__declspec(dllexport)', sym_import => '__declspec(dllimport)', diff -r -u parrot-current/config/inter/libparrot.pm parrot-andy/config/inter/libparrot.pm --- parrot-current/config/inter/libparrot.pm 2009-05-22 07:51:05.000000000 -0400 +++ parrot-andy/config/inter/libparrot.pm 2009-05-22 11:11:20.857449405 -0400 @@ -118,8 +118,28 @@ : '' ); + # When building shared libraries and dynamically loadable + # modules with 'ld', do we need to include -lparrot? If so + # this variable contains the necessary flags. (This is normally + # empty, but may be overridden by various hints files for + # specific platforms.) + + # This version works in the build directory. unless ( defined( $conf->data->get('libparrot_ldflags') ) ) { - $conf->data->set(libparrot_ldflags => + $conf->data->set(libparrot_ldflags => ''); + } + + # This version refers to the installed library. + unless ( defined( $conf->data->get('inst_libparrot_ldflags') ) ) { + $conf->data->set(inst_libparrot_ldflags => ''); + } + + # When linking an executable to -lparrot, this variable + # contains the necessary flags to find and use -lparrot. + + # This version uses the -lparrot in the build directory. + unless ( defined( $conf->data->get('libparrot_linkflags') ) ) { + $conf->data->set(libparrot_linkflags => '-L' . $conf->data->get('build_dir') . $conf->data->get('slash') @@ -128,8 +148,9 @@ ); } - unless ( defined( $conf->data->get('inst_libparrot_ldflags') ) ) { - $conf->data->set(inst_libparrot_ldflags => + # This version uses the installed -lparrot. + unless ( defined( $conf->data->get('inst_libparrot_linkflags') ) ) { + $conf->data->set(inst_libparrot_linkflags => '-L' . $conf->data->get('libdir') . ' -lparrot' diff -r -u parrot-current/lib/Parrot/Test.pm parrot-andy/lib/Parrot/Test.pm --- parrot-current/lib/Parrot/Test.pm 2009-05-22 07:51:00.000000000 -0400 +++ parrot-andy/lib/Parrot/Test.pm 2009-05-22 11:19:52.085678815 -0400 @@ -966,7 +966,7 @@ ? "" : "-L$PConfig{blib_dir} ")) . ($^O =~ m/MSWin32/ - ? $PConfig{libparrot_ldflags} + ? $PConfig{libparrot_linkflags} : "-lparrot") : File::Spec->join( @PConfig{qw/build_dir blib_dir libparrot_static/}, diff -r -u parrot-current/tools/dev/mk_language_shell.pl parrot-andy/tools/dev/mk_language_shell.pl --- parrot-current/tools/dev/mk_language_shell.pl 2009-05-22 07:51:00.000000000 -0400 +++ parrot-andy/tools/dev/mk_language_shell.pl 2009-05-22 11:20:45.980928298 -0400 @@ -318,8 +318,7 @@ CFLAGS := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ CC_OUT := @cc_o_out@ LD_OUT := @ld_out@ -#IF(parrot_is_shared):LIBPARROT := @inst_libparrot_ldflags@ -#ELSE:LIBPARROT := +LIBPARROT := @inst_libparrot_ldflags@ OPS2C := $(PERL) $(LIB_DIR)/tools/build/ops2c.pl @@ -411,8 +410,7 @@ CFLAGS := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ CC_OUT := @cc_o_out@ LD_OUT := @ld_out@ -#IF(parrot_is_shared):LIBPARROT := @inst_libparrot_ldflags@ -#ELSE:LIBPARROT := +LIBPARROT := @inst_libparrot_ldflags@ PMC2C_INCLUDES := --include $(SRC_DIR) --include $(SRC_DIR)/pmc PMC2C := $(PERL) $(LIB_DIR)/tools/build/pmc2c.pl diff -r -u parrot-current/tools/dev/pbc_to_exe.pir parrot-andy/tools/dev/pbc_to_exe.pir --- parrot-current/tools/dev/pbc_to_exe.pir 2009-05-22 07:51:00.000000000 -0400 +++ parrot-andy/tools/dev/pbc_to_exe.pir 2009-05-22 11:10:28.576928161 -0400 @@ -284,7 +284,7 @@ link_dynamic = $P0['link_dynamic'] linkflags = $P0['linkflags'] ld_out = $P0['ld_out'] - libparrot = $P0['libparrot_ldflags'] + libparrot = $P0['libparrot_linkflags'] libs = $P0['libs'] o = $P0['o'] rpath = $P0['rpath_blib']