if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
{
- if (g_file_get_contents (DATADIR "/midori/res/speeddial.json",
+ if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json",
&speed_dial_body, NULL, NULL))
{
g_file_set_contents (body_fname, speed_dial_body, -1, NULL);
GError* error,
MidoriView* view)
{
- const gchar* template_file = DATADIR "/midori/res/error.html";
+ const gchar* template_file = MDATADIR "/midori/res/error.html";
gchar* template;
if (g_file_get_contents (template_file, &template, NULL, NULL))
data = g_strdup_printf (
"<html><head><title>%s</title></head>"
"<body><h1>%s</h1>"
- "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+ "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px;\">"
"<p />The page you were opening doesn't exist."
"<p />Try to <a href=\"%s\">load the page again</a>, "
katze_assign (view->uri, g_strdup (""));
- g_file_get_contents (DATADIR "/midori/res/speeddial-head.html",
+ g_file_get_contents (MDATADIR "/midori/res/speeddial-head.html",
&speed_dial_head, NULL, NULL);
res_server = sokoke_get_res_server ();
if (!g_file_test (body_fname, G_FILE_TEST_EXISTS))
{
- if (g_file_get_contents (DATADIR "/midori/res/speeddial.json",
+ if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json",
&speed_dial_body, NULL, NULL))
g_file_set_contents (body_fname, speed_dial_body, -1, NULL);
else
data = g_strdup_printf (
"<html><head><title>%s</title></head>"
"<body><h1>%s</h1>"
- "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+ "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px;\">"
"<p />The document %s of type '%s' cannot be displayed."
"</body></html>",
data = g_strdup_printf (
"<html><head><title>%s</title></head>"
"<body><h1>%s</h1>"
- "<img src=\"file://" DATADIR "/midori/logo-shade.png\" "
+ "<img src=\"file://" MDATADIR "/midori/logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px;\">"
"<p />There is no documentation installed at %s."
"You may want to ask your distribution or "
{
if (g_str_has_prefix (path, "/res"))
{
- gchar* filename = g_strconcat (DATADIR "/midori", path, NULL);
+ gchar* filename = g_strconcat (MDATADIR "/midori", path, NULL);
gchar* contents;
gsize length;
Utils.pprint ('RED', desc + ' N/A')
sys.exit (1)
- def dirname_default (dirname, default):
+ def dirname_default (dirname, default, defname=None):
if getattr (Options.options, dirname) == '':
dirvalue = default
else:
dirvalue = getattr (Options.options, dirname)
- conf.define (dirname, dirvalue)
+ if not defname:
+ defname = dirname
+ conf.define (defname, dirvalue)
return dirvalue
conf.check_tool ('compiler_cc')
nls = 'no '
conf.define ('ENABLE_NLS', [0,1][nls == 'yes'])
- dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'))
dirname_default ('DOCDIR', os.path.join (conf.env['DATADIR'], 'doc'))
dirname_default ('LIBDIR', os.path.join (conf.env['PREFIX'], 'lib'))
if conf.env['PREFIX'] == '/usr':
dirname_default ('SYSCONFDIR', '/etc')
else:
dirname_default ('SYSCONFDIR', os.path.join (conf.env['PREFIX'], 'etc'))
+ dirname_default ('DATADIR', os.path.join (conf.env['PREFIX'], 'share'),
+ # Use MDATADIR because DATADIR is a constant in objidl.h on Windows
+ 'MDATADIR')
+ conf.undefine ('DATADIR')
if option_enabled ('apidocs'):
conf.find_program ('gtkdoc-scan', var='GTKDOC_SCAN')