ossp-pkg/rc/configure.in
dnl ##
dnl ## OSSP rc - Run-Command Processor
dnl ## Copyright (c) 2002-2003 Ralf S. Engelschall
dnl ## Copyright (c) 2002-2003 Cable & Wireless Deutschland GmbH
dnl ## Copyright (c) 2002-2003 The OSSP Project <http://www.ossp.org/>
dnl ##
dnl ## This file is part of OSSP rc, a portable run-command processor
dnl ## which can be found at http://www.ossp.org/pkg/lib/rc/
dnl ##
dnl ## Permission to use, copy, modify, and distribute this software for
dnl ## any purpose with or without fee is hereby granted, provided that
dnl ## the above copyright notice and this permission notice appear in all
dnl ## copies.
dnl ##
dnl ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
dnl ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
dnl ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
dnl ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dnl ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
dnl ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
dnl ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
dnl ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
dnl ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl ## SUCH DAMAGE.
dnl ##
dnl ## configure.in: GNU Autoconf source script
dnl ##
dnl Version requirement and information
AC_PREREQ(2.53)dnl
AC_REVISION(1.0)
dnl Announce the product and version
V=`./shtool version -lc -dlong rc_version.c`
./shtool echo -e "Configuring %BOSSP rc%b, version %B${V}%b"
echo "Copyright (c) 2002-2003 The OSSP Project <http://www.ossp.org/>"
echo "Copyright (c) 2002-2003 Cable & Wireless Deutschland <http://www.cw.com/de/>"
dnl Process this file with autoconf
AC_INIT(rc.h)
AC_CONFIG_HEADER(ac_config.h)
AC_LANG_C
dnl Checks basic requirements
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_INSTALL
dnl Check for libtool
dnl sinclude(libtool.m4)
dnl AC_PROG_LIBTOOL
dnl Check other requirements
AC_PROG_MAKE_SET
AC_CHECK_DEBUGGING
AC_CHECK_LIB(socket, getprotobyname)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_FUNCS(inet_pton inet_aton)
AC_CHECK_FUNCS(setsid)
AC_CHECK_HEADERS(sys/termios.h)
dnl Check for Dmalloc library
AC_CHECK_EXTLIB([Dmalloc],
dmalloc, dmalloc_debug, dmalloc.h,
[AC_DEFINE(DMALLOC, 1, [Define to 1 if building with dmalloc])])
dnl Check for OSSP popt library
AC_CHECK_EXTLIB([OSSP popt],
popt, popt_getcontext, popt.h,
[SUBDIR_POPT=""],
[SUBDIR_POPT="lib_popt"
CPPFLAGS="$CPPFLAGS -Ilib_popt"
CFLAGS="$CFLAGS -Ilib_popt"
LDFLAGS="$LDFLAGS -Llib_popt/.libs"
LIBS_EXTRA="$LIBS_EXTRA -lpopt"])
AC_SUBST(SUBDIR_POPT)
dnl Check for OSSP ex library
AC_CHECK_EXTLIB([OSSP ex],
ex, __ex_ctx, ex.h,
[SUBDIR_EX=""],
[SUBDIR_EX="lib_ex"
CPPFLAGS="$CPPFLAGS -Ilib_ex"
CFLAGS="$CFLAGS -Ilib_ex"
LDFLAGS="$LDFLAGS -Llib_ex/.libs"
LIBS_EXTRA="$LIBS_EXTRA -lex"])
AC_SUBST(SUBDIR_EX)
#dnl Check for OSSP str library
#AC_CHECK_EXTLIB([OSSP str],
# str, str_parse, str.h,
# [SUBDIR_STR=""],
# [SUBDIR_STR="rc_str"
# CPPFLAGS="$CPPFLAGS -Irc_str"
# CFLAGS="$CFLAGS -Irc_str"
# LDFLAGS="$LDFLAGS -Lrc_str/.libs"
# LIBS_EXTRA="$LIBS_EXTRA -lstr"])
#AC_SUBST(SUBDIR_STR)
#dnl Check for OSSP var library
#AC_CHECK_EXTLIB([OSSP var],
# var, var_expand, var.h,
# [SUBDIR_VAR=""],
# [SUBDIR_VAR="rc_var"
# CPPFLAGS="$CPPFLAGS -Irc_var"
# CFLAGS="$CFLAGS -Irc_var"
# LDFLAGS="$LDFLAGS -Lrc_var/.libs"
# LIBS_EXTRA="$LIBS_EXTRA -lvar"])
#AC_SUBST(SUBDIR_VAR)
#dnl Check for OSSP val library
#AC_CHECK_EXTLIB([OSSP val],
# val, val_expand, val.h,
# [SUBDIR_VAL=""],
# [SUBDIR_VAL="rc_val"
# CPPFLAGS="$CPPFLAGS -Irc_val"
# CFLAGS="$CFLAGS -Irc_val"
# LDFLAGS="$LDFLAGS -Lrc_val/.libs"
# LIBS_EXTRA="$LIBS_EXTRA -lval"])
#AC_SUBST(SUBDIR_VAL)
dnl Extra library handling
LIBS="$LIBS $LIBS_EXTRA"
enable_shared=no
export enable_shared
enable_headline=no
export enable_headline
dnl Call other configure scripts
AC_CONFIG_SUBDIRS([$SUBDIR_EX $SUBDIR_POPT])
#AC_CONFIG_SUBDIRS([$SUBDIR_EX $SUBDIR_STR $SUBDIR_VAR $SUBDIR_VAL $SUBDIR_POPT])
dnl Make all the necessary Makefiles
#AC_CONFIG_FILES(Makefile)
AC_OUTPUT(Makefile)
dnl Remove these placeholders
AC_PATH_PROG(FLEX, flex, true)
AC_CHECK_LIB(nsl, gethostname)
AC_CHECK_LIB(socket, accept)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop setitimer)