Allow compilation from a build directory
[oweals/tinc.git] / src / Makefile.am
index ebd52abca6b24fe5050b9365682eb4890f7630e5..0b28139ed04b626dcb12ad8aaca7d84a271dda9a 100644 (file)
@@ -17,8 +17,6 @@ tincd_SOURCES = \
        fake-gai-errnos.h \
        fake-getaddrinfo.c fake-getaddrinfo.h \
        fake-getnameinfo.c fake-getnameinfo.h \
-       getopt.c getopt.h \
-       getopt1.c \
        graph.c graph.h \
        ipv4.h \
        ipv6.h \
@@ -49,6 +47,12 @@ tincd_SOURCES = \
        xalloc.h \
        xmalloc.c
 
+if !GETOPT
+tincd_SOURCES += \
+       getopt.c getopt.h \
+       getopt1.c
+endif
+
 if LINUX
 tincd_SOURCES += linux/device.c
 endif
@@ -84,4 +88,4 @@ if TUNEMU
 LIBS += -lpcap
 endif
 
-AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\"
+AM_CPPFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -I $(abs_top_builddir)/