about summary refs log tree commit homepage
path: root/Makefile.PL
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-08 05:03:26 +0000
committerEric Wong <e@80x24.org>2023-01-08 05:05:01 +0000
commitb5ab9be6686aa778a4cfd7622c598736b9c42321 (patch)
treea967297606a1f91f8359e287d5a85ad018e185e3 /Makefile.PL
parent4356beb8237a92b3902b17f55cfe93d347b593d5 (diff)
parent2c25edb01139365f4754985c1e3494765dd1e5a7 (diff)
downloadmwrap-b5ab9be6686aa778a4cfd7622c598736b9c42321.tar.gz
This contains many changes from https://80x24.org/mwrap-perl.git
commit

* Built-in RCU-friendly version of dlmalloc, no more fragile dlsym(3m)
  resolution of malloc-family functions in the constructor

* Allocations are now backed by O_TMPFILE on $TMPDIR on modern Linux.
  Since mwrap increases memory usage greatly and I needed to use it
  on a system where I needed more VM space but lacked the ability
  to add swap.

* Configurable C backtrace level via MWRAP=bt:$DEPTH where $DEPTH
  is a non-negative integer.  Be careful about increasing it, even
  a depth of 3-4 can be orders-of-magnitude more expensive in
  time and space.  This can be changed dynamically at runtime via
  local HTTP (see below).

* Embedded per-process local-socket-only HTTP server obsoletes
  MwrapRack when combined with mwrap-rproxy from the Perl dist
  (set `MWRAP=socket_dir:/dir/of/sockets')
  See https://80x24.org/mwrap-perl/20221210015518.272576-4-e@80x24.org/
  for more info.

  It now supports downloading CSV (suitable for importing into sqlite 3.32.0+)

* License switched to GPL-3+ to be compatible with GNU binutils
  since we may take code from addr2line in the future.

* libxxhash supported if XXH3_64bits is available.
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL139
1 files changed, 0 insertions, 139 deletions
diff --git a/Makefile.PL b/Makefile.PL
deleted file mode 100644
index dadf80b..0000000
--- a/Makefile.PL
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright (C) all contributors <mwrap-perl@80x24.org>
-# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
-use v5.12;
-use ExtUtils::MakeMaker;
-use Config;
-my $pkg_config = $ENV{PKG_CONFIG} // 'pkg-config';
-my $LIBS = `$pkg_config --libs liburcu-cds liburcu-bp`;
-if ($?) {
-        print STDERR <<END;
-`$pkg_config --libs liburcu-cds` failed (\$?=$?)
-
-You need to install pkg-config and liburcu <https://liburcu.org/>
-before you can build Devel::Mwrap.
-
-On Debian:
-
-        apt-get install pkg-config liburcu-dev
-END
-        # tell CPAN testing to indicate missing deps
-        exit 0;
-}
-
-chomp($LIBS);
-if ($Config{usemymalloc} eq 'y') {
-        print STDERR <<END;
-Devel::Mwrap requires `usemymalloc=n'.  malloc and related functions
-must be dynamically-linked for Devel::Mwrap to work.
-END
-        exit 0;
-}
-
-# may be empty
-chomp(my $INC = `$pkg_config --cflags liburcu-cds liburcu-bp`);
-my @writemakefile_args = ();
-my $ccflags = '';
-
-print '# checking libxxhash... ';
-chomp(my $xxhash_inc = `$pkg_config --cflags libxxhash`);
-if ($? == 0) {
-        $INC .= " $xxhash_inc";
-        $ccflags .= ' -DHAVE_XXHASH';
-        say 'yes';
-} else {
-        say 'no';
-}
-
-use IO::Handle;
-STDOUT->autoflush(1);
-require ExtUtils::CBuilder;
-require File::Temp;
-my $cb = ExtUtils::CBuilder->new(quiet => $ENV{V} ? 0 : 1);
-my $d = File::Temp->newdir('mwrap-perl-build-XXXX');
-my $olderr;
-print '# checking for -lexecinfo... ';
-{
-        use autodie;
-        open my $fh, '>', "$d/execinfo.c";
-        print $fh <<EOM;
-#include <execinfo.h>
-int main(void) { return backtrace_symbols_fmt ? 1 : 0; }
-EOM
-        close $fh;
-        open $olderr, '+>&', *STDERR{IO};
-        open STDERR, '>', "$d/err.log";
-}
-eval {
-        my $obj = $cb->compile(source => "$d/execinfo.c");
-        $cb->link(objects => $obj, extra_linker_flags => '-lexecinfo');
-        $LIBS .= ' -lexecinfo';
-        say " yes on $^O";
-};
-say " no on $^O" if $@;
-{
-        use autodie;
-        open STDERR, '+>&', $olderr or die "dup stderr: $!";
-}
-
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-push @writemakefile_args, (
-        NAME => 'Devel::Mwrap',
-        VERSION_FROM => 'lib/Devel/Mwrap.pm',
-        CCFLAGS => "$Config{ccflags} $ccflags",
-        PREREQ_PM => {},
-        ABSTRACT_FROM => 'lib/Devel/Mwrap.pm',
-        EXE_FILES => [qw(script/mwrap-perl script/mwrap-rproxy)],
-        AUTHOR => 'mwrap hackers <mwrap-perl@80x24.org>',
-        LIBS => $LIBS, # e.g. -lurcu-cds
-        LICENSE => 'gpl_2', # GPL-3.0+, CPAN::Meta::Spec limitation
-        MIN_PERL_VERSION => '5.12.0',
-        BUILD_REQUIRES => {},
-        INC => $INC,
-        depend => {
-                Makefile => 'lib/Devel/Mwrap.pm',
-        },
-        META_MERGE => {
-                resources => {
-                        repository => 'https://80x24.org/mwrap-perl.git',
-                        homepage => 'https://80x24.org/mwrap-perl.git/about',
-                        bugtracker => 'https://80x24.org/mwrap-public/',
-                },
-        },
-);
-
-WriteMakefile(@writemakefile_args);
-
-my $tflags = $ccflags;
-$tflags .= ' -DHAS_SOCKADDR_SA_LEN ' if $Config{d_sockaddr_sa_len};
-sub MY::postamble {
-        <<EOF;
-N = \$\$(( \$\$(nproc 2>/dev/null || gnproc 2>/dev/null || echo 2) + 1 ))
--include config.mak
-
-check-manifest :: MANIFEST
-        if git ls-files >\$?.gen 2>&1; then diff -u \$? \$?.gen; fi
-
-build.env :: Makefile
-        echo >\$\@+ extra_linker_flags=$LIBS -lpthread
-        echo >>\$\@+ extra_compiler_flags=-I. $INC $Config{ccflags} $tflags
-        mv \$\@+ \$\@
-
-pure_all :: build.env
-
-check:: all check-manifest
-        prove -bvw -j\$(N)
-
-# Install symlinks to ~/bin (which is hopefuly in PATH) which point to
-# this source tree.
-# prefix + bindir matches git.git Makefile:
-prefix = \$(HOME)
-bindir = \$(prefix)/bin
-symlink-install : all
-        mkdir -p \$(bindir)
-        exe=\$\$(realpath exe.sh) && cd \$(bindir) && \\
-        for x in \$(EXE_FILES); do \\
-                ln -sf "\$\$exe" \$\$(basename "\$\$x"); \\
-        done
-EOF
-}