roken: Fix out-of-tree libroken builds
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 1 Mar 2011 00:08:12 +0000 (00:08 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 2 Mar 2011 03:54:53 +0000 (19:54 -0800)
The libroken configuration script is supposed to support using a
libroken which is installed out of the OpenAFS tree, but which isn't
in the standard search paths, by using --with-roken=/path/to/base

This didn't previously work. Fix this so that it works correctly,
and also fix a few problems with libafshcrypto, which assumed that
LDFLAGS_roken would always be -L$(TOP_LIBDIR)

Change-Id: I1219692f601a621e6c08ae26516136ed0cc03845
Reviewed-on: http://gerrit.openafs.org/4096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/cf/roken.m4
src/config/Makefile.config.in
src/crypto/hcrypto/Makefile.in
src/libuafs/Makefile.common.in

index d174f56..245187e 100644 (file)
@@ -1677,7 +1677,9 @@ OPENAFS_HAVE_STRUCT_FIELD(DIR, dd_fd, [#include <sys/types.h>
 
 dnl Eventually, this will look for the system one, or for OpenSSL
 LIB_hcrypto="-lafshcrypto"
+LDFLAGS_hcrypto="-L\$(TOP_LIBDIR)"
 AC_SUBST(LIB_hcrypto)
+AC_SUBST(LDFLAGS_hcrypto)
 ])
 
 AC_DEFUN([SUMMARY], [
index 67f261f..662cf0e 100644 (file)
@@ -28,15 +28,16 @@ AC_DEFUN([_OPENAFS_ROKEN_CHECK], [
 
   dnl Need to be careful what we check for here, as libroken contains
   dnl different symbols on different platforms.
-  AC_CHECK_LIB([roken], [ct_memcmp], [found_foundlib=true])
-  AC_CHECK_HEADER([roken], [roken_foundheader=true])
+  AC_CHECK_LIB([roken], [ct_memcmp], [roken_foundlib=true])
+  AC_CHECK_HEADER([roken.h], [roken_foundheader=true])
   CPPFLAGS=$save_CPPFLAGS
   LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS
 
-  AS_IF([test x"$roken_foundlib" = xtrue && test x"roken_foundheader" = xtrue],
-       [AS_IF([test x"$roken_path" != x],
-              [CPPFLAGS_roken = "-I$roken_path/include"
-               LDFLAGS_roken="-I$roken_path/lib"
+  AS_IF([test x"$roken_foundlib" = xtrue && test x"$roken_foundheader" = xtrue],
+        [AS_IF([test x"$roken_path" != x],
+              [CPPFLAGS_roken="-I$roken_path/include"
+               LDFLAGS_roken="-L$roken_path/lib"
                LIB_roken="-lroken"])
         $2],
        [$3])
@@ -64,6 +65,7 @@ AC_DEFUN([OPENAFS_ROKEN], [
        [AS_IF([test x"$roken_root" = x],
            [_OPENAFS_ROKEN_CHECK([], [], [_OPENAFS_ROKEN_INTERNAL()])],
            [_OPENAFS_ROKEN_CHECK($roken_root,
+               [],
                [AC_MSG_ERROR([Cannot find roken at that location])])
            ])
        ])
index a3fbd67..3c6df7f 100644 (file)
@@ -51,6 +51,7 @@ KERN_DBG = @KERN_DBG@
 KERN_OPTMZ = @KERN_OPTMZ@
 LD = @LD@
 LDFLAGS_roken = @LDFLAGS_roken@
+LDFLAGS_hcrypto = @LDFLAGS_hcrypto@
 LEX = @LEX@
 LIB_AFSDB = @LIB_AFSDB@
 LIB_crypt = @LIB_crypt@
@@ -143,9 +144,9 @@ COMMON_INCL=$(MODULE_INCLUDE) -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \
            -I${srcdir} -I. 
 
 COMMON_CFLAGS=$(CFLAGS) ${DBG} ${OPTMZ} ${COMMON_INCL} ${INCLUDE_LIBINTL} \
-             $(CPPFLAGS_libroken)
+             $(CPPFLAGS_roken)
 
-COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_roken) $(DBG) $(OPTMZ)
+COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_hcrypto) $(LDFLAGS_roken) $(DBG) $(OPTMZ)
 
 # LWP Flags
 LWP_CFLAGS=$(COMMON_CFLAGS) $(MODULE_CFLAGS) $(XCFLAGS) $(ARCHFLAGS)
index 67e2c53..52a1c21 100644 (file)
@@ -73,7 +73,7 @@ ${TOP_LIBDIR}/${SHLIBOBJ}: ${SHLIBOBJ}
 ${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
        ${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
                -M ${LIBMAJOR} -m ${LIBMINOR} -- \
-               ${OBJECTS} -L$(TOP_LIBDIR) -lrokenafs ${MT_LIBS}
+               ${OBJECTS} $(LDFLAGS_roken) $(LIB_roken) ${MT_LIBS}
 
 libafshcrypto.a: ${OBJECTS}
        $(RM) -f $@
index ef06baa..9f7dbb3 100644 (file)
@@ -93,9 +93,9 @@ linktest: UAFS/$(LIBUAFS)
                ${TOP_LIBDIR}/libafsutil.a \
                $(LIB_hcrypto) $(LIB_roken) $(LIB_crypt) $(TEST_LIBS) $(XLIBS)
 
-CRULE1=        $(CC) $(COMMON_INCLUDE) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
-CRULE2=        $(CC) $(COMMON_INCLUDE) $(OPTF) $(WEBOPTS) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
-CRULEPIC=$(CC) $(COMMON_INCLUDE) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) $(SHLIB_CFLAGS) -c $?
+CRULE1=        $(CC) $(COMMON_INCLUDE) $(CPPFLAGS_roken) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
+CRULE2=        $(CC) $(COMMON_INCLUDE) $(CPPFLAGS_roken) $(OPTF) $(WEBOPTS) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) -c $?
+CRULEPIC=$(CC) $(COMMON_INCLUDE) $(CPPFLAGS_roken) $(OPTF) -DKERNEL $(LIBJUAFS_FLAGS) $(CFLAGS) $(SHLIB_CFLAGS) -c $?
 
 UAFSOBJ = \
        $(UOBJ)/afs_atomlist.o \