コード例 #1
0
ファイル: perl.py プロジェクト: hef/samba
def check_perl_ext_devel(conf):
	"""
	Check for configuration needed to build perl extensions.

	Sets different xxx_PERLEXT variables in the environment.

	Also sets the ARCHDIR_PERL variable useful as installation path,
	which can be overridden by --with-perl-archdir
	"""
	if not conf.env.PERL:
		conf.fatal('perl detection is required first')

	def read_out(cmd):
		return Utils.to_list(Utils.cmd_output([conf.env.PERL, '-MConfig', '-e', cmd]))

	conf.env.LINKFLAGS_PERLEXT = read_out('print $Config{lddlflags}')
	conf.env.CPPPATH_PERLEXT   = read_out('print "$Config{archlib}/CORE"')
	conf.env.CCFLAGS_PERLEXT   = read_out('print "$Config{ccflags} $Config{cccdlflags}"')
	conf.env.XSUBPP            = read_out('print "$Config{privlib}/ExtUtils/xsubpp$Config{exe_ext}"')
	conf.env.EXTUTILS_TYPEMAP  = read_out('print "$Config{privlib}/ExtUtils/typemap"')
	conf.env.perlext_PATTERN   = '%s.' + read_out('print $Config{dlext}')[0]

	def try_any(keys):
		for k in keys:
			conf.start_msg("Checking for perl $Config{%s}:" % k)
			try:
				v = read_out('print $Config{%s}' % k)[0]
				conf.end_msg("'%s'" % (v), 'GREEN')
				return v
			except IndexError:
				conf.end_msg(False, 'YELLOW')
				pass
		return None

	perl_arch_install_dir = None
	if getattr(Options.options, 'perl_arch_install_dir', None):
		perl_arch_install_dir = Options.options.perl_arch_install_dir
	if perl_arch_install_dir is None:
		perl_arch_install_dir = try_any(['vendorarch', 'sitearch', 'archlib'])
	if perl_arch_install_dir is None:
		conf.fatal('No perl arch install directory autodetected.' +
			   'Please define it with --with-perl-arch-install-dir.')
	conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
	conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
	conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

	perl_lib_install_dir = None
	if getattr(Options.options, 'perl_lib_install_dir', None):
		perl_lib_install_dir = Options.options.perl_lib_install_dir
	if perl_lib_install_dir is None:
		perl_lib_install_dir = try_any(['vendorlib', 'sitelib', 'privlib'])
	if perl_lib_install_dir is None:
		conf.fatal('No perl lib install directory autodetected. ' +
			   'Please define it with --with-perl-lib-install-dir.')
	conf.start_msg("PERL_LIB_INSTALL_DIR: ")
	conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
	conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir
コード例 #2
0
ファイル: samba_perl.py プロジェクト: Alexander--/samba
 def check_perl_config_var(var):
     conf.start_msg("Checking for perl $Config{%s}:" % var)
     try:
         v = read_perl_config_var('print $Config{%s}' % var)[0]
         conf.end_msg("'%s'" % (v), 'GREEN')
         return v
     except IndexError:
         conf.end_msg(False, 'YELLOW')
         pass
     return None
コード例 #3
0
ファイル: samba_perl.py プロジェクト: runt18/samba
 def check_perl_config_var(var):
     conf.start_msg("Checking for perl $Config{{{0!s}}}:".format(var))
     try:
         v = read_perl_config_var("print $Config{{{0!s}}}".format(var))[0]
         conf.end_msg("'{0!s}'".format((v)), "GREEN")
         return v
     except IndexError:
         conf.end_msg(False, "YELLOW")
         pass
     return None
コード例 #4
0
 def check_perl_config_var(var):
     conf.start_msg("Checking for perl $Config{%s}:" % var)
     try:
         v = read_perl_config_var('print $Config{%s}' % var)[0]
         conf.end_msg("'%s'" % (v), 'GREEN')
         return v
     except IndexError:
         conf.end_msg(False, 'YELLOW')
         pass
     return None
コード例 #5
0
ファイル: perl.py プロジェクト: hef/samba
	def try_any(keys):
		for k in keys:
			conf.start_msg("Checking for perl $Config{%s}:" % k)
			try:
				v = read_out('print $Config{%s}' % k)[0]
				conf.end_msg("'%s'" % (v), 'GREEN')
				return v
			except IndexError:
				conf.end_msg(False, 'YELLOW')
				pass
		return None
