Improve support for relative search paths
authorAndy Spencer <andy753421@gmail.com>
Mon, 19 Dec 2011 08:19:31 +0000 (08:19 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 1 Jan 2012 23:34:13 +0000 (23:34 +0000)
configure.ac
src/Makefile.am

index e92d77e..892bd0a 100644 (file)
@@ -46,9 +46,6 @@ esac
 AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN")
 AM_CONDITIONAL([SYS_MAC], test "$SYS" = "MAC")
 AM_CONDITIONAL([SYS_X11], test "$SYS" = "X11")
-if test "$WIN32" = yes; then
-       ac_default_prefix="/"
-fi
 
 # OpenGL flags
 GL_CFLAGS="-DSYS_$SYS"
@@ -60,6 +57,12 @@ esac
 AC_SUBST([GL_CFLAGS])
 AC_SUBST([GL_LIBS])
 
+# 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
index fd2fceb..ef221dd 100644 (file)
@@ -47,8 +47,8 @@ libgrits_la_SOURCES = grits.h \
        gtkgl.c         gtkgl.h         \
        gpqueue.c       gpqueue.h
 libgrits_la_CPPFLAGS = $(AM_CPPFLAGS) \
-       -DPKGDATADIR="\"$(dots)$(datadir)/$(GRITS_SUBDIR)\"" \
-       -DPLUGINSDIR="\"$(dots)$(libdir)/$(GRITS_SUBDIR)\""
+       -DPKGDATADIR="\"$(DOTS)$(datadir)/$(GRITS_SUBDIR)\"" \
+       -DPLUGINSDIR="\"$(DOTS)$(libdir)/$(GRITS_SUBDIR)\""
 libgrits_la_LIBADD  = $(AM_LDADD) -lm \
        objects/libgrits-objects.la \
        data/libgrits-data.la