[PATCH 1/2] Fix references to source tree in VPATH builds

Jānis Rukšāns <[email protected]>
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <[email protected]>
---
 Makefile.am     |    2 +-
 configure.ac    |   10 ++++++----
 lib/Makefile.am |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index cf902cc..56bd574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,7 +32,7 @@ EXTRA_DIST = m4
 
 if GIT_REPO
 
-ChangeLog: .git/objects
+ChangeLog: $(srcdir)/.git/objects
 	git log > $@
 
 endif
diff --git a/configure.ac b/configure.ac
index e63ca2c..d4d8127 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,11 +154,13 @@ AC_CHECK_FUNCS([gethostbyname gettimeofday inet_ntoa memset select socket strcas
 MISDN_CHECK_AF_ISDN
 
 
-if test -d .git/objects
-then
-	git_repo=true
+AC_MSG_CHECKING([whether building from git])
+if test -d ${srcdir}/.git/objects; then
+    AC_MSG_RESULT([yes])
+    git_repo=true
 else
-	git_repo=false
+    AC_MSG_RESULT([no])
+    git_repo=false
 fi
 
 AC_MISDN_GROUP
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 339813f..2a7c371 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -20,6 +20,6 @@ lib_LTLIBRARIES = libmisdn.la
 libmisdn_la_SOURCES = $(MISC_SRC) $(LAYER3_SRC) $(INCLUDE_SRC) $(ASN1_SRC) $(SUPPSERV_SRC)
 libmisdn_la_LDFLAGS = -version-info 1:0:0
 
-AM_CPPFLAGS = -I$(top_srcdir)/include -Iinclude $(_MEMLEAKDEBUG)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(srcdir)/include $(_MEMLEAKDEBUG)
 
 CLEANFILES = *~ */*~
-- 
1.7.10.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.