コード例 #6
0
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5, 0, 0)):
    #
    # TODO: use the @runonce mechanism for this.
    # The problem is that @runonce currently does
    # not seem to work together with @conf...
    # So @runonce (and/or) @conf needs fixing.
    #
    if "done" in done:
        return
    done["done"] = True
    conf.find_program('perl', var='PERL', mandatory=mandatory)
    conf.check_tool('perl')
    path_perl = conf.find_program('perl')
    conf.env.PERL_SPECIFIED = (conf.env.PERL != path_perl)
    conf.check_perl_version(version)

    def read_perl_config_var(cmd):
        return Utils.to_list(
            Utils.cmd_output([conf.env.PERL, '-MConfig', '-e', cmd]))

    def check_perl_config_var(var):
        conf.start_msg("Checking for perl $Config{%s}:" % var)
        try:
            v = read_perl_config_var('print $Config{%s}' % var)[0]
            conf.end_msg("'%s'" % (v), 'GREEN')
            return v
        except IndexError:
            conf.end_msg(False, 'YELLOW')
            pass
        return None

    vendor_prefix = check_perl_config_var('vendorprefix')

    perl_arch_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_arch_install_dir = check_perl_config_var('vendorarch')
    if perl_arch_install_dir is None:
        perl_arch_install_dir = "${LIBDIR}/perl5"
    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

    perl_lib_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_lib_install_dir = check_perl_config_var('vendorlib')
    if perl_lib_install_dir is None:
        perl_lib_install_dir = "${DATADIR}/perl5"
    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir

    perl_inc = read_perl_config_var('print "@INC"')
    perl_inc.remove('.')
    conf.start_msg("PERL_INC: ")
    conf.end_msg("%s" % (perl_inc), 'GREEN')
    conf.env.PERL_INC = perl_inc
コード例 #7
0
ファイル: samba_perl.py プロジェクト: rchicoli/samba
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5, 0, 0)):
    #
    # TODO: use the @runonce mechanism for this.
    # The problem is that @runonce currently does
    # not seem to work together with @conf...
    # So @runonce (and/or) @conf needs fixing.
    #
    if "done" in done:
        return
    done["done"] = True
    conf.find_program("perl", var="PERL", mandatory=mandatory)
    conf.check_tool("perl")
    path_perl = conf.find_program("perl")
    conf.env.PERL_SPECIFIED = conf.env.PERL != path_perl
    conf.check_perl_version(version)

    def read_perl_config_var(cmd):
        return Utils.to_list(Utils.cmd_output([conf.env.PERL, "-MConfig", "-e", cmd]))

    def check_perl_config_var(var):
        conf.start_msg("Checking for perl $Config{%s}:" % var)
        try:
            v = read_perl_config_var("print $Config{%s}" % var)[0]
            conf.end_msg("'%s'" % (v), "GREEN")
            return v
        except IndexError:
            conf.end_msg(False, "YELLOW")
            pass
        return None

    vendor_prefix = check_perl_config_var("vendorprefix")

    perl_arch_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_arch_install_dir = check_perl_config_var("vendorarch")
    if perl_arch_install_dir is None:
        perl_arch_install_dir = "${LIBDIR}/perl5"
    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_arch_install_dir), "GREEN")
    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

    perl_lib_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_lib_install_dir = check_perl_config_var("vendorlib")
    if perl_lib_install_dir is None:
        perl_lib_install_dir = "${DATADIR}/perl5"
    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_lib_install_dir), "GREEN")
    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir

    perl_inc = read_perl_config_var('print "@INC"')
    perl_inc.remove(".")
    conf.start_msg("PERL_INC: ")
    conf.end_msg("%s" % (perl_inc), "GREEN")
    conf.env.PERL_INC = perl_inc
コード例 #8
0
ファイル: samba_perl.py プロジェクト: Alexander--/samba
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
    if "done" in done:
        return
    done["done"] = True
    conf.find_program('perl', var='PERL', mandatory=mandatory)
    conf.check_tool('perl')
    path_perl = conf.find_program('perl')
    conf.env.PERL_SPECIFIED = (conf.env.PERL != path_perl)
    conf.check_perl_version(version)

    def read_perl_config_var(cmd):
        return Utils.to_list(Utils.cmd_output([conf.env.PERL, '-MConfig', '-e', cmd]))

    def check_perl_config_var(var):
        conf.start_msg("Checking for perl $Config{%s}:" % var)
        try:
            v = read_perl_config_var('print $Config{%s}' % var)[0]
            conf.end_msg("'%s'" % (v), 'GREEN')
            return v
        except IndexError:
            conf.end_msg(False, 'YELLOW')
            pass
        return None

    vendor_prefix = check_perl_config_var('vendorprefix')

    perl_arch_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_arch_install_dir = check_perl_config_var('vendorarch');
    if perl_arch_install_dir is None:
        perl_arch_install_dir = "${LIBDIR}/perl5";
    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

    perl_lib_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_lib_install_dir = check_perl_config_var('vendorlib');
    if perl_lib_install_dir is None:
        perl_lib_install_dir = "${DATADIR}/perl5";
    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir

    perl_inc = read_perl_config_var('print "@INC"')
    if '.' in perl_inc:
        perl_inc.remove('.')
    conf.start_msg("PERL_INC: ")
    conf.end_msg("%s" % (perl_inc), 'GREEN')
    conf.env.PERL_INC = perl_inc
