From d3e8e448d17cc3f3f0687d194f9a377d7da97aec Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 2 Jan 2012 00:02:44 +0000 Subject: [PATCH] Improve support for relative search paths --- configure.ac | 9 ++++++--- src/Makefile.am | 10 ++++------ src/plugins/Makefile.am | 5 ++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 3cded34..b2bddd8 100644 --- a/configure.ac +++ b/configure.ac @@ -28,13 +28,16 @@ case "${host}" in *apple*) SYS="MAC" ;; *) SYS="X11" ;; esac -if test "$SYS" = "WIN"; then - ac_default_prefix="/" -fi AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN") AM_CONDITIONAL([SYS_MAC], test "$SYS" = "MAC") AM_CONDITIONAL([SYS_X11], test "$SYS" = "X11") +# Check for relative build +AC_ARG_ENABLE(relative, [AS_HELP_STRING([--enable-relative], + [enable runtime search paths @<:@default=no@:>@])], + [DOTS=".."; ac_default_prefix="/"]) +AC_SUBST([DOTS]) + # Output AC_CONFIG_FILES([ Makefile diff --git a/src/Makefile.am b/src/Makefile.am index e31c394..fb3d4f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,18 +12,16 @@ aweather_SOURCES = main.c \ aweather-gui.c aweather-gui.h \ aweather-location.c aweather-location.h aweather_CPPFLAGS = \ - -DHTMLDIR="\"$(dots)$(htmldir)\"" \ - -DICONDIR="\"$(dots)$(datadir)/icons\"" \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ - -DPLUGINSDIR="\"$(dots)$(pkglibdir)\"" + -DHTMLDIR="\"$(DOTS)$(htmldir)\"" \ + -DICONDIR="\"$(DOTS)$(datadir)/icons\"" \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ + -DPLUGINSDIR="\"$(DOTS)$(pkglibdir)\"" aweather_LDADD = $(GRITS_LIBS) wsr88ddec = wsr88ddec.c wsr88ddec_LDADD = $(GLIB_LIBS) -lbz2 if SYS_WIN -dots = .. - wsr88ddec_LDFLAGS = -mwindows aweather_SOURCES += resource.rc diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index b873d1b..7cc1b81 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -5,7 +5,6 @@ LIBS = $(GRITS_LIBS) if SYS_WIN AM_LDFLAGS += -no-undefined -dots = .. endif if !SYS_MAC AM_LDFLAGS += -Wl,--as-needed @@ -19,7 +18,7 @@ alert_la_SOURCES = \ alert.c alert.h \ alert-info.c alert-info.h alert_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" alert_la_LIBADD = $(GRITS_LIBS) if HAVE_RSL @@ -31,7 +30,7 @@ radar_la_SOURCES = \ ../aweather-location.c \ ../aweather-location.h radar_la_CPPFLAGS = \ - -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ + -DPKGDATADIR="\"$(DOTS)$(pkgdatadir)\"" \ -I$(top_srcdir)/src radar_la_LIBADD = $(RSL_LIBS) $(GRITS_LIBS) endif -- 2.43.2