Commit 4309735de3953ab6b901514357bfbec06907952d

Ran Benita 2017-07-31T11:24:28

build: use top_srcdir consistently Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/Makefile.am b/Makefile.am
index d46481b..a23c59f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -103,7 +103,7 @@ libxkbcommon_la_SOURCES = \
 	src/utils.c \
 	src/utils.h
 if HAVE_VERSION_SCRIPT
-libxkbcommon_la_LDFLAGS = -Wl,--version-script=${srcdir}/xkbcommon.map
+libxkbcommon_la_LDFLAGS = -Wl,--version-script=${top_srcdir}/xkbcommon.map
 endif HAVE_VERSION_SCRIPT
 
 if ENABLE_X11
@@ -119,7 +119,7 @@ libxkbcommon_x11_la_CFLAGS = $(AM_CFLAGS) $(XCB_XKB_CFLAGS)
 libxkbcommon_x11_la_CPPFLAGS = $(AM_CPPFLAGS)
 libxkbcommon_x11_la_LIBADD = libxkbcommon.la $(XCB_XKB_LIBS)
 if HAVE_VERSION_SCRIPT
-libxkbcommon_x11_la_LDFLAGS = -Wl,--version-script=${srcdir}/xkbcommon-x11.map
+libxkbcommon_x11_la_LDFLAGS = -Wl,--version-script=${top_srcdir}/xkbcommon-x11.map
 endif HAVE_VERSION_SCRIPT
 
 libxkbcommon_x11_la_SOURCES = \
diff --git a/configure.ac b/configure.ac
index a87ad0d..39ded05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ openbsd*)
 esac
 AM_CONDITIONAL([HAVE_NO_UNDEFINED], [test "x$have_no_undefined" = xyes])
 
-XORG_CHECK_LINKER_FLAGS([-Wl,--version-script="$srcdir/xkbcommon.map"], [have_version_script=yes])
+XORG_CHECK_LINKER_FLAGS([-Wl,--version-script="$top_srcdir/xkbcommon.map"], [have_version_script=yes])
 AM_CONDITIONAL([HAVE_VERSION_SCRIPT], [test "x$have_version_script" = xyes])
 
 AC_CHECK_LIB(rt, clock_gettime,
diff --git a/test/common.c b/test/common.c
index 1bb6d35..1ee34e3 100644
--- a/test/common.c
+++ b/test/common.c
@@ -159,7 +159,7 @@ test_get_path(const char *path_rel)
 {
     char *path;
     size_t path_len;
-    const char *srcdir = getenv("srcdir");
+    const char *srcdir = getenv("top_srcdir");
 
     path_len = strlen(srcdir ? srcdir : ".") +
                strlen(path_rel ? path_rel : "") + 12;