コード例 #9
0
ファイル: samba_perl.py プロジェクト: runt18/samba
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5, 0, 0)):
    if "done" in done:
        return
    done["done"] = True
    conf.find_program("perl", var="PERL", mandatory=mandatory)
    conf.check_tool("perl")
    path_perl = conf.find_program("perl")
    conf.env.PERL_SPECIFIED = conf.env.PERL != path_perl
    conf.check_perl_version(version)

    def read_perl_config_var(cmd):
        return Utils.to_list(Utils.cmd_output([conf.env.PERL, "-MConfig", "-e", cmd]))

    def check_perl_config_var(var):
        conf.start_msg("Checking for perl $Config{{{0!s}}}:".format(var))
        try:
            v = read_perl_config_var("print $Config{{{0!s}}}".format(var))[0]
            conf.end_msg("'{0!s}'".format((v)), "GREEN")
            return v
        except IndexError:
            conf.end_msg(False, "YELLOW")
            pass
        return None

    vendor_prefix = check_perl_config_var("vendorprefix")

    perl_arch_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_arch_install_dir = check_perl_config_var("vendorarch")
    if perl_arch_install_dir is None:
        perl_arch_install_dir = "${LIBDIR}/perl5"
    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
    conf.end_msg("'{0!s}'".format((perl_arch_install_dir)), "GREEN")
    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

    perl_lib_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_lib_install_dir = check_perl_config_var("vendorlib")
    if perl_lib_install_dir is None:
        perl_lib_install_dir = "${DATADIR}/perl5"
    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
    conf.end_msg("'{0!s}'".format((perl_lib_install_dir)), "GREEN")
    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir

    perl_inc = read_perl_config_var('print "@INC"')
    perl_inc.remove(".")
    conf.start_msg("PERL_INC: ")
    conf.end_msg("{0!s}".format((perl_inc)), "GREEN")
    conf.env.PERL_INC = perl_inc
コード例 #10
0
def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
    if "done" in done:
        return
    done["done"] = True
    conf.find_program('perl', var='PERL', mandatory=mandatory)
    conf.check_tool('perl')
    path_perl = conf.find_program('perl')
    conf.env.PERL_SPECIFIED = (conf.env.PERL != path_perl)
    conf.check_perl_version(version)

    def read_perl_config_var(cmd):
        return Utils.to_list(Utils.cmd_output([conf.env.PERL, '-MConfig', '-e', cmd]))

    def check_perl_config_var(var):
        conf.start_msg("Checking for perl $Config{%s}:" % var)
        try:
            v = read_perl_config_var('print $Config{%s}' % var)[0]
            conf.end_msg("'%s'" % (v), 'GREEN')
            return v
        except IndexError:
            conf.end_msg(False, 'YELLOW')
            pass
        return None

    vendor_prefix = check_perl_config_var('vendorprefix')

    perl_arch_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_arch_install_dir = check_perl_config_var('vendorarch');
    if perl_arch_install_dir is None:
        perl_arch_install_dir = "${LIBDIR}/perl5";
    conf.start_msg("PERL_ARCH_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_arch_install_dir), 'GREEN')
    conf.env.PERL_ARCH_INSTALL_DIR = perl_arch_install_dir

    perl_lib_install_dir = None
    if vendor_prefix == conf.env.PREFIX:
        perl_lib_install_dir = check_perl_config_var('vendorlib');
    if perl_lib_install_dir is None:
        perl_lib_install_dir = "${DATADIR}/perl5";
    conf.start_msg("PERL_LIB_INSTALL_DIR: ")
    conf.end_msg("'%s'" % (perl_lib_install_dir), 'GREEN')
    conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir

    perl_inc = read_perl_config_var('print "@INC"')
    perl_inc.remove('.')
    conf.start_msg("PERL_INC: ")
    conf.end_msg("%s" % (perl_inc), 'GREEN')
    conf.env.PERL_INC = perl_inc