--- cvsroot/EV/Makefile.PL 2007/10/30 14:02:35 1.6 +++ cvsroot/EV/Makefile.PL 2007/10/31 10:50:05 1.8 @@ -1,7 +1,15 @@ use 5.006; +use Config; use ExtUtils::MakeMaker; +#$ENV{CC} = $Config{cc}; +#$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags); +#system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode" +# and die "configure failed."; + +#$LIBS = qx; + WriteMakefile( dist => { PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', @@ -9,7 +17,9 @@ SUFFIX => '.gz', }, MYEXTLIB => 'libevent/.libs/libevent$(LIB_EXT)', + INC => "-Ilibev", NAME => "EV", + LIBS => ["-lrt -lpthread"], VERSION_FROM => "EV.pm", PM => { 'EV.pm' => '$(INST_LIBDIR)/EV.pm', @@ -17,26 +27,8 @@ 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', - 'libevent/event.h' => '$(INST_LIBDIR)/EV/event.h', - 'libevent/evdns.h' => '$(INST_LIBDIR)/EV/evdns.h', - 'libevent/evhttp.h' => '$(INST_LIBDIR)/EV/evhttp.h', + 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', }, ); -sub MY::postamble { - my $postamble =<<'END'; - -libevent/Makefile: libevent/configure - cd libevent && CC="$(CC)" CFLAGS="$(OPTIMIZE) $(CFLAGS) $(CCCDLFLAGS)" ./configure --disable-shared --enable-static --disable-maintainer-mode - -clean:: - -cd libevent && make distclean - -force: - -$(MYEXTLIB): libevent/Makefile force - cd libevent && $(MAKE) all - -END -}