OK I have it working. Complete patch here, assuming config.h.in is generated by your autotools.
--- libguile/posix.c-orig 2017-10-24 05:28:30.000000000 -0700 +++ libguile/posix.c 2017-10-24 05:28:51.000000000 -0700 @@ -1557,6 +1557,7 @@ } #undef FUNC_NAME +#ifdef ENABLE_TMPNAM #ifdef L_tmpnam SCM_DEFINE (scm_tmpnam, "tmpnam", 0, 0, 0, @@ -1580,6 +1581,7 @@ #undef FUNC_NAME #endif +#endif SCM_DEFINE (scm_tmpfile, "tmpfile", 0, 0, 0, (void), --- configure.ac-orig 2017-10-24 05:21:56.000000000 -0700 +++ configure.ac 2017-10-27 09:03:20.000000000 -0700 @@ -164,6 +164,10 @@ [ --disable-regex omit regular expression interfaces],, enable_regex=yes) +AC_ARG_ENABLE(tmpnam, + [ --enable-tmpnam enable POSIX tmpnam], + AC_DEFINE(ENABLE_TMPNAM,1,[enable POSIX tmpnam()]),) + AC_ARG_ENABLE([deprecated], AS_HELP_STRING([--disable-deprecated],[omit deprecated features]))