diff -uNr util-macros-1.19.1/xorg-macros.m4.in util-macros-1.19.1.mod/xorg-macros.m4.in
--- util-macros-1.19.1/xorg-macros.m4.in	2017-01-29 21:22:45.000000000 +0200
+++ util-macros-1.19.1.mod/xorg-macros.m4.in	2017-11-24 13:21:36.220629554 +0200
@@ -58,7 +58,7 @@
 AC_DEFUN([XORG_PROG_RAWCPP],[
 AC_REQUIRE([AC_PROG_CPP])
 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
-   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
+   [$PATH:@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/lib:/usr/bin:/usr/lib:/bin:/lib])
 
 # Check for flag to avoid builtin definitions - assumes unix is predefined,
 # which is not the best choice for supporting other OS'es, but covers most
@@ -917,7 +917,7 @@
        [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
          ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
    [AC_MSG_ERROR([could not find m4 that supports -I option])],
-   [$PATH:/usr/gnu/bin])])
+   [$PATH:@TERMUX_PREFIX@/bin:/usr/bin:/bin])])
 
 AC_SUBST([M4], [$ac_cv_path_M4])
 ]) # XORG_WITH_M4
