diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp
index 3bb1778d9d13e5912ceff5db5f0ba024a205e304..925da5674bfc5591faa941221c035a4aea8da1da 100644
--- a/indra/llimagej2coj/llimagej2coj.cpp
+++ b/indra/llimagej2coj/llimagej2coj.cpp
@@ -41,8 +41,12 @@ LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl()
 
 std::string LLImageJ2COJ::getEngineInfo() const
 {
+#ifdef OPENJPEG_VERSION
 	return std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ")
 		+ opj_version();
+#else
+	return std::string("OpenJPEG runtime: ") + opj_version();
+#endif
 }
 
 // Return string from message, eliminating final \n if present