charon-tkm: Support for out-of-tree build added
authorTobias Brunner <tobias@strongswan.org>
Tue, 5 Nov 2013 15:29:35 +0000 (16:29 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 27 Nov 2013 17:35:44 +0000 (18:35 +0100)
src/charon-tkm/Makefile.am
src/charon-tkm/build_common.gpr

index 0fef1f6..c3da7d7 100644 (file)
@@ -1,23 +1,23 @@
-SRC = $(top_builddir)/src
+SRC = $(abs_top_srcdir)/src
+OBJ = $(abs_top_builddir)/src
 
-# includes relative to obj directory
 AM_CPPFLAGS = \
-       -include $(top_builddir)/config.h \
-       -I../$(SRC)/libstrongswan \
-       -I../$(SRC)/libhydra \
-       -I../$(SRC)/libcharon
+       -include $(abs_top_builddir)/config.h \
+       -I$(SRC)/libstrongswan \
+       -I$(SRC)/libhydra \
+       -I$(SRC)/libcharon
 
 LIBLD = \
-       -L$(SRC)/libstrongswan/.libs \
-       -L$(SRC)/libhydra/.libs \
-       -L$(SRC)/libcharon/.libs
-LIBPT = $(SRC)/libstrongswan/.libs:$(SRC)/libhydra/.libs:$(SRC)/libcharon/.libs
+       -L$(OBJ)/libstrongswan/.libs \
+       -L$(OBJ)/libhydra/.libs \
+       -L$(OBJ)/libcharon/.libs
+LIBPT = $(OBJ)/libstrongswan/.libs:$(OBJ)/libhydra/.libs:$(OBJ)/libcharon/.libs
 LIBFL = -lstrongswan -lhydra -lcharon
 
 DEFS += -DPLUGINS=\""$(PLUGINS)\"" -DIPSEC_PIDDIR=\"${piddir}\"
 
 BUILD_OPTS = \
-       -XOBJ_DIR=$(CURDIR)/obj \
+       -XOBJ_DIR=$(abs_builddir)/obj \
        -cargs $(AM_CPPFLAGS) $(DEFS) \
        -largs $(LIBLD) $(LIBFL)
 
index ac322d7..102f6b7 100644 (file)
@@ -5,7 +5,7 @@ project Build_Common is
 
    for Source_Dirs use ();
 
-   Obj_Dir := "obj";
+   Obj_Dir := external ("OBJ_DIR", "obj");
 
    C_Compiler_Switches   := ("-W",
                              "-Wall",