Author: stas Date: Wed Dec 1 14:00:15 2004 New Revision: 109383 URL: http://svn.apache.org/viewcvs?view=rev&rev=109383 Log: If none of MP_APXS, MP_AP_PREFIX and MP_USE_STATIC were specified when configuring Makefile.PL, we now prompt for APXS path first and only if that fails ask for MP_AP_PREFIX. This is a requirement to get 'make test' find httpd.
Modified: perl/modperl/trunk/Changes perl/modperl/trunk/Makefile.PL Modified: perl/modperl/trunk/Changes Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=109383&p1=perl/modperl/trunk/Changes&r1=109382&p2=perl/modperl/trunk/Changes&r2=109383 ============================================================================== --- perl/modperl/trunk/Changes (original) +++ perl/modperl/trunk/Changes Wed Dec 1 14:00:15 2004 @@ -12,6 +12,11 @@ =item 1.99_18-dev +If none of MP_APXS, MP_AP_PREFIX and MP_USE_STATIC were specified when +configuring Makefile.PL, we now prompt for APXS path first and only if +that fails ask for MP_AP_PREFIX. This is a requirement to get 'make +test' find httpd. [Stas] + Dynamically prompt and add MP_INST_APACHE2=1 when installing on systems with mod_perl 1 preinstalled. [Stas] Modified: perl/modperl/trunk/Makefile.PL Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Makefile.PL?view=diff&rev=109383&p1=perl/modperl/trunk/Makefile.PL&r1=109382&p2=perl/modperl/trunk/Makefile.PL&r2=109383 ============================================================================== --- perl/modperl/trunk/Makefile.PL (original) +++ perl/modperl/trunk/Makefile.PL Wed Dec 1 14:00:15 2004 @@ -26,6 +26,7 @@ use Config; use File::Spec::Functions; +use File::Spec; use DirHandle (); use File::Copy 'cp'; use File::Basename 'basename'; @@ -227,6 +228,13 @@ debug "Using Apache prefix => $build->{MP_AP_PREFIX}"; } else { + unless ($build->{MP_USE_STATIC}) { + # may populate $build->{MP_APXS} + prompt_for_apxs($build); + } + } + + unless ($build->{MP_APXS} or $build->{MP_AP_PREFIX}) { my $ok = 0; for my $path ($build->find) { $build->dir($path); @@ -310,6 +318,50 @@ } install_typemap(); +} + +sub prompt_for_apxs { + my $build = shift; + + print <<EOI; + +Next we need to know where the 'apxs' script is located. This script +provides a lot of information about the Apache installation, and makes +it easier to find things on your system. Normally it's located in the +same directory as the 'httpd' executable. + +If you don't yet have Apache installed you can build Apache against +the Apache source code, but you won't be able to run the test suite (a +very important step). Therefore you may want to install Apache before +proceeding. + +EOI + + my $prompt = "\nPlease provide a full path to 'apxs' executable\n" . + "(press Enter if you don't have it installed):"; + while (1) { + my $ans = $build->prompt($prompt); + + print "\n\n"; + + # strip leading/closing spaces + $ans =~ s/^\s*|\s*$//g; + + last unless length $ans; # skip + + unless (File::Spec->file_name_is_absolute($ans)) { + warn "The path '$ans' is not an absolute path. " . + "Please specify an absolute path.\n"; + next; + } + + warn("'$ans' doesn't exist.\n"), next unless -e $ans; + warn("'$ans' is not a file.\n"), next unless -f _; + warn("'$ans' is not executable.\n"), next unless -x _; + + $build->{MP_APXS} = $ans; + last; + } } sub post_configure {
