;;; Code:
 
+(eval-when-compile
+  (defun-maybe md5-string (a))
+  (defun-maybe dynamic-link (a))
+  (defun-maybe dynamic-call (a b)))
+
 (defvar md5-dl-module
   (if (and (fboundp 'md5-string)
           (subrp (symbol-function 'md5-string)))
       (md5-region (or beg (point-min)) (or end (point-max))))))
 
 (provide 'md5-dl)
-(provide 'md5)
 
 ;;; md5-dl.el ends here.
 
            (kill-buffer buffer)))
       (and buffer (buffer-name buffer) (kill-buffer buffer) nil))))
 
-(provide 'md5)
+(provide 'md5-el)
 
  ((and (fboundp 'dynamic-link)
        (file-exists-p (expand-file-name "md5.so" exec-directory)))
   ;; Emacs with DL patch.
-  (require 'md5 "md5-dl"))
+  (require 'md5-dl))
  (t
-  (require 'md5 "md5-el")))
+  (require 'md5-el)))
+
+(provide 'md5)
 
 ;;; md5.el ends here.
 
   (concat authorid "\0" authenid "\0" passphrase))
 
 ;;; SCRAM-MD5
-(eval-when-compile
-  (defvar sasl-scram-md5-client-security-info
+(defvar sasl-scram-md5-client-security-info
+  (eval-when-compile
     (scram-make-security-info nil t 0)))
 
 (defun sasl-scram-md5-make-salted-pass (server-msg-1 passphrase)
         client-proof)
       (fillarray client-proof 0))))
             
-(defun sasl-scram-md5-authenticate-server (server-msg-1 
+(defun sasl-scram-md5-authenticate-server (server-msg-1
                                           server-msg-2
                                           client-msg-1
                                           salted-pass)
 
 ;;; Code:
 
 (provide 'sha1-dl)                     ; beware of circular dependency.
-(eval-when-compile (require 'sha1))    ; sha1-dl-module.
+(eval-when-compile
+  (require 'sha1)                      ; sha1-dl-module.
+  (defun-maybe dynamic-link (a))
+  (defun-maybe dynamic-call (a b)))
 
 (defvar sha1-dl-handle
   (and (stringp sha1-dl-module)