I've done a bit of patching to the 2.7.0 build system and am hoping that
some of the ideas expressed might be useful or even good enough to be
included in the source.

I apologize that the first one lumps so much together, but it was either that
or submitting patches that depended on each other.  Hopefully I chose the
least annoying method.

2.7.0-ac_vars-threaded_libs-so_name.patch:
    - Fixes the use of variables inherited from autotools so that DESTDIR
      behaves in the normal fashion.  Also allows the user to define a few
      more paths and grabs some other nice path-related variables from
      autotools.
    - Adds version, minor and revision numbers to shared libraries.
    - Enables the building of threaded libraries with --enable-threaded-libs.
    - Allows the building of just the kernel module, without the dependency
      on kernapps.


2.7.0-configure-static-server.patch:
    - Fixes the use of AC_ARG_ENABLE so that --disable-static-server actually
      does disable the static server and build the shared one by default.

2.7.0-as-needed.patch:
    - Just fixes a couple of places where using -Wl,--as-needed will break
      the build.

2.7.0-Wno-strict-aliasing-2-.patch
    - This one is strange and I'm not sure about it, but there were reports
      that this flag was actually causing warnings to be printed, instead of
      ignoring them, hence breaking builds.  See:
      http://bugs.gentoo.org/show_bug.cgi?id=210923


Thanks for your time,

-- 
Justin Bronder
diff -urN pvfs-2.7.0/configure.in pvfs-2.7.0_patched/configure.in
--- pvfs-2.7.0/configure.in     2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/configure.in     2008-03-11 22:14:49.000000000 -0400
@@ -210,6 +210,12 @@
 [build_static=$enableval], [build_static=yes])
 AC_SUBST(build_static)
 
+dnl build the threaded libraries?
+AC_ARG_ENABLE(threaded-libs,
+[  --enable-threaded-libs        Build threaded libraries],
+[build_threaded=$enableval], [build_threaded=no])
+AC_SUBST(build_threaded)
+
 dnl NOTE: removing the linux-gnu host check for now; we may want to put it back
 dnl before releaseing any code, though...  -Phil
 dnl 
diff -urN pvfs-2.7.0/Makefile.in pvfs-2.7.0_patched/Makefile.in
--- pvfs-2.7.0/Makefile.in      2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/Makefile.in      2008-03-11 22:22:50.000000000 -0400
@@ -50,12 +50,15 @@
 # Generic makefile setup 
 
 # define a few generic variables that we need to use
-DESTDIR =
 srcdir = @srcdir@
-prefix = $(DESTDIR)@prefix@
-datarootdir = $(DESTDIR)@datarootdir@
-mandir = $(DESTDIR)@mandir@
-exec_prefix = $(DESTDIR)@exec_prefix@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+includedir = $(DESTDIR)/@includedir@
+mandir = $(DESTDIR)/@mandir@
+sbindir = $(DESTDIR)/@sbindir@
+bindir = $(DESTDIR)/@bindir@
+libdir = $(DESTDIR)/@libdir@
 
 VPATH = $(srcdir)
 SHELL = @SHELL@
@@ -63,6 +66,7 @@
 # TODO: should probably check for bison and flex in configure
 BISON = bison
 FLEX = flex
+LN_S = ln -s
 BUILD_BMI_TCP = @BUILD_BMI_TCP@
 BUILD_GM = @BUILD_GM@
 BUILD_MX = @BUILD_MX@
@@ -100,6 +104,7 @@
 # build which client libs
 build_shared = @build_shared@
 build_static = @build_static@
+build_threaded = @build_threaded@
 
 # Eliminate all default suffixes.  We want explicit control.
 .SUFFIXES:
@@ -162,6 +167,10 @@
 REDHAT_RELEASE = @REDHAT_RELEASE@
 NPTL_WORKAROUND = @NPTL_WORKAROUND@
 STRICT_CFLAGS = @STRICT_CFLAGS@
+SO_VER = 2
+SO_MINOR = 0
+SO_RELEASE = 0
+
 # for Solaris:
 # LIBS += -lsocket -lnsl
 
@@ -434,16 +443,24 @@
 # LIBRARIES is a list of the pvfs2 client libraries
 LIBRARIES :=
 LIBRARIES_THREADED :=
+
 ifeq ($(build_shared),yes)
-LIBRARIES_SHARED = lib/libpvfs2.so
+LIBRARIES_SHARED = lib/libpvfs2.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE)
 LIBRARIES += $(LIBRARIES_SHARED)
+ifeq ($(build_threaded),yes)
+LIBRARIES_THREADED_SHARED = 
lib/libpvfs2-threaded.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE)
+LIBRARIES_THREADED += $(LIBRARIES_THREADED_SHARED)
 endif
+endif
+
 ifeq ($(build_static),yes)
 LIBRARIES_STATIC = lib/libpvfs2.a
 LIBRARIES += $(LIBRARIES_STATIC)
+ifeq ($(build_threaded),yes)
 LIBRARIES_THREADED_STATIC = lib/libpvfs2-threaded.a
 LIBRARIES_THREADED += $(LIBRARIES_THREADED_STATIC)
 endif
+endif
 
 ################################################################
 # Default target forward pointer, to avoid other targets in make stubs
@@ -627,16 +644,16 @@
        $(E)ar rcs $@ $(LIBTHREADEDOBJS)
 
 # rule for building the pvfs2 library
-lib/libpvfs2.so: $(LIBPICOBJS)
+lib/libpvfs2.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE): $(LIBPICOBJS)
        $(Q) "  LDSO            $@"
        $(E)$(INSTALL) -d lib
-       $(E)$(LDSHARED) -o $@ $(LIBPICOBJS)
+       $(E)$(LDSHARED) -Wl,-soname,libpvfs2.so -o $@ $(LIBPICOBJS)
 
 # rule for building the pvfs2 _multithreaded_ library
-lib/libpvfs2-threaded.so: $(LIBTHREADEDPICOBJS)
+lib/libpvfs2-threaded.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE): 
$(LIBTHREADEDPICOBJS)
        $(Q) "  LDSO            $@"
        $(E)$(INSTALL) -d lib
-       $(E)$(LDSHARED) -o $@ $(LIBTHREADEDPICOBJS)
+       $(E)$(LDSHARED) -Wl,-soname,libpvfs2-threaded.so -o $@ 
$(LIBTHREADEDPICOBJS) 
 
 # rule for building the pvfs2 server library
 lib/libpvfs2-server.a: $(SERVEROBJS)
@@ -713,7 +730,7 @@
 
 # all applications depend on the pvfs2 library
 $(ADMINTOOLS): %: %.o $(LIBRARIES)
-$(ADMINTOOLS_SERVER): %: %.o $(LIBRARIES) lib/libpvfs2-server.a
+$(ADMINTOOLS_SERVER): %: %.o $(LIBRARIES)
 $(KERNAPPS): %: %.o $(LIBRARIES)
 $(KERNAPPSTHR): %: %.o $(LIBRARIES_THREADED)
 
@@ -769,7 +786,7 @@
        $(E)rm -f $(LIBOBJS) $(LIBTHREADEDOBJS) $(SERVEROBJS) $(MISCOBJS) \
                $(LIBRARIES) $(LIBRARIES_THREADED) $(DEPENDS) $(SERVER) \
                $(ADMINOBJS) $(ADMINOBJS_SERVER) $(ADMINTOOLS)\
-               $(ADMINTOOLS_SERVER) lib/libpvfs2-server.a\
+               $(ADMINTOOLS_SERVER) \
                $(KERNAPPOBJS) $(KERNAPPS) $(KERNAPPSTHR) \
                $(VISS) $(VISMISCOBJS) $(VISOBJS) $(VISDEPENDS)\
                $(VISMISCDEPENDS) $(KARMAOBJS) $(LIBPICOBJS) \
@@ -883,43 +900,54 @@
        install -m 644 $(srcdir)/doc/man/*.5 $(mandir)/man5
 
 install:: all install_doc
-       install -d $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-request.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-debug.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-sysint.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-mgmt.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-types.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-util.h $(prefix)/include
-       install -m 644 $(srcdir)/include/pvfs2-encode-stubs.h $(prefix)/include
-
-       install -d $(prefix)/lib
-       install -m 755 $(LIBRARIES) $(prefix)/lib
+       install -d $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-request.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-debug.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-sysint.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-mgmt.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-types.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-util.h $(includedir)
+       install -m 644 $(srcdir)/include/pvfs2-encode-stubs.h $(includedir)
+
+       install -d $(libdir)
+       install -m 755 $(LIBRARIES) $(libdir)
+ifdef LIBRARIES_THREADED
+       install -m 755 $(LIBRARIES_THREADED) $(libdir)
+endif
+ifdef LIBRARIES_SHARED
+       $(LN_S) libpvfs2.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE) 
$(libdir)/libpvfs2.so.$(SO_VER)
+       $(LN_S) libpvfs2.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE) 
$(libdir)/libpvfs2.so
+endif
+ifdef LIBRARIES_THREADED_SHARED
+       $(LN_S) libpvfs2-threaded.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE) 
$(libdir)/libpvfs2-threaded.so.$(SO_VER)
+       $(LN_S) libpvfs2-threaded.so.$(SO_VER).$(SO_MINOR).$(SO_RELEASE) 
$(libdir)/libpvfs2-threaded.so
+endif
 
 ifdef TARGET_OS_DARWIN
 #       TOC needs to be regenerated in libs after they get moved
        ranlib $(patsubst %,$(prefix)/%,$(LIBRARIES))
 endif
 
-       install -d $(prefix)/bin
-       install -m 755 $(ADMINTOOLS) $(prefix)/bin
-       install -m 755 src/apps/admin/pvfs2-config $(prefix)/bin
+       install -d $(bindir)
+       install -m 755 $(ADMINTOOLS) $(bindir)
+       install -m 755 src/apps/admin/pvfs2-config $(bindir)
        @# if we ever auto-generate genconfig, remove the $(srcdir)
-       install -m 755 $(srcdir)/src/apps/admin/pvfs2-genconfig $(prefix)/bin
-       install -m 755 $(srcdir)/src/apps/admin/pvfs2-config-convert 
$(prefix)/bin
+       install -m 755 $(srcdir)/src/apps/admin/pvfs2-genconfig $(bindir)
+       install -m 755 $(srcdir)/src/apps/admin/pvfs2-config-convert $(bindir)
 ifdef BUILD_KARMA
-       install -m 755 $(KARMA) $(prefix)/bin
+       install -m 755 $(KARMA) $(bindir)
 endif
 
-       install -d $(prefix)/sbin
+       install -d $(sbindir)
 
 ifdef BUILD_SERVER
-       install -m 755 $(ADMINTOOLS_SERVER) $(prefix)/bin
+       install -m 755 $(ADMINTOOLS_SERVER) $(bindir)
     ifeq ($(NPTL_WORKAROUND),)
-       install -m 755 $(SERVER) $(prefix)/sbin
+       install -m 755 $(SERVER) $(sbindir)
     else
-       install -m 755 $(srcdir)/$(SERVER_STUB) $(prefix)/sbin/pvfs2-server
-       install -m 755 $(SERVER) $(prefix)/sbin/pvfs2-server.bin
+       install -m 755 $(srcdir)/$(SERVER_STUB) $(sbindir)/pvfs2-server
+       install -m 755 $(SERVER) $(sbindir)/pvfs2-server.bin
     endif
 endif
 
@@ -939,9 +967,12 @@
        install -m 755 src/kernel/linux-2.6/pvfs2.ko $(KMOD_DIR)
 
 .PHONY: kmod_install
-kmod_install: kmod kernapps just_kmod_install
-       install -d $(prefix)/sbin
-       install -m 755 $(KERNAPPS) $(prefix)/sbin
+kmod_install: kmod kernapps_install just_kmod_install
+
+.PHONY: kernapps_install
+kernapps_install: kernapps
+       install -d $(sbindir)
+       install -m 755 $(KERNAPPS) $(sbindir)
 endif
 
 ifneq (,$(LINUX24_KERNEL_SRC))
@@ -960,12 +991,15 @@
        install -m 755 src/kernel/linux-2.4/pvfs2.o $(KMOD_DIR)
 
 .PHONY: kmod24_install
-kmod24_install: kmod24 kernapps just_kmod24_install
-       install -d $(prefix)/sbin
-       install -m 755 $(KERNAPPS) $(prefix)/sbin
-       install -m 755 src/apps/kernel/linux/mount.pvfs2 $(prefix)/sbin
+kmod24_install: kmod24 kernapps_install just_kmod24_install
+
+.PHONY: kernapps_install
+kernapps_install: kernapps
+       install -d $(sbindir)
+       install -m 755 $(KERNAPPS) $(sbindir)
+       install -m 755 src/apps/kernel/linux/mount.pvfs2 $(sbindir)
        @echo ""
        @echo "For improved linux-2.4 support,"
-       @echo "install $(prefix)/sbin/mount.pvfs2 to /sbin/mount.pvfs2"
+       @echo "install $(sbindir)/mount.pvfs2 to /sbin/mount.pvfs2"
        @echo ""
 endif
diff -urN pvfs-2.7.0/maint/config/openssl.m4 
pvfs-2.7.0_patched/maint/config/openssl.m4
--- pvfs-2.7.0/maint/config/openssl.m4  2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/maint/config/openssl.m4  2008-03-11 22:36:27.000000000 
-0400
@@ -12,7 +12,7 @@
             LDFLAGS="$LDFLAGS -L${opensslpath}/lib64 -L${opensslpath}/lib"
             SERVER_LDFLAGS="$SERVER_LDFLAGS -L${opensslpath}/lib64 
-L${opensslpath}/lib"
         fi
-        LIBS="$LIBS -lcrypt -lssl"
+        LIBS="$LIBS -lcrypt -lcrypto -lssl"
     
         AC_COMPILE_IFELSE(
            [#include "openssl/bio.h"],
@@ -36,7 +36,7 @@
 [
     AC_MSG_CHECKING([for openssl library])
     TMPLIBS=${LIBS}
-    LIBS="$LIBS -lcrypt -lssl"
+    LIBS="$LIBS -lcrypt -lcrypto -lssl"
 
     AC_COMPILE_IFELSE(
       [#include "openssl/bio.h"],
diff -urN pvfs-2.7.0/maint/config/rt.m4 pvfs-2.7.0_patched/maint/config/rt.m4
--- pvfs-2.7.0/maint/config/rt.m4       2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/maint/config/rt.m4       2008-03-11 22:36:28.000000000 
-0400
@@ -12,7 +12,7 @@
        [lio_listio(LIO_NOWAIT, NULL, 0, NULL);],
        [AC_MSG_RESULT(no)],
        [
-               LDFLAGS="$LDFLAGS -lrt"
+               LIBS="$LIBS -lrt"
                AC_TRY_LINK(
                        [#include <stdlib.h>
                         #include <unistd.h>
--- pvfs-2.7.0/configure.in     2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/configure.in     2008-03-09 20:56:55.000000000 -0400
@@ -933,12 +933,14 @@
 
 AC_ARG_ENABLE(static-server,
 [  --enable-static-server  Builds the server static],
-[
+[ staticserver=$enableval ],
+[ staticserver="no" ] )
+
+if test "$staticserver" = "yes"; then
        SERVER_LDFLAGS="$LDFLAGS -static"
-],
-[
+else
        SERVER_LDFLAGS="$LDFLAGS -rdynamic"
-])
+fi
 
 AC_SUBST(SERVER_LDFLAGS)
 
diff -urN pvfs-2.7.0/maint/config/kernel.m4 
pvfs-2.7.0_patched/maint/config/kernel.m4
--- pvfs-2.7.0/maint/config/kernel.m4   2007-11-13 17:41:52.000000000 -0500
+++ pvfs-2.7.0_patched/maint/config/kernel.m4   2008-03-11 22:40:08.000000000 
-0400
@@ -402,7 +402,7 @@
                gcc_version=`$CC --version| head -1 | tr . ' ' | cut -d ' ' -f 
3`
                AC_MSG_RESULT($gcc_version)
                if test $gcc_version -gt 3 ; then
-                       extra_gcc_flags="-Wno-pointer-sign  
-Wno-strict-aliasing -Wno-strict-aliasing=2"
+                       extra_gcc_flags="-Wno-pointer-sign  
-Wno-strict-aliasing "
                fi
        fi
                

Attachment: pgpOHhvzI9YFm.pgp
Description: PGP signature

_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to