summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2008-01-11 09:41:08 +0200
committerLauri Leukkunen <lle@rahina.org>2008-01-11 09:41:08 +0200
commita6d61ece5095ed053324abceb99671092701abd2 (patch)
treec1ee493d2d0a1b87205f1012f0f34a9c53fc6f8b
parentc602362bb73de9abf4d55edaf54d7be1f5c32294 (diff)
Make exported.h generated by gen-interface.pl to be a proper header file
Now it can be included by itself with no dependency to libsb2.h. Signed-off-by: Lauri Leukkunen <lle@rahina.org>
-rw-r--r--luaif/sb_log.c1
-rwxr-xr-xpreload/gen-interface.pl42
-rw-r--r--utils/sb2-show.c1
3 files changed, 40 insertions, 4 deletions
diff --git a/luaif/sb_log.c b/luaif/sb_log.c
index 64d28f2..ebfce57 100644
--- a/luaif/sb_log.c
+++ b/luaif/sb_log.c
@@ -21,7 +21,6 @@
#include <config.h>
#include <config_hardcoded.h>
-#include "libsb2.h"
#include "exported.h"
/* ===================== Internal state variables =====================
diff --git a/preload/gen-interface.pl b/preload/gen-interface.pl
index 5380c67..cc7a7c1 100755
--- a/preload/gen-interface.pl
+++ b/preload/gen-interface.pl
@@ -556,7 +556,45 @@ sub create_call_to_gate_fn {
# actual code generators:
my $wrappers_c_buffer = ""; # buffers contents of the generated ".c" file
-my $export_h_buffer = ""; # buffers contents of the generated ".h" file
+
+# buffers contents of the generated ".h" file
+my $export_h_buffer =
+"#ifndef __EXPORT_H
+#define __EXPORT_H
+
+#include <sys/utsname.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/times.h>
+#include <sys/user.h>
+#include <sys/mman.h>
+
+#include <assert.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <dirent.h>
+#include <string.h>
+#include <glob.h>
+#include <utime.h>
+#ifdef HAVE_FTS_H
+#include <fts.h>
+#endif
+#ifdef HAVE_FTW_H
+#include <ftw.h>
+#endif
+#ifdef HAVE_SHADOW_H
+#include <shadow.h>
+#endif
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+
+";
# Handle "WRAP" and "GATE" commands.
sub command_wrap_or_gate {
@@ -808,7 +846,7 @@ if(defined $wrappers_c_output_file) {
}
if(defined $export_h_output_file) {
write_output_file($export_h_output_file,
- $file_header_comment.$export_h_buffer);
+ $file_header_comment.$export_h_buffer."\n#endif\n");
}
if(defined $export_list_for_ld_output_file) {
my $export_list_for_ld = join("\n",sort(keys(%all_function_names)));
diff --git a/utils/sb2-show.c b/utils/sb2-show.c
index b32570d..78d8372 100644
--- a/utils/sb2-show.c
+++ b/utils/sb2-show.c
@@ -10,7 +10,6 @@
#include <config.h>
#include <config_hardcoded.h>
-#include "libsb2.h"
#include "exported.h"
static void usage_exit(const char *progname, const char *errmsg, int exitstatus)