Index: root/config/Makefile.macosx64
===================================================================
--- root/config/Makefile.macosx64	(revision 46119)
+++ root/config/Makefile.macosx64	(working copy)
@@ -104,7 +104,7 @@
 endif
 endif
 ifeq ($(subst $(MACOSX_MINOR),,1234),1234)
-SOEXT         = so
+SOEXT         = dylib
 else
 SOEXT         = dylib
 endif
Index: root/cint/configure
===================================================================
--- root/cint/configure	(revision 46119)
+++ root/cint/configure	(working copy)
@@ -155,7 +155,7 @@
     AR="ar -r -cs "
     IMPLIBEXT=.dylib
 
-    MAKEIMPLIB="ln -sf @so@ @imp@"
+    MAKEIMPLIB="ln -sf `basename @so@` @imp@"
 
     EXPLLINK=1
 
Index: root/cint/ROOT/cintdlls.mk
===================================================================
--- root/cint/ROOT/cintdlls.mk	(revision 46119)
+++ root/cint/ROOT/cintdlls.mk	(working copy)
@@ -146,7 +146,7 @@
 else
   # On macosx one should change the install_name as well.
   # FIXME: not tested on 10.4, should be the same also there?
-  CINTDLLSOEXTCMD += ;install_name_tool -id `otool -D $@ | tail -1 | sed -e's|:$$||;s|[.]so$$|.dll|'` $@
+  CINTDLLSOEXTCMD += ;install_name_tool -id `otool -D $@ | tail -n 1 | sed -e's|:$$||;s|[.]so$$|.dll|'` $@
   CINTDLLSOEXTCMD += ;rm -f $(@:.dll=.so)
 endif
 endif # macosx
@@ -163,21 +163,21 @@
 $(ALLCINTDLLS): $(ORDER_) $(MAINLIBS)
 
 $(CINTDLLDIRSTL)/%.dll: $(CINTDLLDIRDLLSTL)/G__cpp_%.o
-	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(notdir $(@:.dll=.$(SOEXT))) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
+	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(@:.dll=.$(SOEXT)) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
 	$(CINTDLLSOEXTCMD)
 ifneq ($(subst win,,$(ARCH)),$(ARCH))
 	@rm -f $(@:.dll=.lib) $(@:.dll=.exp) # remove import libs
 endif
 
 $(CINTDLLDIRDLLS)/stdcxxfunc.dll: $(CINTDLLDIRL)/G__cpp_stdcxxfunc.o
-	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(notdir $(@:.dll=.$(SOEXT))) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
+	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(@:.dll=.$(SOEXT)) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
 	$(CINTDLLSOEXTCMD)
 ifneq ($(subst win,,$(ARCH)),$(ARCH))
 	@rm -f $(@:.dll=.lib) $(@:.dll=.exp) # remove import libs
 endif
 
 $(CINTDLLDIRDLLS)/%.dll: $(CINTDLLDIRL)/G__c_%.o
-	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(notdir $(@:.dll=.$(SOEXT))) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
+	@$(MAKELIB) $(PLATFORM) $(LD) "$(LDFLAGS)" "$(SOFLAGS)" $(@:.dll=.$(SOEXT)) $(@:.dll=.$(SOEXT)) "$(filter-out $(MAINLIBS),$^)" "$(CINTDLLLIBLINK)"
 	$(CINTDLLSOEXTCMD)
 
 core/metautils/src/stlLoader_%.cc: $(ROOT_SRCDIR)/core/metautils/src/stlLoader.cc
Index: root/build/unix/makelib.sh
===================================================================
--- root/build/unix/makelib.sh	(revision 46119)
+++ root/build/unix/makelib.sh	(working copy)
@@ -34,7 +34,7 @@
 if [ $PLATFORM = "macosx" ]; then
    macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
    if [ $macosx_minor -ge 5 ] && [ $LD != "icpc" ]; then
-      soext="so"
+      soext="dylib"
    else
       soext="dylib"
    fi
@@ -220,7 +220,7 @@
 	ln -fs $SONAME.$MAJOR        $LIB
     elif [ -f $LIBVERS ]; then
 	# Versioned library has format foo.3.05.so
-	source_file=`echo $SONAME | sed "s/.*\./&${MINOR}./"`
+	source_file=`basename $SONAME | sed "s/.*\./&${MINOR}./"`
 	LIBNOMAJORMINOR=`echo $LIB|sed 's,\.'$MAJOR'\.'$MINOR',,'`
 	if [ $LIB != $LIBNOMAJORMINOR ]; then
 	    LIBNOMINOR=`echo $LIB|sed 's,\.'$MINOR',,'`
Index: root/etc/Makefile.arch
===================================================================
--- root/etc/Makefile.arch	(revision 46119)
+++ root/etc/Makefile.arch	(working copy)
@@ -7,8 +7,9 @@
 # Author: Fons Rademakers, 29/2/2000
 
 RC           := root-config
-ifneq ($(shell which $(RC) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC))
-ifneq ($(ROOTSYS),)
+RCCOMMAND    := $(firstword $(RC))
+ifneq ($(shell which $(RCCOMMAND) 2>&1 | sed -ne "s@.*/$(RCCOMMAND)@$(RCCOMMAND)@p"),$(RCCOMMAND))
+ifneq ($(ROOTSYS)
 RC1          := $(ROOTSYS)/bin/root-config
 ifneq ($(shell which $(RC1) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC))
 $(error Please make sure $(RC1) can be found in path)
@@ -16,7 +17,7 @@
 RC           := $(RC1)
 endif
 else
-$(error Please make sure $(RC) can be found in path)
+$(error Please make sure $(RCCOMMAND) can be found in path)
 endif
 endif
 
Index: root/configure
===================================================================
--- root/configure	(revision 46119)
+++ root/configure	(working copy)
@@ -2452,12 +2452,6 @@
         result "See http://root.cern.ch/drupal/content/build-prerequisites"
         exit 1
     fi
-    if test "x$platform" = "xmacosx" &&
-       test ! "x$x11libdir" = "x$found_dir" ; then
-        result "`basename $0`: libXft not in same directory as libX11"
-        result "For consistency they should be in the same directory"
-        exit 1
-    fi
 
     check_library "libXext" "$enable_shared" "$xextlibdir" \
         ${finkdir:+$finkdir/lib} \
@@ -2470,12 +2464,6 @@
         result "See http://root.cern.ch/drupal/content/build-prerequisites"
         exit 1
     fi
-    if test "x$platform" = "xmacosx" &&
-       test ! "x$x11libdir" = "x$found_dir" ; then
-        result "`basename $0`: libXext not in same directory as libX11"
-        result "For consistency they should be in the same directory"
-        exit 1
-    fi
 else
     x11libdir=""
     xpmlibdir=""
@@ -3551,7 +3539,7 @@
 
     # At this time, libfftw3.a should always be prefered over .so,
     # to avoid forcing users to install fftw3.
-    check_library "libfftw3 libfftw3-3" "no" "$fftw3libdir" \
+    check_library "libfftw3 libfftw3-3" "yes" "$fftw3libdir" \
         $FFTW3 ${FFTW3:+$FFTW3/lib} ${FFTW3:+$FFTW3/.libs} \
         ${finkdir:+$finkdir/lib} \
         /usr/local/lib /usr/lib /opt/fftw3/lib
Index: root/proof/afdsmgrd/Module.mk
===================================================================
--- root/proof/afdsmgrd/Module.mk	(revision 46119)
+++ root/proof/afdsmgrd/Module.mk	(working copy)
@@ -8,7 +8,7 @@
 
 AFDSMGRDDIR  := $(MODDIR)
 AFDSMGRDBIN  := bin/afdsmgrd
-AFDSMGRDTAR  := $(shell cd $(AFDSMGRDDIR) && ls -1 afdsmgrd-v*.tar.gz | tail -1)
+AFDSMGRDTAR  := $(shell cd $(AFDSMGRDDIR) && ls -1 afdsmgrd-v*.tar.gz | tail -n 1)
 
 AFDSMGRDPREP   := $(AFDSMGRDDIR)/afdsmgrdPrepare
 AFDSMGRDINST   := $(AFDSMGRDDIR)/afdsmgrdInstall
