build: use top_srcdir consistently Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
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;