Implement fix-man-links.sh in cmake.
diff --git a/man/update-html.cmake b/man/update-html.cmake
index 977e431..9e405b2 100644
--- a/man/update-html.cmake
+++ b/man/update-html.cmake
@@ -1,7 +1,11 @@
# expect variables IN, OUT, and DIR
-EXECUTE_PROCESS(COMMAND mandoc -T html -Oman="%N.html",style=../nih-man.css ${DIR}/${IN}
- COMMAND ${DIR}/fix-man-links.sh
- OUTPUT_FILE ${DIR}/${OUT}.new)
+EXECUTE_PROCESS(COMMAND mandoc -T html -Oman=%N.html,style=../nih-man.css ${DIR}/${IN}
+ OUTPUT_VARIABLE HTML)
+SET(LINKBASE "http://pubs.opengroup.org/onlinepubs/9699919799/functions/")
+STRING(REGEX REPLACE "(<a class=\"Xr\" href=\")([^\"]*)(\">)" "\\1${LINKBASE}\\2\\3" HTML "${HTML}")
+STRING(REGEX REPLACE "${LINKBASE}(libzip|zip)" "\\1" HTML "${HTML}")
+FILE(WRITE ${DIR}/${OUT}.new "${HTML}")
CONFIGURE_FILE(${DIR}/${OUT}.new ${DIR}/${OUT} COPYONLY)
FILE(REMOVE ${DIR}/${OUT}.new)
+