diff --git a/configure.ac b/configure.ac
index cbdbf5469bee0b3dec966e8c15955929d2445bec..f1d69e1eb33066b53322217816c5bb5b82e5cf7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,8 +290,9 @@ AC_MSG_RESULT($rtc_ok)
 AC_PATH_PROG([GIT_CMD], [git])
 AC_SUBST([GIT_CMD])
 
-# Make the documentation.
+# Make the documentation. Add conditional to handle disable option.
 DX_INIT_DOXYGEN(libswift,doc/Doxyfile,doc/)
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$ac_cv_path_ac_pt_DX_DOXYGEN" != ""])
 
 # Handle .in files.
 AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile doc/Makefile doc/Doxyfile])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index cb645898f57ba8c29d96870ba5eeca6cc73228d9..1736a4ad81a674e68932a45e2f8bea8ef82305f3 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,9 @@
+
 doxyfile.stamp: 
+if HAVE_DOXYGEN
 	@DX_ENV@ @DX_DOXYGEN@ Doxyfile
 	echo `date` > doxyfile.stamp
+endif
 
 CLEANFILES = doxyfile.stamp