Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow a build directory to be specified to Configure.pl #674

Open
leto opened this Issue Mar 18, 2010 · 8 comments

Comments

Projects
None yet
4 participants
Owner

leto commented Mar 18, 2010

To facilitate cross-compiling environments, it would be nice if we had something like

perl Configure.pl --builddir=/foo/build

See http://lists.parrot.org/pipermail/parrot-dev/2010-March/003992.html for more details.

This feature would greatly help in porting Parrot to Embedded Linux distros as well as RTEMS.

Originally http://trac.parrot.org/parrot/ticket/1516

Contributor

jkeenan commented Mar 19, 2010

Replying to dukeleto:

To facilitate cross-compiling environments, it would be nice if we had something like perl Configure.pl --builddir=/foo/build

At coke's suggestion, I created a branch for this purpose:  https://svn.parrot.org/parrot/branches/tt1516_builddir_option/

I committed one patch to this branch (r45050) -- a patch which, I should caution, DOES NOT WORK. (The build fails at miniparrot because it can't locate -lparrot.) So it illustrates that we need to figure out how to get all the linking paths to work right.

People working on this ticket should also perldoc Configure.pl and read up on file-based configuration.

Thank you very much.

kid51

Contributor

gerd commented Apr 20, 2010

1201 byte attachment from gerd
at http://trac.parrot.org/parrot/raw-attachment/ticket/1516/patch.root.in

Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in    (Revision 45754)
+++ config/gen/makefiles/root.in    (Arbeitskopie)
@@ -222,7 +222,7 @@
    runtime/parrot/include/pmctypes.pasm \

 GEN_PM_INCLUDES = \
-   lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm
+   $(BUILD_DIR)/lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm

 CONFIGURE_GENERATED_FILES = \
     $(GEN_CONFIGS) \
@@ -691,7 +691,7 @@
 .pmc.c : # suffix rule (limited support)
    $(PMC2CC) $<

-vtable.dump : src/vtable.tbl lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm
+vtable.dump : src/vtable.tbl $(BUILD_DIR)/lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm
    $(PMC2CV)

 # This is a listing of all targets meant to be called by users
@@ -1082,7 +1082,8 @@
    $(PERL) $(H2INC) $(INC_DIR)/enums.h $@
 runtime/parrot/include/call_bits.pasm : $(INC_DIR)/enums.h $(H2INC)
    $(PERL) $(H2INC) $(INC_DIR)/enums.h $@
-lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm : $(INC_DIR)/enums.h $(H2INC)
+$(BUILD_DIR)/lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm : $(INC_DIR)/enums.h $(H2INC)
+   $(MKPATH) $(BUILD_DIR)/lib/Parrot/Pmc2c
    $(PERL) $(H2INC) $(INC_DIR)/enums.h $@

 runtime/parrot/include/libpaths.pasm : $(INC_DIR)/library.h $(H2INC)
Contributor

gerd commented Apr 20, 2010

really only a little first step

Contributor

gerd commented Apr 20, 2010

If I understand this, then the "builddir" option is to be able to specify a builddir that is different from the source directory and all generated files during the "make" will be written in that directory.

So may be: sourcedir != builddir != installdir

For building gcc you have to change the current directory to the build directory before executing make.

I add a patch for that I think would be the first step after enable the builddir option. It looks to be a terrible work to get the builddir option working.

@ghost

ghost commented Apr 21, 2010

Replying to gerd:

For building gcc you have to change the current directory to the build directory before executing make.

This is what perl 5 does also. In fact for perl 5, we actually just make a symlink tree so that most of the build process didn't have to be altered. Thus you run something like

    mkdir build
    cd build
    sh ../perl-5.12.0/Configure -Dmksymlinks [... other options]
    make
Contributor

jkeenan commented Sep 18, 2010

dukeleto,

Could you comment on what steps we need to take next on this ticket?

Thank you very much.

kid51

Member

rurban commented Jan 10, 2013

My usual approach for clean builddirs is creating a tree of symlinks via lndir.

make -s realclean
pwd=`pwd`
mkdir ../build
cd ../build
lndir $pwd
perl Configure.pl
Owner

leto commented Jan 10, 2013

@rurban I originally created this ticket because I thought it would help us in cross-compiling. If we can create a BitBake recipe without this, then it is less important than #894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment