// $Id$
// vim:ft=javascript

ARG_WITH("mssql", "mssql support", "no");

if (PHP_MSSQL != "no") {
	if (CHECK_LIB("ntwdblib.lib", "mssql", "\\MSSQL7\\DevTools\\Lib;\\MSSQL7\\DevTools\\Lib;" + PHP_MSSQL) &&
			CHECK_HEADER_ADD_INCLUDE("sqlfront.h", "CFLAGS_MSSQL", "\\MSSQL7\\DevTools\\Include;\\MSSQL7\\DevTools\\Include" + PHP_MSSQL)) {
		EXTENSION("mssql", "php_mssql.c");
		AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
		ADD_FLAG("CFLAGS_MSSQL", "/D DBNTWIN32=1 /D MSSQL70=1");
	} else {
		WARNING("mssql not enabled; libraries and headers not found");
	}
}

ARG_WITH("dblib", "mssql support with freetds", "no");

if (PHP_DBLIB != "no") {
	if (CHECK_LIB("dblib.lib", "dblib", PHP_PHP_BUILD + "\\freetds") &&
			CHECK_HEADER_ADD_INCLUDE("sybfront.h", "CFLAGS_DBLIB", PHP_PHP_BUILD + "\\freetds;" + PHP_DBLIB)) {
		EXTENSION("dblib", "php_mssql.c", null, null, null, "ext\\dblib");
		AC_DEFINE('HAVE_MSSQL', 1, 'Have MSSQL support');
		ADD_FLAG("CFLAGS_DBLIB", "/D HAVE_FREETDS=1 /D DBNTWIN32=1 /D MSSQL70=1 /D MSSQL_EXPORTS /D COMPILE_DL_MSSQL");
	} else {
		WARNING("dblib not enabled; libraries and headers not found");
	}
}
