| 1 | module mssql |
| 2 | |
| 3 | $if $pkgconfig('odbc') { |
| 4 | #pkgconfig --cflags --libs odbc |
| 5 | } $else { |
| 6 | #flag -lodbc |
| 7 | // Common fallback paths when unixODBC is installed via package managers on macOS. |
| 8 | #flag darwin -I/opt/homebrew/opt/unixodbc/include |
| 9 | #flag darwin -L/opt/homebrew/opt/unixodbc/lib |
| 10 | #flag darwin -I/usr/local/opt/unixodbc/include |
| 11 | #flag darwin -L/usr/local/opt/unixodbc/lib |
| 12 | #flag darwin -I/opt/local/include |
| 13 | #flag darwin -L/opt/local/lib |
| 14 | } |
| 15 | |
| 16 | $if tinyc { |
| 17 | // tcc does not search system include paths by default; add /usr/include so |
| 18 | // that it can find the unixODBC headers (sql.h, sqlext.h) on Linux. |
| 19 | #flag linux -I/usr/include |
| 20 | } |
| 21 | |
| 22 | #include <sql.h> |
| 23 | #include <sqlext.h> |
| 24 | |