diff options
author | Tor Lillqvist <tml@novell.com> | 2005-11-25 22:32:54 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-11-25 22:32:54 +0800 |
commit | 6dc1dc5620c653d17d467d129c64dad94f8f82ac (patch) | |
tree | 72e675a0ab0593c536e933e54ac90995b83150d0 /e-util | |
parent | c3b27aca696a51e4b6d455f6a0ec39e61bb434bc (diff) | |
download | gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar.gz gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar.bz2 gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar.lz gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar.xz gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.tar.zst gsoc2013-evolution-6dc1dc5620c653d17d467d129c64dad94f8f82ac.zip |
Sort the stuff in the Win32 part for clarity. Add some new run-time
2005-11-25 Tor Lillqvist <tml@novell.com>
* e-util-private.h: Sort the stuff in the Win32 part for
clarity. Add some new run-time overrides for compile-time
paths. Include fcntl.h and define O_BINARY as zero if not defined
(on Unix).
* e-win32-reloc.c: Sort here, too, and add the implementation for
the new run-time overrides.
* Makefile.am: Ditto here. Link with INTLLIBS.
svn path=/trunk/; revision=30670
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 12 | ||||
-rw-r--r-- | e-util/Makefile.am | 27 | ||||
-rw-r--r-- | e-util/e-util-private.h | 92 | ||||
-rw-r--r-- | e-util/e-win32-reloc.c | 72 |
4 files changed, 132 insertions, 71 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 8e0a97a24b..90a055a519 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,15 @@ +2005-11-25 Tor Lillqvist <tml@novell.com> + + * e-util-private.h: Sort the stuff in the Win32 part for + clarity. Add some new run-time overrides for compile-time + paths. Include fcntl.h and define O_BINARY as zero if not defined + (on Unix). + + * e-win32-reloc.c: Sort here, too, and add the implementation for + the new run-time overrides. + + * Makefile.am: Ditto here. Link with INTLLIBS. + 2005-11-09 P. S. Chakravarthi <pchakravarthi@novell.com> Fixes #314638 diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 1527521627..caf4df42e4 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -1,5 +1,6 @@ eutilincludedir = $(privincludedir)/e-util econdincludedir = $(privincludedir)/e-conduit +ecpsdir = $(privdatadir)/ecps if OS_WIN32 WIN32_BOOTSTRAP_LIBS = $(top_builddir)/win32/libemiscwidgets.la @@ -10,23 +11,26 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/widgets \ - -DEVOLUTION_PREFIX=\""$(prefix)"\" \ - -DEVOLUTION_SYSCONFDIR=\""$(sysconfdir)"\" \ + -DEVOLUTION_CATEGORY_ICONS=\""$(imagesdir)/categories"\" \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DEVOLUTION_LIBDIR=\""$(datadir)"\" \ + -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \ + -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ + -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DEVOLUTION_HELPDIR=\""$(evolutionhelpdir)"\" \ - -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DEVOLUTION_ICONSDIR=\""$(imagesdir)"\" \ - -DEVOLUTION_CATEGORY_ICONS=\""$(imagesdir)/categories"\" \ + -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ + -DEVOLUTION_LIBDIR=\""$(datadir)"\" \ + -DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\" \ + -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_PLUGINDIR=\""$(plugindir)"\" \ + -DEVOLUTION_PREFIX=\""$(prefix)"\" \ -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DSEARCH_RULE_DIR=\"$(ruledir)\" \ - -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ - -DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\" \ -DEVOLUTION_SOUNDDIR=\""$(soundsdir)"\" \ + -DEVOLUTION_SYSCONFDIR=\""$(sysconfdir)"\" \ + -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ + -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \ + -DSEARCH_RULE_DIR=\"$(ruledir)\" \ -DG_LOG_DOMAIN=\"e-utils\" \ $(GNOME_PILOT_CFLAGS) \ $(EXTRA_GNOME_CFLAGS) \ @@ -143,7 +147,8 @@ libeutil_la_LDFLAGS = $(NO_UNDEFINED) libeutil_la_LIBADD = \ $(WIN32_BOOTSTRAP_LIBS) \ $(ICONV_LIBS) \ - $(E_UTIL_LIBS) + $(E_UTIL_LIBS) \ + $(INTLLIBS) econdinclude_HEADERS = \ e-pilot-map.h \ diff --git a/e-util/e-util-private.h b/e-util/e-util-private.h index 5f68341d4a..f40b09f674 100644 --- a/e-util/e-util-private.h +++ b/e-util/e-util-private.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * e-util-private.h + * e-util-private.h: Private functions for Evolution (not just for libeutil) * Copyright 2005, Novell, Inc. * * Authors: @@ -24,45 +24,67 @@ #ifndef _E_UTIL_PRIVATE_H_ #define _E_UTIL_PRIVATE_H_ +#include <fcntl.h> #include <glib.h> +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #ifdef G_OS_WIN32 -const char *_e_get_localedir (void) G_GNUC_CONST; -const char *_e_get_prefix (void) G_GNUC_CONST; -const char *_e_get_sysconfdir (void) G_GNUC_CONST; +int fsync (int fd); + +const char *_e_get_category_icons (void) G_GNUC_CONST; const char *_e_get_datadir (void) G_GNUC_CONST; -const char *_e_get_libdir (void) G_GNUC_CONST; +const char *_e_get_ecpsdir (void) G_GNUC_CONST; +const char *_e_get_etspecdir (void) G_GNUC_CONST; +const char *_e_get_galviewsdir (void) G_GNUC_CONST; const char *_e_get_gladedir (void) G_GNUC_CONST; const char *_e_get_helpdir (void) G_GNUC_CONST; -const char *_e_get_etspecdir (void) G_GNUC_CONST; -const char *_e_get_imagesdir (void) G_GNUC_CONST; const char *_e_get_iconsdir (void) G_GNUC_CONST; -const char *_e_get_category_icons (void) G_GNUC_CONST; +const char *_e_get_imagesdir (void) G_GNUC_CONST; +const char *_e_get_libdir (void) G_GNUC_CONST; +const char *_e_get_libexecdir (void) G_GNUC_CONST; +const char *_e_get_localedir (void) G_GNUC_CONST; const char *_e_get_plugindir (void) G_GNUC_CONST; +const char *_e_get_prefix (void) G_GNUC_CONST; const char *_e_get_privdatadir (void) G_GNUC_CONST; const char *_e_get_search_rule_dir (void) G_GNUC_CONST; -const char *_e_get_galviewsdir (void) G_GNUC_CONST; -const char *_e_get_libexecdir (void) G_GNUC_CONST; const char *_e_get_sounddir (void) G_GNUC_CONST; +const char *_e_get_sysconfdir (void) G_GNUC_CONST; +const char *_e_get_toolsdir (void) G_GNUC_CONST; +const char *_e_get_uidir (void) G_GNUC_CONST; -#undef EVOLUTION_LOCALEDIR -#define EVOLUTION_LOCALEDIR _e_get_localedir () +#undef DATADIR +#define DATADIR _e_get_datadir () -#undef PREFIX -#define PREFIX _e_get_prefix () +#undef LIBDIR +#define LIBDIR _e_get_libdir () #undef SYSCONFDIR #define SYSCONFDIR _e_get_sysconfdir () -#undef DATADIR -#define DATADIR _e_get_datadir () +#undef PREFIX +#define PREFIX _e_get_prefix () + +#undef EVOLUTION_CATEGORY_ICONS +#define EVOLUTION_CATEGORY_ICONS _e_get_category_icons () #undef EVOLUTION_DATADIR #define EVOLUTION_DATADIR _e_get_datadir () -#undef LIBDIR -#define LIBDIR _e_get_libdir () +#undef EVOLUTION_ECPSDIR +#define EVOLUTION_ECPSDIR _e_get_ecpsdir () + +#undef EVOLUTION_ETSPECDIR +#define EVOLUTION_ETSPECDIR _e_get_etspecdir () + +#undef EVOLUTION_LOCALEDIR +#define EVOLUTION_LOCALEDIR _e_get_localedir () + +#undef EVOLUTION_GALVIEWSDIR +#define EVOLUTION_GALVIEWSDIR _e_get_galviewsdir () #undef EVOLUTION_GLADEDIR #define EVOLUTION_GLADEDIR _e_get_gladedir () @@ -70,20 +92,17 @@ const char *_e_get_sounddir (void) G_GNUC_CONST; #undef EVOLUTION_HELPDIR #define EVOLUTION_HELPDIR _e_get_helpdir () -#undef EVOLUTION_ETSPECDIR -#define EVOLUTION_ETSPECDIR _e_get_etspecdir () - -#undef EVOLUTION_IMAGESDIR -#define EVOLUTION_IMAGESDIR _e_get_imagesdir () +#undef EVOLUTION_ICONSDIR +#define EVOLUTION_ICONSDIR _e_get_iconsdir () #undef EVOLUTION_IMAGES #define EVOLUTION_IMAGES EVOLUTION_IMAGESDIR -#undef EVOLUTION_ICONSDIR -#define EVOLUTION_ICONSDIR _e_get_iconsdir () +#undef EVOLUTION_IMAGESDIR +#define EVOLUTION_IMAGESDIR _e_get_imagesdir () -#undef EVOLUTION_CATEGORY_ICONS -#define EVOLUTION_CATEGORY_ICONS _e_get_category_icons () +#undef EVOLUTION_LIBEXECDIR +#define EVOLUTION_LIBEXECDIR _e_get_libexecdir () #undef EVOLUTION_PLUGINDIR #define EVOLUTION_PLUGINDIR _e_get_plugindir () @@ -91,17 +110,20 @@ const char *_e_get_sounddir (void) G_GNUC_CONST; #undef EVOLUTION_PRIVDATADIR #define EVOLUTION_PRIVDATADIR _e_get_privdatadir () -#undef SEARCH_RULE_DIR -#define SEARCH_RULE_DIR _e_get_search_rule_dir () +#undef EVOLUTION_SOUNDDIR +#define EVOLUTION_SOUNDDIR _e_get_sounddir () -#undef EVOLUTION_GALVIEWSDIR -#define EVOLUTION_GALVIEWSDIR _e_get_galviewsdir () +#undef EVOLUTION_SYSCONFDIR +#define EVOLUTION_SYSCONFDIR _e_get_sysconfdir () -#undef EVOLUTION_LIBEXECDIR -#define EVOLUTION_LIBEXECDIR _e_get_libexecdir () +#undef EVOLUTION_TOOLSDIR +#define EVOLUTION_TOOLSDIR _e_get_toolsdir () -#undef EVOLUTION_SOUNDDIR -#define EVOLUTION_SOUNDDIR _e_get_sounddir () +#undef EVOLUTION_UIDIR +#define EVOLUTION_UIDIR _e_get_uidir () + +#undef SEARCH_RULE_DIR +#define SEARCH_RULE_DIR _e_get_search_rule_dir () #endif /* G_OS_WIN32 */ diff --git a/e-util/e-win32-reloc.c b/e-util/e-win32-reloc.c index a3c9be7b84..c093843ce5 100644 --- a/e-util/e-win32-reloc.c +++ b/e-util/e-win32-reloc.c @@ -35,22 +35,25 @@ static const char *localedir = NULL; /* The others are in UTF-8 */ -static const char *prefix; -static const char *sysconfdir; +static const char *category_icons; static const char *datadir; -static const char *libdir; +static const char *ecpsdir; +static const char *etspecdir; +static const char *galviewsdir; static const char *gladedir; static const char *helpdir; -static const char *etspecdir; -static const char *imagesdir; static const char *iconsdir; -static const char *category_icons; +static const char *imagesdir; +static const char *libdir; +static const char *libexecdir; static const char *plugindir; +static const char *prefix; static const char *privdatadir; static const char *search_rule_dir; -static const char *galviewsdir; -static const char *libexecdir; static const char *sounddir; +static const char *sysconfdir; +static const char *toolsdir; +static const char *uidir; static HMODULE hmodule; G_LOCK_DEFINE_STATIC (mutex); @@ -108,20 +111,36 @@ setup (void) g_free (cp_prefix); prefix = g_strdup (full_prefix); - sysconfdir = replace_prefix (full_prefix, EVOLUTION_SYSCONFDIR); + + /* It makes sense to have some of the paths overridable with + * environment variables. + */ + category_icons = replace_prefix (full_prefix, EVOLUTION_CATEGORY_ICONS); datadir = replace_prefix (full_prefix, EVOLUTION_DATADIR); + ecpsdir = replace_prefix (full_prefix, EVOLUTION_ECPSDIR); + etspecdir = replace_prefix (full_prefix, EVOLUTION_ETSPECDIR); + galviewsdir = replace_prefix (full_prefix, EVOLUTION_GALVIEWSDIR); + gladedir = replace_prefix (full_prefix, EVOLUTION_GLADEDIR); + helpdir = replace_prefix (full_prefix, EVOLUTION_HELPDIR); + if (g_getenv ("EVOLUTION_ICONSDIR") && + g_file_test (g_getenv ("EVOLUTION_ICONSDIR"), G_FILE_TEST_IS_DIR)) + iconsdir = g_getenv ("EVOLUTION_ICONSDIR"); + else + iconsdir = replace_prefix (full_prefix, EVOLUTION_ICONSDIR); + if (g_getenv ("EVOLUTION_IMAGESDIR") && + g_file_test (g_getenv ("EVOLUTION_IMAGESDIR"), G_FILE_TEST_IS_DIR)) + imagesdir = g_getenv ("EVOLUTION_IMAGESDIR"); + else + imagesdir = replace_prefix (full_prefix, EVOLUTION_IMAGESDIR); libdir = replace_prefix (full_prefix, EVOLUTION_LIBDIR); - gladedir = replace_prefix (full_prefix, EVOLUTION_GLADEDIR); - helpdir = replace_prefix (full_prefix, EVOLUTION_HELPDIR); - etspecdir = replace_prefix (full_prefix, EVOLUTION_ETSPECDIR); - imagesdir = replace_prefix (full_prefix, EVOLUTION_IMAGESDIR); - category_icons = replace_prefix (full_prefix, EVOLUTION_CATEGORY_ICONS); + libexecdir = replace_prefix (full_prefix, EVOLUTION_LIBEXECDIR); plugindir = replace_prefix (full_prefix, EVOLUTION_PLUGINDIR); privdatadir = replace_prefix (full_prefix, EVOLUTION_PRIVDATADIR); search_rule_dir = replace_prefix (full_prefix, SEARCH_RULE_DIR); - galviewsdir = replace_prefix (full_prefix, EVOLUTION_GALVIEWSDIR); - libexecdir = replace_prefix (full_prefix, EVOLUTION_LIBEXECDIR); sounddir = replace_prefix (full_prefix, EVOLUTION_SOUNDDIR); + sysconfdir = replace_prefix (full_prefix, EVOLUTION_SYSCONFDIR); + toolsdir = replace_prefix (full_prefix, EVOLUTION_TOOLSDIR); + uidir = replace_prefix (full_prefix, EVOLUTION_UIDIR); g_free (full_prefix); @@ -138,20 +157,23 @@ _e_get_##varbl (void) \ return varbl; \ } -GETTER(localedir) -GETTER(prefix) -GETTER(sysconfdir) +GETTER(category_icons) GETTER(datadir) -GETTER(libdir) +GETTER(ecpsdir) +GETTER(etspecdir) +GETTER(galviewsdir) GETTER(gladedir) GETTER(helpdir) -GETTER(etspecdir) -GETTER(imagesdir) GETTER(iconsdir) -GETTER(category_icons) +GETTER(imagesdir) +GETTER(libdir) +GETTER(libexecdir) +GETTER(localedir) GETTER(plugindir) +GETTER(prefix) GETTER(privdatadir) GETTER(search_rule_dir) -GETTER(galviewsdir) -GETTER(libexecdir) GETTER(sounddir) +GETTER(sysconfdir) +GETTER(toolsdir) +GETTER(uidir) |