use 5.008; use ExtUtils::MakeMaker; %os_supported = ( 'linux' => 1, 'MSWin32' => 1, 'darwin' => 1 ); if( ! $os_supported{$^O} ) { print < '_auto_', 'with_pgsql' => '_auto_', 'with_sqlite3' => '_auto_', ); @argv = (); foreach( @ARGV ) { if( /--help/ ) { print_usage(); } if( /--with-mysql=*(.*)/ ) { $PAB_OPT{'with_mysql'} = $1 ? $1 : '_search_'; } elsif( /--with-pgsql=*(.*)/ ) { $PAB_OPT{'with_pgsql'} = $1 ? $1 : '_search_'; } elsif( /--with-sqlite3=*(.*)/ ) { $PAB_OPT{'with_sqlite3'} = $1 ? $1 : '_search_'; } elsif( /--enable-sqlite3-metadata/ ) { $PAB_OPT{'sqlite3_enable_metadata'} = 1; } elsif( /--disable-mysql/ ) { $PAB_OPT{'with_mysql'} = 0; } elsif( /--disable-pgsql/ ) { $PAB_OPT{'with_pgsql'} = 0; } elsif( /--disable-sqlite3/ ) { $PAB_OPT{'with_sqlite3'} = 0; } else { push @argv, $_; } } @ARGV = @argv; WriteMakefile( NAME => 'PAB3', VERSION_FROM => 'xs/PAB3/PAB3.pm', ABSTRACT => 'PAB - Perl Application Builder', PREREQ_PM => { 'Time::HiRes' => 0, 'Digest::MD5' => 0, 'Storable' => 0, }, XSPROTOARG => '-prototypes', OPTIMIZE => '-O3', OBJECT => '', XS => {}, C => [], H => [], DIR => [ 'xs' ], ); 1; sub print_usage { print <