diff --git a/configure.ac b/configure.ac
index 8ff520fd42861b2b7267ed80973bd765a14fb13b..6afbd263cd92949481ac7af07277868d560ac423 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,8 +279,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