From: John Darrington Date: Thu, 25 Dec 2008 02:52:57 +0000 (+0900) Subject: Automatically detect src dir from build dir X-Git-Tag: v0.7.1~1^2~13^2~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=aee574220dad196b9e5a872e3afe930275a79bfa Automatically detect src dir from build dir --- diff --git a/perl-module/Makefile.PL b/perl-module/Makefile.PL index dfa235e7..77505f2f 100644 --- a/perl-module/Makefile.PL +++ b/perl-module/Makefile.PL @@ -5,8 +5,9 @@ use ExtUtils::MakeMaker; do 'pspp-module-config' || do { - my $src = prompt ("Enter the location of the full pspp source","../pspp"); - my $build = prompt ("Enter the location of the pspp build directory", "$src" ); + my $build = prompt ("Enter the location of the build directory of the configured pspp source:", "" ); + do 'lib/pspp-vers.pl' || die "No version info"; + my $src = $top_srcdir; %Locations = (SourceDir => "$src", BuildDir => "$build"); }; diff --git a/perl-module/automake.mk b/perl-module/automake.mk index c502cbe8..2b838313 100644 --- a/perl-module/automake.mk +++ b/perl-module/automake.mk @@ -33,9 +33,10 @@ perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config module-make: perl-module/Makefile cd perl-module && $(MAKE) $(AM_MAKEFLAGS) -perl-module/lib/pspp-vers.pl: src/libpspp/version.c +perl-module/lib/pspp-vers.pl: src/libpspp/version.c Makefile mkdir -p perl-module/lib - $(GREP) '^\$$VERSION' $(top_builddir)/src/libpspp/version.c | $(SED) -e 's/VERSION/PSPP::VERSION/' > $@ + (cd $(top_srcdir) && echo "\$$top_srcdir='"`pwd`"';") > $@ + $(GREP) '^\$$VERSION' $(top_builddir)/src/libpspp/version.c | $(SED) -e 's/VERSION/PSPP::VERSION/' >> $@ all-local: perl-module/lib/pspp-vers.pl if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \