# configure.ac - Configure script for the GNU Hurd. # Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Marcus Brinkmann. # # This file is part of the GNU Hurd. # # The GNU Hurd is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(hurd, 0.0, l4-hurd@gnu.org) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE( dnl Don't define `PACKAGE' and `VERSION'. [no-define] dnl Do not clutter the main build directory. [subdir-objects] dnl This is only a very rough estimation of the version we actually need. Feel dnl free to refine that. [1.9] dnl We require GNU make. [-Wall -Wno-portability] ) AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([laden/laden.c]) AC_CONFIG_HEADER([config.h]) AC_GNU_SOURCE maintainer_mode=${enable_maintainer_mode-no} # Checks for programs. AC_PROG_CC AM_PROG_AS AC_PROG_RANLIB AC_CHECK_TOOL([AR], [ar], :) AC_CHECK_TOOL([NM], [nm], :) AC_PATH_PROG([SED], [sed], :) AC_PATH_PROG([SORT], [sort], :) AC_PROG_LN_S # Required for building the documentation AC_PATH_PROG([PDFLATEX], [pdflatex], no) if test "x$PDFLATEX" = xno; then missing_progs="$missing_progs pdflatex" fi AC_PATH_PROG([BIBTEX], [bibtex], no) if test "x$BIBTEX" = xno; then missing_progs="$missing_progs bibtex" fi AC_PATH_PROG([INKSCAPE], [inkscape], no) if test "x$INKSCAPE" = xno; then if test "x$maintainer_mode" = xyes; then missing_progs="missing_progs inkscape" fi fi # Set up the host information. AC_CANONICAL_HOST # Checks for header files. arch_ia32=false arch_powerpc=false case $host_cpu in alpha) arch=alpha arch_alpha=true ;; amd64) arch=amd64 arch_amd64=true ;; i386 | i486 | i586 | i686) arch=ia32 arch_ia32=true ;; ia64) arch=ia64 arch_ia64=true ;; powerpc) arch=powerpc arch_powerpc=true ;; powerpc64) arch=powerpc64 arch_powerpc64=true ;; *) AC_MSG_ERROR([unsupported architecture]) ;; esac AM_CONDITIONAL([ARCH_ALPHA], $arch_alpha) AM_CONDITIONAL([ARCH_AMD64], $arch_amd64) AM_CONDITIONAL([ARCH_IA32], $arch_ia32) AM_CONDITIONAL([ARCH_IA64], $arch_ia64) AM_CONDITIONAL([ARCH_POWERPC], $arch_powerpc) AM_CONDITIONAL([ARCH_POWERPC64], $arch_powerpc64) l4_abi_v2=false l4_abi_x2=false AC_ARG_ENABLE([l4-abi], AC_HELP_STRING([--enable-l4-abi=abi], [L4 ABI to use (supported are: v2, x2)]), [ac_cv_use_l4_abi=$enableval], [ac_cv_use_l4_abi=no]) case $ac_cv_use_l4_abi in v2) l4_abi=v2 l4_abi_v2=true ;; x2) l4_abi=x2 l4_abi_x2=true ;; no) AC_MSG_ERROR([L4 ABI not specified; select an ABI using --enable-l4-abi]) ;; *) AC_MSG_ERROR([unsupported L4 ABI $ac_cv_use_l4_abi]) ;; esac AM_CONDITIONAL([L4_ABI_V2], $l4_abi_v2) AM_CONDITIONAL([L4_ABI_X2], $l4_abi_x2) AC_MSG_NOTICE([compiling for L4 ABI $l4_abi]) # Configure components. m4_include([laden/config.m4]) m4_include([viengoos/config.m4]) # Create links for header file. m4_include([libl4/headers.m4]) m4_include([platform/headers.m4]) m4_include([hurd/headers.m4]) m4_include([libhurd-ihash/headers.m4]) m4_include([libhurd-btree/headers.m4]) m4_include([libbitarray/headers.m4]) m4_include([libhurd-slab/headers.m4]) m4_include([libpthread/headers.m4]) m4_include([libhurd-mm/headers.m4]) m4_include([viengoos/headers.m4]) # Check for libc and components using it. AC_ARG_WITH([libc], [ --with-libc compile with the GNU C library (see libc/README)]) AM_CONDITIONAL(WITH_LIBC, test x"${with_libc-no}" != xno) AC_ARG_WITH([newlib], [ --with-newlib compile with Newlib's C library (see newlib/README)]) AM_CONDITIONAL(WITH_NEWLIB, test x"${with_newlib-no}" != xno) ABS_BUILDDIR=$ac_pwd AC_SUBST([ABS_BUILDDIR]) ABS_SRCDIR=`readlink -f $srcdir` AC_SUBST([ABS_SRCDIR]) # Location of the installed headers and .a's. We expect that # LIBC/libc.a and LIBC/include exists. LIBC= if test x"${with_libc-no}" != xno then LIBC=$ABS_BUILDDIR/libc elif test x"${with_newlib-no}" != xno then LIBC=$ABS_BUILDDIR/newlib fi AC_SUBST([LIBC]) LIBC_A= LIBC_M= if test x$LIBC != x then LIBC_A=$LIBC/libc.a LIBC_M=$LIBC/libm.a fi AC_SUBST([LIBC_A]) AC_SUBST([LIBC_M]) # Compute some variables that we need everywhere. # Ripped from glibc. ccheaders = $(${CC} -print-file-name=include) SYSINCLUDES = -nostdinc -isystem ${ccheaders} -isystem ${ccheaders}-fixed USER_CFLAGS="-std=gnu99 -Wall -g -O2 -fno-stack-protector" USER_CPPFLAGS="-U__linux -U__linux__ -U__gnu_linux__ -Ulinux -D__GNU__ \ -D_GNU_SOURCE ${SYSINCLUDES} -I${LIBC}/include \ -I${ABS_BUILDDIR}/include -I${ABS_SRCDIR}/libc-parts" USER_LDFLAGS="-u_start -e_start -nostdlib" USER_LDADD="${ABS_BUILDDIR}/libc.a" KERNEL_CFLAGS="-std=gnu99 -Wall -g -O2 -fno-stack-protector" KERNEL_CPPFLAGS="-U__linux -U__linux__ -U__gnu_linux__ -Ulinux -D__GNU__ \ -D_GNU_SOURCE -DRM_INTERN $SYSINCLUDES -I${ABS_BUILDDIR}/include \ -I${ABS_SRCDIR}/libc-parts" CHECK_CPPFLAGS="-I${ABS_BUILDDIR}/include -I${ABS_SRCDIR}/libc-parts" AC_SUBST(USER_CFLAGS) AC_SUBST(USER_CPPFLAGS) AC_SUBST(USER_LDFLAGS) AC_SUBST(USER_LDADD) AC_SUBST(KERNEL_CFLAGS) AC_SUBST(KERNEL_CPPFLAGS) AC_SUBST(CHECK_CPPFLAGS) if test "x$missing_progs" != "x"; then AC_MSG_ERROR([The following programs were not found:$missing_progs]) fi # Checks for library functions. AC_CONFIG_FILES([Makefile libc.a libl4/ia32/Makefile libl4/powerpc/Makefile libl4/v2/Makefile libl4/v2/ia32/Makefile libl4/x2/Makefile libl4/tests/Makefile libl4/Makefile platform/alpha/Makefile platform/amd64/Makefile platform/ia32/Makefile platform/ia64/Makefile platform/powerpc/Makefile platform/powerpc64/Makefile platform/Makefile libc-parts/Makefile hurd/Makefile libhurd-ihash/Makefile libhurd-btree/Makefile libbitarray/Makefile libhurd-slab/Makefile libpthread/Makefile libhurd-mm/Makefile laden/Makefile viengoos/Makefile libc/Makefile newlib/Makefile hieronymus/Makefile ruth/Makefile doc/Makefile ]) AC_OUTPUT