Fossil SCM

Commit build fixes for NetBSD, OpenBSD, NixOS

danshearer 2026-10-27 10:34 UTC trunk merge
Commit b99a9977c9f65dabb4a6cfc70e91cb8935be3a6b1a2aa5a307e4f3983ba3b078
1 file changed +40 -1
+40 -1
--- auto.def
+++ auto.def
@@ -376,11 +376,34 @@
376376
} else {
377377
msg-result "no"
378378
return 0
379379
}
380380
}
381
-
381
+#
382
+# Give a runtime search path to every -L directory we added ourselves.
383
+#
384
+# The probes below look outside the compiler's default paths for various OSs.
385
+# A -L will link at build time but the runtime linker needs to find the libs too.
386
+# The pkgsrc convention is to add the matching rpath so rtld works.
387
+#
388
+proc fossil-rpath-ldflags {ldflags} {
389
+ set rv {}
390
+ foreach flag $ldflags {
391
+ if {![string match -L* $flag]} continue
392
+ set dir [string range $flag 2 end]
393
+ if {$dir eq "" || ![file isdirectory $dir]} continue
394
+ set rp "-Wl,-rpath,$dir"
395
+ if {$rp in $rv} continue
396
+ if {[cctest -link 1 -cflags $rp]} {
397
+ lappend rv $rp
398
+ }
399
+ }
400
+ if {[llength $rv]} {
401
+ define-append EXTRA_LDFLAGS {*}$rv
402
+ msg-result "Runtime search path: $rv"
403
+ }
404
+}
382405
#
383406
# Check for zlib, using the given location if specified
384407
#
385408
proc handle-zlib {} {
386409
set ::zlibpath [opt-val with-zlib]; # used by downstream tcl tests
@@ -428,18 +451,29 @@
428451
if {$lcheck eq ""} {
429452
msg-result "Linked to zlib via default library path"
430453
} else {
431454
define-append EXTRA_LDFLAGS "$lcheck"
432455
msg-result "Linked to zlib via $lcheck"
456
+ fossil-rpath-ldflags $lcheck
433457
}
458
+ # Keep the flags that worked for every later probe too, in the
459
+ # persistent form of cc-with, as the --with-zlib=tree branch above
460
+ # already does. check-for-openssl appends $::zlib_lib to its own link
461
+ # test, and without these it links a bare -lz against a path autosetup
462
+ # has not been told about, then reports OpenSSL as missing.
463
+ cc-with [list -cflags "$cfound $lcheck"]
464
+ set lfound $lcheck
434465
if {![check-function-in-lib compressBound z]} {
435466
puts "Notice: disabling zlib compression in the SQL shell"
436467
define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
437468
}
438469
break
439470
}
440471
}
472
+ if {![info exists lfound]} {
473
+ user-error "zlib not linkable; either install it or specify its location via --with-zlib"
474
+ }
441475
set ::zlib_lib -lz
442476
}
443477
}; # handle-zlib
444478
handle-zlib
445479
@@ -519,10 +553,11 @@
519553
}
520554
if {$found} {
521555
define FOSSIL_ENABLE_SSL
522556
define-append EXTRA_CFLAGS $cflags
523557
define-append EXTRA_LDFLAGS $ldflags
558
+ fossil-rpath-ldflags $ldflags
524559
if {[info exists ssllibs]} {
525560
define-append LIBS $ssllibs
526561
} else {
527562
define-append LIBS -lssl -lcrypto
528563
}
@@ -818,10 +853,14 @@
818853
819854
# Check for the FuseFS library
820855
if {[opt-bool fusefs]} {
821856
if {[opt-bool static]} {
822857
msg-result "FuseFS support disabled due to -static"
858
+ } elseif {![cc-with {-cflags {-DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64}} {
859
+ cc-check-includes fuse.h
860
+ }]} {
861
+ msg-result "FuseFS support disabled: <fuse.h> not found"
823862
} elseif {[cc-check-function-in-lib fuse_mount fuse]} {
824863
define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
825864
define FOSSIL_HAVE_FUSEFS 1
826865
msg-result "FuseFS support enabled"
827866
}
828867
--- auto.def
+++ auto.def
@@ -376,11 +376,34 @@
376 } else {
377 msg-result "no"
378 return 0
379 }
380 }
381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382 #
383 # Check for zlib, using the given location if specified
384 #
385 proc handle-zlib {} {
386 set ::zlibpath [opt-val with-zlib]; # used by downstream tcl tests
@@ -428,18 +451,29 @@
428 if {$lcheck eq ""} {
429 msg-result "Linked to zlib via default library path"
430 } else {
431 define-append EXTRA_LDFLAGS "$lcheck"
432 msg-result "Linked to zlib via $lcheck"
 
433 }
 
 
 
 
 
 
 
434 if {![check-function-in-lib compressBound z]} {
435 puts "Notice: disabling zlib compression in the SQL shell"
436 define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
437 }
438 break
439 }
440 }
 
 
 
