| 1 |
# Copyright 2007-2009 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# Author: Michael Haubenwallner <haubi@gentoo.org>
|
| 4 |
|
| 5 |
AC_INIT(toolchain-prefix-wrapper,0.3.svnversion)
|
| 6 |
AC_CONFIG_AUX_DIR([build-aux])
|
| 7 |
AC_PROG_INSTALL
|
| 8 |
AC_CONFIG_SRCDIR(ld/ldwrapper.c)
|
| 9 |
AC_PREREQ(2.52)
|
| 10 |
AC_CANONICAL_HOST
|
| 11 |
AM_INIT_AUTOMAKE
|
| 12 |
AC_CONFIG_HEADERS(config.h)
|
| 13 |
AC_CONFIG_FILES(utils/Makefile ld/Makefile ld/create-ldwrapper Makefile)
|
| 14 |
|
| 15 |
AC_PROG_CC
|
| 16 |
|
| 17 |
AC_PROG_RANLIB
|
| 18 |
|
| 19 |
AC_DEFINE_UNQUOTED([CHOST], ["${ac_cv_host}"], [host the wrapper is running on])
|
| 20 |
|
| 21 |
AC_C_INLINE
|
| 22 |
|
| 23 |
AC_MSG_CHECKING([for Gentoo Portage EPREFIX])
|
| 24 |
AC_ARG_WITH([gentoo-portage-eprefix],
|
| 25 |
[AC_HELP_STRING(
|
| 26 |
[--with-gentoo-portage-eprefix],
|
| 27 |
[the Gentoo Portage EPREFIX, e.g. '/opt/gentoo']
|
| 28 |
)],
|
| 29 |
[GENTOO_PORTAGE_EPREFIX=$withval],
|
| 30 |
[GENTOO_PORTAGE_EPREFIX=yes]
|
| 31 |
)
|
| 32 |
case "x${GENTOO_PORTAGE_EPREFIX}" in
|
| 33 |
xyes)
|
| 34 |
GENTOO_PORTAGE_EPREFIX=$prefix
|
| 35 |
if test "x${GENTOO_PORTAGE_EPREFIX}" = xNONE; then
|
| 36 |
GENTOO_PORTAGE_EPREFIX=
|
| 37 |
else
|
| 38 |
GENTOO_PORTAGE_EPREFIX=`echo "${GENTOO_PORTAGE_EPREFIX}" | sed 's,/usr/*$,,'`
|
| 39 |
fi
|
| 40 |
;;
|
| 41 |
xno) GENTOO_PORTAGE_EPREFIX= ;;
|
| 42 |
x/*) ;;
|
| 43 |
*) AC_ERROR([need yes, no, or absolute path for --with-gentoo-portage-eprefix])
|
| 44 |
;;
|
| 45 |
esac
|
| 46 |
case "x${GENTOO_PORTAGE_EPREFIX}" in
|
| 47 |
x*/) GENTOO_PORTAGE_EPREFIX=`echo "${GENTOO_PORTAGE_EPREFIX}" | sed 's,/*$,,'` ;;
|
| 48 |
esac
|
| 49 |
AC_MSG_RESULT(['${GENTOO_PORTAGE_EPREFIX}'])
|
| 50 |
AC_DEFINE_UNQUOTED(
|
| 51 |
[GENTOO_PORTAGE_EPREFIX], ["${GENTOO_PORTAGE_EPREFIX}"],
|
| 52 |
[gentoo portage eprefix]
|
| 53 |
)
|
| 54 |
AC_SUBST(GENTOO_PORTAGE_EPREFIX)
|
| 55 |
|
| 56 |
AC_MSG_CHECKING([for Mac OS X minimum deployment target])
|
| 57 |
AC_ARG_WITH([macosx-version-min],
|
| 58 |
[AC_HELP_STRING(
|
| 59 |
[--with-macosx-version-min],
|
| 60 |
[the minimum deployment target on Mac OS X, such as 10.4]
|
| 61 |
)],
|
| 62 |
[MIN_OSX_TARGET=$withval],
|
| 63 |
[MIN_OSX_TARGET=auto]
|
| 64 |
)
|
| 65 |
# We only "support" Panther, Tiger, Leopard and Snow Leopard
|
| 66 |
case $ac_cv_host in
|
| 67 |
*-darwin*)
|
| 68 |
case "x${MIN_OSX_TARGET}" in
|
| 69 |
x10.[[3456789]]) ;;
|
| 70 |
xno)
|
| 71 |
AC_ERROR([--with-macosx-version-min must be given on Mac OS X hosts])
|
| 72 |
;;
|
| 73 |
xauto)
|
| 74 |
# auto guessing
|
| 75 |
case $ac_cv_host in
|
| 76 |
*-darwin7*)
|
| 77 |
MIN_OSX_TARGET=10.3
|
| 78 |
;;
|
| 79 |
*-darwin8*)
|
| 80 |
MIN_OSX_TARGET=10.4
|
| 81 |
;;
|
| 82 |
*-darwin9*)
|
| 83 |
MIN_OSX_TARGET=10.5
|
| 84 |
;;
|
| 85 |
*-darwin10*)
|
| 86 |
MIN_OSX_TARGET=10.6
|
| 87 |
;;
|
| 88 |
esac
|
| 89 |
;;
|
| 90 |
*)
|
| 91 |
AC_ERROR([need an explicit Mac OS X version number with --with-macosx-version-min])
|
| 92 |
;;
|
| 93 |
esac
|
| 94 |
AC_MSG_RESULT(['${MIN_OSX_TARGET}'])
|
| 95 |
;;
|
| 96 |
*)
|
| 97 |
MIN_OSX_TARGET="you shouldn't use this"
|
| 98 |
AC_MSG_RESULT([irrelevant for $ac_cv_host])
|
| 99 |
;;
|
| 100 |
esac
|
| 101 |
AC_DEFINE_UNQUOTED(
|
| 102 |
[MIN_OSX_TARGET], ["${MIN_OSX_TARGET}"],
|
| 103 |
[macosx_version_min]
|
| 104 |
)
|
| 105 |
AC_SUBST(MIN_OSX_TARGET)
|
| 106 |
|
| 107 |
AC_OUTPUT
|