# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/luasql/luasql.conf # Copyright (C) 2007 - 2022 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # inherit some stuff like myCFLAGS, myLIBS . $base/package/*/*/lua-conf.in var_append makeinstopt ' ' "LUA_LIBDIR=$root$pkglibdir" pkginstalled mysql && var_append dblist ' ' 'mysql' pkginstalled postgresql && var_append dblist ' ' 'postgres' pkginstalled unixodbc && var_append dblist ' ' 'odbc' pkginstalled sqlite && var_append dblist ' ' 'sqlite3' luasql_build_db() { local db=$1 case "$db" in mysql) di="-I$root/$(pkgprefix includedir mysql)/mysql" dl="-L$root/$(pkgprefix libdir mysql)/mysql -lmysqlclient -lz" ;; postgres) di="-I$root/$(pkgprefix includedir postgresql)" dl="-L$root/$(pkgprefix libdir postgresql) -lpq" ;; odbc) di="-I$root/$(pkgprefix includedir unixodbc)" dl="-L$root/$(pkgprefix libdir unixodbc) -lodbc" ;; sqlite3) di="-I$root/$(pkgprefix includedir sqlite)" dl="-L$root/$(pkgprefix libdir sqlite) -lsqlite3" ;; esac eval $MAKE $makeopt T=$db DRIVER_LIBS="'$dl'" DRIVER_INCS="'$di'" eval $MAKE $makeinstopt T=$db } luasql_build() { for db in $dblist; do luasql_build_db $db done makeopt= makeinstopt= } hook_add premake 3 luasql_build