dnl Process this file with autoconf to produce a configure script. AC_INIT(portage, 2.1.20, grobian@gentoo.org, portage-prefix) AC_PREREQ([2.61]) case "${prefix}" in '') AC_MSG_ERROR([bad value ${prefix} for --prefix, must not be empty]) ;; */) AC_MSG_ERROR([bad value ${prefix} for --prefix, must not end with '/']) ;; /*|NONE) ;; *) AC_MSG_ERROR([bad value ${prefix} for --prefix, must start with /]) ;; esac AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE dnl Checks for programs. dnl store clfags prior, otherwise it's not propagated. if test "x$CFLAGS" != "x" then CFLAGS=$CFLAGS fi AC_PREFIX_DEFAULT([/usr]) AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_EGREP GENTOO_PATH_XCU_ID() GENTOO_PATH_PYTHON([2.4]) AC_PATH_PROG(RM, [rm], no) AC_PATH_PROG(MV, [mv], no) AC_PATH_PROG(BASENAME, [basename], no) AC_PATH_PROG(DIRNAME, [dirname], no) dnl avoid bash internal variable messing up things here unset BASH GENTOO_PATH_GNUPROG(BASH, [bash]) GENTOO_PATH_GNUPROG(SED, [sed]) GENTOO_PATH_GNUPROG(WGET, [wget]) GENTOO_PATH_GNUPROG(FIND, [find]) GENTOO_PATH_GNUPROG(XARGS, [xargs]) GENTOO_PATH_GNUPROG(GREP, [grep]) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h]) AC_ARG_ENABLE(tbz2tool, AC_HELP_STRING([--enable-tbz2tool],[build tbz2tool, tool for creating binpkgs (default yes)]), [case "${enableval}" in yes) enable_tbz2tool=true;; no) enable_tbz2tool=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tbz2tool);; esac], [enable_tbz2tool=true]) AC_ARG_ENABLE(just-compiled-sources, AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]), [case "${enableval}" in yes) enable_py_sources=false;; no) enable_py_sources=true;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-just-compiled-sources);; esac], [enable_py_sources=true]) AC_ARG_WITH(portage-user, AC_HELP_STRING([--with-portage-user=myuser],[use user 'myuser' as portage owner (default portage)]), [case "${withval}" in ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-user);; *) portageuser="${withval}";; esac], [portageuser="portage"]) AC_ARG_WITH(portage-group, AC_HELP_STRING([--with-portage-group=mygroup],[use group 'mygroup' as portage users group (default portage)]), [case "${withval}" in ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-group);; *) portagegroup="${withval}";; esac], [portagegroup="portage"]) AC_ARG_WITH(rootuser, AC_HELP_STRING([--with-rootuser=myuser],[uses 'myuser' as owner of installed files (default is portage-user)]), [case "${withval}" in ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuser);; *) rootuser=${withval};; esac], [rootuser=${portageuser}]) AC_MSG_CHECKING([for user id of ${rootuser}]) dnl grab uid of rootuser rootuid=`${XCU_ID} -u ${rootuser}` if [[ `echo ${rootuid} | ${EGREP} '^[[:digit:]]+$'` ]] then AC_MSG_RESULT([${rootuid}]) else AC_MSG_ERROR([error finding the user id of ${rootuser}]) fi AC_MSG_CHECKING([for group id of ${rootuser}]) rootgid=`${XCU_ID} -g ${rootuser}` if [[ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ]] then AC_MSG_RESULT([${rootgid}]) else AC_MSG_ERROR([error finding the group id of ${rootuser}]) fi AC_ARG_WITH(offset-prefix, AC_HELP_STRING([--with-offset-prefix], [specify the installation prefix for all packages , defaults to /]), [DOMAIN_PREFIX=$withval], [DOMAIN_PREFIX='/']) DEFAULT_PATH="${DOMAIN_PREFIX}/usr/bin:${DOMAIN_PREFIX}/usr/sbin:${DOMAIN_PREFIX}/bin:${DOMAIN_PREFIX}/sbin:${prefix}/bin" AC_ARG_WITH(default-path, AC_HELP_STRING([--with-default-path], [specify additional PATHs available to the portage build environment ]), [DEFAULT_PATH="${DEFAULT_PATH}":$withval], [DEFAULT_PATH="${DEFAULT_PATH}"]) AC_MSG_CHECKING([for ARCH to be used]) dnl detect ARCH from target_cpu case "${target_cpu}" in i?86) ARCH=x86 ;; sparc*) ARCH=sparc ;; hppa*) ARCH=hppa ;; powerpc*) ARCH=ppc ;; dnl don't know more target_cpus yet... *) AC_MSG_RESULT([unknown]) AC_MSG_CHECKING([for default ARCH to be used]) ARCH=${target_cpu} ;; esac AC_MSG_RESULT([${ARCH}]) AC_CONFIG_FILES([ Makefile ]) AC_CONFIG_FILES([ subst-install ]) AC_CONFIG_FILES([ subst-install.vars.in ]) AC_CONFIG_FILES([ src/Makefile ]) AC_CONFIG_FILES([ man/Makefile ]) AC_CONFIG_FILES([ bin/Makefile ]) AC_CONFIG_FILES([ pym/Makefile ]) AC_CONFIG_FILES([ cnf/Makefile ]) AC_SUBST(portageuser) AC_SUBST(portagegroup) AC_SUBST(rootuser) AC_SUBST(rootuid) AC_SUBST(rootgid) AC_SUBST(DOMAIN_PREFIX) AC_SUBST(DEFAULT_PATH) AC_SUBST(ARCH) AC_SUBST(PORTAGE_BASE,['${exec_prefix}/lib/portage']) AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue) AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue) AC_MSG_CHECKING([for a list of variables known by configure]) pt_configvars=`sed -n -e "/^ac_subst_vars='/,/'$/p" ${srcdir}/configure | sed -e "s/^ac_subst_vars='//" -e "s/'$//"` { pt_all_configurevars= for pt_configvar in ${pt_configvars} do echo "${pt_configvar}=@${pt_configvar}@" pt_all_configurevars="${pt_all_configurevars} ${pt_configvar}" done echo "all_configurevars='${pt_all_configurevars}'" } > subst-install.vars.in.in $as_unset pt_configvar pt_configvars pt_all_configurevars AC_MSG_RESULT([ok]) AC_OUTPUT