Skip to content

Commit

Permalink
Support Configure.pl --libdir=...
Browse files Browse the repository at this point in the history
Allows for installing architecture dependent libraries in /usr/lib64 for
example.
  • Loading branch information
niner committed Dec 16, 2016
1 parent ad00a7b commit 0dce14b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
9 changes: 5 additions & 4 deletions Configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
my $exe = $NQP::Configure::exe;

my %options;
GetOptions(\%options, 'help!', 'prefix=s',
GetOptions(\%options, 'help!', 'prefix=s', 'libdir=s',
'sysroot=s', 'sdkroot=s',
'backends=s',
'no-clean',
Expand Down Expand Up @@ -127,9 +127,10 @@
: ($options{sysroot}
? '/usr'
: File::Spec->catdir(cwd, 'install'));
$config{prefix} = $prefix;
$config{sysroot} = $options{sysroot};
$config{sdkroot} = $options{sdkroot};
$config{prefix} = $prefix;
$config{nqplibdir} = $options{libdir} ? "$options{libdir}/nqp" : '$(NQP_LANG_DIR)/lib';
$config{sysroot} = $options{sysroot};
$config{sdkroot} = $options{sdkroot};

# Save options in config.status
unlink('config.status');
Expand Down
4 changes: 2 additions & 2 deletions tools/build/Makefile-JVM.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ $(J_STAGE1)/$(P6QREGEX_JAR): $(J_STAGE0) $(P6QREGEX_SOURCES) $(J_STAGE1)/$(QAST_

$(J_STAGE1)/$(NQP_JAR): $(J_STAGE0) $(J_NQP_SOURCES) $(J_STAGE1)/$(P6QREGEX_JAR)
$(MKPATH) $(J_STAGE1)
$(PERL) tools/build/gen-version.pl > $(J_STAGE1)/nqp-config.nqp
$(PERL) tools/build/gen-version.pl $(PREFIX) $(NQP_LIB_DIR) > $(J_STAGE1)/nqp-config.nqp
$(PERL) tools/build/gen-cat.pl jvm $(J_NQP_SOURCES) $(J_STAGE1)/nqp-config.nqp > $(J_STAGE1)/$(NQP_COMBINED)
$(J_STAGE0_NQP) --module-path=$(J_STAGE1) --setting-path=$(J_STAGE1) \
--setting=NQPCORE --target=jar --no-regex-lib --javaclass=nqp \
Expand Down Expand Up @@ -238,7 +238,7 @@ $(J_STAGE2)/$(P6QREGEX_JAR): $(J_STAGE1) $(P6QREGEX_SOURCES) $(J_STAGE2)/$(QAST_

$(J_STAGE2)/$(NQP_JAR): $(J_STAGE1) $(J_NQP_SOURCES) $(J_STAGE2)/$(P6QREGEX_JAR)
$(MKPATH) $(J_STAGE2)
$(PERL) tools/build/gen-version.pl > $(J_STAGE2)/nqp-config.nqp
$(PERL) tools/build/gen-version.pl $(PREFIX) $(NQP_LIB_DIR) > $(J_STAGE2)/nqp-config.nqp
$(PERL) tools/build/gen-cat.pl jvm $(J_NQP_SOURCES) $(J_STAGE2)/nqp-config.nqp > $(J_STAGE2)/$(NQP_COMBINED)
$(J_STAGE1_NQP) --module-path=$(J_STAGE2) --setting-path=$(J_STAGE2) \
--setting=NQPCORE --target=jar --no-regex-lib --javaclass=nqp \
Expand Down
4 changes: 2 additions & 2 deletions tools/build/Makefile-Moar.in
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ $(M_STAGE1)/$(P6QREGEX_MOAR): $(M_STAGE0) $(P6QREGEX_SOURCES) $(M_STAGE1)/$(QAST

$(M_STAGE1)/$(NQP_MOAR): $(M_STAGE0) $(M_NQP_SOURCES) $(M_STAGE1)/$(P6QREGEX_MOAR)
$(MKPATH) $(M_STAGE1)/gen
$(PERL) tools/build/gen-version.pl $(PREFIX) > $(M_STAGE1)/nqp-config.nqp
$(PERL) tools/build/gen-version.pl $(PREFIX) $(NQP_LIB_DIR) > $(M_STAGE1)/nqp-config.nqp
$(PERL) tools/build/gen-cat.pl moar $(M_NQP_SOURCES) $(M_STAGE1)/nqp-config.nqp > $(M_STAGE1)/$(NQP_COMBINED)
$(M_STAGE0_NQP) --module-path=$(M_STAGE1) --setting-path=$(M_STAGE1) \
--setting=NQPCORE --target=mbc --no-regex-lib \
Expand Down Expand Up @@ -235,7 +235,7 @@ $(M_STAGE2)/$(P6QREGEX_MOAR): $(M_STAGE1) $(P6QREGEX_SOURCES) $(M_STAGE2)/$(QAST

$(M_STAGE2)/$(NQP_MOAR): $(M_STAGE1) $(M_NQP_SOURCES) $(M_STAGE2)/$(P6QREGEX_MOAR)
$(MKPATH) $(M_STAGE2)/gen
$(PERL) tools/build/gen-version.pl $(PREFIX) > $(M_STAGE2)/nqp-config.nqp
$(PERL) tools/build/gen-version.pl $(PREFIX) $(NQP_LIB_DIR) > $(M_STAGE2)/nqp-config.nqp
$(PERL) tools/build/gen-cat.pl moar $(M_NQP_SOURCES) $(M_STAGE2)/nqp-config.nqp > $(M_STAGE2)/$(NQP_COMBINED)
$(M_STAGE1_NQP) --module-path=$(M_STAGE2) --setting-path=$(M_STAGE2) \
--setting=NQPCORE --target=mbc --no-regex-lib \
Expand Down
2 changes: 1 addition & 1 deletion tools/build/Makefile-common.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SYSROOT = @sysroot@
PREFIX = @prefix@
BIN_DIR = $(PREFIX)/bin
NQP_LANG_DIR = $(PREFIX)/share/nqp
NQP_LIB_DIR = $(NQP_LANG_DIR)/lib
NQP_LIB_DIR = @nqplibdir@
PROVE = prove

# nqp::makefile <-- tells NQP::Configure to treat this file as a makefile,
Expand Down
2 changes: 2 additions & 0 deletions tools/build/gen-version.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ =head1 TITLE
use POSIX 'strftime';

my $prefix = shift;
my $libdir = shift;

open(my $fh, '<', 'VERSION') or die $!;
my $VERSION = <$fh>;
Expand All @@ -29,6 +30,7 @@ =head1 TITLE
\$config<version> := '$VERSION';
\$config<build-date> := '$builddate';
\$config<prefix> := '$prefix';
\$config<libdir> := '$libdir';
}
END_VERSION

Expand Down

0 comments on commit 0dce14b

Please sign in to comment.