[PATCH 2/2] waf: Add option to specify perl vendor dir.

Andreas Schneider asn at samba.org
Wed Feb 26 04:24:07 MST 2014


BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 buildtools/wafadmin/Tools/perl.py | 10 ++++++++++
 pidl/lib/wscript_build            |  2 +-
 pidl/wscript                      |  2 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/buildtools/wafadmin/Tools/perl.py b/buildtools/wafadmin/Tools/perl.py
index a6787a8..fef4160 100644
--- a/buildtools/wafadmin/Tools/perl.py
+++ b/buildtools/wafadmin/Tools/perl.py
@@ -103,7 +103,17 @@ def check_perl_ext_devel(conf):
 	else:
 		conf.env.ARCHDIR_PERL = read_out('print $Config{sitearch}')[0]
 
+	if getattr(Options.options, 'perlvendordir', None):
+		conf.env.VENDORDIR_PERL = Options.options.perlvendordir
+	else:
+		conf.env.VENDORDIR_PERL = read_out('print $Config{vendorlib}')[0]
+
 def set_options(opt):
 	opt.add_option("--with-perl-binary", type="string", dest="perlbinary", help = 'Specify alternate perl binary', default=None)
 	opt.add_option("--with-perl-archdir", type="string", dest="perlarchdir", help = 'Specify directory where to install arch specific files', default=None)
 
+	opt.add_option("--with-perl-vendordir",
+		       type="string",
+		       dest="perlvendordir",
+		       help="Specify directory where to install perl vendor files",
+		       default=None)
diff --git a/pidl/lib/wscript_build b/pidl/lib/wscript_build
index 9bddf3f..29632d4 100644
--- a/pidl/lib/wscript_build
+++ b/pidl/lib/wscript_build
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 # install the pidl modules
-bld.INSTALL_FILES('${DATAROOTDIR}/perl5',
+bld.INSTALL_FILES(bld.env.VENDORDIR_PERL,
                   '''
                   Parse/Pidl.pm
                   Parse/Pidl/Samba4.pm
diff --git a/pidl/wscript b/pidl/wscript
index 05d9982..77abb01 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -8,6 +8,8 @@ def set_options(opt):
 
 def configure(conf):
     conf.check_tool('perl')
+    conf.check_perl_ext_devel()
+
     # we need a recent version of MakeMaker to get the right man page names
     if conf.CHECK_PERL_MANPAGE():
         conf.env.PERLMAN1EXT = conf.CHECK_PERL_MANPAGE(section='1')
-- 
1.8.5.2




More information about the samba-technical mailing list