dnl Copyright (C) 2001-2005 Peter Selinger. dnl This file is part of psdim. It is free software and it is covered dnl by the GNU general public license. See the file COPYING for details. dnl Process this file with autoconf to produce a configure script. dnl ---------------------------------------------------------------------- dnl Package info AC_INIT(src/psdim.c) AM_INIT_AUTOMAKE(psdim, 1.4) DATE="March 2005" AM_CONFIG_HEADER(config.h) dnl ---------------------------------------------------------------------- dnl The names of the installed executables are in dnl principle configurable. However, they should not normally be changed, dnl because other scripts might depend on them. PSDIM=psdim AC_DEFINE_UNQUOTED(PSDIM,"$PSDIM",Name of the psdim binary) dnl ---------------------------------------------------------------------- dnl Check for compiler AC_PROG_CC dnl ---------------------------------------------------------------------- dnl Check for library functions. AC_CHECK_FUNC(getopt_long, , EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o") dnl ---------------------------------------------------------------------- dnl Check for programs AC_CHECK_PROGS(GS,gs ghostscript) if [[ "$GS" = "" ]]; then AC_MSG_ERROR([cannot find ghostscript (required).]); fi AC_DEFINE_UNQUOTED(GS,"$GS",Name of the ghostscript binary) dnl ---------------------------------------------------------------------- dnl check for features dnl Enable optional features AC_ARG_ENABLE(metric, [ --enable-metric use metric units (centimeters) as default]) if test "$enable_metric" = yes; then AC_DEFINE(USE_METRIC,, do we use metric units by default?) DEFAULT_UNIT=cm else DEFAULT_UNIT=in fi AC_ARG_ENABLE(a4, [ --enable-a4 use a4 as the default papersize]) if test "$enable_a4" = yes; then AC_DEFINE(USE_A4,, do we use a4 papersize by default?) DEFAULT_FORMAT=a4 else DEFAULT_FORMAT=letter fi dnl ---------------------------------------------------------------------- dnl Set up substitutions of non-standard configuration parameters AC_SUBST(DATE) AC_SUBST(PSDIM) AC_SUBST(EXTRA_OBJS) AC_SUBST(GS) AC_SUBST(DEFAULT_UNIT) AC_SUBST(DEFAULT_FORMAT) dnl ---------------------------------------------------------------------- AC_OUTPUT([Makefile src/Makefile man/Makefile rpm/Makefile man/psdim.1 ])