From owner-svn-ports-all@freebsd.org Wed Aug 7 13:05:23 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0647AAC2D; Wed, 7 Aug 2019 13:05:23 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463WvR4wjyz3DDF; Wed, 7 Aug 2019 13:05:23 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7073ED0AE; Wed, 7 Aug 2019 13:05:23 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77D5N5W052071; Wed, 7 Aug 2019 13:05:23 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77D5Npl052070; Wed, 7 Aug 2019 13:05:23 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201908071305.x77D5Npl052070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Wed, 7 Aug 2019 13:05:23 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r508315 - head/devel/fossil/files X-SVN-Group: ports-head X-SVN-Commit-Author: gahr X-SVN-Commit-Paths: head/devel/fossil/files X-SVN-Commit-Revision: 508315 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 13:05:23 -0000 Author: gahr Date: Wed Aug 7 13:05:22 2019 New Revision: 508315 URL: https://svnweb.freebsd.org/changeset/ports/508315 Log: devel/fossil: adopt sqlite3 config tests from upstream See discussion here: https://fossil-scm.org/forum/forumpost/68b692badf Added: head/devel/fossil/files/patch-sqlite-config-test (contents, props changed) Deleted: head/devel/fossil/files/patch-auto.def Added: head/devel/fossil/files/patch-sqlite-config-test ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/fossil/files/patch-sqlite-config-test Wed Aug 7 13:05:22 2019 (r508315) @@ -0,0 +1,154 @@ +Index: auto.def +================================================================== +--- auto.def ++++ auto.def +@@ -116,11 +116,11 @@ + } + return $found + } + + if {![opt-bool internal-sqlite]} { +- proc find_internal_sqlite {} { ++ proc find_system_sqlite {} { + + # On some systems (slackware), libsqlite3 requires -ldl to link. So + # search for the system SQLite once with -ldl, and once without. If + # the library can only be found with $extralibs set to -ldl, then + # the code below will append -ldl to LIBS. +@@ -131,14 +131,10 @@ + # if sqlite3_stmt_isexplain can be found as well. If we can find open() but + # not stmt_isexplain(), then the system SQLite is too old to link against + # fossil. + # + if {[check-function-in-lib sqlite3_open sqlite3 $extralibs]} { +- if {![check-function-in-lib sqlite3_stmt_isexplain sqlite3 $extralibs]} { +- user-error "system sqlite3 too old (require >= 3.28.0)" +- } +- + # Success. Update symbols and return. + # + define USE_SYSTEM_SQLITE 1 + define-append LIBS -lsqlite3 + define-append LIBS $extralibs +@@ -146,11 +142,44 @@ + } + } + user-error "system sqlite3 not found" + } + +- find_internal_sqlite ++ find_system_sqlite ++ ++ proc test_system_sqlite {} { ++ # Check compatibility of the system SQLite library by running the sqlcompttest.c ++ # program in the source tree ++ # ++ set cmdline {} ++ lappend cmdline {*}[get-define CCACHE] ++ lappend cmdline {*}[get-define CC] {*}[get-define CFLAGS] ++ lappend cmdline $::autosetup(dir)/../src/sqlcompattest.c -o conftest__ ++ lappend cmdline {*}[get-define LDFLAGS] ++ lappend cmdline {*}[get-define LIBS] ++ set ok 1 ++ set err [catch {exec-with-stderr {*}$cmdline} result errinfo] ++ if {$err} { ++ configlog "Failed: [join $cmdline]" ++ if {[string length $result]>0} {configlog $result} ++ configlog "============" ++ set ok 0 ++ } elseif {$::autosetup(debug)} { ++ configlog "Compiled OK: [join $cmdline]" ++ configlog "============" ++ } ++ if {!$ok} { ++ user-error "unable to compile SQLite compatibility test program" ++ } ++ set err [catch {exec-with-stderr ./conftest__} result errinfo] ++ if {$err} { ++ user-error $result ++ } ++ file delete ./conftest__ ++ } ++ test_system_sqlite ++ + } + + proc is_mingw {} { + return [string match *mingw* [get-define host]] + } + +ADDED src/sqlcompattest.c +Index: src/sqlcompattest.c +================================================================== +--- src/sqlcompattest.c ++++ src/sqlcompattest.c +@@ -0,0 +1,69 @@ ++/* ++** Copyright (c) 2019 D. Richard Hipp ++** ++** This program is free software; you can redistribute it and/or ++** modify it under the terms of the Simplified BSD License (also ++** known as the "2-Clause License" or "FreeBSD License".) ++** ++** This program is distributed in the hope that it will be useful, ++** but without any warranty; without even the implied warranty of ++** merchantability or fitness for a particular purpose. ++** ++** Author contact information: ++** drh@hwaci.com ++** http://www.hwaci.com/drh/ ++** ++******************************************************************************* ++** ++** This file is NOT part of the Fossil executable ++** ++** This file contains a test program used by ../configure with the ++** the --disable-internal-sqlite option to determine whether or ++** not the system SQLite library is sufficient to support Fossil. ++** ++** It is preferred to statically link Fossil with the sqlite3.c source ++** file that is part of the source tree and not use any SQLite shared ++** library that is included with the system. But some packagers do not ++** like to do this. Hence, we provide the option to link Fossil against ++** the system SQLite shared library. But Fossil is very particular about ++** the version and build options for SQLite. Unless a recent version of ++** SQLite is available, and unless that SQLite is built using some ++** non-default features, the system library won't meet the needs of ++** Fossil. This program attempts to determine if the system library ++** SQLite is sufficient for Fossil. ++** ++** Compile this program, linking it against the system SQLite library, ++** and run it. If it returns with a zero exit code, then all is well. ++** But if it returns a non-zero exit code, then the system SQLite library ++** lacks some capability that Fossil uses. A message on stdout describes ++** the missing feature. ++*/ ++#include "sqlite3.h" ++#include ++ ++int main(int argc, char **argv){ ++ int i; ++ static const char *zRequiredOpts[] = { ++ "ENABLE_FTS4", /* Required for repository search */ ++ "ENABLE_JSON1", /* Required for the check-in locking protocol */ ++ "ENABLE_DBSTAT_VTAB", /* Required by /repo-tabsize page */ ++ }; ++ ++ /* Check minimum SQLite version number */ ++ if( sqlite3_libversion_number()<3028000 ){ ++ printf("found SQLite version %s but need 3.28.0 or later\n", ++ sqlite3_libversion()); ++ return 1; ++ } ++ ++ for(i=0; i