File: ax_gcc_install_dir.m4

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (29 lines) | stat: -rw-r--r-- 945 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
dnl @synopsis AX_GCC_INSTALL_DIR (VARIABLE)
dnl
dnl AX_GCC_INSTALL_DIR (VARIABLE) defines VARIABLE as the gcc install
dnl directory. The install directory will be obtained using the gcc
dnl -print-search-dirs option. This macro requires AX_GCC_OPTION macro.
dnl
dnl @category InstalledPackages
dnl @category C
dnl @author Francesco Salvestrini <salvestrini@users.sourceforge.net>
dnl @version 2005-01-22
dnl @license GPLWithACException

AC_DEFUN([AX_GCC_INSTALL_DIR], [
AC_REQUIRE([AC_PROG_CC])
if test "x$GCC" = "xyes"; then
	AX_GCC_OPTION(GCC_ALL_DIRECTORIES,[-print-search-dirs],[yes],[no])
	if test x"$GCC_ALL_DIRECTORIES" = x"yes"; then
		AC_MSG_CHECKING([gcc install directory])
		ax_gcc_install_dir=`$CC -print-search-dirs | grep install | sed -e "s/^install://" | sed -e "s/\/$//"`
		AC_MSG_RESULT([$ax_gcc_install_dir])
		$1=$ax_gcc_install_dir
	else
		unset $1
	fi
else
        AC_MSG_RESULT([sorry, no gcc available])
	unset $1
fi
])