aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindGettextLib.cmake
Commit message (Collapse)AuthorAge
* Clean up cmake DLL installation and other minor thingssfan52021-03-12
|
* cmake: Silence warnings. (#9750)orbea2020-04-28
| | | Fixes https://github.com/minetest/minetest/issues/9734
* DragonFly BSD is somewhat identical to FreeBSD (#8159)Leonid Bobrov2019-02-03
|
* Clean up and tweak build systemShadowNinja2015-03-27
| | | | | | | | | | | | | | | | * Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
* Fix cmake po detection bugest312015-03-23
| | | | Previously, cmake po detection would treat the "timestamp" file created by building for android as own language directory.
* OS X compatibility fixesMartin Doege2014-06-29
|
* Flatten share/ and user/ in the source and for the RUN_IN_PLACE buildPerttu Ahola2012-03-20
|
* Gettext fix for *BSD - require special linkage as glibc is not usedq662011-08-11
|
* Locale dir should be parallel to global data dirGiuseppe Bilotta2011-07-24
|
* Bring po update out of cmake againGiuseppe Bilotta2011-07-24
| | | | | | | | | | | | | | This solves two issues at once: * CMake would delete po files during ‘make clean’ because it thought they were autogenerated and not just managed * the only gettext tools readily available in Windows are so old they don't support options like --package-name The change also moves minetest.pot down one level, so we don't need to special case ‘en’ anymore. The downside is of course that you need some sane POSIX shell to update the po files.
* updated cmakerules to autodetect if gettext can be usedConstantin Wenger2011-07-23
| | | fixed error if gettext is disabled
* updatepo cmake ruleGiuseppe Bilotta2011-07-22
| | | | | | | | | | Get rid of the system-specific updatelocales.sh and introduce an updatepo cmake rule. po files are also updated before creating the mo files, and we now keep the .pot file (in the po/en directory). To stabilize the po file creation, file contents are sorted by source filename. Update po files in the process.
* Refactor mo creation/installationGiuseppe Bilotta2011-07-22
|
* fixed not finding dll for gettext in MSVCConstantin Wenger2011-07-21
|
* Find correct library for MSVC vs MingW in WinowsGiuseppe Bilotta2011-07-21
|
* updated some path because the dlls are mostly under bin not libConstantin Wenger2011-07-21
| | | added explanation why libintl must not belinked under some oses
* Refactor and clean up gettext managementGiuseppe Bilotta2011-07-21
opt">, 3) * 1000; // post_data: if table, post form data, otherwise raw data lua_getfield(L, 1, "post_data"); if (lua_istable(L, 2)) { lua_pushnil(L); while (lua_next(L, 2) != 0) { req.post_fields[luaL_checkstring(L, -2)] = luaL_checkstring(L, -1); lua_pop(L, 1); } } else if (lua_isstring(L, 2)) { req.post_data = lua_tostring(L, 2); } lua_pop(L, 1); lua_getfield(L, 1, "extra_headers"); if (lua_istable(L, 2)) { lua_pushnil(L); while (lua_next(L, 2) != 0) { const char *header = luaL_checkstring(L, -1); req.extra_headers.push_back(header); lua_pop(L, 1); } } lua_pop(L, 1); } void ModApiHttp::push_http_fetch_result(lua_State *L, HTTPFetchResult &res, bool completed) { lua_newtable(L); setboolfield(L, -1, "succeeded", res.succeeded); setboolfield(L, -1, "timeout", res.timeout); setboolfield(L, -1, "completed", completed); setintfield(L, -1, "code", res.response_code); setstringfield(L, -1, "data", res.data.c_str()); } // http_api.fetch_async(HTTPRequest definition) int ModApiHttp::l_http_fetch_async(lua_State *L) { NO_MAP_LOCK_REQUIRED; HTTPFetchRequest req; read_http_fetch_request(L, req); actionstream << "Mod performs HTTP request with URL " << req.url << std::endl; httpfetch_async(req); // Convert handle to hex string since lua can't handle 64-bit integers std::stringstream handle_conversion_stream; handle_conversion_stream << std::hex << req.caller; std::string caller_handle(handle_conversion_stream.str()); lua_pushstring(L, caller_handle.c_str()); return 1; } // http_api.fetch_async_get(handle) int ModApiHttp::l_http_fetch_async_get(lua_State *L) { NO_MAP_LOCK_REQUIRED; std::string handle_str = luaL_checkstring(L, 1); // Convert hex string back to 64-bit handle u64 handle; std::stringstream handle_conversion_stream; handle_conversion_stream << std::hex << handle_str; handle_conversion_stream >> handle; HTTPFetchResult res; bool completed = httpfetch_async_get(handle, res); push_http_fetch_result(L, res, completed); return 1; } int ModApiHttp::l_request_http_api(lua_State *L) { NO_MAP_LOCK_REQUIRED; // We have to make sure that this function is being called directly by // a mod, otherwise a malicious mod could override this function and // steal its return value. lua_Debug info; // Make sure there's only one item below this function on the stack... if (lua_getstack(L, 2, &info)) { return 0; } FATAL_ERROR_IF(!lua_getstack(L, 1, &info), "lua_getstack() failed"); FATAL_ERROR_IF(!lua_getinfo(L, "S", &info), "lua_getinfo() failed"); // ...and that that item is the main file scope. if (strcmp(info.what, "main") != 0) { return 0; } // Mod must be listed in secure.http_mods or secure.trusted_mods lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_CURRENT_MOD_NAME); if (!lua_isstring(L, -1)) { return 0; } const char *mod_name = lua_tostring(L, -1); std::string http_mods = g_settings->get("secure.http_mods"); http_mods.erase(std::remove(http_mods.begin(), http_mods.end(), ' '), http_mods.end()); std::vector<std::string> mod_list_http = str_split(http_mods, ','); std::string trusted_mods = g_settings->get("secure.trusted_mods"); trusted_mods.erase(std::remove(trusted_mods.begin(), trusted_mods.end(), ' '), trusted_mods.end()); std::vector<std::string> mod_list_trusted = str_split(trusted_mods, ','); mod_list_http.insert(mod_list_http.end(), mod_list_trusted.begin(), mod_list_trusted.end()); if (std::find(mod_list_http.begin(), mod_list_http.end(), mod_name) == mod_list_http.end()) { lua_pushnil(L); return 1; } lua_getglobal(L, "core"); lua_getfield(L, -1, "http_add_fetch"); lua_newtable(L); HTTP_API(fetch_async); HTTP_API(fetch_async_get); // Stack now looks like this: // <core.http_add_fetch> <table with fetch_async, fetch_async_get> // Now call core.http_add_fetch to append .fetch(request, callback) to table lua_call(L, 1, 1); return 1; } #endif void ModApiHttp::Initialize(lua_State *L, int top) { #if USE_CURL API_FCT(request_http_api); #endif }