1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

Cleaning up the layout

This commit is contained in:
Adam Kennedy 2009-01-24 12:49:35 +00:00
parent d3c816b701
commit 19672c1627

View file

@ -2,12 +2,11 @@ use ExtUtils::MakeMaker;
eval {
require DBI;
require DBI::DBD;
die "Your DBI Version is too old - DBD::SQLite requires at least 1.21"
unless $DBI::VERSION >= 1.21;
};
if ($@) {
warn $@;
unless ( $DBI::VERSION >= 1.21 ) {
die "Your DBI Version is too old - DBD::SQLite requires at least 1.21";
}
};
warn $@ if $@;
use Config;
use strict;
eval {
@ -34,7 +33,7 @@ corruption.
EOT
if ( prompt("Continue?", "N") !~ /^y/i ) {
print "Exiting\n";
exit -1;
exit(-1);
}
}
};
@ -61,12 +60,13 @@ if ($force_local = (grep(/USE_LOCAL_SQLITE=.*/, @ARGV))[0]) {
$force_local =~ /=(.*)/;
$force_local = "$1" ? 1 : 0;
if ( $force_local ) {
undef $sqlite_lib; # Keep these from making into CFLAGS/LDFLAGS
# Keep these from making into CFLAGS/LDFLAGS
undef $sqlite_lib;
undef $sqlite_inc;
}
}
# Now, check for a compatible sqlite3
# Now check for a compatible sqlite3
unless ($force_local) {
my ($dir, $file, $fh, $version);
print "Checking installed SQLite version...\n";
@ -112,33 +112,32 @@ unless ($force_local) {
my $nlid = $DBI::VERSION > 1.42 ? '' : '-Dno_last_insert_id';
my $libs = '';
$libs .= "-L$sqlite_lib " if ($sqlite_lib);
$libs .= "-lsqlite3 " unless ($force_local);
$libs .= "-L$sqlite_lib " if $sqlite_lib;
$libs .= "-lsqlite3 " unless $force_local;
WriteMakefile(
'NAME' => 'DBD::SQLite',
'VERSION_FROM' => 'lib/DBD/SQLite.pm', # finds $VERSION
'PREREQ_PM' => {DBI => 1.21}, # e.g., Module::Name => 1.1
'OBJECT' => ($force_local) ? '$(O_FILES)' : 'SQLite.o dbdimp.o',
'INC' => '-I. -I$(DBI_INSTARCH_DIR)' .
(($sqlite_inc) ? " -I$sqlite_inc" : ''),
'VERSION_FROM' => 'lib/DBD/SQLite.pm',
'PREREQ_PM' => { DBI => 1.21 },
'OBJECT' => ( $force_local ? '$(O_FILES)' : 'SQLite.o dbdimp.o' ),
$libs ? ('LIBS' => $libs) : (),
'OPTIMIZE' => "-O2",
'DEFINE' => "-DSQLITE_CORE -DSQLITE_ENABLE_FTS2 -DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}" .
( ($Config{d_usleep} ||
$Config{osname} =~ m/linux/) ?
" -DHAVE_USLEEP=1" : "" ) .
($DBI::VERSION > 1.42 ? '' : ' -Dno_last_insert_id') .
($Config{usethreads} ? '' : ' -DTHREADSAFE=0'),
'clean' => { FILES => 'SQLite.xsi config.h tv.log output' },
'PL_FILES' => {},
'EXE_FILES' => [],
'INC' => '-I. -I$(DBI_INSTARCH_DIR)' . ($sqlite_inc ? " -I$sqlite_inc" : ''),
'DEFINE' => "-DSQLITE_CORE -DSQLITE_ENABLE_FTS2 -DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}" .
(($Config{d_usleep} || $Config{osname} =~ m/linux/) ? " -DHAVE_USLEEP=1" : "" ) .
($DBI::VERSION > 1.42 ? '' : ' -Dno_last_insert_id') .
($Config{usethreads} ? '' : ' -DTHREADSAFE=0'),
);
package MY;
sub postamble {
eval { DBI::DBD::dbd_postamble(@_) };
}
sub libscan {
my ($self, $path) = @_;
return if $path =~ /\.pl$/;