SQLite

Check-in [806ad1ac17]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make failure to find pthreads support non-fatal unless --enable-threadsafe is specifically passed in. Build regression reported in forum post 8e0fdb8c0d.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 806ad1ac173d7c0d6d94bfccd3b961fc5c9541b32773c063a8c4082380d7a90d
User & Date: stephan 2025-02-14 18:06:28.632
Original Comment: Make failure to find pthreads support non-fatal unless --enable-threadsafe is specifically passed in. Build regression reported in [8e0fdb8c0d].
Context
2025-02-14
18:17
More informative output for the pthread feature test. (check-in: 01b9ed73ca user: stephan tags: trunk)
18:07
Make failure to find pthreads support non-fatal unless --enable-threadsafe is specifically passed in. Build regression reported in forum post 8e0fdb8c0d. (check-in: f8843b8292 user: stephan tags: branch-3.49)
18:06
Make failure to find pthreads support non-fatal unless --enable-threadsafe is specifically passed in. Build regression reported in forum post 8e0fdb8c0d. (check-in: 806ad1ac17 user: stephan tags: trunk)
17:52
Simplify the --help workaround introduced in [6a21d6a2ed]. (check-in: b0928f2043 user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to autosetup/sqlite-config.tcl.
676
677
678
679
680
681
682
683
684
685
686
687
688
689


690
691
692
693
694
695
696
697
698




699
700
701
702
703
704
705


706
707
708
709
710
711
712
  } else {
    # --soname was not explicitly requested but not available, so just warn
    msg-result "This environment does not support SONAME."
  }
}

########################################################################
# If --enable-thresafe is set, this adds -DSQLITE_THREADSAFE=1 to
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags
# needed for linking pthread. If --enable-threadsafe is not set, adds
# -DSQLITE_THREADSAFE=0 to OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD
# to an empty string.
proc sqlite-handle-threadsafe {} {
  msg-checking "Support threadsafe operation? "


  proj-if-opt-truthy threadsafe {
    msg-result yes
    sqlite-add-feature-flag -DSQLITE_THREADSAFE=1
    if {![proj-check-function-in-lib pthread_create pthread]
        || ![proj-check-function-in-lib pthread_mutexattr_init pthread]} {
      user-error "Missing required pthread bits"
    }
    define LDFLAGS_PTHREAD [get-define lib_pthread_create]
    undefine lib_pthread_create




    # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
    # found because it's in -lc on some platforms.
  } {
    msg-result no
    sqlite-add-feature-flag -DSQLITE_THREADSAFE=0
    define LDFLAGS_PTHREAD ""
  }


}

########################################################################
# Handles the --with-tempstore flag.
#
# The test fixture likes to set SQLITE_TEMP_STORE on its own, so do
# not set that feature flag unless it was explicitly provided to the







|

|
|
|


>
>

<
<
|
|
|
<
|
|
>
>
>
>




<
<

>
>







676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692


693
694
695

696
697
698
699
700
701
702
703
704
705


706
707
708
709
710
711
712
713
714
715
  } else {
    # --soname was not explicitly requested but not available, so just warn
    msg-result "This environment does not support SONAME."
  }
}

########################################################################
# If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags
# needed for linking pthread (possibly an empty string). If
# --enable-threadsafe is not set, adds -DSQLITE_THREADSAFE=0 to
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to an empty string.
proc sqlite-handle-threadsafe {} {
  msg-checking "Support threadsafe operation? "
  define LDFLAGS_PTHREAD ""
  set enable 0
  proj-if-opt-truthy threadsafe {


    if {[proj-check-function-in-lib pthread_create pthread]
        && [proj-check-function-in-lib pthread_mutexattr_init pthread]} {
      set enable 1

      define LDFLAGS_PTHREAD [get-define lib_pthread_create]
      undefine lib_pthread_create
      undefine lib_pthread_mutexattr_init
    } elseif {[proj-opt-was-provided threadsafe]} {
      user-error "Missing required pthread libraries. Use --disable-threadsafe to disable this check."
    }
    # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
    # found because it's in -lc on some platforms.
  } {
    msg-result no


  }
  sqlite-add-feature-flag -DSQLITE_THREADSAFE=${enable}
  return $enable
}

########################################################################
# Handles the --with-tempstore flag.
#
# The test fixture likes to set SQLITE_TEMP_STORE on its own, so do
# not set that feature flag unless it was explicitly provided to the