summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-10-29 09:44:44 +0000
committerMartin Mares <mj@ucw.cz>1999-10-29 09:44:44 +0000
commited6081502ad814289b9b7b5537658c3b1ad435e5 (patch)
tree75ab845ca3876e88d6ddd60b6867f9dd860f85a9
parent41be4444f2f548c5cc135593b2c820180a22ff99 (diff)
Added skeleton of the client. Does nothing, but at least compiles.
-rw-r--r--client/Makefile5
-rw-r--r--client/client.c16
-rw-r--r--client/client.h11
-rw-r--r--sysdep/unix/Modules2
-rw-r--r--sysdep/unix/client-main.c54
-rw-r--r--tools/Makefile.in13
-rw-r--r--tools/Rules.in6
7 files changed, 99 insertions, 8 deletions
diff --git a/client/Makefile b/client/Makefile
new file mode 100644
index 00000000..0d01724f
--- /dev/null
+++ b/client/Makefile
@@ -0,0 +1,5 @@
+source=client.c
+root-rel=../
+dir-name=client
+
+include ../Rules
diff --git a/client/client.c b/client/client.c
new file mode 100644
index 00000000..ea12c291
--- /dev/null
+++ b/client/client.c
@@ -0,0 +1,16 @@
+/*
+ * BIRD Client
+ *
+ * (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "nest/bird.h"
+#include "client/client.h"
+
+int
+main(int argc, char **argv)
+{
+ return client_main(argc, argv); /* Call sysdep code */
+}
diff --git a/client/client.h b/client/client.h
new file mode 100644
index 00000000..b5d6ab16
--- /dev/null
+++ b/client/client.h
@@ -0,0 +1,11 @@
+/*
+ * BIRD Client
+ *
+ * (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+/* sysdep code */
+
+int client_main(int argc, char **argv);
diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules
index 7d403dd9..7534a47b 100644
--- a/sysdep/unix/Modules
+++ b/sysdep/unix/Modules
@@ -18,3 +18,5 @@ krt-iface.h
krt-set.c
krt-set.h
#endif
+
+client-main.c
diff --git a/sysdep/unix/client-main.c b/sysdep/unix/client-main.c
new file mode 100644
index 00000000..da01e21b
--- /dev/null
+++ b/sysdep/unix/client-main.c
@@ -0,0 +1,54 @@
+/*
+ * BIRD Client -- Unix Entry Point
+ *
+ * (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "nest/bird.h"
+#include "client/client.h"
+
+#include "unix.h"
+
+static char *opt_list = "";
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: birdc\n");
+ exit(1);
+}
+
+static void
+parse_args(int argc, char **argv)
+{
+ int c;
+
+ while ((c = getopt(argc, argv, opt_list)) >= 0)
+ switch (c)
+ {
+ default:
+ usage();
+ }
+ if (optind < argc)
+ usage();
+}
+
+int
+client_main(int argc, char **argv)
+{
+#ifdef HAVE_LIBDMALLOC
+ if (!getenv("DMALLOC_OPTIONS"))
+ dmalloc_debug(0x2f03d00);
+#endif
+
+ parse_args(argc, argv);
+
+ bug("Not implemented yet!");
+}
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 1f41e829..337c1b43 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -7,17 +7,20 @@ srcdir_abs := $(shell cd $(srcdir) ; pwd)
.PHONY: all subdir depend clean distclean tags
-all: .dep-stamp subdir $(exedir)/bird
+all: .dep-stamp subdir $(exedir)/bird $(exedir)/birdc
subdir depend: .dir-stamp
set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
- set -e ; for a in $(static-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
+ set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
$(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+$(exedir)/birdc: client/all.o lib/birdlib.a
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
.dir-stamp:
- mkdir -p $(static-dirs)
+ mkdir -p $(static-dirs) $(client-dirs)
touch .dir-stamp
.dep-stamp:
@@ -25,11 +28,11 @@ $(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
touch .dep-stamp
tags:
- cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) -name *.[chY]`
+ cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
clean:
find . -name "*.[oa]" -or -name core -or -name depend | xargs rm -f
- rm -f $(exedir)/bird .dep-stamp
+ rm -f $(exedir)/bird $(exedir)/birdc .dep-stamp
distclean: clean
rm -f config.* configure sysdep/autoconf.h Makefile Rules
diff --git a/tools/Rules.in b/tools/Rules.in
index 23f171ac..fc3d2b1a 100644
--- a/tools/Rules.in
+++ b/tools/Rules.in
@@ -10,11 +10,11 @@ static-dirs := nest filter $(addprefix proto/,$(protocols))
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
dynamic-dirs := lib conf
dynamic-dir-paths := $(dynamic-dirs)
-dir-makefiles := $(addsuffix /Makefile,$(static-dir-paths) $(dynamic-dir-paths))
+client-dirs := client
+client-dir-paths := $(client-dirs)
-all-dirs:=$(static-dirs) $(dynamic-dirs)
+all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs)
clean-dirs:=$(all-dirs) proto sysdep
-dir-objs:=$(addprefix $(objdir)/,$(all-dirs))
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
CFLAGS=$(CPPFLAGS) @CFLAGS@