[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Move pk-utils.h out of libpoke.h
From: |
Tim Rühsen |
Subject: |
[PATCH] Move pk-utils.h out of libpoke.h |
Date: |
Sat, 2 May 2020 19:48:30 +0200 |
---
ChangeLog | 26 ++++++++++++++++++++++++++
Makefile.am | 2 +-
configure.ac | 1 +
include/Makefile.am | 1 +
{lib => include}/libpoke.h | 2 +-
lib/Makefile.am | 19 +++++++++++++------
lib/libpoke.c | 4 ++--
src/Makefile.am | 2 ++
src/pk-cmd.c | 1 +
src/pk-cmd.h | 1 +
src/pk-editor.c | 1 +
src/pk-info.c | 1 +
src/pk-ios.c | 1 +
src/pk-misc.c | 1 +
src/pk-set.c | 1 +
src/poke.c | 1 +
src/poke.h | 2 +-
17 files changed, 56 insertions(+), 11 deletions(-)
create mode 100644 include/Makefile.am
rename {lib => include}/libpoke.h (99%)
diff --git a/Makefile.am b/Makefile.am
index bcbb2069..27022544 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = jitter gl pickles lib src doc man testsuite etc po
+SUBDIRS = jitter gl pickles include lib src doc man testsuite etc po
noinst_SCRIPTS = run
diff --git a/configure.ac b/configure.ac
index 35bef2ac..0cca14ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,7 @@ fi
dnl Generate output files
AC_CONFIG_FILES(Makefile
gl/Makefile
+ include/Makefile
lib/Makefile
src/Makefile
pickles/Makefile
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 00000000..2818c5f1
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1 @@
+include_HEADERS = libpoke.h
diff --git a/lib/libpoke.h b/include/libpoke.h
similarity index 99%
rename from lib/libpoke.h
rename to include/libpoke.h
index 38a39cee..da031f65 100644
--- a/lib/libpoke.h
+++ b/include/libpoke.h
@@ -21,7 +21,7 @@
#include <config.h>
-#include "pk-utils.h"
+#include <stdint.h>
typedef struct pk_compiler *pk_compiler;
typedef struct pk_ios *pk_ios;
diff --git a/lib/Makefile.am b/lib/Makefile.am
index df624094..f9096849 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -22,11 +22,11 @@ MAINTAINERCLEANFILES =
dist_pkgdata_DATA = pkl-rt.pk std.pk
-lib_LTLIBRARIES = libpoke.la
+lib_LTLIBRARIES = libpokeutils.la libpoke.la
-include_HEADERS = libpoke.h pk-utils.h
+#include_HEADERS = pk-utils.h
-libpoke_la_SOURCES = libpoke.h libpoke.c \
+libpoke_la_SOURCES = libpoke.c \
pkt.h \
pkl.h pkl.c \
pkl-ast.h pkl-ast.c \
@@ -52,8 +52,7 @@ libpoke_la_SOURCES = libpoke.h libpoke.c \
pvm-program.h pvm-program.c \
pvm.jitter \
ios.c ios.h ios-dev.h \
- ios-dev-file.c ios-dev-mem.c \
- pk-utils.h pk-utils.c
+ ios-dev-file.c ios-dev-mem.c
if NBD
libpoke_la_SOURCES += ios-dev-nbd.c
@@ -77,12 +76,13 @@ MOSTLYCLEANFILES += pkl-tab.output
AM_LFLAGS = -d
libpoke_la_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
+ -I$(top_builddir)/include -I$(top_srcdir)/include \
-DPKL_DEBUG \
-DPKGDATADIR=\"$(pkgdatadir)\" \
-DPKGINFODIR=\"$(infodir)\" \
-DLOCALEDIR=\"$(localedir)\"
libpoke_la_CFLAGS = -Wall $(BDW_GC_CFLAGS) $(LIBNBD_CFLAGS)
-libpoke_la_LIBADD = libpvmjitter.la \
+libpoke_la_LIBADD = libpokeutils.la libpvmjitter.la \
$(BDW_GC_LIBS) \
$(LIBNBD_LIBS)
libpoke_la_LDFLAGS =
@@ -104,4 +104,11 @@ BUILT_SOURCES += pvm-vm.h pvm-vm1.c pvm-vm2.c
pvm-vm.h pvm-vm1.c pvm-vm2.c: pvm.jitter
$(JITTER) $(srcdir)/pvm.jitter --output $(builddir)
+libpokeutils_la_SOURCES = pk-utils.c pk-utils.h pkt.h
+libpokeutils_la_CFLAGS = -Wall $(BDW_GC_CFLAGS) $(LIBNBD_CFLAGS)
+libpokeutils_la_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
+ -I$(top_builddir)/include -I$(top_srcdir)/include
+libpokeutils_la_LIBADD = ../gl/libgnu.la
+libpokeutils_la_LDFLAGS =
+
# End of Makefile.am
diff --git a/lib/libpoke.c b/lib/libpoke.c
index eb867594..d414053f 100644
--- a/lib/libpoke.c
+++ b/lib/libpoke.c
@@ -18,6 +18,7 @@
#include <config.h>
+#include <string.h>
#include <stdlib.h>
#include <assert.h>
@@ -34,8 +35,7 @@ struct pk_compiler
pvm vm;
};
-struct pk_term_if libpoke_term_if
-__attribute__ ((visibility ("hidden")));
+struct pk_term_if libpoke_term_if;
pk_compiler
pk_compiler_new (const char *rtpath,
diff --git a/src/Makefile.am b/src/Makefile.am
index 5bc512d4..a7e51cc0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,7 @@ if HSERVER
endif
poke_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
+ -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
-DJITTER_VERSION=\"$(JITTER_VERSION)\" \
-DPKGDATADIR=\"$(pkgdatadir)\" \
@@ -44,6 +45,7 @@ poke_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl \
poke_CFLAGS = -Wall
# XXX remove JITTER_LDADD
poke_LDADD = $(top_builddir)/gl/libgnu.la \
+ $(top_builddir)/lib/libpokeutils.la \
$(top_builddir)/lib/libpoke.la \
$(LTLIBREADLINE) \
$(JITTER_LDADD) \
diff --git a/src/pk-cmd.c b/src/pk-cmd.c
index ece9a982..bc3ac62a 100644
--- a/src/pk-cmd.c
+++ b/src/pk-cmd.c
@@ -36,6 +36,7 @@
#include "poke.h"
#include "pk-cmd.h"
#include "pk-term.h"
+#include "pk-utils.h"
/* Table of supported commands. */
diff --git a/src/pk-cmd.h b/src/pk-cmd.h
index d18b0432..fd95ba92 100644
--- a/src/pk-cmd.h
+++ b/src/pk-cmd.h
@@ -21,6 +21,7 @@
#include <config.h>
+#include <stddef.h>
#include "poke.h"
enum pk_cmd_arg_type
diff --git a/src/pk-editor.c b/src/pk-editor.c
index 2e466d0d..c8a966c1 100644
--- a/src/pk-editor.c
+++ b/src/pk-editor.c
@@ -29,6 +29,7 @@
#include "poke.h"
#include "pk-cmd.h"
#include "pk-term.h"
+#include "pk-utils.h"
static int
pk_cmd_editor (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
diff --git a/src/pk-info.c b/src/pk-info.c
index 53bc4bff..baf73359 100644
--- a/src/pk-info.c
+++ b/src/pk-info.c
@@ -18,6 +18,7 @@
#include <config.h>
#include "pk-cmd.h"
+#include "pk-utils.h"
extern struct pk_cmd null_cmd; /* pk-cmd.c */
extern struct pk_cmd info_ios_cmd; /* pk-ios.c */
diff --git a/src/pk-ios.c b/src/pk-ios.c
index 6254a804..5960df00 100644
--- a/src/pk-ios.c
+++ b/src/pk-ios.c
@@ -31,6 +31,7 @@
#include "poke.h"
#include "pk-cmd.h"
#include "pk-term.h"
+#include "pk-utils.h"
#if HAVE_HSERVER
# include "pk-hserver.h"
#endif
diff --git a/src/pk-misc.c b/src/pk-misc.c
index 3510511b..37c50552 100644
--- a/src/pk-misc.c
+++ b/src/pk-misc.c
@@ -28,6 +28,7 @@
#include "poke.h"
#include "pk-cmd.h"
#include "pk-term.h"
+#include "pk-utils.h"
static int
pk_cmd_exit (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
diff --git a/src/pk-set.c b/src/pk-set.c
index 83f615cd..d1ab0a47 100644
--- a/src/pk-set.c
+++ b/src/pk-set.c
@@ -28,6 +28,7 @@
#include "poke.h"
#include "pk-cmd.h"
#include "pk-term.h"
+#include "pk-utils.h"
static int
pk_cmd_set_obase (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
diff --git a/src/poke.c b/src/poke.c
index 55714865..27320fe8 100644
--- a/src/poke.c
+++ b/src/poke.c
@@ -37,6 +37,7 @@
#include "pk-cmd.h"
#include "pk-repl.h"
#include "pk-term.h"
+#include "pk-utils.h"
/* poke can be run either interactively (from a tty) or in batch mode.
The following predicate records this. */
diff --git a/src/poke.h b/src/poke.h
index 9811c372..ae8b8031 100644
--- a/src/poke.h
+++ b/src/poke.h
@@ -20,7 +20,7 @@
#define POKE_H
#include <config.h>
-#include "libpoke.h"
+#include <libpoke.h>
extern int poke_interactive_p;
extern int poke_quiet_p;
--
2.26.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Move pk-utils.h out of libpoke.h,
Tim Rühsen <=