# ibisa - Image-Based Identification/Search for Archaeology
# Copyright (C) 2008, 2009 Anthony Beurive'

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# 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.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#----------------------------------------------------------------------

set os $::tcl_platform(os)

switch -glob $os {

    Windows* {
        package ifneeded libibisa 1.0 [list load [file join $dir libibisa-1.dll] libibisa]
        package ifneeded liboctava 1.0 [list load [file join $dir liboctava-1.dll] liboctava]
        package ifneeded sqlite3 3.6.11 [list load [file join $dir sqlite3611.dll] sqlite3]
        package ifneeded Thread 2.6.5 [list load [file join $dir thread265.dll] Thread]
    }

    Linux* {
        package ifneeded libibisa 1.0 [list load [file join $dir libibisa.so.1.0.0] libibisa]
        package ifneeded liboctava 1.0 [list load [file join $dir liboctava.so.1.0.0] liboctava]
        #package ifneeded sqlite3 3.6.11 [list load [file join $dir libsqlite3.6.11.so] sqlite3]
        #package ifneeded Thread 2.6.5 [list load [file join $dir libthread2.6.5.so] Thread]
    }

    Darwin* {
        package ifneeded libibisa 1.0 [list load [file join $dir libibisa.1.so] libibisa]
        package ifneeded liboctava 1.0 [list load [file join $dir liboctava.1.so] liboctava]
        #package ifneeded sqlite3 3.6.11 [list load [file join $dir libsqlite3.6.11.so] sqlite3]
        #package ifneeded Thread 2.6.5 [list load [file join $dir libthread2.6.5.so] Thread]
    }

    default {
        error "unmanaged OS: $os"
    }
}

