# The source files of the 'hello' program.
hello_SOURCES = hello.c resources.c
-# Define a C macro LOCALEDIR indicating where catalogs will be installed.
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+# Define a C macro LOCALEDIR indicating where catalogs will be installed
+# and a C macro PKGDATADIR indicating a package-specific location.
+DEFS = \
+ -DLOCALEDIR=$(localedir_c_make) \
+ -DPKGDATADIR=$(pkgdatadir_c_make) \
+ @DEFS@
# Make sure the gnome.h include file is found.
AM_CPPFLAGS = $(GTK_CFLAGS)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
--sourcedir=$(srcdir) --generate-source
+# Install the compiled GSettings schema in a package-specific location
+# (so that "make install" works with a --prefix other than /usr).
+pkgdata_DATA = gschemas.compiled
+
desktopdir = $(datadir)/applications
desktop_DATA = hello.desktop
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.23])
+dnl Define localedir_c and localedir_c_make.
+gl_BUILD_TO_HOST_LOCALEDIR
+dnl Define pkgdatadir_c and pkgdatadir_c_make.
+gl_BUILD_TO_HOST_PKGDATADIR
+
dnl Check GNOME specific stuff.
dnl
dnl If you have full GNOME development environment installed on your
GApplication *application;
int status;
- /* Load the GSettings schema from the current directory. */
- g_setenv ("GSETTINGS_SCHEMA_DIR", ".", FALSE);
+ /* Load the compiled GSettings schema
+ - from PKGDATADIR (so that it works after "make install"),
+ - from the current directory (so that it works in the build directory,
+ before "make install"). */
+ g_setenv ("GSETTINGS_SCHEMA_DIR", PKGDATADIR G_SEARCHPATH_SEPARATOR_S ".",
+ FALSE);
/* Initializations. */
textdomain ("hello-c-gnome3");