]> granicus.if.org Git - curl/commitdiff
cmdline-opts: Fixed build and test in out of source tree builds
authorDan Fandrich <dan@coneharvesters.com>
Mon, 6 Feb 2017 21:47:41 +0000 (22:47 +0100)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 6 Feb 2017 22:37:05 +0000 (23:37 +0100)
docs/cmdline-opts/Makefile.am
docs/cmdline-opts/gen.pl
src/Makefile.am
tests/data/test1139
tests/manpage-scan.pl

index 3467de15669269f27be7adebfe0b600a9eca632f..c844bca4f3c9c715259a12d47a857b5a3808701d 100644 (file)
@@ -73,4 +73,4 @@ EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(OTHERPAGES)
 all: $(MANPAGE)
 
 $(MANPAGE): $(DPAGES) $(OTHERPAGES)
-       @PERL@ gen.pl mainpage > $(MANPAGE)
+       @PERL@ $(srcdir)/gen.pl mainpage $(srcdir) > $(MANPAGE)
index 89a5df845896344fb03e62ba2f75c75a3d03597c..91e893f3ea9891aa1747bc019143dda6be226c47 100755 (executable)
@@ -16,7 +16,7 @@ Unfortunately it seems some perls like msysgit can't handle a global input-only
 =end comment
 =cut
 
-my $some_dir=".";
+my $some_dir=$ARGV[1] || ".";
 
 opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!";
 my @s = grep { /\.d$/ && -f "$some_dir/$_" } readdir($dh);
@@ -101,7 +101,7 @@ sub added {
 
 sub single {
     my ($f, $standalone)=@_;
-    open(F, "<:crlf", "$f") ||
+    open(F, "<:crlf", "$some_dir/$f") ||
         return 1;
     my $short;
     my $long;
@@ -235,7 +235,7 @@ sub single {
 
 sub getshortlong {
     my ($f)=@_;
-    open(F, "<:crlf", "$f");
+    open(F, "<:crlf", "$some_dir/$f");
     my $short;
     my $long;
     my $help;
@@ -281,7 +281,7 @@ sub indexoptions {
 
 sub header {
     my ($f)=@_;
-    open(F, "<:crlf", "$f");
+    open(F, "<:crlf", "$some_dir/$f");
     my @d;
     while(<F>) {
         push @d, $_;
@@ -371,7 +371,7 @@ sub getargs {
         }
     } while($f);
 
-    print "Usage: gen.pl <mainpage/listhelp/single FILE/protos>\n";
+    print "Usage: gen.pl <mainpage/listhelp/single FILE/protos> [srcdir]\n";
 }
 
 #------------------------------------------------------------------------
index 67fa6d70d2323b0ed0be55912a95d320afbb0f71..19bab68ac3047a75c8f653f5cbeaca061e8118a4 100644 (file)
@@ -93,7 +93,7 @@ EXTRA_DIST = mkhelp.pl makefile.dj Makefile.b32               \
  macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
  curl.rc Makefile.netware Makefile.inc Makefile.Watcom CMakeLists.txt
 
-MANPAGE=$(top_srcdir)/docs/curl.1
+MANPAGE=$(top_builddir)/docs/curl.1
 README=$(top_srcdir)/docs/MANUAL
 MKHELP=$(top_srcdir)/src/mkhelp.pl
 HUGE=tool_hugehelp.c
index 30f730c2eaeeed9ab006ae3d177c49a90391c2a3..17c74097fc34118eb9a99a3c56ab40baf80279c5 100644 (file)
@@ -19,7 +19,7 @@ Verify that all libcurl options have man pages
  </name>
 
 <command type="perl">
-%SRCDIR/manpage-scan.pl %SRCDIR/..
+%SRCDIR/manpage-scan.pl %SRCDIR/.. %PWD/..
 </command>
 </client>
 
index f374be99d96a05658d05cd0ac8f4c2b85a3d644b..1cc47eb313858a8f2f01fd29e9bd0e9e7882948a 100644 (file)
@@ -39,8 +39,9 @@
 use strict;
 use warnings;
 
-# we may get the dir root pointed out
+# we may get the dir roots pointed out
 my $root=$ARGV[0] || ".";
+my $buildroot=$ARGV[1] || ".";
 my $syms = "$root/docs/libcurl/symbols-in-versions";
 my $curlh = "$root/include/curl/curl.h";
 my $errors=0;
@@ -196,7 +197,7 @@ close(R);
 
 #########################################################################
 # parse the curl.1 man page, extract all documented command line options
-open(R, "<$root/docs/curl.1") ||
+open(R, "<$buildroot/docs/curl.1") ||
     die "no input file";
 my @manpage; # store all parsed parameters
 while(<R>) {