]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: non-recursive ldpd
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 4 Aug 2017 14:13:29 +0000 (16:13 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 4 Aug 2017 17:09:11 +0000 (19:09 +0200)
This also fixes a build problem where using #include
"ldpd/ldp_vty_cmds_clippy.c" results in the Makefile dependency tracking
having both

ldp_vty_cmds.c: ldp_vty_cmds_clippy.c
ldp_vty_cmds.c: ../ldpd/ldp_vty_cmds_clippy.c

(because, if it's included as "ldpd/..", it uses the "-I.." include path
in gcc, so the gcc -MD dependency output is "../ldpd/...")

... all of which causes the build to try to build it twice (at the same
time) and fail rather stupidly.

With a non-recursive build, the two paths are identical and everything
just works.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Makefile.am
configure.ac
ldpd/.gitignore
ldpd/Makefile [new file with mode: 0644]
ldpd/Makefile.am [deleted file]
ldpd/subdir.am [new file with mode: 0644]

index 72689c28f7657adc2e649251f04973361121b588..7d607b2d53b1e69a3a8319f0e67c2126b596621b 100644 (file)
@@ -37,14 +37,15 @@ include ospf6d/subdir.am
 include ospfclient/subdir.am
 include isisd/subdir.am
 include nhrpd/subdir.am
+include ldpd/subdir.am
 
 SUBDIRS = . @LIBRFP@ @RFPTEST@ \
-        @BGPD@ @LDPD@ \
+        @BGPD@ \
          @PIMD@ @EIGRPD@ @BABELD@ \
         @WATCHFRR@ @VTYSH@ @DOC@ \
          @SOLARIS@ tests tools
 
-DIST_SUBDIRS = . bgpd ldpd \
+DIST_SUBDIRS = . bgpd \
          watchfrr vtysh doc tests \
          solaris pimd eigrpd bgpd/rfp-example/librfp \
          bgpd/rfp-example/rfptest tools babeld \
index 7403047b62f7a2cc3a602060264713fe0085f58f..0cae5e58247f19c6b2103ec646d94b500b5734be 100755 (executable)
@@ -1253,14 +1253,11 @@ AM_CONDITIONAL(BGPD, test "x$BGPD" = "xbgpd")
 
 AM_CONDITIONAL(RIPD, test "${enable_ripd}" != "no")
 AM_CONDITIONAL(OSPFD, test "${enable_ospfd}" != "no")
+AM_CONDITIONAL(LDPD, test "${enable_ldpd}" != "no")
 
-if test "${enable_ldpd}" = "no";then
-  LDPD=""
-else
-  LDPD="ldpd"
+AS_IF([test "${enable_ldpd}" != "no"], [
   AC_DEFINE(HAVE_LDPD, 1, ldpd)
-fi
-AM_CONDITIONAL(LDPD, test "x$LDPD" = "xldpd")
+])
 
 NHRPD=""
 case "$host_os" in
@@ -1352,7 +1349,6 @@ AC_SUBST(LIBRFP)
 AC_SUBST(RFPINC)
 AC_SUBST(BABELD)
 AC_SUBST(BGPD)
-AC_SUBST(LDPD)
 AC_SUBST(EIGRPD)
 AC_SUBST(WATCHFRR)
 AC_SUBST(ISISD)
@@ -1805,7 +1801,7 @@ AC_MSG_RESULT($ac_cv_htonl_works)
 
 AC_CONFIG_FILES([Makefile
          bgpd/Makefile watchfrr/Makefile
-         ldpd/Makefile vtysh/Makefile
+         vtysh/Makefile
          doc/Makefile tests/Makefile
          bgpd/rfp-example/rfptest/Makefile bgpd/rfp-example/librfp/Makefile
          babeld/Makefile
index f52b227cb1f9f1f93908a9ee4548e5d5931a860a..eee96c636f52d748ea64fdb195f8a86a006033a1 100644 (file)
@@ -1,4 +1,4 @@
-Makefile
+!Makefile
 Makefile.in
 *.o
 ldpd
diff --git a/ldpd/Makefile b/ldpd/Makefile
new file mode 100644 (file)
index 0000000..464e02c
--- /dev/null
@@ -0,0 +1,10 @@
+all: ALWAYS
+       @$(MAKE) -s -C .. ldpd/ldpd
+%: ALWAYS
+       @$(MAKE) -s -C .. ldpd/$@
+
+Makefile:
+       #nothing
+ALWAYS:
+.PHONY: ALWAYS makefiles
+.SUFFIXES:
diff --git a/ldpd/Makefile.am b/ldpd/Makefile.am
deleted file mode 100644 (file)
index de9b07e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-include ../common.am
-
-AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
-INSTALL_SDATA=@INSTALL@ -m 600
-
-AM_CFLAGS = $(WERROR)
-
-noinst_LIBRARIES = libldp.a
-sbin_PROGRAMS = ldpd
-
-libldp_a_SOURCES = \
-       accept.c address.c adjacency.c control.c hello.c init.c interface.c \
-       keepalive.c l2vpn.c labelmapping.c lde.c lde_lib.c ldpd.c \
-       ldpe.c log.c logmsg.c neighbor.c notification.c packet.c pfkey.c \
-       socket.c util.c ldp_vty_cmds.c ldp_vty_conf.c ldp_vty_exec.c \
-       ldp_debug.c ldp_zebra.c
-
-ldp_vty_cmds.o: ldp_vty_cmds_clippy.c
-
-noinst_HEADERS = \
-       control.h lde.h ldpd.h ldpe.h ldp.h log.h ldp_debug.h ldp_vty.h
-
-ldpd_SOURCES = ldpd.c
-ldpd_LDADD = libldp.a ../lib/libfrr.la @LIBCAP@
-
-examplesdir = $(exampledir)
-dist_examples_DATA = ldpd.conf.sample
diff --git a/ldpd/subdir.am b/ldpd/subdir.am
new file mode 100644 (file)
index 0000000..db71cee
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# ldpd
+#
+
+if LDPD
+noinst_LIBRARIES += ldpd/libldp.a
+sbin_PROGRAMS += ldpd/ldpd
+dist_examples_DATA += ldpd/ldpd.conf.sample
+endif
+
+ldpd_libldp_a_SOURCES = \
+       ldpd/accept.c \
+       ldpd/address.c \
+       ldpd/adjacency.c \
+       ldpd/control.c \
+       ldpd/hello.c \
+       ldpd/init.c \
+       ldpd/interface.c \
+       ldpd/keepalive.c \
+       ldpd/l2vpn.c \
+       ldpd/labelmapping.c \
+       ldpd/lde.c \
+       ldpd/lde_lib.c \
+       ldpd/ldp_debug.c \
+       ldpd/ldp_vty_cmds.c \
+       ldpd/ldp_vty_conf.c \
+       ldpd/ldp_vty_exec.c \
+       ldpd/ldp_zebra.c \
+       ldpd/ldpd.c \
+       ldpd/ldpe.c \
+       ldpd/log.c \
+       ldpd/logmsg.c \
+       ldpd/neighbor.c \
+       ldpd/notification.c \
+       ldpd/packet.c \
+       ldpd/pfkey.c \
+       ldpd/socket.c \
+       ldpd/util.c \
+       # end
+
+ldpd/ldp_vty_cmds.$(OBJEXT): ldpd/ldp_vty_cmds_clippy.c
+
+noinst_HEADERS += \
+       ldpd/control.h \
+       ldpd/lde.h \
+       ldpd/ldp.h \
+       ldpd/ldp_debug.h \
+       ldpd/ldp_vty.h \
+       ldpd/ldpd.h \
+       ldpd/ldpe.h \
+       ldpd/log.h \
+       # end
+
+ldpd_ldpd_SOURCES = ldpd/ldpd.c
+ldpd_ldpd_LDADD = ldpd/libldp.a lib/libfrr.la @LIBCAP@