diff -up xpdf-4.00/xpdf/CMakeLists.txt.paperfix xpdf-4.00/xpdf/CMakeLists.txt
--- xpdf-4.00/xpdf/CMakeLists.txt.paperfix	2017-08-08 19:22:50.000000000 -0400
+++ xpdf-4.00/xpdf/CMakeLists.txt	2017-08-16 19:40:19.103263736 -0400
@@ -108,7 +108,7 @@ if (HAVE_SPLASH)
   target_link_libraries(pdftops goo fofi splash
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
-                        ${LCMS_LIBRARY})
+                        ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 else ()
   add_executable(pdftops
     $<TARGET_OBJECTS:xpdf_objs>
@@ -116,7 +116,7 @@ else ()
     PSOutputDev.cc
     pdftops.cc
   )
-  target_link_libraries(pdftops goo fofi ${LCMS_LIBRARY})
+  target_link_libraries(pdftops goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 endif ()
 install(TARGETS pdftops RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftops.1 DESTINATION man/man1)
@@ -128,7 +128,7 @@ add_executable(pdftotext
   TextOutputDev.cc
   pdftotext.cc
 )
-target_link_libraries(pdftotext goo fofi ${LCMS_LIBRARY})
+target_link_libraries(pdftotext goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 install(TARGETS pdftotext RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftotext.1 DESTINATION man/man1)
 
@@ -145,7 +145,7 @@ if (HAVE_SPLASH AND PNG_FOUND)
   target_link_libraries(pdftohtml goo fofi splash
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
-                        ${LCMS_LIBRARY} ${PNG_LIBRARIES})
+                        ${LCMS_LIBRARY} ${PNG_LIBRARIES} ${HAVE_PAPER_H})
   install(TARGETS pdftohtml RUNTIME DESTINATION bin)
   install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftohtml.1 DESTINATION man/man1)
 endif ()
@@ -156,7 +156,7 @@ add_executable(pdfinfo
   $<TARGET_OBJECTS:xpdf_objs>
   pdfinfo.cc
 )
-target_link_libraries(pdfinfo goo fofi ${LCMS_LIBRARY})
+target_link_libraries(pdfinfo goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 install(TARGETS pdfinfo RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfinfo.1 DESTINATION man/man1)
 
@@ -166,7 +166,7 @@ add_executable(pdffonts
   $<TARGET_OBJECTS:xpdf_objs>
   pdffonts.cc
 )
-target_link_libraries(pdffonts goo fofi ${LCMS_LIBRARY})
+target_link_libraries(pdffonts goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 install(TARGETS pdffonts RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdffonts.1 DESTINATION man/man1)
 
@@ -176,7 +176,7 @@ add_executable(pdfdetach
   $<TARGET_OBJECTS:xpdf_objs>
   pdfdetach.cc
 )
-target_link_libraries(pdfdetach goo fofi ${LCMS_LIBRARY})
+target_link_libraries(pdfdetach goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 install(TARGETS pdfdetach RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfdetach.1 DESTINATION man/man1)
 
@@ -191,7 +191,7 @@ if (HAVE_SPLASH)
   target_link_libraries(pdftoppm goo fofi splash
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
-                        ${LCMS_LIBRARY})
+                        ${LCMS_LIBRARY} ${HAVE_PAPER_H})
   install(TARGETS pdftoppm RUNTIME DESTINATION bin)
   install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftoppm.1 DESTINATION man/man1)
 endif ()
@@ -207,7 +207,7 @@ if (HAVE_SPLASH AND PNG_FOUND)
   target_link_libraries(pdftopng goo fofi splash
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
-                        ${LCMS_LIBRARY} ${PNG_LIBRARIES})
+                        ${LCMS_LIBRARY} ${PNG_LIBRARIES} ${HAVE_PAPER_H})
   install(TARGETS pdftopng RUNTIME DESTINATION bin)
   install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftopng.1 DESTINATION man/man1)
 endif ()
@@ -219,7 +219,7 @@ add_executable(pdfimages
   ImageOutputDev.cc
   pdfimages.cc
 )
-target_link_libraries(pdfimages goo fofi ${LCMS_LIBRARY})
+target_link_libraries(pdfimages goo fofi ${LCMS_LIBRARY} ${HAVE_PAPER_H})
 install(TARGETS pdfimages RUNTIME DESTINATION bin)
 install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfimages.1 DESTINATION man/man1)
 
diff -up xpdf-4.00/xpdf-qt/CMakeLists.txt.paperfix xpdf-4.00/xpdf-qt/CMakeLists.txt
--- xpdf-4.00/xpdf-qt/CMakeLists.txt.paperfix	2017-08-16 19:39:23.275757290 -0400
+++ xpdf-4.00/xpdf-qt/CMakeLists.txt	2017-08-16 19:39:47.810100923 -0400
@@ -83,7 +83,7 @@ if ((QT4_FOUND OR Qt5Widgets_FOUND)
   target_link_libraries(xpdf ${QT_LIBRARIES} ${EXTRA_QT_LIBRARIES}
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY} ${LCMS_LIBRARY}
-                        ${CMAKE_THREAD_LIBS_INIT})
+                        ${CMAKE_THREAD_LIBS_INIT} ${HAVE_PAPER_H})
   set_property(TARGET xpdf PROPERTY WIN32_EXECUTABLE 1)
 
   install(TARGETS xpdf RUNTIME DESTINATION bin)
