#!/bin/bash

clear
pwd
cd ./app/

# QxEntityEditor application library dependencies
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH

# Avoid loading host OpenSSL configuration that may interfere with the application
export OPENSSL_CONF=/dev/null

################################################################
# Import database schema via ODBC (plugin 'QxEEOdbcImport')
# 
# By default :
# - load bundled unixODBC
# - load ODBC drivers config in './unixODBC/etc/odbcinst.ini'
# - load DSN config in file './unixODBC/etc/odbc.ini'
# 
# To use system-installed unixODBC :
# - comment the following lines
# - install unixODBC on the system
# - install database-specific ODBC drivers
# - configure ODBC drivers in '/etc/odbcinst.ini'
# - configure DSN in file '/etc/odbc.ini'
# 
# Note :
# - mixing bundled unixODBC with system ODBC may cause conflicts
################################################################

export LD_LIBRARY_PATH=$PWD/unixODBC/lib:$LD_LIBRARY_PATH
export ODBCINI=$PWD/unixODBC/etc/odbc.ini
export ODBCSYSINI=$PWD/unixODBC/etc

./QxEntityEditor "$@"
