# Top-level configure.in for the Virtual Server Administrator # Copyright (c) 1999, 2000 Idaya Ltd. # Contributed by Nick Burrett # This file is part of the Virtual Server Administrator (FreeVSD) # FreeVSD 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 2, or (at your option) # any later version. # FreeVSD 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 FreeVSD; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. AC_INIT(src/vsd/vsd.c) AC_CANONICAL_SYSTEM AC_ARG_PROGRAM dnl Global version variable PACKAGE="FreeVSD" AC_SUBST(PACKAGE) VERSION="1.4.9" AC_SUBST(VERSION) AC_SUBST(MANDATE) dnl Checks for programs AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for header files dnl Checks for typedefs, structures and compiler characteristics dnl Checks for library functions dnl Additional configure command line parameters AC_ARG_WITH(siteconf, [ --with-siteconf=DIR additional site specific configuration]) test "$with_siteconf" = yes && with_siteconf=dfl test "$with_siteconf" = default && with_siteconf=dfl test "$with_siteconf" = "" && with_siteconf=dfl AC_ARG_WITH(hostconf, [ --with-hostconf=DIR alternative host specific configuration]) test "$with_hostconf" = yes && with_hostconf=dfl test "$with_hostconf" = default && with_hostconf=dfl test "$with_hostconf" = "" && with_hostconf=dfl AC_ARG_ENABLE(add-ons, [ --enable-addons=DIR additional packages to install in the skel], [ enable_addons=$enableval ] ) test "$enable_addons" = yes && enable_addons=no AC_ARG_WITH(openssl, [ --with-openssl support openssl secure certificates], , with_openssl=no) AC_MSG_CHECKING(addons directory) if test -d "$enable_addons"; then AC_MSG_RESULT($enable_addons) else if test -d "/usr/share/freevsd/pkgs"; then enable_addons="/usr/share/freevsd/pkgs" AC_MSG_RESULT($enable_addons) else AC_MSG_RESULT(not found) enable_addons=no fi fi with_siteskel=no with_sitevsbatch=no with_freevsdconf=no echo Targeting for host $host case "$host" in *-*-freebsd*) os_subdir="freebsd" ;; *-*-linux) os_subdir="linux" ;; *-*-linux-*) os_subdir="linux" ;; esac os_vendor="unknown" if test "$os_subdir" = "linux"; then # Discover distribution type AC_MSG_CHECKING([Linux vendor]) if test -f /etc/redhat-release; then os_vendor="redhat" elif test -f /etc/SuSE-release; then os_vendor="suse" elif test -f /etc/debian-version; then os_vendor="debian" fi AC_MSG_RESULT($os_vendor) fi host_subdirs="" host_subdirs_make="" # --with-hostconf tests if test "$with_hostconf" = "dfl"; then with_hostconf="host/$os_subdir" fi if test "$with_hostconf" != "no"; then AC_MSG_CHECKING(host configuration directory is valid) if test -d "$with_hostconf" && test -e "$with_hostconf/Makefile.in"; then host_subdirs="$host_subdirs $with_hostconf" host_subdirs_make="$host_subdirs_make $with_hostconf/Makefile" AC_MSG_RESULT($with_hostconf) else with_hostconf=no AC_MSG_RESULT(not found) fi fi # Check for the vendor, and try to obtain the release number: AC_MSG_CHECKING(for release version) if test "$os_vendor" = "redhat" ; then os_version=`cat /etc/redhat-release | sed -n -e 's/^.* release \(.*\) .*$/\1/p'`; AC_MSG_RESULT($os_version) else AC_MSG_RESULT(not found) fi # --with-siteconf tests if test "$with_siteconf" = "dfl"; then with_siteconf="site/$os_subdir" fi if test "$with_siteconf" != "no"; then AC_MSG_CHECKING(site configuration directory is valid) if test -d "$with_siteconf" && test -e "$with_siteconf/Makefile.in"; then host_subdirs="$host_subdirs $with_siteconf" host_subdirs_make="$host_subdirs_make $with_siteconf/Makefile" AC_MSG_RESULT($with_siteconf) else with_siteconf=no AC_MSG_RESULT(not found) fi fi if test "$with_siteconf" != "no"; then AC_MSG_CHECKING(for site skel script) if test -x "$with_siteconf/$os_vendor/scripts/site-skel.pl"; then with_siteskel=$with_siteconf/$os_vendor/scripts/site-skel.pl AC_MSG_RESULT($with_siteskel) else AC_MSG_RESULT(not found) fi AC_MSG_CHECKING(for site VS script) if test -x "$with_siteconf/$os_vendor/scripts/site-vs-batch.pl"; then with_sitevsbatch=$with_siteconf/$os_vendor/scripts/site-vs-batch.pl AC_MSG_RESULT($with_sitevsbatch) else AC_MSG_RESULT(not found) fi AC_MSG_CHECKING(for site alternative freevsd.conf) if test -e "$with_siteconf/$os_vendor/freevsd.conf"; then with_sitefreevsdconf=$with_siteconf/$os_vendor/freevsd.conf AC_MSG_RESULT($with_sitefreevsdconf) elif test -e "$with_siteconf/$os_vendor/scripts/freevsd.conf"; then with_sitefreevsdconf=$with_siteconf/$os_vendor/scripts/freevsd.conf AC_MSG_RESULT($with_sitefreevsdconf) else AC_MSG_RESULT(not found) fi fi amake_subdirs="" amake_subdirs_make="" # Ensure libvsd is built before any other package build_subdirs="src/libvsd" incl_subdirs="" for file in src/* src/$os_subdir/*; do if test -d "$file"; then if test -e "$file/configure.in"; then echo "configuring sub-directory $file" if test "$file" = "src/libvsd"; then # We have already added libvsd echo "libvsd will be the first to be built" elif test "$with_openssl" = "no" -a "$file" = "src/vsdproxyd" ; then # We don't want vsdproxyd if we haven't got openssl echo "vsdproxyd can only be compiled with an openssl enabled install" else build_subdirs="${build_subdirs} ${file}" fi if test -e "$file/Makefile.am"; then automake --gnu $file/Makefile fi ( cd $file; autoheader; autoconf ) elif test -e "$file/Makefile.am"; then echo "configuring (automake) sub-directory $file" amake_subdirs="${amake_subdirs} ${file}" amake_subdirs_make="${amake_subdirs_make} ${file}/Makefile" automake --gnu $file/Makefile elif test -e "$file/Makefile"; then echo "including sub-directory $file" incl_subdirs="${incl_subdirs} ${file}" fi fi done AC_SUBST(build_subdirs) AC_SUBST(amake_subdirs) AC_SUBST(incl_subdirs) AC_SUBST(os_subdir) AC_SUBST(os_vendor) AC_SUBST(os_version) AC_SUBST(with_hostconf) AC_SUBST(with_siteconf) AC_SUBST(with_siteskel) AC_SUBST(with_sitevsbatch) AC_SUBST(with_sitefreevsdconf) AC_SUBST(enable_addons) AC_SUBST(host_subdirs) AC_CONFIG_SUBDIRS($build_subdirs) AC_PROG_MAKE_SET AC_OUTPUT([Makefile $host_subdirs_make $amake_subdirs_make])