?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/Devel-CheckLib-1.16-0.tar
???????
CHANGES 0000644 00000006501 15125124520 0005536 0 ustar 00 1.16 2022-05-04 Stop all the tests that require a working compiler from skipping on AIX 1.15 2022-05-04 Refactor, stop GCC optimising away test code 1.14 2019-11-12 Use Capture::Tiny instead of Capture::Output 1.13 2018-06-23 Improve Makefile.PL update compatibility code from App-EUMM-Upgrade-1.0 1.12 2018-05-23 Fix order of flags for gcc Fix problems with executable binaries 1.11 2017-05-23 Prevent concatenation warnings when LD_RUN_PATH is undefined. 1.10 2017-04-08 Use Mock::Config. 1.09 2017-04-08 Remove link options from @ldflags. 1.09 2017-03-18 Add $PATH for the libs on Windows. 1.08 2017-03-18 Add $LD_RUN_PATH for the libs. 1.07 2016-04-09 Add analyze_binary feature. 1.06 2016-02-20 Fix linking on MSVC. 1.05 2015-09-16 Fix handling $PERL_MM_OPT. 1.04 2015-09-16 Handle $PERL_MM_OPT. 1.03 2015-01-04 Update travis.yml Fix possible crash bug on windows. 1.02 2014-08-30 Remove .exe when it run on cygwin. 1.01 2013-07-26 Correct version 1.00 2013-07-26 Deprecate use-devel-checklib script. 0.99 2013-04-02 Allow -R rpaths as libpaths used with solaris cc (see RT #81330) 0.98 2012-03-17 Merge ldflags & perllibs. 0.97 2012-02-02 Fixed test. 0.96 2012-02-02 Pass linker options to MSVC. 0.95 2011-10-22 Clean up object files. Also MSVC generates extra files, clean them up. 0.94 2011-10-14 Better error message. 0.93 2011-04-09 Add support for gcc that have version number in the command name. Fix about that the command path include space character. 0.92 2010-12-13 Patch included, thanks to CHM and SISYPHUS (see RT #63742) 0.91 2010-09-29 Version bump up. 0.9 2010-09-29 Fix deprecated parenthesis. use "(qw())". 0.8 2010-09-15 Add include header files into dependencies files. (see RT #61297) Add minimum version number of perl. 0.7 2010-08-25 Add support for checking if a function exists in a library and it returns the right value (see RT #48332) Add check_lib function 0.6 2009-05-20 Support EU::MM-stylee command line, thanks to DAXIM (see RT #46044) 0.5 2008-03-12 Break up 'package Devel::CheckLib' in inc/ so distributions including it don't get marked as 'unauthorised' 0.4 2008-03-04 Look for headers as well as libraries; Clean up temp dirs in tests; use-devel-checklib fixed for Win32 0.3 2007-10-30 tests now skip when they need a compiler and can't find one; Borland compiler support; added bin/use-devel-checklib script; added EU::MM-stylee LIBS support 0.2 2007-10-18 better portability, more features Renamed to Devel::CheckLib 0.1 2007-10-14 Initial release pm_to_blib 0000644 00000000000 15125124520 0006560 0 ustar 00 Makefile 0000644 00000075675 15125124520 0006225 0 ustar 00 # This Makefile is for the Devel::CheckLib extension to perl. # # It was generated automatically by MakeMaker version # 7.60 (Revision: 76000) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # ABSTRACT_FROM => q[lib/Devel/CheckLib.pm] # AUTHOR => [q[David Cantrell], q[David Golden], q[Yasuhiro Matsumoto]] # BUILD_REQUIRES => { } # CONFIGURE_REQUIRES => { } # EXE_FILES => [q[bin/use-devel-checklib]] # LICENSE => q[perl] # META_MERGE => { dynamic_config=>q[0], resources=>{ repository=>q[http://github.com/mattn/p5-Devel-CheckLib] } } # MIN_PERL_VERSION => q[5.004050] # NAME => q[Devel::CheckLib] # PREREQ_PM => { Capture::Tiny=>q[0], Exporter=>q[0], File::Spec=>q[0], File::Temp=>q[0.16], Mock::Config=>q[0.02], Test::More=>q[0.88] } # TEST_REQUIRES => { Capture::Tiny=>q[0], Mock::Config=>q[0.02], Test::More=>q[0.88] } # VERSION_FROM => q[lib/Devel/CheckLib.pm] # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /usr/lib64/perl5/Config.pm). # They may have been overridden via Makefile.PL or on the command line. AR = ar CC = gcc CCCDLFLAGS = -fPIC CCDLFLAGS = -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 DLEXT = so DLSRC = dl_dlopen.xs EXE_EXT = FULL_AR = /usr/bin/ar LD = gcc LDDLFLAGS = -lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -L/usr/local/lib -fstack-protector-strong LDFLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fstack-protector-strong -L/usr/local/lib LIBC = /lib/../lib64/libc.so.6 LIB_EXT = .a OBJ_EXT = .o OSNAME = linux OSVERS = 4.18.0-513.18.1.el8_9.x86_64 RANLIB = : SITELIBEXP = /usr/local/share/perl5/5.32 SITEARCHEXP = /usr/local/lib64/perl5/5.32 SO = so VENDORARCHEXP = /usr/lib64/perl5/vendor_perl VENDORLIBEXP = /usr/share/perl5/vendor_perl # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = / DFSEP = $(DIRFILESEP) NAME = Devel::CheckLib NAME_SYM = Devel_CheckLib VERSION = 1.16 VERSION_MACRO = VERSION VERSION_SYM = 1_16 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 1.16 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = blib/arch INST_SCRIPT = blib/script INST_BIN = blib/bin INST_LIB = blib/lib INST_MAN1DIR = blib/man1 INST_MAN3DIR = blib/man3 MAN1EXT = 1 MAN3EXT = 3pm MAN1SECTION = 1 MAN3SECTION = 3 INSTALLDIRS = site DESTDIR = PREFIX = $(SITEPREFIX) PERLPREFIX = /usr SITEPREFIX = /usr/local VENDORPREFIX = /usr INSTALLPRIVLIB = /usr/share/perl5 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /usr/local/share/perl5/5.32 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /usr/share/perl5/vendor_perl DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /usr/lib64/perl5 DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /usr/local/lib64/perl5/5.32 DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /usr/lib64/perl5/vendor_perl DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/local/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLSITESCRIPT = /usr/local/bin DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) INSTALLVENDORSCRIPT = /usr/bin DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/local/share/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/local/share/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = /usr/share/perl5 PERL_ARCHLIB = /usr/lib64/perl5 PERL_ARCHLIBDEP = /usr/lib64/perl5 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKEFILE_OLD = Makefile.old MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /usr/lib64/perl5/CORE PERL_INCDEP = /usr/lib64/perl5/CORE PERL = "/usr/bin/perl" FULLPERL = "/usr/bin/perl" ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" PERL_CORE = 0 PERM_DIR = 755 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm MM_VERSION = 7.60 MM_REVISION = 76000 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. MAKE = make FULLEXT = Devel/CheckLib BASEEXT = CheckLib PARENT_NAME = Devel DLBASE = $(BASEEXT) VERSION_FROM = lib/Devel/CheckLib.pm OBJECT = LDFROM = $(OBJECT) LINKTYPE = dynamic BOOTDEP = # Handy lists of source code files: XS_FILES = C_FILES = O_FILES = H_FILES = MAN1PODS = bin/use-devel-checklib MAN3PODS = lib/Devel/CheckLib.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIBDEP)$(DFSEP)Config.pm $(PERL_INCDEP)$(DFSEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)/Devel INST_ARCHLIBDIR = $(INST_ARCHLIB)/Devel INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = INST_DYNAMIC = INST_BOOT = # Extra linker info EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVEDEP = PERL_ARCHIVE_AFTER = TO_INST_PM = lib/Devel/CheckLib.pm # --- MakeMaker platform_constants section: MM_Unix_VERSION = 7.60 PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$$$ARGV[0], $$$$ARGV[1], 0, 1, 1)' -- # --- MakeMaker tool_xsubpp section: # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp MV = mv NOOP = $(TRUE) NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- FALSE = false TRUE = true ECHO = echo ECHO_N = echo -n UNINST = 0 VERBINST = 0 MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- MACROSTART = MACROEND = USEMAKEFILE = -f FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- CP_NONEMPTY = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'cp_nonempty' -- # --- MakeMaker makemakerdflt section: makemakerdflt : all $(NOECHO) $(NOOP) # --- MakeMaker dist section: TAR = tar TARFLAGS = cvf ZIP = zip ZIPFLAGS = -r COMPRESS = gzip --best SUFFIX = .gz SHAR = shar PREOP = $(NOECHO) $(NOOP) POSTOP = $(NOECHO) $(NOOP) TO_UNIX = $(NOECHO) $(NOOP) CI = ci -u RCS_LABEL = rcs -Nv$(VERSION_SYM): -q DIST_CP = best DIST_DEFAULT = tardist DISTNAME = Devel-CheckLib DISTVNAME = Devel-CheckLib-1.16 # --- MakeMaker macro section: # --- MakeMaker depend section: # --- MakeMaker cflags section: # --- MakeMaker const_loadlibs section: # --- MakeMaker const_cccmd section: # --- MakeMaker post_constants section: # --- MakeMaker pasthru section: PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ PREFIX="$(PREFIX)"\ PASTHRU_DEFINE='$(DEFINE) $(PASTHRU_DEFINE)'\ PASTHRU_INC='$(INC) $(PASTHRU_INC)' # --- MakeMaker special_targets section: .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir pure_all subdirs clean_subdirs makemakerdflt manifypods realclean_subdirs subdirs_dynamic subdirs_pure_nolink subdirs_static subdirs-test_dynamic subdirs-test_static test_dynamic test_static # --- MakeMaker c_o section: # --- MakeMaker xs_c section: # --- MakeMaker xs_o section: # --- MakeMaker top_targets section: all :: pure_all manifypods $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs $(NOECHO) $(NOOP) help : perldoc ExtUtils::MakeMaker # --- MakeMaker blibdirs section: blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists $(NOECHO) $(NOOP) # Backwards compat with 6.18 through 6.25 blibdirs.ts : blibdirs $(NOECHO) $(NOOP) $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHLIB) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_BIN) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_SCRIPT) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN1DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists # --- MakeMaker linkext section: linkext :: dynamic $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic_bs section: BOOTSTRAP = # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) config $(INST_BOOT) $(INST_DYNAMIC) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_lib section: # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all config \ bin/use-devel-checklib \ lib/Devel/CheckLib.pm $(NOECHO) $(POD2MAN) --section=$(MAN1SECTION) --perm_rw=$(PERM_RW) -u \ bin/use-devel-checklib $(INST_MAN1DIR)/use-devel-checklib.$(MAN1EXT) $(NOECHO) $(POD2MAN) --section=$(MAN3SECTION) --perm_rw=$(PERM_RW) -u \ lib/Devel/CheckLib.pm $(INST_MAN3DIR)/Devel::CheckLib.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: EXE_FILES = bin/use-devel-checklib pure_all :: $(INST_SCRIPT)/use-devel-checklib $(NOECHO) $(NOOP) realclean :: $(RM_F) \ $(INST_SCRIPT)/use-devel-checklib $(INST_SCRIPT)/use-devel-checklib : bin/use-devel-checklib $(FIRST_MAKEFILE) $(INST_SCRIPT)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(NOECHO) $(RM_F) $(INST_SCRIPT)/use-devel-checklib $(CP) bin/use-devel-checklib $(INST_SCRIPT)/use-devel-checklib $(FIXIN) $(INST_SCRIPT)/use-devel-checklib -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/use-devel-checklib # --- MakeMaker subdirs section: # none # --- MakeMaker clean_subdirs section: clean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs - $(RM_F) \ $(BASEEXT).bso $(BASEEXT).def \ $(BASEEXT).exp $(BASEEXT).x \ $(BOOTSTRAP) $(INST_ARCHAUTODIR)/extralibs.all \ $(INST_ARCHAUTODIR)/extralibs.ld $(MAKE_APERL_FILE) \ *$(LIB_EXT) *$(OBJ_EXT) \ *perl.core MYMETA.json \ MYMETA.yml blibdirs.ts \ core core.*perl.*.? \ core.[0-9] core.[0-9][0-9] \ core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] \ core.[0-9][0-9][0-9][0-9][0-9] lib$(BASEEXT).def \ mon.out perl \ perl$(EXE_EXT) perl.exe \ perlmain.c pm_to_blib \ pm_to_blib.ts so_locations \ tmon.out - $(RM_RF) \ blib $(NOECHO) $(RM_F) $(MAKEFILE_OLD) - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) # --- MakeMaker realclean_subdirs section: # so clean is forced to complete before realclean_subdirs runs realclean_subdirs : clean $(NOECHO) $(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete dist files realclean purge :: realclean_subdirs - $(RM_F) \ $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(RM_RF) \ $(DISTVNAME) # --- MakeMaker metafile section: metafile : create_distdir $(NOECHO) $(ECHO) Generating META.yml $(NOECHO) $(ECHO) '---' > META_new.yml $(NOECHO) $(ECHO) 'abstract: '\''check that a library is available'\''' >> META_new.yml $(NOECHO) $(ECHO) 'author:' >> META_new.yml $(NOECHO) $(ECHO) ' - '\''David Cantrell'\''' >> META_new.yml $(NOECHO) $(ECHO) ' - '\''David Golden'\''' >> META_new.yml $(NOECHO) $(ECHO) ' - '\''Yasuhiro Matsumoto'\''' >> META_new.yml $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' Capture::Tiny: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) ' Mock::Config: '\''0.02'\''' >> META_new.yml $(NOECHO) $(ECHO) ' Test::More: '\''0.88'\''' >> META_new.yml $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'dynamic_config: 0' >> META_new.yml $(NOECHO) $(ECHO) 'generated_by: '\''ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010'\''' >> META_new.yml $(NOECHO) $(ECHO) 'license: perl' >> META_new.yml $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml $(NOECHO) $(ECHO) ' version: '\''1.4'\''' >> META_new.yml $(NOECHO) $(ECHO) 'name: Devel-CheckLib' >> META_new.yml $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml $(NOECHO) $(ECHO) ' directory:' >> META_new.yml $(NOECHO) $(ECHO) ' - t' >> META_new.yml $(NOECHO) $(ECHO) ' - inc' >> META_new.yml $(NOECHO) $(ECHO) 'requires:' >> META_new.yml $(NOECHO) $(ECHO) ' Exporter: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) ' File::Spec: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) ' File::Temp: '\''0.16'\''' >> META_new.yml $(NOECHO) $(ECHO) ' perl: '\''5.004050'\''' >> META_new.yml $(NOECHO) $(ECHO) 'resources:' >> META_new.yml $(NOECHO) $(ECHO) ' repository: http://github.com/mattn/p5-Devel-CheckLib' >> META_new.yml $(NOECHO) $(ECHO) 'version: '\''1.16'\''' >> META_new.yml $(NOECHO) $(ECHO) 'x_serialization_backend: '\''CPAN::Meta::YAML version 0.018'\''' >> META_new.yml -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml $(NOECHO) $(ECHO) Generating META.json $(NOECHO) $(ECHO) '{' > META_new.json $(NOECHO) $(ECHO) ' "abstract" : "check that a library is available",' >> META_new.json $(NOECHO) $(ECHO) ' "author" : [' >> META_new.json $(NOECHO) $(ECHO) ' "David Cantrell",' >> META_new.json $(NOECHO) $(ECHO) ' "David Golden",' >> META_new.json $(NOECHO) $(ECHO) ' "Yasuhiro Matsumoto"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "dynamic_config" : 0,' >> META_new.json $(NOECHO) $(ECHO) ' "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010",' >> META_new.json $(NOECHO) $(ECHO) ' "license" : [' >> META_new.json $(NOECHO) $(ECHO) ' "perl_5"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "meta-spec" : {' >> META_new.json $(NOECHO) $(ECHO) ' "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : 2' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "name" : "Devel-CheckLib",' >> META_new.json $(NOECHO) $(ECHO) ' "no_index" : {' >> META_new.json $(NOECHO) $(ECHO) ' "directory" : [' >> META_new.json $(NOECHO) $(ECHO) ' "t",' >> META_new.json $(NOECHO) $(ECHO) ' "inc"' >> META_new.json $(NOECHO) $(ECHO) ' ]' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "prereqs" : {' >> META_new.json $(NOECHO) $(ECHO) ' "build" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "configure" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "runtime" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "Exporter" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "File::Spec" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "File::Temp" : "0.16",' >> META_new.json $(NOECHO) $(ECHO) ' "perl" : "5.004050"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "test" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "Capture::Tiny" : "0",' >> META_new.json $(NOECHO) $(ECHO) ' "Mock::Config" : "0.02",' >> META_new.json $(NOECHO) $(ECHO) ' "Test::More" : "0.88"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json $(NOECHO) $(ECHO) ' "resources" : {' >> META_new.json $(NOECHO) $(ECHO) ' "repository" : {' >> META_new.json $(NOECHO) $(ECHO) ' "url" : "http://github.com/mattn/p5-Devel-CheckLib"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "version" : "1.16",' >> META_new.json $(NOECHO) $(ECHO) ' "x_serialization_backend" : "JSON::PP version 4.06"' >> META_new.json $(NOECHO) $(ECHO) '}' >> META_new.json -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json # --- MakeMaker signature section: signature : cpansign -s # --- MakeMaker dist_basics section: distclean :: realclean distcheck $(NOECHO) $(NOOP) distcheck : $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck skipcheck : $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck manifest : $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest veryclean : realclean $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old # --- MakeMaker dist_core section: dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- tardist : $(DISTVNAME).tar$(SUFFIX) $(NOECHO) $(NOOP) uutardist : $(DISTVNAME).tar$(SUFFIX) uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)_uu' $(DISTVNAME).tar$(SUFFIX) : distdir $(PREOP) $(TO_UNIX) $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(COMPRESS) $(DISTVNAME).tar $(NOECHO) $(ECHO) 'Created $(DISTVNAME).tar$(SUFFIX)' $(POSTOP) zipdist : $(DISTVNAME).zip $(NOECHO) $(NOOP) $(DISTVNAME).zip : distdir $(PREOP) $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(NOECHO) $(ECHO) 'Created $(DISTVNAME).zip' $(POSTOP) shdist : distdir $(PREOP) $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar $(RM_RF) $(DISTVNAME) $(NOECHO) $(ECHO) 'Created $(DISTVNAME).shar' $(POSTOP) # --- MakeMaker distdir section: create_distdir : $(RM_RF) $(DISTVNAME) $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" distdir : create_distdir distmeta $(NOECHO) $(NOOP) # --- MakeMaker dist_test section: disttest : distdir cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL cd $(DISTVNAME) && $(MAKE) $(PASTHRU) cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) # --- MakeMaker dist_ci section: ci : $(ABSPERLRUN) -MExtUtils::Manifest=maniread -e '@all = sort keys %{ maniread() };' \ -e 'print(qq{Executing $(CI) @all\n});' \ -e 'system(qq{$(CI) @all}) == 0 or die $$!;' \ -e 'print(qq{Executing $(RCS_LABEL) ...\n});' \ -e 'system(qq{$(RCS_LABEL) @all}) == 0 or die $$!;' -- # --- MakeMaker distmeta section: distmeta : create_distdir metafile $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.yml to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.json to MANIFEST: $${'\''@'\''}"' -- # --- MakeMaker distsignature section: distsignature : distmeta $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }' \ -e ' or die "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE cd $(DISTVNAME) && cpansign -s # --- MakeMaker install section: install :: pure_install doc_install $(NOECHO) $(NOOP) install_perl :: pure_perl_install doc_perl_install $(NOECHO) $(NOOP) install_site :: pure_site_install doc_site_install $(NOECHO) $(NOOP) install_vendor :: pure_vendor_install doc_vendor_install $(NOECHO) $(NOOP) pure_install :: pure_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) doc_install :: doc_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) pure__install : pure_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site doc__install : doc_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_perl_install :: all $(NOECHO) $(MOD_INSTALL) \ read "$(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist" \ write "$(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist" \ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \ "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \ "$(INST_BIN)" "$(DESTINSTALLBIN)" \ "$(INST_SCRIPT)" "$(DESTINSTALLSCRIPT)" \ "$(INST_MAN1DIR)" "$(DESTINSTALLMAN1DIR)" \ "$(INST_MAN3DIR)" "$(DESTINSTALLMAN3DIR)" $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ "$(SITEARCHEXP)/auto/$(FULLEXT)" pure_site_install :: all $(NOECHO) $(MOD_INSTALL) \ read "$(SITEARCHEXP)/auto/$(FULLEXT)/.packlist" \ write "$(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist" \ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \ "$(INST_ARCHLIB)" "$(DESTINSTALLSITEARCH)" \ "$(INST_BIN)" "$(DESTINSTALLSITEBIN)" \ "$(INST_SCRIPT)" "$(DESTINSTALLSITESCRIPT)" \ "$(INST_MAN1DIR)" "$(DESTINSTALLSITEMAN1DIR)" \ "$(INST_MAN3DIR)" "$(DESTINSTALLSITEMAN3DIR)" $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ "$(PERL_ARCHLIB)/auto/$(FULLEXT)" pure_vendor_install :: all $(NOECHO) $(MOD_INSTALL) \ read "$(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist" \ write "$(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist" \ "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \ "$(INST_ARCHLIB)" "$(DESTINSTALLVENDORARCH)" \ "$(INST_BIN)" "$(DESTINSTALLVENDORBIN)" \ "$(INST_SCRIPT)" "$(DESTINSTALLVENDORSCRIPT)" \ "$(INST_MAN1DIR)" "$(DESTINSTALLVENDORMAN1DIR)" \ "$(INST_MAN3DIR)" "$(DESTINSTALLVENDORMAN3DIR)" doc_perl_install :: all $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLPRIVLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> "$(DESTINSTALLARCHLIB)/perllocal.pod" doc_site_install :: all $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> "$(DESTINSTALLARCHLIB)/perllocal.pod" doc_vendor_install :: all $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod" -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)" -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLVENDORLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> "$(DESTINSTALLARCHLIB)/perllocal.pod" uninstall :: uninstall_from_$(INSTALLDIRS)dirs $(NOECHO) $(NOOP) uninstall_from_perldirs :: $(NOECHO) $(UNINSTALL) "$(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist" uninstall_from_sitedirs :: $(NOECHO) $(UNINSTALL) "$(SITEARCHEXP)/auto/$(FULLEXT)/.packlist" uninstall_from_vendordirs :: $(NOECHO) $(UNINSTALL) "$(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist" # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE : $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: # --- MakeMaker makefile section: # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" $(FALSE) # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = perl FULLPERL = "/usr/bin/perl" MAP_PERLINC = "-Iblib/arch" "-Iblib/lib" "-I/usr/lib64/perl5" "-I/usr/share/perl5" $(MAP_TARGET) :: $(MAKE_APERL_FILE) $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ $(MAKE_APERL_FILE) : static $(FIRST_MAKEFILE) pm_to_blib $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR="" \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t/*.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) $(NOECHO) $(NOOP) test :: $(TEST_TYPE) $(NOECHO) $(NOOP) # Occasionally we may face this degenerate target: test_ : test_dynamic $(NOECHO) $(NOOP) subdirs-test_dynamic :: dynamic pure_all test_dynamic :: subdirs-test_dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: dynamic pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) subdirs-test_static :: static pure_all test_static :: subdirs-test_static PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_static :: static pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : $(NOECHO) $(ECHO) '<SOFTPKG NAME="Devel-CheckLib" VERSION="1.16">' > Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <ABSTRACT>check that a library is available</ABSTRACT>' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <AUTHOR>David Cantrell, David Golden, Yasuhiro Matsumoto</AUTHOR>' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <PERLCORE VERSION="5,004050,0,0" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <REQUIRE NAME="Exporter::" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <REQUIRE NAME="File::Spec" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <REQUIRE NAME="File::Temp" VERSION="0.16" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="x86_64-linux-thread-multi-5.32" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> Devel-CheckLib.ppd $(NOECHO) $(ECHO) '</SOFTPKG>' >> Devel-CheckLib.ppd # --- MakeMaker pm_to_blib section: pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ 'lib/Devel/CheckLib.pm' 'blib/lib/Devel/CheckLib.pm' $(NOECHO) $(TOUCH) pm_to_blib # --- MakeMaker selfdocument section: # here so even if top_targets is overridden, these will still be defined # gmake will silently still work if any are .PHONY-ed but nmake won't static :: $(NOECHO) $(NOOP) dynamic :: $(NOECHO) $(NOOP) config :: $(NOECHO) $(NOOP) # --- MakeMaker postamble section: # End. META.json 0000664 00000002506 15125124520 0006167 0 ustar 00 { "abstract" : "check that a library is available", "author" : [ "David Cantrell", "David Golden", "Yasuhiro Matsumoto" ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Devel-CheckLib", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Exporter" : "0", "File::Spec" : "0", "File::Temp" : "0.16", "perl" : "5.00405" } }, "test" : { "requires" : { "Capture::Tiny" : "0", "Mock::Config" : "0.02", "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "http://github.com/mattn/p5-Devel-CheckLib" } }, "version" : "1.16", "x_serialization_backend" : "JSON::PP version 4.02" } t/found.t 0000644 00000002700 15125124520 0006303 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } else { eval "use Helper qw/create_testlib/"; } my $debug = $ENV{DEVEL_CHECKLIB_DEBUG} || 0; # compile a test library my $libdir = create_testlib("bazbam"); my @lib = $^O eq 'MSWin32' # if Win32 (not Cygwin) ... ? ( $Config{cc} =~ /(^|^\w+ )bcc/ # FIXME - find a second Borland lib ? ('cc3250', 'cc3250') # ... Borland : ('msvcrt', 'kernel32') # ... otherwise assume Microsoft ) : qw(m c) # default to Unix-style ; # cases are strings to interpolate into the assert_lib call my @cases = ( qq/lib => '$lib[0]'/, qq/lib => '$lib[1]'/, qq/lib => ['$lib[0]', '$lib[1]']/, ); push @cases, qq{lib => 'bazbam', libpath => '$libdir'} if $libdir; plan tests => 2 * scalar @cases; for my $c ( @cases ) { my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $c)"; $error = $@; }; is($error, q{}, "$c") || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); ok(check_lib(debug => $debug, eval($c)), "... and check_lib is true"); } t/not_found.t 0000644 00000002646 15125124520 0007174 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Test::More; use Config; my $debug = 0; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } my $platform_lib = $^O eq 'MSWin32' # if Win32 (not Cygwin) ... ? ( $Config{cc} =~ /(^|^\w+ )bcc/ ? 'cc3250' # ... Borland : 'msvcrt' # ... otherwise assume Microsoft ) : 'm' # default to Unix-style ; # Cases are AoH: { arg => $string, missing => $string } my @cases = ( { arg => qq{lib => 'foo'}, missing => ['foo'] }, { arg => qq{lib => [qw/$platform_lib foo/]}, missing => ['foo'] }, { arg => qq{lib => [qw/foo $platform_lib/]}, missing => ['foo'] }, { arg => qq{lib => [qw/foo bar/]}, missing => [qw/foo bar/] }, ); plan tests => 3 * @cases; for my $c ( @cases ) { eval "assert_lib(debug => $debug, $c->{arg})"; my $err = $@; ok ( $err, "died on '$c->{arg}'" ); my $miss_string = join(q{, }, map { qq{'$_'} } @{$c->{missing}} ); like ($err, "/^Can't link\/include C library ${miss_string}/ms", "missing $miss_string detected" ); ok(!check_lib(debug => $debug, eval($c->{arg})), "... and check_lib is false"); } t/flags.t 0000644 00000002264 15125124520 0006271 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } my $libdir; eval "use Helper qw(create_testlib)"; unless($libdir = create_testlib("bazbam")) { plan skip_all => "Couldn't build a library to test against"; }; my($debug, $stdout, $stderr) = ($ENV{DEVEL_CHECKLIB_DEBUG} || 0); sub diagout { diag "\tSTDOUT: $stdout\n\tSTDERR: $stderr\n" } my %common = ( debug => $debug, incpath => 't/inc', libpath => $libdir, lib => 'bazbam', header => 'headerfile.h', function => <<EOF); #ifdef FOO1234 return 0; #else return 1; #endif EOF my $error; ($stdout, $stderr) = capture { eval { assert_lib(%common, ccflags => '-DFOO1234') }; $error = $@; }; is($error, '', "ccflags ok") or diagout; ($stdout, $stderr) = capture { eval { assert_lib(%common) }; $error = $@; }; like($error, qr/wrong/i, "ccflags wrong") or diagout; done_testing; t/bad-single-word-compiler.t 0000644 00000002074 15125124520 0011762 0 ustar 00 # $Id: bad-single-word-compiler.t,v 1.2 2008/02/07 14:16:39 drhyde Exp $ use strict; BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Test::More; plan tests => 1; use Config; BEGIN { eval 'use Mock::Config;'; warnings->unimport('redefine') if $] >= 5.006; unless (defined($ActivePerl::VERSION) && $Config{cc} =~ /\bgcc\b/) { if (!$Mock::Config::VERSION) { plan skip_all => "XSConfig is readonly" if $Config{usecperl} or exists &Config::KEYS; *Config::STORE = sub { $_[0]->{$_[1]} = $_[2] } } } } if ($Mock::Config::VERSION) { Mock::Config->import(cc => "flibbertigibbet"); } elsif (defined($ActivePerl::VERSION) && $Config{cc} =~ /\bgcc\b/) { my $obj = tied %Config::Config; $obj->{cc} = "flibbertigibbet"; } else { eval { $Config{cc} = 'flibbertigibbet' }; } SKIP: { skip "Couldn't update %Config", 1 if $@ =~ /%Config::Config is read-only/; eval "use Devel::CheckLib"; ok($@ =~ /^Couldn't find your C compiler/, "Bad single-word compiler is not OK"); } t/dash-l-libs.t 0000644 00000002312 15125124520 0007266 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; my $debug = $ENV{DEVEL_CHECKLIB_DEBUG} || 0; my $libdir; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } eval "use Helper qw(create_testlib)"; if($libdir = create_testlib("bazbam")) { plan tests => 1; } else { plan skip_all => "Couldn't build a library to test against"; }; my $runtime = '-l'.( $^O eq 'MSWin32' # if Win32 (not Cygwin) ... ? ( $Config{cc} =~ /(^|^\w+ )bcc/ ? 'cc3250' # ... Borland : 'msvcrt' # ... otherwise assume Microsoft ) : 'm' # default to Unix-style ); # my $runtime = $^O eq 'MSWin32' ? '-lmsvcrt' : '-lm'; my $args = qq{LIBS => '$runtime -lbazbam -L$libdir'}; my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $args)"; $error = $@; }; is($error, q{}, "$args") || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); t/headers.t 0000644 00000002540 15125124520 0006605 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } my $debug = $ENV{DEVEL_CHECKLIB_DEBUG} || 0; # cases are strings to interpolate into the assert_lib call my %failcases = ( qq{incpath => '.', header => 'headerfile.h'} => "Can't link/include", qq{INC => '-t/inc', header => 'headerfile.h'} => "INC argument badly-formed" ); my @passcases = ( qq{incpath => '.', header => 't/inc/headerfile.h'}, qq{incpath => [qw(t/inc)], header => 'headerfile.h'}, qq{INC => '-I. -It/inc', header => 'headerfile.h'} ); plan tests => scalar(keys %failcases) + scalar(@passcases); for my $c (keys %failcases) { my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $c)"; $error = $@; }; ok($error =~ /^$failcases{$c}/, "$c") || diag("$@\n\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); } for my $c ( @passcases ) { my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $c)"; $error = $@; }; is($error, q{}, "$c") || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); } t/custom-function.t 0000644 00000004617 15125124520 0010336 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } my $libdir; eval "use Helper qw(create_testlib)"; unless($libdir = create_testlib("bazbam")) { plan skip_all => "Couldn't build a library to test against"; }; my $debug = $ENV{DEVEL_CHECKLIB_DEBUG} || 0; # cases are strings to interpolate into the assert_lib call my %failcases = ( qq{ incpath => 't/inc', libpath => '$libdir', lib => 'bazbam', header => 'headerfile.h', # bar() doesn't exist function => 'bar();' } => 'Can\'t link/include', qq{ incpath => 't/inc', libpath => '$libdir', lib => 'bazbam', header => 'headerfile.h', # libversion returns wrong result function => 'foo();if(libversion() < 5) return 0; else return 1;' } => 'wrong result', ); my %passcases = ( qq{ incpath => 't/inc', libpath => '$libdir', lib => 'bazbam', header => 'headerfile.h', functionbody => 'foo(); return 0;' }, "function exists", qq{ incpath => 't/inc', libpath => '$libdir', lib => 'bazbam', header => 'headerfile.h', functionbody => 'if(libversion() > 5) return 0; else return 1;' }, "function returns right value", qq{ incpath => 't/inc', libpath => '$libdir', lib => 'bazbam', header => 'headerfile.h', functionbody => 'foo();if(libversion() > 5) return 0; else return 1;' }, "function exists and other function returns right value", ); plan tests => scalar(keys %failcases) + scalar(keys %passcases); for my $c (keys %failcases) { my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $c)"; $error = $@; }; ok($error =~ /^$failcases{$c}/, "failed to build: $failcases{$c}") || diag("$c\n$@\n\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); } for my $c ( keys %passcases ) { my $error; my ($stdout, $stderr) = capture { eval "assert_lib(debug => $debug, $c)"; $error = $@; }; is($error, q{}, "$passcases{$c}") || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); } t/inc/headerfile.h 0000644 00000000046 15125124520 0010016 0 ustar 00 int foo(void); int libversion(void); t/cmdline-LIBS-INC.t 0000644 00000004073 15125124520 0007746 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; my($debug, $stdout, $stderr) = ($ENV{DEVEL_CHECKLIB_DEBUG} || 0); my $libdir; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { #' plan skip_all => "Couldn't find your C compiler"; } eval "use Helper qw(create_testlib)"; if($libdir = create_testlib("bazbam")) { plan tests => 3; } else { plan skip_all => "Couldn't build a library to test against"; }; my $runtime = '-l'.( $^O eq 'MSWin32' # if Win32 (not Cygwin) ... ? ( $Config{cc} =~ /(^|^\w+ )bcc/ ? 'cc3250' # ... Borland : 'msvcrt' # ... otherwise assume Microsoft ) : 'm' # default to Unix-style ); my $rval = undef; my @args = (qq{LIBS=$runtime}); ($stdout, $stderr) = capture { $rval = system( $Config{perlpath}, '-Mblib', '-MDevel::CheckLib', '-e', "print @ARGV;assert_lib(debug => $debug)", @args ); }; ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); $rval = undef; @args = map { "LIBS=$_" } ($runtime, '-lbazbam', "-L$libdir"); ($stdout, $stderr) = capture { $rval = system( $Config{perlpath}, '-Mblib', '-MDevel::CheckLib', '-e', "print @ARGV;assert_lib(debug => $debug)", @args ); }; ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); $rval = undef; @args = (qq{"LIBS=$runtime -lbazbam -L$libdir"}); ($stdout, $stderr) = capture { $rval = system( $Config{perlpath}, '-Mblib', '-MDevel::CheckLib', '-e', "print @ARGV;assert_lib(debug => $debug)", @args ); }; ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); t/multi-word-compiler.t 0000644 00000002033 15125124520 0011102 0 ustar 00 # $Id: multi-word-compiler.t,v 1.3 2008/02/07 14:16:39 drhyde Exp $ use strict; BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Test::More; plan tests => 1; use Config; BEGIN { eval 'use Mock::Config;'; warnings->unimport('redefine') if $] >= 5.006; unless(defined($ActivePerl::VERSION) && $Config{cc} =~ /\bgcc\b/) { if (!$Mock::Config::VERSION) { plan skip_all => "XSConfig is readonly" if $Config{usecperl} or exists &Config::KEYS; *Config::STORE = sub { $_[0]->{$_[1]} = $_[2] } } } } my $fake_cc = qq{"$^X" $Config{cc}}; if ($Mock::Config::VERSION) { Mock::Config->import(cc => $fake_cc); } elsif (defined($ActivePerl::VERSION) && $Config{cc} =~ /\bgcc\b/) { my $obj = tied %Config::Config; $obj->{cc} = $fake_cc; } else { eval { $Config{cc} = $fake_cc; } } SKIP: { skip "Couldn't update %Config", 1 if $@ =~ /%Config::Config is read-only/; eval "use Devel::CheckLib"; is $@, "", "Good multi-word compiler is OK"; } t/exit_with_message.t 0000644 00000001046 15125124520 0010702 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Test::More; use File::Temp; my $fh = File::Temp->new(); print {$fh} << 'ENDPRINT'; use Devel::CheckLib; check_lib_or_exit( qw/lib hlagh/ ); ENDPRINT $fh->close; my $err = `"$^X" $fh 2>&1`; if($err =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } else { plan tests => 1; like ($err, "/^Can't link\\/include C library 'hlagh'/ms", "missing hlagh detected non-fatally" ); } t/analyze-binary.t 0000644 00000003066 15125124520 0010123 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use lib 't/lib'; use Capture::Tiny qw(capture); use Config; use File::Spec; use Test::More; eval "use Devel::CheckLib"; if($@ =~ /Couldn't find your C compiler/) { plan skip_all => "Couldn't find your C compiler"; } my $libdir; eval "use Helper qw(create_testlib)"; unless($libdir = create_testlib("bazbam")) { plan skip_all => "Couldn't build a library to test against"; }; my($debug, $stdout, $stderr) = ($ENV{DEVEL_CHECKLIB_DEBUG} || 0); sub diagout { diag "\tSTDOUT: $stdout\n\tSTDERR: $stderr\n" } sub analyze_binary { my ($lib, $bin, $expected_rc, @args) = @_; $bin = File::Spec->rel2abs($bin); system $bin, @args; warn "\$?: $?, expected: ".($expected_rc << 8)."\n"; return ($? == ($expected_rc << 8)); } my %common = ( debug => $debug, incpath => 't/inc', libpath => $libdir, lib => 'bazbam', header => 'headerfile.h', function => 'return (argc - 1);', ); my $error; ($stdout, $stderr) = capture { eval { assert_lib(%common, analyze_binary => sub { analyze_binary @_, 3, qw(foo bar doz) } ) }; $error = $@; }; is($error, '', "analyze_binary ok") or diagout; ($stdout, $stderr) = capture { eval { assert_lib(%common, analyze_binary => sub { analyze_binary @_, 3, qw(foo) } ) }; $error = $@; }; like($error, qr/wrong analysis/i, "analyze_binary wrong") or diagout; done_testing; t/coverage.sh 0000755 00000000210 15125124520 0007127 0 ustar 00 #!/bin/sh # $Id: coverage.sh,v 1.1 2008/02/26 21:54:55 drhyde Exp $ cover -delete HARNESS_PERL_SWITCHES=-MDevel::Cover make test cover t/00-load.t 0000644 00000000350 15125124520 0006323 0 ustar 00 use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Test::More tests => 1; eval "use Devel::CheckLib"; ok($@ =~ /Couldn't find your C compiler/ || !$@, "Can load module"); t/lib/Helper.pm 0000644 00000007314 15125124520 0007334 0 ustar 00 package Helper; use strict; # compatible use warnings BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } use Config; use Cwd; use Exporter; use IO::File; use File::Spec::Functions qw/catfile canonpath splitdir/; use File::Temp qw/tempdir/; use vars qw/@EXPORT @ISA/; @ISA = qw/Exporter/; @EXPORT = qw( create_testlib find_compiler find_binary ); my $orig_wd = cwd; BEGIN { require Devel::CheckLib; } # for _quiet_system() sub _quiet_system { goto &Devel::CheckLib::_quiet_system; } #--------------------------------------------------------------------------# # create_testlib( 'bazbam' ) # # takes a library name and compiles a simple library with two functions, # foo() (which returns 0) and libversion() (which returns 42), in a temp # directory and returns the temp directory. Returns undef if something # went wrong #--------------------------------------------------------------------------# sub create_testlib { my ($libname) = (@_); return unless $libname; my $tempdir = tempdir(CLEANUP => 1, TEMPLATE => "Devel-Assert-testlib-XXXXXXXX"); chdir $tempdir; my $code_fh = IO::File->new("${libname}.c", ">"); print {$code_fh} "int libversion() { return 42; }\nint foo() { return 0; }\n"; $code_fh->close; my $cc = (split(/\s+/, $Config{cc}))[0]; my $gccv = $Config{gccversion}; my $rv = $cc eq 'gcc' ? _gcc_lib( $libname ) : $cc eq 'cc' ? _gcc_lib( $libname ) : $cc eq 'cl' ? _cl_lib( $libname ) : $gccv ? _gcc_lib( $libname ) : undef ; chdir $orig_wd; return $rv ? canonpath($tempdir) : undef; } sub _gcc_lib { my ($libname) = @_; my $cc = find_compiler() or return; my $ar = find_binary('ar') or return; my $ranlib = find_binary('ranlib') or return; my $ccflags = $Config{ccflags}; my $libfile = "lib${libname}.a"; _quiet_system(qq{"$cc" $ccflags -c ${libname}.c}) and return; _quiet_system($ar, 'rc', $libfile, "${libname}$Config{_o}") and return; _quiet_system($ranlib, $libfile) and return; return -f $libfile } sub _cl_lib { my ($libname) = @_; my $cc = find_compiler() or return; my $ar = find_binary('lib') or return; _quiet_system($cc, '/c', "${libname}.c") and return; _quiet_system($ar, "${libname}$Config{_o}") and return; return -f "${libname}.lib"; } #--------------------------------------------------------------------------# # find_binary, find_compiler # # Returns absolute path to an executable file in $ENV{PATH} or undef # if it can't be found. find_binary() takes a program argument; # find_compiler takes no arguments and just returns the path to $Config{cc} #--------------------------------------------------------------------------# sub find_binary { my ($program) = @_; if ($Config{_exe} && $program !~ /$Config{_exe}$/) { $program .= $Config{_exe}; } return $program if -x $program; my @search_paths = split /$Config{path_sep}/, $ENV{PATH}; my @lib_search_paths = map lib_to_bin($_), split /$Config{path_sep}/, $ENV{LIBRARY_PATH}||''; for my $path ( @search_paths, @lib_search_paths ) { my $binary = catfile( $path, $program ); return $binary if -x $binary; } return; } sub lib_to_bin { my ( $lib_dir ) = @_; my @parts = splitdir $lib_dir; pop @parts; push @parts, 'bin'; my $bin_dir = catfile(@parts); return $bin_dir; } sub find_compiler { my $result = find_binary($Config{cc}); return $result if($result); # sometimes $Config{cc} isn't very clean eg it can be 'cc -q32' on AIX return find_binary((split(/\s+/, $Config{cc}))[0]) if($Config{cc} =~ /\s/); undef; } 1; # must be true TODO 0000644 00000000035 15125124520 0005227 0 ustar 00 SGI (maybe) VMS pkg-config? META.yml 0000664 00000001410 15125124520 0006010 0 ustar 00 --- abstract: 'check that a library is available' author: - 'David Cantrell' - 'David Golden' - 'Yasuhiro Matsumoto' build_requires: Capture::Tiny: '0' ExtUtils::MakeMaker: '0' Mock::Config: '0.02' Test::More: '0.88' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Devel-CheckLib no_index: directory: - t - inc requires: Exporter: '0' File::Spec: '0' File::Temp: '0.16' perl: '5.00405' resources: repository: http://github.com/mattn/p5-Devel-CheckLib version: '1.16' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Makefile.PL 0000644 00000004570 15125124520 0006521 0 ustar 00 # $Id: Makefile.PL,v 1.6 2008/03/04 21:49:19 drhyde Exp $ use 5.00405; use ExtUtils::MakeMaker; use strict; $^W = 1; WriteMakefile1( NAME => 'Devel::CheckLib', ABSTRACT_FROM => 'lib/Devel/CheckLib.pm', VERSION_FROM => 'lib/Devel/CheckLib.pm', AUTHOR => [ 'David Cantrell', 'David Golden', 'Yasuhiro Matsumoto', ], PREREQ_PM => { 'File::Temp' => 0.16, 'Exporter' => 0, 'File::Spec' => 0, }, MIN_PERL_VERSION => '5.00405', META_MERGE => { dynamic_config => 0, resources => { repository => 'http://github.com/mattn/p5-Devel-CheckLib', }, }, TEST_REQUIRES => { 'Test::More' => 0.88, # done_testing 'Capture::Tiny' => 0, 'Mock::Config' => 0.02, }, LICENSE => 'perl', EXE_FILES => [qw( bin/use-devel-checklib )], ); sub WriteMakefile1 { #Compatibility code for old versions of EU::MM. Written by Alexandr Ciornii, version 2. Added by eumm-upgrade. my %params=@_; my $eumm_version=$ExtUtils::MakeMaker::VERSION; $eumm_version=eval $eumm_version; die "EXTRA_META is deprecated" if exists $params{EXTRA_META}; die "License not specified" if not exists $params{LICENSE}; if ($params{AUTHOR} and ref($params{AUTHOR}) eq 'ARRAY' and $eumm_version < 6.5705) { $params{META_ADD}->{author}=$params{AUTHOR}; $params{AUTHOR}=join(', ',@{$params{AUTHOR}}); } if ($params{TEST_REQUIRES} and $eumm_version < 6.64) { $params{BUILD_REQUIRES}={ %{$params{BUILD_REQUIRES} || {}} , %{$params{TEST_REQUIRES}} }; delete $params{TEST_REQUIRES}; } if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) { #EUMM 6.5502 has problems with BUILD_REQUIRES $params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} }; delete $params{BUILD_REQUIRES}; } delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52; delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48; delete $params{META_MERGE} if $eumm_version < 6.46; delete $params{META_ADD} if $eumm_version < 6.46; delete $params{LICENSE} if $eumm_version < 6.31; delete $params{AUTHOR} if $] < 5.005; delete $params{ABSTRACT_FROM} if $] < 5.005; delete $params{BINARY_LOCATION} if $] < 5.005; WriteMakefile(%params); } bin/use-devel-checklib 0000755 00000005317 15125124520 0010700 0 ustar 00 #!perl -w # $Id: use-devel-checklib,v 1.9 2008/03/12 19:52:50 drhyde Exp $ use strict; $/ = undef; use File::Spec; use Devel::CheckLib; warn "----------------------- [WARNING] --------\n"; warn "THIS SCRIPT WAS DEPRECATED.\n"; warn "YOU SHOULD USE configure_requires INSTEAD.\n"; warn "---------- [/WARNING] --------------------\n"; my @files = grep { -f $_ } qw(Makefile.PL Build.PL); push @files, 'Makefile.PL' unless(@files); my @libs = @ARGV; mkdir 'inc'; mkdir 'inc/Devel'; open(CHECKLIBPM, $INC{'Devel/CheckLib.pm'}) || die("Can't read $INC{'Devel/CheckLib.pm'}: $!"); (my $checklibpm = <CHECKLIBPM>) =~ s/package Devel::CheckLib/package #\nDevel::CheckLib/; close(CHECKLIBPM); open(CHECKLIBPM, '>'.File::Spec->catfile(qw(inc Devel CheckLib.pm))) || die("Can't write inc/Devel/CheckLib.pm: $!"); print CHECKLIBPM $checklibpm; close(CHECKLIBPM); print "Copied Devel::CheckLib to inc/ directory\n"; foreach my $file (@files) { open(FILE, $file) || next; my $contents = <FILE>; close(FILE); open(FILE, ">$file") || die("Can't write $file\n"); print FILE q{use lib qw(inc); use Devel::CheckLib; # Prompt the user here for any paths and other configuration check_lib_or_exit( # fill in what you prompted the user for here lib => [qw(}.join(' ', @libs).q{)] ); }; print FILE "\n\n$contents"; close(FILE); print "Updated/created $file\n"; } open(MANIFEST, 'MANIFEST') || warn("Couldn't read MANIFEST, will create one\n"); my $manifest = <MANIFEST>; close(MANIFEST); open(MANIFEST, '>MANIFEST') || die("Couldn't write MANIFEST\n"); print MANIFEST "inc/Devel/CheckLib.pm\n$manifest"; close(MANIFEST); print "Updated/created MANIFEST\n"; =head1 NAME use-devel-checklib - (DEPRECATED)a script to package Devel::CheckLib with your code. =head1 DESCRIPTION This script was DEPRECATED. If you need to depend on this library, you should use `configure_requires` in Makefile.PL or Build.PL instead. =head1 WARNINGS, BUGS and FEEDBACK This script has not been thoroughly tested. You should check by hand that it has done what you expected after running it. If you use Module::Build::Compat to write a Makefile.PL, then you will need to re-run this script whenever you have generated a new Makefile.PL. I welcome feedback about my code, including constructive criticism. Bug reports should be made using L<http://rt.cpan.org/> or by email. =head1 SEE ALSO L<Devel::CheckLib> =head1 AUTHOR David Cantrell E<lt>F<david@cantrell.org.uk>E<gt> =head1 COPYRIGHT and LICENCE Copyright 2007 David Cantrell This software is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. =head1 CONSPIRACY This module is also free-as-in-mason software. =cut blib/man3/Devel::CheckLib.3pm 0000644 00000023272 15125124520 0011546 0 ustar 00 .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Devel::CheckLib 3" .TH Devel::CheckLib 3 "2022-05-04" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Devel::CheckLib \- check that a library is available .SH "DESCRIPTION" .IX Header "DESCRIPTION" Devel::CheckLib is a perl module that checks whether a particular C library and its headers are available. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Devel::CheckLib; \& \& check_lib_or_exit( lib => \*(Aqjpeg\*(Aq, header => \*(Aqjpeglib.h\*(Aq ); \& check_lib_or_exit( lib => [ \*(Aqiconv\*(Aq, \*(Aqjpeg\*(Aq ] ); \& \& # or prompt for path to library and then do this: \& check_lib_or_exit( lib => \*(Aqjpeg\*(Aq, libpath => $additional_path ); .Ve .SH "USING IT IN Makefile.PL or Build.PL" .IX Header "USING IT IN Makefile.PL or Build.PL" If you want to use this from Makefile.PL or Build.PL, do not simply copy the module into your distribution as this may cause problems when \s-1PAUSE\s0 and search.cpan.org index the distro. Instead, use the use-devel-checklib script. .SH "HOW IT WORKS" .IX Header "HOW IT WORKS" You pass named parameters to a function, describing to it how to build and link to the libraries. .PP It works by trying to compile some code \- which defaults to this: .PP .Vb 1 \& int main(int argc, char *argv[]) { return 0; } .Ve .PP and linking it to the specified libraries. If something pops out the end which looks executable, it gets executed, and if \fBmain()\fR returns 0 we know that it worked. That tiny program is built once for each library that you specify, and (without linking) once for each header file. .PP If you want to check for the presence of particular functions in a library, or even that those functions return particular results, then you can pass your own function body for \fBmain()\fR thus: .PP .Vb 7 \& check_lib_or_exit( \& function => \*(Aqfoo();if(libversion() > 5) return 0; else return 1;\*(Aq \& incpath => ... \& libpath => ... \& lib => ... \& header => ... \& ); .Ve .PP In that case, it will fail to build if either \fBfoo()\fR or \fBlibversion()\fR don't exist, and \fBmain()\fR will return the wrong value if \fBlibversion()\fR's return value isn't what you want. .SH "FUNCTIONS" .IX Header "FUNCTIONS" All of these take the same named parameters and are exported by default. To avoid exporting them, \f(CW\*(C`use Devel::CheckLib ()\*(C'\fR. .SS "assert_lib" .IX Subsection "assert_lib" This takes several named parameters, all of which are optional, and dies with an error message if any of the libraries listed can not be found. \fBNote\fR: dying in a Makefile.PL or Build.PL may provoke a '\s-1FAIL\s0' report from \s-1CPAN\s0 Testers' automated smoke testers. Use \&\f(CW\*(C`check_lib_or_exit\*(C'\fR instead. .PP The named parameters are: .IP "lib" 4 .IX Item "lib" Must be either a string with the name of a single library or a reference to an array of strings of library names. Depending on the compiler found, library names will be fed to the compiler either as \&\f(CW\*(C`\-l\*(C'\fR arguments or as \f(CW\*(C`.lib\*(C'\fR file names. (E.g. \f(CW\*(C`\-ljpeg\*(C'\fR or \f(CW\*(C`jpeg.lib\*(C'\fR) .IP "libpath" 4 .IX Item "libpath" a string or an array of strings representing additional paths to search for libraries. .IP "\s-1LIBS\s0" 4 .IX Item "LIBS" a \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR\-style space-separated list of libraries (each preceded by '\-l') and directories (preceded by '\-L'). .Sp This can also be supplied on the command-line. .IP "debug" 4 .IX Item "debug" If true \- emit information during processing that can be used for debugging. .PP And libraries are no use without header files, so ... .IP "header" 4 .IX Item "header" Must be either a string with the name of a single header file or a reference to an array of strings of header file names. .IP "incpath" 4 .IX Item "incpath" a string or an array of strings representing additional paths to search for headers. .IP "\s-1INC\s0" 4 .IX Item "INC" a \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR\-style space-separated list of incpaths, each preceded by '\-I'. .Sp This can also be supplied on the command-line. .IP "ccflags" 4 .IX Item "ccflags" Extra flags to pass to the compiler. .IP "ldflags" 4 .IX Item "ldflags" Extra flags to pass to the linker. .IP "analyze_binary" 4 .IX Item "analyze_binary" a callback function that will be invoked in order to perform custom analysis of the generated binary. The callback arguments are the library name and the path to the binary just compiled. .Sp It is possible to use this callback, for instance, to inspect the binary for further dependencies. .IP "not_execute" 4 .IX Item "not_execute" Do not try to execute generated binary. Only check that compilation has not failed. .SS "check_lib_or_exit" .IX Subsection "check_lib_or_exit" This behaves exactly the same as \f(CW\*(C`assert_lib()\*(C'\fR except that instead of dieing, it warns (with exactly the same error message) and exits. This is intended for use in Makefile.PL / Build.PL when you might want to prompt the user for various paths and things before checking that what they've told you is sane. .PP If any library or header is missing, it exits with an exit value of 0 to avoid causing a \s-1CPAN\s0 Testers '\s-1FAIL\s0' report. \s-1CPAN\s0 Testers should ignore this result \*(-- which is what you want if an external library dependency is not available. .SS "check_lib" .IX Subsection "check_lib" This behaves exactly the same as \f(CW\*(C`assert_lib()\*(C'\fR except that it is silent, returning false instead of dieing, or true otherwise. .SH "PLATFORMS SUPPORTED" .IX Header "PLATFORMS SUPPORTED" You must have a C compiler installed. We check for \f(CW$Config{cc}\fR, both literally as it is in Config.pm and also in the \f(CW$PATH\fR. .PP It has been tested with varying degrees of rigorousness on: .IP "gcc (on Linux, *BSD, Mac \s-1OS X,\s0 Solaris, Cygwin)" 4 .IX Item "gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin)" .PD 0 .IP "Sun's compiler tools on Solaris" 4 .IX Item "Sun's compiler tools on Solaris" .IP "\s-1IBM\s0's tools on \s-1AIX\s0" 4 .IX Item "IBM's tools on AIX" .IP "\s-1SGI\s0's tools on Irix 6.5" 4 .IX Item "SGI's tools on Irix 6.5" .IP "Microsoft's tools on Windows" 4 .IX Item "Microsoft's tools on Windows" .IP "MinGW on Windows (with Strawberry Perl)" 4 .IX Item "MinGW on Windows (with Strawberry Perl)" .IP "Borland's tools on Windows" 4 .IX Item "Borland's tools on Windows" .IP "\s-1QNX\s0" 4 .IX Item "QNX" .PD .SH "WARNINGS, BUGS and FEEDBACK" .IX Header "WARNINGS, BUGS and FEEDBACK" This is a very early release intended primarily for feedback from people who have discussed it. The interface may change and it has not been adequately tested. .PP Feedback is most welcome, including constructive criticism. Bug reports should be made using <http://rt.cpan.org/> or by email. .PP When submitting a bug report, please include the output from running: .PP .Vb 2 \& perl \-V \& perl \-MDevel::CheckLib \-e0 .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Devel::CheckOS .PP Probe::Perl .SH "AUTHORS" .IX Header "AUTHORS" David Cantrell <david@cantrell.org.uk> .PP David Golden <dagolden@cpan.org> .PP Yasuhiro Matsumoto <mattn@cpan.org> .PP Thanks to the cpan-testers-discuss mailing list for prompting us to write it in the first place; .PP to Chris Williams for help with Borland support; .PP to Tony Cook for help with Microsoft compiler command-line options .SH "COPYRIGHT and LICENCE" .IX Header "COPYRIGHT and LICENCE" Copyright 2007 David Cantrell. Portions copyright 2007 David Golden. .PP This module is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. .SH "CONSPIRACY" .IX Header "CONSPIRACY" This module is also free-as-in-mason software. blib/man3/.exists 0000644 00000000000 15125124520 0007615 0 ustar 00 blib/man1/use-devel-checklib.1 0000644 00000006560 15125124520 0012031 0 ustar 00 .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "USE-DEVEL-CHECKLIB 1" .TH USE-DEVEL-CHECKLIB 1 "2022-05-04" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" use\-devel\-checklib \- (DEPRECATED)a script to package Devel::CheckLib with your code. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This script was \s-1DEPRECATED.\s0 .PP If you need to depend on this library, you should use `configure_requires` in Makefile.PL or Build.PL instead. .SH "WARNINGS, BUGS and FEEDBACK" .IX Header "WARNINGS, BUGS and FEEDBACK" This script has not been thoroughly tested. You should check by hand that it has done what you expected after running it. .PP If you use Module::Build::Compat to write a Makefile.PL, then you will need to re-run this script whenever you have generated a new Makefile.PL. .PP I welcome feedback about my code, including constructive criticism. Bug reports should be made using <http://rt.cpan.org/> or by email. .SH "SEE ALSO" .IX Header "SEE ALSO" Devel::CheckLib .SH "AUTHOR" .IX Header "AUTHOR" David Cantrell <\fIdavid@cantrell.org.uk\fR> .SH "COPYRIGHT and LICENCE" .IX Header "COPYRIGHT and LICENCE" Copyright 2007 David Cantrell .PP This software is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. .SH "CONSPIRACY" .IX Header "CONSPIRACY" This module is also free-as-in-mason software. blib/man1/.exists 0000644 00000000000 15125124520 0007613 0 ustar 00 blib/arch/.exists 0000644 00000000000 15125124520 0007674 0 ustar 00 blib/arch/auto/Devel/CheckLib/.exists 0000644 00000000000 15125124520 0013347 0 ustar 00 blib/bin/.exists 0000644 00000000000 15125124520 0007527 0 ustar 00 blib/script/use-devel-checklib 0000755 00000005330 15125124520 0012337 0 ustar 00 #!/usr/bin/perl -w # $Id: use-devel-checklib,v 1.9 2008/03/12 19:52:50 drhyde Exp $ use strict; $/ = undef; use File::Spec; use Devel::CheckLib; warn "----------------------- [WARNING] --------\n"; warn "THIS SCRIPT WAS DEPRECATED.\n"; warn "YOU SHOULD USE configure_requires INSTEAD.\n"; warn "---------- [/WARNING] --------------------\n"; my @files = grep { -f $_ } qw(Makefile.PL Build.PL); push @files, 'Makefile.PL' unless(@files); my @libs = @ARGV; mkdir 'inc'; mkdir 'inc/Devel'; open(CHECKLIBPM, $INC{'Devel/CheckLib.pm'}) || die("Can't read $INC{'Devel/CheckLib.pm'}: $!"); (my $checklibpm = <CHECKLIBPM>) =~ s/package Devel::CheckLib/package #\nDevel::CheckLib/; close(CHECKLIBPM); open(CHECKLIBPM, '>'.File::Spec->catfile(qw(inc Devel CheckLib.pm))) || die("Can't write inc/Devel/CheckLib.pm: $!"); print CHECKLIBPM $checklibpm; close(CHECKLIBPM); print "Copied Devel::CheckLib to inc/ directory\n"; foreach my $file (@files) { open(FILE, $file) || next; my $contents = <FILE>; close(FILE); open(FILE, ">$file") || die("Can't write $file\n"); print FILE q{use lib qw(inc); use Devel::CheckLib; # Prompt the user here for any paths and other configuration check_lib_or_exit( # fill in what you prompted the user for here lib => [qw(}.join(' ', @libs).q{)] ); }; print FILE "\n\n$contents"; close(FILE); print "Updated/created $file\n"; } open(MANIFEST, 'MANIFEST') || warn("Couldn't read MANIFEST, will create one\n"); my $manifest = <MANIFEST>; close(MANIFEST); open(MANIFEST, '>MANIFEST') || die("Couldn't write MANIFEST\n"); print MANIFEST "inc/Devel/CheckLib.pm\n$manifest"; close(MANIFEST); print "Updated/created MANIFEST\n"; =head1 NAME use-devel-checklib - (DEPRECATED)a script to package Devel::CheckLib with your code. =head1 DESCRIPTION This script was DEPRECATED. If you need to depend on this library, you should use `configure_requires` in Makefile.PL or Build.PL instead. =head1 WARNINGS, BUGS and FEEDBACK This script has not been thoroughly tested. You should check by hand that it has done what you expected after running it. If you use Module::Build::Compat to write a Makefile.PL, then you will need to re-run this script whenever you have generated a new Makefile.PL. I welcome feedback about my code, including constructive criticism. Bug reports should be made using L<http://rt.cpan.org/> or by email. =head1 SEE ALSO L<Devel::CheckLib> =head1 AUTHOR David Cantrell E<lt>F<david@cantrell.org.uk>E<gt> =head1 COPYRIGHT and LICENCE Copyright 2007 David Cantrell This software is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. =head1 CONSPIRACY This module is also free-as-in-mason software. =cut blib/script/.exists 0000644 00000000000 15125124520 0010263 0 ustar 00 blib/lib/auto/Devel/CheckLib/.exists 0000644 00000000000 15125124520 0013200 0 ustar 00 blib/lib/Devel/.exists 0000644 00000000000 15125124520 0010564 0 ustar 00 blib/lib/Devel/CheckLib.pm 0000444 00000044540 15125124520 0011265 0 ustar 00 # $Id: CheckLib.pm,v 1.25 2008/10/27 12:16:23 drhyde Exp $ package Devel::CheckLib; use 5.00405; #postfix foreach use strict; use vars qw($VERSION @ISA @EXPORT); $VERSION = '1.16'; use Config qw(%Config); use Text::ParseWords qw(quotewords shellwords); use File::Spec; use File::Temp; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(assert_lib check_lib_or_exit check_lib); # localising prevents the warningness leaking out of this module local $^W = 1; # use warnings is a 5.6-ism _findcc(); # bomb out early if there's no compiler =head1 NAME Devel::CheckLib - check that a library is available =head1 DESCRIPTION Devel::CheckLib is a perl module that checks whether a particular C library and its headers are available. =head1 SYNOPSIS use Devel::CheckLib; check_lib_or_exit( lib => 'jpeg', header => 'jpeglib.h' ); check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] ); # or prompt for path to library and then do this: check_lib_or_exit( lib => 'jpeg', libpath => $additional_path ); =head1 USING IT IN Makefile.PL or Build.PL If you want to use this from Makefile.PL or Build.PL, do not simply copy the module into your distribution as this may cause problems when PAUSE and search.cpan.org index the distro. Instead, use the use-devel-checklib script. =head1 HOW IT WORKS You pass named parameters to a function, describing to it how to build and link to the libraries. It works by trying to compile some code - which defaults to this: int main(int argc, char *argv[]) { return 0; } and linking it to the specified libraries. If something pops out the end which looks executable, it gets executed, and if main() returns 0 we know that it worked. That tiny program is built once for each library that you specify, and (without linking) once for each header file. If you want to check for the presence of particular functions in a library, or even that those functions return particular results, then you can pass your own function body for main() thus: check_lib_or_exit( function => 'foo();if(libversion() > 5) return 0; else return 1;' incpath => ... libpath => ... lib => ... header => ... ); In that case, it will fail to build if either foo() or libversion() don't exist, and main() will return the wrong value if libversion()'s return value isn't what you want. =head1 FUNCTIONS All of these take the same named parameters and are exported by default. To avoid exporting them, C<use Devel::CheckLib ()>. =head2 assert_lib This takes several named parameters, all of which are optional, and dies with an error message if any of the libraries listed can not be found. B<Note>: dying in a Makefile.PL or Build.PL may provoke a 'FAIL' report from CPAN Testers' automated smoke testers. Use C<check_lib_or_exit> instead. The named parameters are: =over =item lib Must be either a string with the name of a single library or a reference to an array of strings of library names. Depending on the compiler found, library names will be fed to the compiler either as C<-l> arguments or as C<.lib> file names. (E.g. C<-ljpeg> or C<jpeg.lib>) =item libpath a string or an array of strings representing additional paths to search for libraries. =item LIBS a C<ExtUtils::MakeMaker>-style space-separated list of libraries (each preceded by '-l') and directories (preceded by '-L'). This can also be supplied on the command-line. =item debug If true - emit information during processing that can be used for debugging. =back And libraries are no use without header files, so ... =over =item header Must be either a string with the name of a single header file or a reference to an array of strings of header file names. =item incpath a string or an array of strings representing additional paths to search for headers. =item INC a C<ExtUtils::MakeMaker>-style space-separated list of incpaths, each preceded by '-I'. This can also be supplied on the command-line. =item ccflags Extra flags to pass to the compiler. =item ldflags Extra flags to pass to the linker. =item analyze_binary a callback function that will be invoked in order to perform custom analysis of the generated binary. The callback arguments are the library name and the path to the binary just compiled. It is possible to use this callback, for instance, to inspect the binary for further dependencies. =item not_execute Do not try to execute generated binary. Only check that compilation has not failed. =back =head2 check_lib_or_exit This behaves exactly the same as C<assert_lib()> except that instead of dieing, it warns (with exactly the same error message) and exits. This is intended for use in Makefile.PL / Build.PL when you might want to prompt the user for various paths and things before checking that what they've told you is sane. If any library or header is missing, it exits with an exit value of 0 to avoid causing a CPAN Testers 'FAIL' report. CPAN Testers should ignore this result -- which is what you want if an external library dependency is not available. =head2 check_lib This behaves exactly the same as C<assert_lib()> except that it is silent, returning false instead of dieing, or true otherwise. =cut sub check_lib_or_exit { eval 'assert_lib(@_)'; if($@) { warn $@; exit; } } sub check_lib { eval 'assert_lib(@_)'; return $@ ? 0 : 1; } # borrowed from Text::ParseWords sub _parse_line { my($delimiter, $keep, $line) = @_; my($word, @pieces); no warnings 'uninitialized'; # we will be testing undef strings while (length($line)) { # This pattern is optimised to be stack conservative on older perls. # Do not refactor without being careful and testing it on very long strings. # See Perl bug #42980 for an example of a stack busting input. $line =~ s/^ (?: # double quoted string (") # $quote ((?>[^\\"]*(?:\\.[^\\"]*)*))" # $quoted | # --OR-- # singe quoted string (') # $quote ((?>[^\\']*(?:\\.[^\\']*)*))' # $quoted | # --OR-- # unquoted string ( # $unquoted (?:\\.|[^\\"'])*? ) # followed by ( # $delim \Z(?!\n) # EOL | # --OR-- (?-x:$delimiter) # delimiter | # --OR-- (?!^)(?=["']) # a quote ) )//xs or return; # extended layout my ($quote, $quoted, $unquoted, $delim) = (($1 ? ($1,$2) : ($3,$4)), $5, $6); return() unless( defined($quote) || length($unquoted) || length($delim)); if ($keep) { $quoted = "$quote$quoted$quote"; } else { $unquoted =~ s/\\(.)/$1/sg; if (defined $quote) { $quoted =~ s/\\(.)/$1/sg if ($quote eq '"'); } } $word .= substr($line, 0, 0); # leave results tainted $word .= defined $quote ? $quoted : $unquoted; if (length($delim)) { push(@pieces, $word); push(@pieces, $delim) if ($keep eq 'delimiters'); undef $word; } if (!length($line)) { push(@pieces, $word); } } return(@pieces); } sub _parsewords { return shellwords @_ if $^O ne 'MSWin32'; # for Win32, take off "" but leave \ map { my $s=$_; $s =~ s/^"(.*)"$/$1/; $s } grep defined && length, quotewords '\s+', 1, @_; } sub _compile_cmd { my ($Config_cc, $cc, $cfile, $exefile, $incpaths, $ld, $Config_libs, $lib, $libpaths) = @_; my @sys_cmd = @$cc; if ( $Config_cc eq 'cl' ) { # Microsoft compiler # this is horribly sensitive to the order of arguments push @sys_cmd, $cfile, (defined $lib ? "${lib}.lib" : ()), "/Fe$exefile", (map '/I'.$_, @$incpaths), "/link", @$ld, _parsewords($Config_libs), (defined $lib ? map '/libpath:'.$_, @$libpaths : ()), ; } elsif($Config_cc =~ /bcc32(\.exe)?/) { # Borland push @sys_cmd, @$ld, (map "-I$_", @$incpaths), "-o$exefile", (defined $lib ? ((map "-L$_", @$libpaths), "-l$lib") : ()), $cfile, ; } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ... push @sys_cmd, (map "-I$_", @$incpaths), $cfile, (!defined $lib ? () : ( (map "-L$_", @$libpaths), ($^O eq 'darwin' ? (map { "-Wl,-rpath,$_" } @$libpaths) : ()), "-l$lib", )), @$ld, "-o", $exefile, ; } @sys_cmd; } sub _make_cfile { my ($use_headers, $function, $debug) = @_; my $code = ''; $code .= qq{#include <$_>\n} for @$use_headers; $code .= "int main(int argc, char *argv[]) { ".($function || 'return 0;')." }\n"; if ($debug) { (my $c = $code) =~ s:^:# :gm; warn "# Code:\n$c\n"; } my ($ch, $cfile) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' ); print $ch $code; close $ch; (my $ofile = $cfile) =~ s/\.c$/$Config{_o}/; ($cfile, $ofile); } sub assert_lib { my %args = @_; $args{$_} = [$args{$_}] for grep $args{$_} && !ref($args{$_}), qw(lib libpath header incpath); my @libs = @{$args{lib} || []}; my @libpaths = @{$args{libpath} || []}; my @headers = @{$args{header} || []}; my @incpaths = @{$args{incpath} || []}; my $analyze_binary = $args{analyze_binary}; my $execute = !$args{not_execute}; my @argv = @ARGV; push @argv, _parse_line('\s+', 0, $ENV{PERL_MM_OPT}||''); # work-a-like for Makefile.PL's LIBS and INC arguments # if given as command-line argument, append to %args for my $arg (@argv) { for my $mm_attr_key (qw(LIBS INC)) { if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) { # it is tempting to put some \s* into the expression, but the # MM command-line parser only accepts LIBS etc. followed by =, # so we should not be any more lenient with whitespace than that $args{$mm_attr_key} .= " $mm_attr_value"; } } } if(defined($args{LIBS})) { foreach my $arg (_parsewords($args{LIBS})) { die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-[lLR]/); push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2); } } if(defined($args{INC})) { foreach my $arg (_parsewords($args{INC})) { die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/); push @incpaths, substr($arg, 2); } } my ($cc, $ld) = _findcc($args{debug}, $args{ccflags}, $args{ldflags}); my @missing; my @wrongresult; my @wronganalysis; my @use_headers; # first figure out which headers we can't find ... for my $header (@headers) { push @use_headers, $header; my ($cfile, $ofile) = _make_cfile(\@use_headers, '', $args{debug}); my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, \@incpaths, $ld, $Config{libs}); warn "# @sys_cmd\n" if $args{debug}; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); push @missing, $header if $rv != 0 || ! -f $exefile; _cleanup_exe($exefile); unlink $cfile; } # now do each library in turn with headers my ($cfile, $ofile) = _make_cfile(\@use_headers, @args{qw(function debug)}); for my $lib ( @libs ) { last if $Config{cc} eq 'CC/DECC'; # VMS my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, \@incpaths, $ld, $Config{libs}, $lib, \@libpaths); warn "# @sys_cmd\n" if $args{debug}; local $ENV{LD_RUN_PATH} = join(":", grep $_, @libpaths, $ENV{LD_RUN_PATH}) unless $^O eq 'MSWin32' or $^O eq 'darwin'; local $ENV{PATH} = join(";", @libpaths).";".$ENV{PATH} if $^O eq 'MSWin32'; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); if ($rv != 0 || ! -f $exefile) { push @missing, $lib; } else { chmod 0755, $exefile; my $absexefile = File::Spec->rel2abs($exefile); $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/; warn "# Execute($execute): $absexefile\n" if $args{debug}; if ($execute) { my $retval = system($absexefile); warn "# return value: $retval\n" if $args{debug}; push @wrongresult, $lib if $retval != 0; } push @wronganalysis, $lib if $analyze_binary and !$analyze_binary->($lib, $exefile); } _cleanup_exe($exefile); } unlink $cfile; my $miss_string = join( q{, }, map qq{'$_'}, @missing ); die("Can't link/include C library $miss_string, aborting.\n") if @missing; my $wrong_string = join( q{, }, map qq{'$_'}, @wrongresult); die("wrong result: $wrong_string\n") if @wrongresult; my $analysis_string = join(q{, }, map qq{'$_'}, @wronganalysis ); die("wrong analysis: $analysis_string") if @wronganalysis; } sub _cleanup_exe { my ($exefile) = @_; my $ofile = $exefile; $ofile =~ s/$Config{_exe}$/$Config{_o}/; # List of files to remove my @rmfiles; push @rmfiles, $exefile, $ofile, "$exefile\.manifest"; if ( $Config{cc} eq 'cl' ) { # MSVC also creates foo.ilk and foo.pdb my $ilkfile = $exefile; $ilkfile =~ s/$Config{_exe}$/.ilk/; my $pdbfile = $exefile; $pdbfile =~ s/$Config{_exe}$/.pdb/; push @rmfiles, $ilkfile, $pdbfile; } foreach (grep -f, @rmfiles) { unlink $_ or warn "Could not remove $_: $!"; } return } # return ($cc, $ld) # where $cc is an array ref of compiler name, compiler flags # where $ld is an array ref of linker flags sub _findcc { my ($debug, $user_ccflags, $user_ldflags) = @_; # Need to use $keep=1 to work with MSWin32 backslashes and quotes my $Config_ccflags = $Config{ccflags}; # use copy so ASPerl will compile $Config_ccflags =~ s:-O\S*::; # stop GCC optimising away test code my @Config_ldflags = (); for my $config_val ( @Config{qw(ldflags)} ){ push @Config_ldflags, $config_val if ( $config_val =~ /\S/ ); } my @ccflags = grep { length } _parsewords($Config_ccflags||'', $user_ccflags||''); my @ldflags = grep { length && $_ !~ m/^-Wl/ } _parsewords(@Config_ldflags, $user_ldflags||''); my @paths = split(/$Config{path_sep}/, $ENV{PATH}); my @cc = _parsewords($Config{cc}); if (check_compiler ($cc[0], $debug)) { return ( [ @cc, @ccflags ], \@ldflags ); } # Find the extension for executables. my $exe = $Config{_exe}; if ($^O eq 'cygwin') { $exe = ''; } foreach my $path (@paths) { # Look for "$path/$cc[0].exe" my $compiler = File::Spec->catfile($path, $cc[0]) . $exe; if (check_compiler ($compiler, $debug)) { return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags) } next if ! $exe; # Look for "$path/$cc[0]" without the .exe, if necessary. $compiler = File::Spec->catfile($path, $cc[0]); if (check_compiler ($compiler, $debug)) { return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags) } } die("Couldn't find your C compiler.\n"); } sub check_compiler { my ($compiler, $debug) = @_; if (-f $compiler && -x $compiler) { warn "# Compiler seems to be $compiler\n" if $debug; return 1; } warn "# Compiler was not $compiler\n" if $debug; return ''; } # code substantially borrowed from IPC::Run3 sub _quiet_system { my (@cmd) = @_; # save handles local *STDOUT_SAVE; local *STDERR_SAVE; open STDOUT_SAVE, ">&STDOUT" or die "CheckLib: $! saving STDOUT"; open STDERR_SAVE, ">&STDERR" or die "CheckLib: $! saving STDERR"; # redirect to nowhere local *DEV_NULL; open DEV_NULL, ">" . File::Spec->devnull or die "CheckLib: $! opening handle to null device"; open STDOUT, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDOUT to null handle"; open STDERR, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDERR to null handle"; # run system command my $rv = system(@cmd); # restore handles open STDOUT, ">&" . fileno STDOUT_SAVE or die "CheckLib: $! restoring STDOUT handle"; open STDERR, ">&" . fileno STDERR_SAVE or die "CheckLib: $! restoring STDERR handle"; return $rv; } =head1 PLATFORMS SUPPORTED You must have a C compiler installed. We check for C<$Config{cc}>, both literally as it is in Config.pm and also in the $PATH. It has been tested with varying degrees of rigorousness on: =over =item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin) =item Sun's compiler tools on Solaris =item IBM's tools on AIX =item SGI's tools on Irix 6.5 =item Microsoft's tools on Windows =item MinGW on Windows (with Strawberry Perl) =item Borland's tools on Windows =item QNX =back =head1 WARNINGS, BUGS and FEEDBACK This is a very early release intended primarily for feedback from people who have discussed it. The interface may change and it has not been adequately tested. Feedback is most welcome, including constructive criticism. Bug reports should be made using L<http://rt.cpan.org/> or by email. When submitting a bug report, please include the output from running: perl -V perl -MDevel::CheckLib -e0 =head1 SEE ALSO L<Devel::CheckOS> L<Probe::Perl> =head1 AUTHORS David Cantrell E<lt>david@cantrell.org.ukE<gt> David Golden E<lt>dagolden@cpan.orgE<gt> Yasuhiro Matsumoto E<lt>mattn@cpan.orgE<gt> Thanks to the cpan-testers-discuss mailing list for prompting us to write it in the first place; to Chris Williams for help with Borland support; to Tony Cook for help with Microsoft compiler command-line options =head1 COPYRIGHT and LICENCE Copyright 2007 David Cantrell. Portions copyright 2007 David Golden. This module is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. =head1 CONSPIRACY This module is also free-as-in-mason software. =cut 1; MYMETA.yml 0000644 00000001411 15125124520 0006255 0 ustar 00 --- abstract: 'check that a library is available' author: - 'David Cantrell' - 'David Golden' - 'Yasuhiro Matsumoto' build_requires: Capture::Tiny: '0' ExtUtils::MakeMaker: '0' Mock::Config: '0.02' Test::More: '0.88' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Devel-CheckLib no_index: directory: - t - inc requires: Exporter: '0' File::Spec: '0' File::Temp: '0.16' perl: '5.004050' resources: repository: http://github.com/mattn/p5-Devel-CheckLib version: '1.16' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' MANIFEST 0000644 00000001005 15125124520 0005666 0 ustar 00 CHANGES lib/Devel/CheckLib.pm Makefile.PL MANIFEST README t/00-load.t t/exit_with_message.t t/found.t t/lib/Helper.pm t/not_found.t TODO bin/use-devel-checklib t/multi-word-compiler.t t/bad-single-word-compiler.t t/dash-l-libs.t t/headers.t t/inc/headerfile.h VMS-notes t/coverage.sh t/cmdline-LIBS-INC.t t/custom-function.t META.yml Module meta-data (added by MakeMaker) t/analyze-binary.t t/flags.t META.json Module JSON meta-data (added by MakeMaker) lib/Devel/CheckLib.pm 0000644 00000044540 15125124520 0010357 0 ustar 00 # $Id: CheckLib.pm,v 1.25 2008/10/27 12:16:23 drhyde Exp $ package Devel::CheckLib; use 5.00405; #postfix foreach use strict; use vars qw($VERSION @ISA @EXPORT); $VERSION = '1.16'; use Config qw(%Config); use Text::ParseWords qw(quotewords shellwords); use File::Spec; use File::Temp; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(assert_lib check_lib_or_exit check_lib); # localising prevents the warningness leaking out of this module local $^W = 1; # use warnings is a 5.6-ism _findcc(); # bomb out early if there's no compiler =head1 NAME Devel::CheckLib - check that a library is available =head1 DESCRIPTION Devel::CheckLib is a perl module that checks whether a particular C library and its headers are available. =head1 SYNOPSIS use Devel::CheckLib; check_lib_or_exit( lib => 'jpeg', header => 'jpeglib.h' ); check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] ); # or prompt for path to library and then do this: check_lib_or_exit( lib => 'jpeg', libpath => $additional_path ); =head1 USING IT IN Makefile.PL or Build.PL If you want to use this from Makefile.PL or Build.PL, do not simply copy the module into your distribution as this may cause problems when PAUSE and search.cpan.org index the distro. Instead, use the use-devel-checklib script. =head1 HOW IT WORKS You pass named parameters to a function, describing to it how to build and link to the libraries. It works by trying to compile some code - which defaults to this: int main(int argc, char *argv[]) { return 0; } and linking it to the specified libraries. If something pops out the end which looks executable, it gets executed, and if main() returns 0 we know that it worked. That tiny program is built once for each library that you specify, and (without linking) once for each header file. If you want to check for the presence of particular functions in a library, or even that those functions return particular results, then you can pass your own function body for main() thus: check_lib_or_exit( function => 'foo();if(libversion() > 5) return 0; else return 1;' incpath => ... libpath => ... lib => ... header => ... ); In that case, it will fail to build if either foo() or libversion() don't exist, and main() will return the wrong value if libversion()'s return value isn't what you want. =head1 FUNCTIONS All of these take the same named parameters and are exported by default. To avoid exporting them, C<use Devel::CheckLib ()>. =head2 assert_lib This takes several named parameters, all of which are optional, and dies with an error message if any of the libraries listed can not be found. B<Note>: dying in a Makefile.PL or Build.PL may provoke a 'FAIL' report from CPAN Testers' automated smoke testers. Use C<check_lib_or_exit> instead. The named parameters are: =over =item lib Must be either a string with the name of a single library or a reference to an array of strings of library names. Depending on the compiler found, library names will be fed to the compiler either as C<-l> arguments or as C<.lib> file names. (E.g. C<-ljpeg> or C<jpeg.lib>) =item libpath a string or an array of strings representing additional paths to search for libraries. =item LIBS a C<ExtUtils::MakeMaker>-style space-separated list of libraries (each preceded by '-l') and directories (preceded by '-L'). This can also be supplied on the command-line. =item debug If true - emit information during processing that can be used for debugging. =back And libraries are no use without header files, so ... =over =item header Must be either a string with the name of a single header file or a reference to an array of strings of header file names. =item incpath a string or an array of strings representing additional paths to search for headers. =item INC a C<ExtUtils::MakeMaker>-style space-separated list of incpaths, each preceded by '-I'. This can also be supplied on the command-line. =item ccflags Extra flags to pass to the compiler. =item ldflags Extra flags to pass to the linker. =item analyze_binary a callback function that will be invoked in order to perform custom analysis of the generated binary. The callback arguments are the library name and the path to the binary just compiled. It is possible to use this callback, for instance, to inspect the binary for further dependencies. =item not_execute Do not try to execute generated binary. Only check that compilation has not failed. =back =head2 check_lib_or_exit This behaves exactly the same as C<assert_lib()> except that instead of dieing, it warns (with exactly the same error message) and exits. This is intended for use in Makefile.PL / Build.PL when you might want to prompt the user for various paths and things before checking that what they've told you is sane. If any library or header is missing, it exits with an exit value of 0 to avoid causing a CPAN Testers 'FAIL' report. CPAN Testers should ignore this result -- which is what you want if an external library dependency is not available. =head2 check_lib This behaves exactly the same as C<assert_lib()> except that it is silent, returning false instead of dieing, or true otherwise. =cut sub check_lib_or_exit { eval 'assert_lib(@_)'; if($@) { warn $@; exit; } } sub check_lib { eval 'assert_lib(@_)'; return $@ ? 0 : 1; } # borrowed from Text::ParseWords sub _parse_line { my($delimiter, $keep, $line) = @_; my($word, @pieces); no warnings 'uninitialized'; # we will be testing undef strings while (length($line)) { # This pattern is optimised to be stack conservative on older perls. # Do not refactor without being careful and testing it on very long strings. # See Perl bug #42980 for an example of a stack busting input. $line =~ s/^ (?: # double quoted string (") # $quote ((?>[^\\"]*(?:\\.[^\\"]*)*))" # $quoted | # --OR-- # singe quoted string (') # $quote ((?>[^\\']*(?:\\.[^\\']*)*))' # $quoted | # --OR-- # unquoted string ( # $unquoted (?:\\.|[^\\"'])*? ) # followed by ( # $delim \Z(?!\n) # EOL | # --OR-- (?-x:$delimiter) # delimiter | # --OR-- (?!^)(?=["']) # a quote ) )//xs or return; # extended layout my ($quote, $quoted, $unquoted, $delim) = (($1 ? ($1,$2) : ($3,$4)), $5, $6); return() unless( defined($quote) || length($unquoted) || length($delim)); if ($keep) { $quoted = "$quote$quoted$quote"; } else { $unquoted =~ s/\\(.)/$1/sg; if (defined $quote) { $quoted =~ s/\\(.)/$1/sg if ($quote eq '"'); } } $word .= substr($line, 0, 0); # leave results tainted $word .= defined $quote ? $quoted : $unquoted; if (length($delim)) { push(@pieces, $word); push(@pieces, $delim) if ($keep eq 'delimiters'); undef $word; } if (!length($line)) { push(@pieces, $word); } } return(@pieces); } sub _parsewords { return shellwords @_ if $^O ne 'MSWin32'; # for Win32, take off "" but leave \ map { my $s=$_; $s =~ s/^"(.*)"$/$1/; $s } grep defined && length, quotewords '\s+', 1, @_; } sub _compile_cmd { my ($Config_cc, $cc, $cfile, $exefile, $incpaths, $ld, $Config_libs, $lib, $libpaths) = @_; my @sys_cmd = @$cc; if ( $Config_cc eq 'cl' ) { # Microsoft compiler # this is horribly sensitive to the order of arguments push @sys_cmd, $cfile, (defined $lib ? "${lib}.lib" : ()), "/Fe$exefile", (map '/I'.$_, @$incpaths), "/link", @$ld, _parsewords($Config_libs), (defined $lib ? map '/libpath:'.$_, @$libpaths : ()), ; } elsif($Config_cc =~ /bcc32(\.exe)?/) { # Borland push @sys_cmd, @$ld, (map "-I$_", @$incpaths), "-o$exefile", (defined $lib ? ((map "-L$_", @$libpaths), "-l$lib") : ()), $cfile, ; } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ... push @sys_cmd, (map "-I$_", @$incpaths), $cfile, (!defined $lib ? () : ( (map "-L$_", @$libpaths), ($^O eq 'darwin' ? (map { "-Wl,-rpath,$_" } @$libpaths) : ()), "-l$lib", )), @$ld, "-o", $exefile, ; } @sys_cmd; } sub _make_cfile { my ($use_headers, $function, $debug) = @_; my $code = ''; $code .= qq{#include <$_>\n} for @$use_headers; $code .= "int main(int argc, char *argv[]) { ".($function || 'return 0;')." }\n"; if ($debug) { (my $c = $code) =~ s:^:# :gm; warn "# Code:\n$c\n"; } my ($ch, $cfile) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' ); print $ch $code; close $ch; (my $ofile = $cfile) =~ s/\.c$/$Config{_o}/; ($cfile, $ofile); } sub assert_lib { my %args = @_; $args{$_} = [$args{$_}] for grep $args{$_} && !ref($args{$_}), qw(lib libpath header incpath); my @libs = @{$args{lib} || []}; my @libpaths = @{$args{libpath} || []}; my @headers = @{$args{header} || []}; my @incpaths = @{$args{incpath} || []}; my $analyze_binary = $args{analyze_binary}; my $execute = !$args{not_execute}; my @argv = @ARGV; push @argv, _parse_line('\s+', 0, $ENV{PERL_MM_OPT}||''); # work-a-like for Makefile.PL's LIBS and INC arguments # if given as command-line argument, append to %args for my $arg (@argv) { for my $mm_attr_key (qw(LIBS INC)) { if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) { # it is tempting to put some \s* into the expression, but the # MM command-line parser only accepts LIBS etc. followed by =, # so we should not be any more lenient with whitespace than that $args{$mm_attr_key} .= " $mm_attr_value"; } } } if(defined($args{LIBS})) { foreach my $arg (_parsewords($args{LIBS})) { die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-[lLR]/); push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2); } } if(defined($args{INC})) { foreach my $arg (_parsewords($args{INC})) { die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/); push @incpaths, substr($arg, 2); } } my ($cc, $ld) = _findcc($args{debug}, $args{ccflags}, $args{ldflags}); my @missing; my @wrongresult; my @wronganalysis; my @use_headers; # first figure out which headers we can't find ... for my $header (@headers) { push @use_headers, $header; my ($cfile, $ofile) = _make_cfile(\@use_headers, '', $args{debug}); my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, \@incpaths, $ld, $Config{libs}); warn "# @sys_cmd\n" if $args{debug}; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); push @missing, $header if $rv != 0 || ! -f $exefile; _cleanup_exe($exefile); unlink $cfile; } # now do each library in turn with headers my ($cfile, $ofile) = _make_cfile(\@use_headers, @args{qw(function debug)}); for my $lib ( @libs ) { last if $Config{cc} eq 'CC/DECC'; # VMS my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd = _compile_cmd($Config{cc}, $cc, $cfile, $exefile, \@incpaths, $ld, $Config{libs}, $lib, \@libpaths); warn "# @sys_cmd\n" if $args{debug}; local $ENV{LD_RUN_PATH} = join(":", grep $_, @libpaths, $ENV{LD_RUN_PATH}) unless $^O eq 'MSWin32' or $^O eq 'darwin'; local $ENV{PATH} = join(";", @libpaths).";".$ENV{PATH} if $^O eq 'MSWin32'; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); if ($rv != 0 || ! -f $exefile) { push @missing, $lib; } else { chmod 0755, $exefile; my $absexefile = File::Spec->rel2abs($exefile); $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/; warn "# Execute($execute): $absexefile\n" if $args{debug}; if ($execute) { my $retval = system($absexefile); warn "# return value: $retval\n" if $args{debug}; push @wrongresult, $lib if $retval != 0; } push @wronganalysis, $lib if $analyze_binary and !$analyze_binary->($lib, $exefile); } _cleanup_exe($exefile); } unlink $cfile; my $miss_string = join( q{, }, map qq{'$_'}, @missing ); die("Can't link/include C library $miss_string, aborting.\n") if @missing; my $wrong_string = join( q{, }, map qq{'$_'}, @wrongresult); die("wrong result: $wrong_string\n") if @wrongresult; my $analysis_string = join(q{, }, map qq{'$_'}, @wronganalysis ); die("wrong analysis: $analysis_string") if @wronganalysis; } sub _cleanup_exe { my ($exefile) = @_; my $ofile = $exefile; $ofile =~ s/$Config{_exe}$/$Config{_o}/; # List of files to remove my @rmfiles; push @rmfiles, $exefile, $ofile, "$exefile\.manifest"; if ( $Config{cc} eq 'cl' ) { # MSVC also creates foo.ilk and foo.pdb my $ilkfile = $exefile; $ilkfile =~ s/$Config{_exe}$/.ilk/; my $pdbfile = $exefile; $pdbfile =~ s/$Config{_exe}$/.pdb/; push @rmfiles, $ilkfile, $pdbfile; } foreach (grep -f, @rmfiles) { unlink $_ or warn "Could not remove $_: $!"; } return } # return ($cc, $ld) # where $cc is an array ref of compiler name, compiler flags # where $ld is an array ref of linker flags sub _findcc { my ($debug, $user_ccflags, $user_ldflags) = @_; # Need to use $keep=1 to work with MSWin32 backslashes and quotes my $Config_ccflags = $Config{ccflags}; # use copy so ASPerl will compile $Config_ccflags =~ s:-O\S*::; # stop GCC optimising away test code my @Config_ldflags = (); for my $config_val ( @Config{qw(ldflags)} ){ push @Config_ldflags, $config_val if ( $config_val =~ /\S/ ); } my @ccflags = grep { length } _parsewords($Config_ccflags||'', $user_ccflags||''); my @ldflags = grep { length && $_ !~ m/^-Wl/ } _parsewords(@Config_ldflags, $user_ldflags||''); my @paths = split(/$Config{path_sep}/, $ENV{PATH}); my @cc = _parsewords($Config{cc}); if (check_compiler ($cc[0], $debug)) { return ( [ @cc, @ccflags ], \@ldflags ); } # Find the extension for executables. my $exe = $Config{_exe}; if ($^O eq 'cygwin') { $exe = ''; } foreach my $path (@paths) { # Look for "$path/$cc[0].exe" my $compiler = File::Spec->catfile($path, $cc[0]) . $exe; if (check_compiler ($compiler, $debug)) { return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags) } next if ! $exe; # Look for "$path/$cc[0]" without the .exe, if necessary. $compiler = File::Spec->catfile($path, $cc[0]); if (check_compiler ($compiler, $debug)) { return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags) } } die("Couldn't find your C compiler.\n"); } sub check_compiler { my ($compiler, $debug) = @_; if (-f $compiler && -x $compiler) { warn "# Compiler seems to be $compiler\n" if $debug; return 1; } warn "# Compiler was not $compiler\n" if $debug; return ''; } # code substantially borrowed from IPC::Run3 sub _quiet_system { my (@cmd) = @_; # save handles local *STDOUT_SAVE; local *STDERR_SAVE; open STDOUT_SAVE, ">&STDOUT" or die "CheckLib: $! saving STDOUT"; open STDERR_SAVE, ">&STDERR" or die "CheckLib: $! saving STDERR"; # redirect to nowhere local *DEV_NULL; open DEV_NULL, ">" . File::Spec->devnull or die "CheckLib: $! opening handle to null device"; open STDOUT, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDOUT to null handle"; open STDERR, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDERR to null handle"; # run system command my $rv = system(@cmd); # restore handles open STDOUT, ">&" . fileno STDOUT_SAVE or die "CheckLib: $! restoring STDOUT handle"; open STDERR, ">&" . fileno STDERR_SAVE or die "CheckLib: $! restoring STDERR handle"; return $rv; } =head1 PLATFORMS SUPPORTED You must have a C compiler installed. We check for C<$Config{cc}>, both literally as it is in Config.pm and also in the $PATH. It has been tested with varying degrees of rigorousness on: =over =item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin) =item Sun's compiler tools on Solaris =item IBM's tools on AIX =item SGI's tools on Irix 6.5 =item Microsoft's tools on Windows =item MinGW on Windows (with Strawberry Perl) =item Borland's tools on Windows =item QNX =back =head1 WARNINGS, BUGS and FEEDBACK This is a very early release intended primarily for feedback from people who have discussed it. The interface may change and it has not been adequately tested. Feedback is most welcome, including constructive criticism. Bug reports should be made using L<http://rt.cpan.org/> or by email. When submitting a bug report, please include the output from running: perl -V perl -MDevel::CheckLib -e0 =head1 SEE ALSO L<Devel::CheckOS> L<Probe::Perl> =head1 AUTHORS David Cantrell E<lt>david@cantrell.org.ukE<gt> David Golden E<lt>dagolden@cpan.orgE<gt> Yasuhiro Matsumoto E<lt>mattn@cpan.orgE<gt> Thanks to the cpan-testers-discuss mailing list for prompting us to write it in the first place; to Chris Williams for help with Borland support; to Tony Cook for help with Microsoft compiler command-line options =head1 COPYRIGHT and LICENCE Copyright 2007 David Cantrell. Portions copyright 2007 David Golden. This module is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. =head1 CONSPIRACY This module is also free-as-in-mason software. =cut 1; MYMETA.json 0000644 00000002507 15125124520 0006434 0 ustar 00 { "abstract" : "check that a library is available", "author" : [ "David Cantrell", "David Golden", "Yasuhiro Matsumoto" ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Devel-CheckLib", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Exporter" : "0", "File::Spec" : "0", "File::Temp" : "0.16", "perl" : "5.004050" } }, "test" : { "requires" : { "Capture::Tiny" : "0", "Mock::Config" : "0.02", "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "http://github.com/mattn/p5-Devel-CheckLib" } }, "version" : "1.16", "x_serialization_backend" : "JSON::PP version 4.06" } VMS-notes 0000644 00000003576 15125124520 0006272 0 ustar 00 http://perl-qa.hexten.net/wiki/index.php/Testing_on_VMS --- 15:32 <anomenat> well $Config{cc} will contain 'CC/DECC', which is the right command to use but "if -x $cc[0]" will fail 15:33 <anomenat> then "CC/DECC foo.c" will compile foo.c to foo.obj 15:37 <DrHyde> how do i pass include paths? 15:38 <anomenat> CC/DECC/INCLUDE_DIRECTORY=foo 15:39 <anomenat> I'm still trying to work out the best way to do the linking bit though 15:40 <DrHyde> is CC/DECC/INCLUDE_DIRECTORY=foo/INCLUDE_DIRECTORY=bar valid? 15:41 <anomenat> yes 15:41 <DrHyde> hurrah! 15:41 <anomenat> I'm still trying to work out the best way to do linking though 16:17 <anomenat> well, buggered if I can find a standard place to put libraries on VMS. There probably is one but my VMS skills are too weak. 16:17 <anomenat> anyway, the command is just "LINK foo.obj, bar.obj" where foo is the previously compiled foo.c and bar is the library whose presence you are testing for 16:18 <anomenat> but it won't be very portable because "bar.obj" needs to be a proper path, unless it is a system library 16:26 <DrHyde> that's a good start, so thanks! 16:34 <anomenat> no problem. incidentally, VMS command line options can be shortened to their shortest unambiguous form, and so /include_directory can actually just be /inc 16:50 <anomenat> OK, it looks like SYS$LIBRARY is the VMS sort-of-equivalent of /usr/lib on Linux 16:52 <anomenat> thus "LINK foo.obj, sys$library:vaxcrtl/share" links foo.obj with the shared library vaxctrl 16:54 <anomenat> and "LINK foo.obj, sys$library:ucx$ipc/library" links foo.obj with the static library ucx$ipc 16:54 <anomenat> also, "link/exe=bar.exe foo.obj" links foo.obj to create an executable called bar.exe README 0000644 00000000401 15125124520 0005414 0 ustar 00 This module provides a way of checking whether a particular library and its headers are available, by attempting to compile a simple program and link against it. To install, do the usual dance: perl Makefile.PL make make test make install
| ver. 1.6 |
Github
|
.
| PHP 8.2.30 | ??????????? ?????????: 0 |
proxy
|
phpinfo
|
???????????