-[AC_DEFINE_UNQUOTED(DICTIONARY, "$withval")],
-[AC_DEFINE(DICTIONARY, "/usr/dict/words")])
-AC_OUTPUT(Makefile)
+[DICTIONARY=$withval],
+[DICTIONARY="/usr/dict/words"])
+AC_DEFINE_UNQUOTED([DICTIONARY], ["$DICTIONARY"])
+AC_SUBST([DICTIONARY])
+mdw_DEFINE_PATHS([
+ ANAG=mdw_PATH([${bindir}])/mdw_PROG([anag])
+])
+AC_SUBST([ANAG])
+AC_OUTPUT(Makefile anag-gui)