# configure.ac --- configuration setup for VM # Author: Robert Widhopf-Fenk # Copyright (C) 2006-2007 Robert Widhopf-Fenk # Copyright (C) 2010 Uday S Reddy # VM is free software; you can redistribute it and/or modify it under the # terms of the GNU Library General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # VM 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 Library General Public License for # more details. # You should have received a copy of the GNU Library General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Process this file with autoconf to produce a new configure script # VM_ARG_SUBST(VAR, OPTION, VAL, DESC[, DEFAULT[, ACTION]]) # # Substitute the autoconf variable VAR to a value specified by the user # option --with-OPTION[=VAL] (described by DESC), or with a DEFAULT value. # If an additional ACTION is given, it is executed at the top of the # ACTION-IF-FOUND part of AC_ARG_WITH. # #### WARNING: pay attention to the quoting of ACTION if given !!!!! AC_DEFUN([VM_ARG_SUBST], [ AC_SUBST([$1]) AC_ARG_WITH([$2], AC_HELP_STRING([--with-][$2]ifelse($3, [], [], [=$3]), [$4]ifelse($5, [], [], [ [[[$5]]]])), [ ifelse($6, [], [], $6) $1="${withval}" ], ifelse($5, [], [], [$1="$5"])) ]) # Find a (g)tar program and make sure it is GNU one. A failure is not fatal # since tar is needed for non critical targets only. AC_DEFUN([VM_PROG_GNU_TAR], [ AC_CHECK_PROGS(TAR, gtar tar) if test "x${TAR}" = "xtar" ; then AC_MSG_CHECKING([that tar is GNU tar]) ${TAR} --version > /dev/null 2>&1 || TAR= if test "x${TAR}" = "x" ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi fi if test "x${TAR}" = "x" ; then AC_MSG_WARN([*** No GNU tar program found.]) AC_MSG_WARN([*** Some targets will be unavailable.]) fi ]) # Find an xargs program. A failure is not fatal, only clean/tarball will not # work AC_DEFUN([VM_PROG_XARGS], [ AC_CHECK_PROG(XARGS, xargs, xargs) if test "x${XARGS}" = "x" ; then AC_MSG_WARN([*** No xargs program found.]) AC_MSG_WARN([*** make clean/tarball will not work.]) fi ]) # Find a makeinfo program. A failure is not fatal, only info files won't be # built. AC_DEFUN([VM_PROG_MAKEINFO], [ AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo) if test "x${MAKEINFO}" = "x" ; then AC_MSG_WARN([*** No makeinfo program found.]) AC_MSG_WARN([*** Info files will not be built.]) fi ]) # Find a texi2dvi program. A failure is not fatal, only dvi and pdf files # won't be built. AC_DEFUN([VM_PROG_TEXI2DVI], [ AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi) if test "x${TEXI2DVI}" = "x" ; then AC_MSG_WARN([*** No texi2dvi program found.]) AC_MSG_WARN([*** DVI and PDF files will not be built.]) fi ]) # Choose an Emacs flavor according to the --with-emacs user option, or try # emacs and xemacs. # We use EMACS_PROG instead of EMACS to avoid colliding with Emacs' own # internal environment. AC_DEFUN([VM_PROG_EMACS], [ AC_ARG_WITH([emacs], AC_HELP_STRING([--with-emacs=PROG], [choose which flavor of Emacs to use]), [ EMACS_PROG="${withval}" ], [ AC_CHECK_PROGS(EMACS_PROG, emacs xemacs) ]) if test "x${EMACS_PROG}" = "x" ; then dnl This is critical enough to generate an error and not a warning... AC_MSG_ERROR([*** No Emacs program found.]) fi # EMACS TYPE ################################################## AC_MSG_CHECKING([checking emacs-type of ${EMACS_PROG}]) cat > conftest.el < conftest.el < conftest.el <]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_FILES([Makefile lisp/Makefile info/Makefile src/Makefile pixmaps/Makefile vm-load.el]) # Common system utilities checking: AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(LS, ls, /bin/ls) AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir) AC_PATH_PROG(GREP, grep, /bin/grep) # External programs checking: VM_PROG_XARGS VM_PROG_GNU_TAR VM_PROG_MAKEINFO VM_PROG_TEXI2DVI VM_PROG_EMACS VM_BUILD_FLAGS VM_PATH_INFO_DIR VM_OTHERDIRS # is there a sane way to set this to a useful default? VM_ARG_SUBST([PACKAGEDIR], [package-dir], [DIR], [set the Emacs package directory to DIR],) VM_ARG_SUBST([SYMLINKS], [symlinks], [], [install VM by linking instead of copying], [no]) VM_ARG_SUBST([LINKPATH], [linkpath], [PATH], [path to symlink from if `pwd' does not work]) AC_OUTPUT # configure.ac ends here