use installed SQLite, okay robert@
This commit is contained in:
parent
34802d8471
commit
67f79cfa1c
@ -1,11 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.8 2006/04/14 15:30:37 robert Exp $
|
||||
# $OpenBSD: Makefile,v 1.9 2006/05/10 11:38:08 espie Exp $
|
||||
|
||||
NOT_FOR_ARCHS= ${NO_SHARED_ARCHS}
|
||||
|
||||
COMMENT= 'SQLite drivers for the Perl DBI'
|
||||
|
||||
DISTNAME= DBD-SQLite-1.12
|
||||
PKGNAME= p5-${DISTNAME}
|
||||
PKGNAME= p5-${DISTNAME}p0
|
||||
CATEGORIES= databases perl5
|
||||
|
||||
MAINTAINER= Robert Nagy <robert@openbsd.org>
|
||||
@ -20,8 +20,10 @@ MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=DBD/}
|
||||
|
||||
BUILD_DEPENDS= :p5-DBI->=1.08:databases/p5-DBI
|
||||
RUN_DEPENDS= :p5-DBI->=1.08:databases/p5-DBI
|
||||
LIB_DEPENDS= sqlite3::databases/sqlite3
|
||||
|
||||
CONFIGURE_STYLE= perl
|
||||
CONFIGURE_ARGS= SQLITE_LOCATION=${LOCALBASE}
|
||||
MAKE_FLAGS= CC='${CC}' \
|
||||
LD='${CC}'
|
||||
|
||||
|
@ -1,81 +1,12 @@
|
||||
$OpenBSD: patch-Makefile_PL,v 1.3 2006/03/23 15:50:30 robert Exp $
|
||||
--- Makefile.PL.orig Fri Aug 5 19:15:09 2005
|
||||
+++ Makefile.PL Thu Mar 23 16:39:18 2006
|
||||
@@ -36,73 +36,12 @@
|
||||
}
|
||||
};
|
||||
|
||||
-# 2005/6/19, by rjray@blackperl.com
|
||||
#
|
||||
-# Determine if we are going to use the provided SQLite code, or an already-
|
||||
-# installed copy. To this end, look for two command-line parameters:
|
||||
+# Use the provided SQLite code, instead of picking up some installed copy.
|
||||
#
|
||||
-# USE_LOCAL_SQLITE -- If non-false, force use of the installed version
|
||||
-# SQLITE_LOCATION -- If passed, look for headers and libs under this root
|
||||
-#
|
||||
-# In absense of either of those, expect SQLite 3.X.X libs and headers in the
|
||||
-# common places known to Perl or the C compiler.
|
||||
-require File::Spec;
|
||||
-my ($force_local, $sqlite_base, $sqlite_lib, $sqlite_inc);
|
||||
-if ($sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0]) {
|
||||
- $sqlite_base =~ /=(.*)/;
|
||||
- $sqlite_base = $1;
|
||||
- $sqlite_lib = File::Spec->catdir($sqlite_base, 'lib');
|
||||
- $sqlite_inc = File::Spec->catdir($sqlite_base, 'include');
|
||||
-}
|
||||
-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
|
||||
- undef $sqlite_inc;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-# Now, check for a compatible sqlite3
|
||||
-unless ($force_local) {
|
||||
- my ($dir, $file, $fh, $version);
|
||||
- print "Checking installed SQLite version...\n";
|
||||
- if ($sqlite_inc) {
|
||||
- open($fh, '< ' . File::Spec->catfile($sqlite_inc, 'sqlite3.h'))
|
||||
- or die "Error opening sqlite3.h in $sqlite_inc: $!";
|
||||
- while (defined($_ = <$fh>)) {
|
||||
- if (/\#define\s+SQLITE_VERSION_NUMBER\s+(\d+)/) {
|
||||
- $version = $1;
|
||||
- last;
|
||||
- }
|
||||
- }
|
||||
- close($fh);
|
||||
- } else {
|
||||
- # Go hunting for the file (Matt: Add more dirs here as you see fit)
|
||||
- for $dir ([ qw(usr include) ], [ qw(usr local include) ]) {
|
||||
- $file = File::Spec->catfile('', @$dir, 'sqlite3.h');
|
||||
- next unless (-f $file);
|
||||
- open($fh, "< $file") or die "Error opening $file: $!";
|
||||
- while (defined($_ = <$fh>)) {
|
||||
- if (/\#define\s+SQLITE_VERSION_NUMBER\s+(\d+)/) {
|
||||
- $version = $1;
|
||||
- last;
|
||||
- }
|
||||
- }
|
||||
- close($fh);
|
||||
- last if $version;
|
||||
- }
|
||||
- }
|
||||
- unless ($version && ($version >= 3001003)) {
|
||||
- warn "SQLite version must be at least 3.1.3. No header file at that\n";
|
||||
- warn "version or higher was found. Using the local version instead.\n";
|
||||
- $force_local = 1;
|
||||
- undef $sqlite_lib;
|
||||
- undef $sqlite_inc;
|
||||
- } else {
|
||||
- print "Looks good\n";
|
||||
- }
|
||||
-}
|
||||
+my $force_local = 1;
|
||||
+my $sqlite_lib = 0;
|
||||
+my $sqlite_inc = 0;
|
||||
|
||||
@ARGV = grep(! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV);
|
||||
|
||||
$OpenBSD: patch-Makefile_PL,v 1.4 2006/05/10 11:38:08 espie Exp $
|
||||
--- Makefile.PL.orig Wed May 10 11:35:05 2006
|
||||
+++ Makefile.PL Wed May 10 11:35:30 2006
|
||||
@@ -115,7 +115,7 @@ WriteMakefile(
|
||||
'OBJECT' => ($force_local) ? '$(O_FILES)' : 'SQLite.o dbdimp.o',
|
||||
'INC' => '-I. -I$(DBI_INSTARCH_DIR)' .
|
||||
(($sqlite_inc) ? " -I$sqlite_inc" : ''),
|
||||
- $force_local ? () : ('LIBS' => '-lsqlite3'),
|
||||
+ $force_local ? () : ('LIBS' => "-L$sqlite_lib -lsqlite3"),
|
||||
$sqlite_lib ? ('dynamic_lib' => { OTHERLDFLAGS => "-L$sqlite_lib" }) : (),
|
||||
'OPTIMIZE' => "-O2",
|
||||
'DEFINE' => "-DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}" .
|
||||
|
Loading…
Reference in New Issue
Block a user