441 set ::zlib_lib -lz
442 }
443 }; # handle-zlib
444 handle-zlib
445
@@ -519,10 +553,11 @@
519 }
520 if {$found} {
521 define FOSSIL_ENABLE_SSL
522 define-append EXTRA_CFLAGS $cflags
523 define-append EXTRA_LDFLAGS $ldflags
 
524 if {[info exists ssllibs]} {
525 define-append LIBS $ssllibs
526 } else {
527 define-append LIBS -lssl -lcrypto
528 }
@@ -818,10 +853,14 @@
818
819 # Check for the FuseFS library
820 if {[opt-bool fusefs]} {
821 if {[opt-bool static]} {
822 msg-result "FuseFS support disabled due to -static"
 
 
 
 
823 } elseif {[cc-check-function-in-lib fuse_mount fuse]} {
824 define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
825 define FOSSIL_HAVE_FUSEFS 1
826 msg-result "FuseFS support enabled"
827 }
828
--- auto.def
+++ auto.def
@@ -376,11 +376,34 @@
376 } else {
377 msg-result "no"
378 return 0
379 }
380 }
381 #
382 # Give a runtime search path to every -L directory we added ourselves.
383 #
384 # The probes below look outside the compiler's default paths for various OSs.
385 # A -L will link at build time but the runtime linker needs to find the libs too.
386 # The pkgsrc convention is to add the matching rpath so rtld works.
387 #
388 proc fossil-rpath-ldflags {ldflags} {
389 set rv {}
390 foreach flag $ldflags {
391 if {![string match -L* $flag]} continue
392 set dir [string range $flag 2 end]
393 if {$dir eq "" || ![file isdirectory $dir]} continue
394 set rp "-Wl,-rpath,$dir"
395 if {$rp in $rv} continue
396 if {[cctest -link 1 -cflags $rp]} {
397 lappend rv $rp
398 }
399 }
400 if {[llength $rv]} {
401 define-append EXTRA_LDFLAGS {*}$rv
402 msg-result "Runtime search path: $rv"
403 }
404 }
405 #
406 # Check for zlib, using the given location if specified
407 #
408 proc handle-zlib {} {
409 set ::zlibpath [opt-val with-zlib]; # used by downstream tcl tests
@@ -428,18 +451,29 @@
451 if {$lcheck eq ""} {
452 msg-result "Linked to zlib via default library path"
453 } else {
454 define-append EXTRA_LDFLAGS "$lcheck"
455 msg-result "Linked to zlib via $lcheck"
456 fossil-rpath-ldflags $lcheck
457 }
458 # Keep the flags that worked for every later probe too, in the
459 # persistent form of cc-with, as the --with-zlib=tree branch above
460 # already does. check-for-openssl appends $::zlib_lib to its own link
461 # test, and without these it links a bare -lz against a path autosetup
462 # has not been told about, then reports OpenSSL as missing.
463 cc-with [list -cflags "$cfound $lcheck"]
464 set lfound $lcheck
465 if {![check-function-in-lib compressBound z]} {
466 puts "Notice: disabling zlib compression in the SQL shell"
467 define-append SQLITE_OPTIONS_EXT {-USQLITE_HAVE_ZLIB}
468 }
469 break
470 }
471 }
472 if {![info exists lfound]} {
473 user-error "zlib not linkable; either install it or specify its location via --with-zlib"
474 }
475 set ::zlib_lib -lz
476 }
477 }; # handle-zlib
478 handle-zlib
479
@@ -519,10 +553,11 @@
553 }
554 if {$found} {
555 define FOSSIL_ENABLE_SSL
556 define-append EXTRA_CFLAGS $cflags
557 define-append EXTRA_LDFLAGS $ldflags
558 fossil-rpath-ldflags $ldflags
559 if {[info exists ssllibs]} {
560 define-append LIBS $ssllibs
561 } else {
562 define-append LIBS -lssl -lcrypto
563 }
@@ -818,10 +853,14 @@
853
854 # Check for the FuseFS library
855 if {[opt-bool fusefs]} {
856 if {[opt-bool static]} {
857 msg-result "FuseFS support disabled due to -static"
858 } elseif {![cc-with {-cflags {-DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64}} {
859 cc-check-includes fuse.h
860 }]} {
861 msg-result "FuseFS support disabled: <fuse.h> not found"
862 } elseif {[cc-check-function-in-lib fuse_mount fuse]} {
863 define-append EXTRA_CFLAGS -DFOSSIL_HAVE_FUSEFS
864 define FOSSIL_HAVE_FUSEFS 1
865 msg-result "FuseFS support enabled"
866 }
867

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button