dnl * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * dnl * This source file is part of SableVM SDK. * dnl * * dnl * See the file "LICENSE" for the copyright information and for * dnl * the terms and conditions for copying, distribution and * dnl * modification of this source file. * dnl * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * dnl *** IMPORTANT: Uncomment the apropriate line below. *** dnl a) uncomment for official releases. Please update version number. AC_INIT([sablevm-sdk], [1.13], [http://sablevm.org/]) dnl b) uncomment for development on the trunk dnl AC_INIT([sablevm-sdk],[trunk+]esyscmd([svn info | grep ^Revision: | awk '{print $2}' | head -n 1 | xargs echo -n]),[http://sablevm.org/]) dnl c) uncomment for development on branches. Please update branch name. dnl AC_INIT([sablevm-sdk], [branchname+]esyscmd([svn info | grep ^Revision: | awk '{print $2}' | head -n 1 | xargs echo -n]), [http://sablevm.org/]) dnl The following code makes sure that a branch version has been dnl selected above, when developing on a branch in a subversion working dnl copy. dnl dnl If one of the svn, grep or cut command is missing, the script assumes dnl that the version is OK. if test -d .svn ; then SVN_URL=`svn info | grep ^URL\: | cut -c6- | grep -v '/sablevm-sdk/trunk$' | grep -v '/tags/'` if test "x$SVN_URL" != "x" ; then case $PACKAGE_VERSION in trunk+*) echo "$PACKAGE_VERSION is not an appropriate branch version" echo "Please uncomment appropatiate AC INIT macro in configure.ac" exit 1 ;; *+*) ;; *) echo "$PACKAGE_VERSION is not an appropriate branch version" echo "Please uncomment appropatiate AC INIT macro in configure.ac" exit 1 ;; esac fi fi dnl we need to do this ourselves, as we want to use $prefix early test "x$prefix" = xNONE && prefix=$ac_default_prefix dnl TODO: dnl * Add recursive handling for ./configure --help dnl * Install all programs in "normal" locations in $prefix/bin, then dnl add symlinks in $prefix/lib/sablevm/bin/. The same for manual dnl pages and others. AC_PREREQ(2.13) AM_INIT_AUTOMAKE([tar-ustar]) AC_CANONICAL_HOST AM_CONFIG_HEADER(config) # Remember the arguments passed to us, so that we could pass them further. MAIN_CONFIGURE_ARGS="$ac_configure_args" MAIN_BUILDDIR=`pwd` MAIN_SRCDIR=`cd $srcdir; pwd` dnl remove --with-jikes from common options sed "s/--with-jikes=[[^ ']]*//g" <confargs.tmp ${MAIN_CONFIGURE_ARGS} EOF MAIN_CONFIGURE_ARGS=`cat confargs.tmp` rm -f confargs.tmp dnl remove --with-fastjar from common options sed "s/--with-fastjar=[[^ ']]*//g" <confargs.tmp ${MAIN_CONFIGURE_ARGS} EOF MAIN_CONFIGURE_ARGS=`cat confargs.tmp` rm -f confargs.tmp dnl remove --srcdir from common options sed "s/--srcdir=[[^ ']]*//g" <confargs.tmp ${MAIN_CONFIGURE_ARGS} EOF MAIN_CONFIGURE_ARGS=`cat confargs.tmp` rm -f confargs.tmp AC_SUBST(MAIN_CONFIGURE_ARGS) AC_SUBST(MAIN_BUILDDIR) AC_SUBST(MAIN_SRCDIR) # Do we build gjdoc? # FIXME: we should probably allow for external gjdoc??? AC_ARG_ENABLE([gjdoc],[AS_HELP_STRING(--disable-gjdoc, do we build gjdoc (default:yes))],, [enable_gjdoc=yes]) case "$enable_gjdoc" in yes|no) ;; *) AC_MSG_ERROR("bad value \"${enable_gjdoc}\"for --enable-gjdoc") ;; esac AM_CONDITIONAL(BUILD_GJDOC, test "$enable_gjdoc" = "yes") # Do we build cp-tools? AC_ARG_ENABLE([cp-tools],[AS_HELP_STRING(--disable-cp-tools, do we build cp-tools (default:yes))],, [enable_cp_tools=yes]) case "$enable_cp_tools" in yes|no) ;; *) AC_MSG_ERROR("bad value \"${enable_cp_tools}\"for --enable-cp-tools") ;; esac AM_CONDITIONAL(BUILD_CPTOOLS, test "$enable_cp_tools" = "yes") # Which jikes do we use? AC_ARG_WITH([jikes],[AS_HELP_STRING(--with-jikes=, java compiler ('auto', 'internal' or jikes name/path))],, [with_jikes=auto]) AC_MSG_CHECKING(for jikes ("$with_jikes")) case "$with_jikes" in auto) AC_PATH_PROG(JIKES, "jikes") if test "X$JIKES" = "X"; then with_jikes=internal AC_MSG_RESULT(Will use "internal" jikes.) fi ;; yes|no) AC_MSG_ERROR(*** you need to specify path to jikes, 'auto' or 'internal') ;; internal) ;; *) AC_PATH_PROG(JIKES, "$with_jikes") if test "X$JIKES" = "X"; then AC_MSG_ERROR("*** unable to run jikes"); fi ;; esac AM_CONDITIONAL(INTERNAL_JIKES, test "$with_jikes" = "internal") if test "$with_jikes" = "internal"; then JIKES="$MAIN_BUILDDIR/jikes/src/jikes" dnl SableVM need to know location of jikes after the installation sablevm_CONFIGURE_ARGS="$sablevm_CONFIGURE_ARGS --with-jikes=$prefix/lib/sablevm/bin/jikes" else sablevm_CONFIGURE_ARGS="$sablevm_CONFIGURE_ARGS --with-jikes=$JIKES" fi AC_SUBST(JIKES) # Which jar do we use? AC_ARG_WITH([fastjar],[AS_HELP_STRING(--with-fastjar=, fastjar tool ('auto', 'internal' or fastjar name/path))],, [with_fastjar=auto]) AC_MSG_CHECKING(for fastjar ("$with_fastjar")) case "$with_fastjar" in auto) AC_PATH_PROG(FASTJAR, "fastjar") if test "X$FASTJAR" = "X"; then AC_PATH_PROG(FASTJAR, "fastjar") if test "X$FASTJAR" = "X"; then with_fastjar=internal AC_MSG_RESULT(Will use "internal" fastjar.) fi fi ;; internal) ;; yes|no) AC_MSG_ERROR(*** you need to specify path to a fastjar, 'auto' or 'internal') ;; *) AC_PATH_PROG(FASTJAR, "$with_fastjar") if test "X$FASTJAR" = "X"; then AC_MSG_ERROR(*** unable to run "$with_fastjar" fastjar tool); fi ;; esac AM_CONDITIONAL(INTERNAL_FASTJAR, test "$with_fastjar" = "internal") if test "$with_fastjar" = "internal"; then FASTJAR="$MAIN_BUILDDIR/fastjar/fastjar" dnl SableVM need to know location of fastjar after the installation sablevm_CONFIGURE_ARGS="$sablevm_CONFIGURE_ARGS --with-fastjar=$prefix/lib/sablevm/bin/fastjar" else sablevm_CONFIGURE_ARGS="$sablevm_CONFIGURE_ARGS --with-fastjar=$FASTJAR" fi AC_SUBST(FASTJAR) if test $enable_gjdoc != yes; then gjdoc_CONFIGURE_ARGS="$gjdoc_CONFIGURE_ARGS --with-antlr-jar=ignore" fi dnl COMPILATION STAGES DEPENDENCY GRAPH dnl dnl EARLY_CONFIGURE dnl /\ dnl || dnl EARLY_BUILD <=== MAIN_CONFIGURE dnl /\ dnl || dnl MAIN_BUILD <=== EXTRA_CONFIGURE <=== configure-all dnl (~/bin/ works ) /\ dnl (after this stage) || dnl EXTRA_BUILD <=== build-all dnl dnl ***************** HERE YOU ADD NEW MODULES ********************** EARLY_CONFIGURE='jikes fastjar' EARLY_BUILD= MAIN_CONFIGURE='sablevm sablevm-classpath' MAIN_BUILD="$MAIN_CONFIGURE" EXTRA_CONFIGURE='cp-tools gjdoc' EXTRA_BUILD= if test "$enable_cp_tools" = "yes"; then EXTRA_BUILD="$EXTRA_BUILD cp-tools"; fi if test "$enable_gjdoc" = "yes"; then EXTRA_BUILD="$EXTRA_BUILD gjdoc"; fi if test "$with_jikes" = "internal"; then EARLY_BUILD="$EARLY_BUILD jikes"; fi if test "$with_fastjar" = "internal"; then EARLY_BUILD="$EARLY_BUILD fastjar"; fi fastjar_CONFIGURE_ARGS="$fastjar_CONFIGURE_ARGS --enable-maintainer-mode" ALL_MODULES="$EARLY_CONFIGURE $MAIN_CONFIGURE $EXTRA_CONFIGURE" INSTALL_ALL="$EARLY_BUILD $MAIN_BUILD $EXTRA_BUILD" AC_SUBST(ALL_MODULES) AC_SUBST(EARLY_CONFIGURE) AC_SUBST(EARLY_BUILD) AC_SUBST(MAIN_CONFIGURE) AC_SUBST(MAIN_BUILD) AC_SUBST(EXTRA_CONFIGURE) AC_SUBST(EXTRA_BUILD) AC_SUBST(INSTALL_ALL) dnl it's easier to access these values from files rm -f *.confargs for subdir in $ALL_MODULES; do VARNAME=`echo $subdir|sed s/-/_/g`_CONFIGURE_ARGS eval echo \"\$\{$VARNAME\}\" >> ${subdir}.confargs echo "--srcdir=${srcdir}/../${subdir}" >> ${subdir}.confargs done AC_CONFIG_FILES([Makefile bin/java bin/javac bin/fastjar bin/jikes]) AC_OUTPUT for one in java javac fastjar jikes; do unlink bin/${one}-live &>/dev/null || true chmod +x bin/$one ln -s $one bin/${one}-live done echo "MODULES ENABLED: ${INSTALL_ALL}." echo "You can run 'make' now."