MAKE = @MAKE@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
-MKDEP_OPTIONS = -fdepend
+MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = $(TOP)/bin/minstall
# Python and flags (generally only needed by the developers)
AC_PATH_PROG(MKDEP, makedepend)
AC_PATH_PROG(SED, sed)
+dnl Ask gcc where it's keeping its secret headers
+if test "x$GCC" = xyes; then
+ GCC_PATH=$(gcc -print-search-dirs | sed -ne 's/install: //p')
+ MKDEP_OPTIONS="-fdepend -I${GCC_PATH}include"
+else
+ MKDEP_OPTIONS=-fdepend
+fi
+AC_SUBST(MKDEP_OPTIONS)
+
dnl Make sure the pkg-config macros are defined
m4_ifdef([PKG_PROG_PKG_CONFIG],,[
AC_MSG_ERROR([The pkg-config autoconf macros are not defined.
depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
- $(ASM_SOURCES) 2>&1 /dev/null
+ $(ASM_SOURCES)
# Emacs tags
$(INSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
-include depend
+-include depend