%attr(-, root, root) %{_libdir}/libptlctl.a
%attr(-, root, root) %{_libdir}/liblustreapi.a
+%attr(-, root, root) %{_libdir}/liblustreapi.so
%attr(-, root, root) /usr/include/lustre
%attr(-, root, root) /usr/include/libcfs
#define MAX_OBD_NAME 128 /* If this changes, a NEW ioctl must be added */
-#define O_LOV_DELAY_CREATE 0100000000 /* hopefully this does not conflict */
+/* Hopefully O_LOV_DELAY_CREATE does not conflict with standard O_xxx flags.
+ * Previously it was defined as 0100000000 and conflicts with FMODE_NONOTIFY
+ * which was added since kernel 2.6.36, so we redefine it as 020000000.
+ * To be compatible with old version's statically linked binary, finally we
+ * define it as (020000000 | 0100000000).
+ * */
+#define O_LOV_DELAY_CREATE 0120000000
#define LL_FILE_IGNORE_LOCK 0x00000001
#define LL_FILE_GROUP_LOCKED 0x00000002
endif # UTILS
lib_LIBRARIES = liblustreapi.a libiam.a
+noinst_LIBRARIES = liblustreapitmp.a
lctl_SOURCES = lustre_lfsck.c obd.c lustre_cfg.c lctl.c obdctl.h
lctl_LDADD := $(LIBREADLINE) liblustreapi.a $(LIBPTLCTL) $(PTHREAD_LIBS)
L_IOCTL := $(top_builddir)/libcfs/libcfs/util/l_ioctl.c
L_KERNELCOMM := $(top_builddir)/libcfs/libcfs/kernel_user_comm.c
-liblustreapi_a_SOURCES = liblustreapi.c $(L_IOCTL) $(L_KERNELCOMM)
+liblustreapitmp_a_SOURCES = liblustreapi.c $(L_IOCTL) $(L_KERNELCOMM)
+
+# build static and shared lib lustreapi
+liblustreapi.a : liblustreapitmp.a
+ rm -f liblustreapi.a liblustreapi.so
+ gcc -shared -o liblustreapi.so `ar -t liblustreapitmp.a`
+ mv liblustreapitmp.a liblustreapi.a
+
+install-exec-hook: liblustreapi.so
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list=$< ; for p in $$list; do \
+ if test -f $$p; then \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$f"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$f; \
+ else :; fi; \
+ done
libiam_a_SOURCES = libiam.c