From 12e25c55a3f2d556c7716223564e53b8d78aa049 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 19 Mar 2009 15:17:55 -0400 Subject: [PATCH] Add support for installing glade files. --- Makefile.am | 5 +++++ configure.ac | 14 +++++++++++--- m4/distmatch.m4 | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 m4/distmatch.m4 diff --git a/Makefile.am b/Makefile.am index 907c9d6..0266f3d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,11 @@ DIST_SUBDIRS = examples ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libaspectbin.la +if INST_GLADE +glade_catalogdir = $(GLADE_catalogdir) +dist_glade_catalog_DATA = aspectbin.xml +endif + libaspectbin_la_SOURCES = aspectbin.c libaspectbin_la_CFLAGS = $(GTK_CFLAGS) libaspectbin_la_LDFLAGS = $(GTK_LIBS) diff --git a/configure.ac b/configure.ac index 64c8630..1594a48 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_ARG_WITH(glade, have_glade=no if test x"$use_glade" = x"yes"; then -PKG_CHECK_MODULES(GLADEUI, [gladeui-1.0 >= 3.4.5], +PKG_CHECK_MODULES(GLADEUI, [gladeui-1.0 >= 3.4], [have_glade=yes], [have_glade=no]) AC_SUBST(GLADEUI_LIBS) AC_SUBST(GLADEUI_CFLAGS) @@ -31,18 +31,26 @@ fi have_gladedirs=no if test x"$have_glade" = x"yes"; then +PKG_CHECK_VAR([GLADE], [prefix], [Glade prefix], [gladeui-1.0], + [have_gladedirs=yes], [have_gladedirs=no]) PKG_CHECK_VAR([GLADE], [catalogdir], [Glade catalog directory], [gladeui-1.0], [have_gladedirs=yes], [have_gladedirs=no]) -PKG_CHECK_VAR([GLADE], [moduledir], [Glade module directory], [gladeui-1.0], +PKG_CHECK_VAR([GLADE], [pixmapdir], [Glade pixmap directory], [gladeui-1.0], [have_gladedirs=yes], [have_gladedirs=no]) + +DIST_FIND_MATCH([GLADE_catalogdir], [$GLADE_prefix], [$GLADE_catalogdir]) +DIST_FIND_MATCH([GLADE_pixmapdir], [$GLADE_prefix], [$GLADE_pixmapdir]) + AC_SUBST(GLADE_catalogdir) -AC_SUBST(GLADE_moduledir) +AC_SUBST(GLADE_pixmapdir) fi if test x"$have_glade" = x"yes" -a x"$have_gladedirs" = x"no"; then AC_MSG_WARN([Glade support will be built, but not installed.]) fi + AM_CONDITIONAL([BUILD_GLADE], [test x"$have_glade" = x"yes"]) +AM_CONDITIONAL([INST_GLADE], [test x"$have_gladedirs" = x"yes"]) AC_CONFIG_FILES([ Makefile diff --git a/m4/distmatch.m4 b/m4/distmatch.m4 new file mode 100644 index 0000000..74a3ae5 --- /dev/null +++ b/m4/distmatch.m4 @@ -0,0 +1,15 @@ +dnl DIST_FIND_MATCH(outvar, pkg_prefix, pkg_dest) +AC_DEFUN([DIST_FIND_MATCH], +[ +arg=`printf '%s\n' "$2" | sed 's:@<:@@:>@@<:@^$.*\/@:>@:\\\\&:g'` +$1=`printf '%s\n' "$3" | sed 's/^\/*'"$arg"'\/*// + t foo + : foo + t; s:^etc/:${sysconfdir}/: + t; s:^lib/:${libdir}/: + t; s:^bin/:${bindir}/: + t; s:^sbin/:${sbindir}/: + t; s:^share/:${datarootdir}/: + t; s:^:${prefix}/: +'` +]) -- 2.43.0