sqlite: fix cross build with libedit

This commit is contained in:
Đoàn Trần Công Danh 2025-07-19 06:48:40 +07:00
parent 80f869c196
commit 25c69b90a6
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,25 @@
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -1076,6 +1076,10 @@ proc sqlite-check-line-editing {} {
# set the -I to one dir up from that because our sources
# #include <readline/readline.h> or <editline/readline.h>.
set v [file dirname $v]
+ } elseif {[string match */editline $v]} {
+ # ditto, but set to EDITLINE
+ set v [file dirname $v]
+ set editLibDef HAVE_EDITLINE
}
proj-opt-set with-readline-cflags "-I$v"
}
@@ -1111,6 +1115,11 @@ proc sqlite-check-line-editing {} {
}
} elseif {"" ne $rlInc && ![string match *-I* $rlInc]} {
proj-fatal "Argument to --with-readline-cflags is intended to be CFLAGS and contain -I..."
+ } else {
+ set v [string range $rlInc 2 end]
+ if {[file exists [file join $v "editline/readline.h"]]} {
+ set editLibDef HAVE_EDITLINE
+ }
}
# If readline.h was found/specified, look for lib(readline|edit)...

View file

@ -9,6 +9,7 @@ configure_args="--enable-threadsafe --enable-load-extension --enable-math
--enable-fts3 --enable-fts4 --enable-fts5 --enable-memsys5
--enable-rtree --enable-geopoly --host=$XBPS_CROSS_TRIPLET
--prefix=/usr --soname=legacy --editline
--with-readline-header=${CROSS_BUILD:+$XBPS_CROSS_BASE}/usr/include/editline/readline.h
--with-tcl=$XBPS_CROSS_BASE/usr/lib"
hostmakedepends="tcl"
makedepends="libedit-devel zlib-devel tcl-devel"