summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
Diffstat (limited to 'booster')
-rw-r--r--booster/src/Makefile.am25
-rw-r--r--booster/src/booster.c7
2 files changed, 20 insertions, 12 deletions
diff --git a/booster/src/Makefile.am b/booster/src/Makefile.am
index a5158591226..6402c8d7977 100644
--- a/booster/src/Makefile.am
+++ b/booster/src/Makefile.am
@@ -1,18 +1,21 @@
-xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/performance
-
-ldpreload_PROGRAMS = glusterfs-booster.so
+ldpreload_LTLIBRARIES = libglusterfs-booster.la
ldpreloaddir = $(libdir)/glusterfs/
noinst_HEADERS = booster_fstab.h booster-fd.h
-glusterfs_booster_so_SOURCES = booster.c booster_stat.c booster_fstab.c booster-fd.c
-glusterfs_booster_so_CFLAGS = -I$(top_srcdir)/libglusterfsclient/src/ -D_GNU_SOURCE -D$(GF_HOST_OS) -fPIC -Wall \
- -pthread $(GF_BOOSTER_CFLAGS)
-glusterfs_booster_so_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
+libglusterfs_booster_la_SOURCES = booster.c booster_stat.c booster_fstab.c booster-fd.c
+libglusterfs_booster_la_CFLAGS = -I$(top_srcdir)/libglusterfsclient/src/ -D_GNU_SOURCE -D$(GF_HOST_OS) -fPIC -Wall \
+ -pthread $(GF_BOOSTER_CFLAGS) -shared -nostartfiles
+libglusterfs_booster_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-I$(top_srcdir)/libglusterfsclient/src \
-I$(top_srcdir)/libglusterfs/src -DDATADIR=\"$(localstatedir)\" \
-DCONFDIR=\"$(sysconfdir)/glusterfs\"
-glusterfs_booster_so_LDFLAGS = -shared -nostartfiles
-glusterfs_booster_so_LDADD = -L$(top_builddir)/libglusterfs/src -lglusterfs \
- -L$(top_builddir)/libglusterfsclient/src -lglusterfsclient
-CLEANFILES =
+libglusterfs_booster_la_LDFLAGS = -module -avoidversion
+libglusterfs_booster_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(top_builddir)/libglusterfsclient/src/libglusterfsclient.la
+
+CLEANFILES =
+
+uninstall-local:
+ rm -f $(DESTDIR)$(ldpreloaddir)/glusterfs-booster.so
+install-data-hook:
+ ln -sf libglusterfs-booster.so $(DESTDIR)$(ldpreloaddir)/glusterfs-booster.so
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 26cf6b6113f..0ed914b1f0d 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -49,6 +49,11 @@
#define GF_UNIT_KB 1024
#endif
+/* attr constructor registers this function with libc's
+ * _init function as a function that must be called before
+ * the main() of the program.
+ */
+static void booster_lib_init (void) __attribute__((constructor));
extern fd_t *
fd_ref (fd_t *fd);
@@ -2194,7 +2199,7 @@ out:
}
void
-_init (void)
+booster_lib_init (void)
{
RESOLVE (open);