Mailing List talk@openhack.ru Message #21
From: "Vladimir Timofeev" <vovkasm@gmail.com>
Subject: patch to makefiles
Date: Wed, 2 Apr 2008 08:08:52 +0400
To: talk@openhack.ru
Hi, this patch solves two small problems:
1. optionify optimization flags so by default they sets same as perl
itself. This, for example, allow freebsd's ports compile module with
default system settings. For old flags: perl Makefile.PL OPTIMIZE='-g
-O3'
2. resolve first item in TODO (it not installed libclient.a at all),
files after install (on freebsd):
> make install DESTDIR=~/tmp/ttt
Files found in blib/arch: installing files in blib/lib into
architecture dependent library tree
Installing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/auto/Cache/Memcached/Fast/Fast.so
Installing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/auto/Cache/Memcached/Fast/Fast.bs
Installing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/auto/Cache/Memcached/Fast/libclient/extralibs.ld
Installing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/Cache/Memcached/Fast.pm
Installing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/share/man/man3/Cache::Memcached::Fast.3
Writing /spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/auto/Cache/Memcached/Fast/.packlist
Appending installation info to
/spool/home/vovkasm/tmp/ttt/spool/home/vovkasm/perl5.10/lib/perl5/perllocal.pod

Patch valid for fresh version from git.

Regards ;-)
--
 Vladimir Timofeev

Patch itself (because this maillist can't restrict mails to don't
contain attachments):
====> cut <====
diff --git a/Makefile.PL b/Makefile.PL
index e34f675..87e90fc 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -14,12 +14,11 @@ WriteMakefile(
     ABSTRACT_FROM => 'lib/Cache/Memcached/Fast.pm',
     AUTHOR => 'Tomash Brechko <tomash.brechko@gmail.com>',
     MYEXTLIB => 'src/libclient$(LIB_EXT)',
- OPTIMIZE => '-g -O3',
 );

 sub MY::postamble {
 '
 $(MYEXTLIB): src/Makefile
- cd src && $(MAKE) $(PASSTHRU)
-'
+ cd src && $(MAKE) all $(PASTHRU)
+';
 }
diff --git a/src/Makefile.PL b/src/Makefile.PL
index bd55155..5821105 100644
--- a/src/Makefile.PL
+++ b/src/Makefile.PL
@@ -3,31 +3,38 @@ use strict;
 use warnings;
 use ExtUtils::MakeMaker;

-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
 WriteMakefile(
- NAME => 'Cache::Memcached::Fast::libclient',
- VERSION_FROM => '../lib/Cache/Memcached/Fast.pm',
- AUTHOR => 'Tomash Brechko <tomash.brechko@gmail.com>',
- LIBS => [''], # e.g., '-lm'
- DEFINE => '', # e.g., '-DHAVE_SOMETHING'
- INC => '-I.', # e.g., '-I. -I/usr/include/other'
- OBJECT => 'parse_keyword$(OBJ_EXT) compute_crc32$(OBJ_EXT)
- $(O_FILES)',
- OPTIMIZE => '-g -O3',
+ NAME => 'Cache::Memcached::Fast::libclient',
+ DEFINE => '',
+ INC => '',
+ OBJECT => 'parse_keyword$(OBJ_EXT) compute_crc32$(OBJ_EXT)
$(O_FILES)',
+ H => [qw(array.h client.h connect.h dispatch_key.h
compute_crc32.h parse_keyword.h)],
+ C => [qw(array.c client.c connect.c dispatch_key.c
compute_crc32.c parse_keyword.c)],
+ SKIP => [qw(dynamic dynamic_lib dlsyms)],
+ PM => {},
+ clean => {FILES => 'compute_crc32.c compute_crc32.h
parse_keyword.c parse_keyword.h'},
 );

+sub MY::constants {
+ package MY;
+ my $self = shift;
+ $self->{INST_STATIC} = 'libclient$(LIB_EXT)';
+ return $self->SUPER::constants();
+}
+
 sub MY::top_targets {
 '
 all :: static
+ $(NOECHO) $(NOOP)

-pure_all :: static
+pure_all ::
+ $(NOECHO) $(NOOP)

-static :: libclient$(LIB_EXT)
+config ::
+ $(NOECHO) $(NOOP)

-libclient$(LIB_EXT): $(OBJECT)
- $(AR) cr libclient$(LIB_EXT) $(OBJECT)
- $(RANLIB) libclient$(LIB_EXT)
+src/libclient.a:
+ $(NOECHO) $(NOOP)

 parse_keyword.c parse_keyword.h :: genparser.pl reply.kw
  $(PERL) genparser.pl reply.kw parse_keyword.c parse_keyword.h
====> cut <====
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster