2003-06-03 19:46:29 +00:00
|
|
|
dnl
|
2004-04-06 01:47:20 +00:00
|
|
|
dnl "$Id: configure.in,v 1.9 2004/04/06 01:47:20 mike Exp $"
|
2003-06-03 19:46:29 +00:00
|
|
|
dnl
|
|
|
|
dnl Configuration script for mini-XML, a small XML-like file parsing library.
|
|
|
|
dnl
|
2004-04-06 01:47:20 +00:00
|
|
|
dnl Copyright 2003-2004 by Michael Sweet.
|
2003-06-03 19:46:29 +00:00
|
|
|
dnl
|
|
|
|
dnl This program is free software; you can redistribute it and/or
|
|
|
|
dnl modify it under the terms of the GNU Library General Public
|
|
|
|
dnl License as published by the Free Software Foundation; either
|
|
|
|
dnl version 2, or (at your option) any later version.
|
|
|
|
dnl
|
|
|
|
dnl This program is distributed in the hope that it will be useful,
|
|
|
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
dnl GNU General Public License for more details.
|
|
|
|
dnl
|
|
|
|
|
2003-07-20 13:41:17 +00:00
|
|
|
dnl Specify a source file from the distribution...
|
2003-06-03 19:46:29 +00:00
|
|
|
AC_INIT(mxml.h)
|
2003-06-15 00:44:34 +00:00
|
|
|
|
2003-07-20 13:41:17 +00:00
|
|
|
dnl Set the name of the config header file...
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
|
2003-06-15 00:44:34 +00:00
|
|
|
dnl Clear default debugging options and set normal optimization by
|
|
|
|
dnl default unless the user asks for debugging specifically.
|
|
|
|
CFLAGS="${CFLAGS:=}"
|
|
|
|
CXXFLAGS="${CXXFLAGS:=}"
|
|
|
|
LDFLAGS="${LDFLAGS:=}"
|
|
|
|
AC_SUBST(LDFLAGS)
|
|
|
|
OPTIM="-O"
|
|
|
|
AC_SUBST(OPTIM)
|
|
|
|
|
2003-07-27 23:11:40 +00:00
|
|
|
AC_ARG_WITH(ansi, [ --with-ansi set full ANSI C mode, default=no],
|
|
|
|
use_ansi="$withval",
|
|
|
|
use_ansi="no")
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
|
2003-06-15 00:44:34 +00:00
|
|
|
if eval "test x$enable_debug = xyes"; then
|
|
|
|
OPTIM="-g"
|
|
|
|
else
|
|
|
|
LDFLAGS="$LDFLAGS -s"
|
|
|
|
fi)
|
|
|
|
|
2003-07-27 23:11:40 +00:00
|
|
|
AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation, default=${prefix}/share/doc/mxml],
|
2003-06-15 00:44:34 +00:00
|
|
|
docdir="$withval",
|
|
|
|
docdir="NONE")
|
|
|
|
|
|
|
|
AC_SUBST(docdir)
|
2003-06-03 19:46:29 +00:00
|
|
|
|
2003-09-28 12:44:39 +00:00
|
|
|
AC_ARG_WITH(vsnprintf, [ --with-vsnprintf use vsnprintf emulation functions, default=auto],
|
|
|
|
use_vsnprintf="$withval",
|
|
|
|
use_vsnprintf="no")
|
|
|
|
|
2003-07-20 13:41:17 +00:00
|
|
|
dnl Get the operating system and version number...
|
|
|
|
uname=`uname`
|
|
|
|
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
|
|
|
|
if test x$uname = xIRIX64; then
|
|
|
|
uname="IRIX"
|
|
|
|
fi
|
|
|
|
|
2003-06-03 19:46:29 +00:00
|
|
|
dnl Checks for programs...
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_RANLIB
|
2003-06-15 00:44:34 +00:00
|
|
|
AC_PATH_PROG(AR,ar)
|
|
|
|
AC_PATH_PROG(CP,cp)
|
|
|
|
AC_PATH_PROG(MKDIR,mkdir)
|
|
|
|
AC_PATH_PROG(NROFF,nroff)
|
|
|
|
if test x$NROFF = x; then
|
|
|
|
AC_PATH_PROG(GROFF,groff)
|
|
|
|
if test x$GROFF = x; then
|
|
|
|
NROFF="echo"
|
|
|
|
else
|
|
|
|
NROFF="$GROFF -T ascii"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_PATH_PROG(RM,rm)
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
dnl Flags for "ar" command...
|
2003-07-20 13:41:17 +00:00
|
|
|
case "$uname" in
|
2003-06-03 19:46:29 +00:00
|
|
|
Darwin* | *BSD*)
|
|
|
|
ARFLAGS="-rcv"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
ARFLAGS="crvs"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_SUBST(ARFLAGS)
|
|
|
|
|
2003-07-20 13:41:17 +00:00
|
|
|
dnl Checks for string functions.
|
2003-07-27 23:11:40 +00:00
|
|
|
if test "x$use_ansi" != xyes; then
|
|
|
|
AC_CHECK_FUNCS(strdup)
|
|
|
|
fi
|
2003-07-20 13:41:17 +00:00
|
|
|
|
2003-09-28 12:44:39 +00:00
|
|
|
if test "x$use_vsnprintf" != xyes; then
|
|
|
|
AC_CHECK_FUNCS(vsnprintf)
|
|
|
|
fi
|
|
|
|
|
2003-06-04 00:30:04 +00:00
|
|
|
dnl Add -Wall for GCC...
|
|
|
|
if test -n "$GCC"; then
|
|
|
|
CFLAGS="-Wall $CFLAGS"
|
2003-07-27 23:11:40 +00:00
|
|
|
|
|
|
|
if test "x$use_ansi" = xyes; then
|
|
|
|
CFLAGS="-ansi -pedantic $CFLAGS"
|
|
|
|
fi
|
2003-06-04 00:30:04 +00:00
|
|
|
fi
|
|
|
|
|
2003-06-15 00:44:34 +00:00
|
|
|
dnl Fix "prefix" variable if it hasn't been specified...
|
|
|
|
if test "$prefix" = "NONE"; then
|
|
|
|
prefix="/usr/local"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Fix "exec_prefix" variable if it hasn't been specified...
|
|
|
|
if test "$exec_prefix" = "NONE"; then
|
|
|
|
exec_prefix="$prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Fix "docdir" variable if it hasn't been specified...
|
|
|
|
if test "$docdir" = "NONE"; then
|
|
|
|
docdir="$datadir/doc/mxml"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Fix "mandir" variable if it hasn't been specified...
|
|
|
|
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
|
2003-07-20 13:41:17 +00:00
|
|
|
case "$uname" in
|
2003-06-15 00:44:34 +00:00
|
|
|
*BSD* | Darwin* | Linux*)
|
|
|
|
# BSD, Darwin (MacOS X), and Linux
|
|
|
|
mandir="/usr/share/man"
|
|
|
|
;;
|
|
|
|
IRIX*)
|
|
|
|
# SGI IRIX
|
|
|
|
mandir="/usr/share/catman/u_man"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# All others
|
|
|
|
mandir="/usr/man"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl More manpage stuff...
|
2003-07-20 13:41:17 +00:00
|
|
|
case "$uname" in
|
2003-06-15 00:44:34 +00:00
|
|
|
*BSD* | Darwin*)
|
|
|
|
# *BSD
|
|
|
|
CAT1EXT="0"
|
|
|
|
MAN1EXT="1"
|
2003-06-15 01:22:37 +00:00
|
|
|
CAT3EXT="0"
|
|
|
|
MAN3EXT="3"
|
2003-06-15 00:44:34 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# All others
|
|
|
|
CAT1EXT="1"
|
|
|
|
MAN1EXT="1"
|
2003-06-15 01:22:37 +00:00
|
|
|
CAT3EXT="3"
|
|
|
|
MAN3EXT="3"
|
2003-06-15 00:44:34 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_SUBST(CAT1EXT)
|
2003-06-15 01:22:37 +00:00
|
|
|
AC_SUBST(CAT3EXT)
|
2003-06-15 00:44:34 +00:00
|
|
|
AC_SUBST(MAN1EXT)
|
2003-06-15 01:22:37 +00:00
|
|
|
AC_SUBST(MAN3EXT)
|
2003-06-15 00:44:34 +00:00
|
|
|
|
|
|
|
dnl Output the makefile, etc...
|
|
|
|
AC_OUTPUT(Makefile mxml.list)
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
dnl
|
2004-04-06 01:47:20 +00:00
|
|
|
dnl End of "$Id: configure.in,v 1.9 2004/04/06 01:47:20 mike Exp $".
|
2003-06-03 19:46:29 +00:00
|
|
|
dnl
|