Return-Path: Delivered-To: apmail-modperl-cvs-archive@apache.org Received: (qmail 91087 invoked by uid 500); 11 Apr 2001 22:53:16 -0000 Mailing-List: contact modperl-cvs-help@apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@apache.org Received: (qmail 91075 invoked by uid 500); 11 Apr 2001 22:53:15 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org Date: 11 Apr 2001 22:53:14 -0000 Message-ID: <20010411225314.91070.qmail@apache.org> From: dougm@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0/xs/ModPerl/Const Const.pm Const.xs Makefile.PL dougm 01/04/11 15:53:14 Added: xs/ModPerl Makefile.PL xs/ModPerl/Const Const.pm Const.xs Makefile.PL Log: base module for compiling/exporting constants Revision Changes Path 1.1 modperl-2.0/xs/ModPerl/Makefile.PL Index: Makefile.PL =================================================================== use ExtUtils::MakeMaker; WriteMakefile(NAME => "ModPerl", VERSION => '0.01'); 1.1 modperl-2.0/xs/ModPerl/Const/Const.pm Index: Const.pm =================================================================== package ModPerl::Const; use DynaLoader (); our $VERSION = '0.01'; our @ISA = qw(DynaLoader); #dlopen("Const.so", RTDL_GLOBAL); sub dl_load_flags { 0x01 } __PACKAGE__->bootstrap($VERSION); sub import { my $class = shift; my $arg; if ($_[0] and $_[0] =~ /^-compile/) { $arg = shift; #just compile the constants subs, export nothing } $arg ||= scalar caller; #compile and export into caller's namespace $class->compile($arg, @_ ? @_ : ':common'); } 1; 1.1 modperl-2.0/xs/ModPerl/Const/Const.xs Index: Const.xs =================================================================== #include "mod_perl.h" MODULE = ModPerl::Const PACKAGE = ModPerl::Const BOOT: file = file; /* -Wall */ 1.1 modperl-2.0/xs/ModPerl/Const/Makefile.PL Index: Makefile.PL =================================================================== use lib qw(../lib); use ModPerl::MM (); use File::Basename; my $srcdir = '../../../src/modules/perl'; #link these two into Const.so so constants can be used outside of httpd my @names = map { "modperl_$_" } qw(const constants); my @obj; for (@names) { my $srcfile = join '.', "$srcdir/$_", 'c'; my $lnfile = join '.', $_, 'c'; push @obj, join '.', $_, 'o'; unlink $lnfile; symlink $srcfile, $lnfile; } ModPerl::MM::WriteMakefile( NAME => 'ModPerl::Const', VERSION_FROM => 'Const.pm', OBJECT => "Const.o @obj", );