dnl dnl File : configure.in dnl Author : Robert Chalmers dnl dnl Original : October 13, 1999 dnl Revised : February 26, 2000 dnl 1. Changed over for use in mob package. dnl dnl Content : Project configuration script template used by autoconf. dnl This provides a means for configuring the project in a dnl modular manner. Not all source packages need to be dnl present. The configure script actively searches for dnl all Makefile.in's in the project tree. dnl dnl Process this file with autoconf to produce a configure script. dnl dnl initialize autoconf, automake, and message redirection AC_INIT(src/inspector.c) AC_CONFIG_AUX_DIR(config) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(mob,0.1.0) AM_CONFIG_HEADER(config/config.h) RC_MSG_INIT dnl export project install destinations AC_SUBST(pprefix)dnl AC_SUBST(pbindir)dnl AC_SUBST(plibdir)dnl AC_SUBST(palibdir)dnl AC_SUBST(pdatadir)dnl AC_SUBST(pcfgdir)dnl AC_SUBST(psrcdir)dnl AC_SUBST(pdocdir)dnl dnl dnl export project properties AC_SUBST(P_PKG)dnl AC_SUBST(P_PKGPATH)dnl AC_SUBST(P_TOP)dnl AC_SUBST(P_BUILD)dnl AC_SUBST(P_SECTIONS)dnl AC_SUBST(P_SRCPATH)dnl AC_SUBST(P_SRCPATH_BUILD)dnl AC_SUBST(P_DOCPATH)dnl AC_SUBST(P_DOCPATH_BUILD)dnl AC_SUBST(P_DEVELOPER)dnl AC_SUBST(P_DEBUGS)dnl # set package prefix and directories pprefix="\${prefix}/$PACKAGE-$VERSION" pbindir="\${pprefix}/bin" psrcdir="\${pprefix}/src" pdocdir="\${pprefix}/doc" # check for warnining only mode # this allows distributions to be made in non-conformant environment RC_MSG_WARN_ONLY # consider if developer support is required AC_MSG_CHECKING([whether to set developer mode]) P_DEVELOPER= AC_ARG_ENABLE(developer, [ --enable-developer configure for a development environment], test "$enableval" != "no" && P_DEVELOPER="yes" ) if test -n "$P_DEVELOPER"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi dnl check for gnu make dnl AC_CHECK_PROG(GNU_MAKE,[gmake],found) dnl if test -z "$GNU_MAKE"; then dnl AC_MSG_ERROR([Could not find GNU Make.]) dnl fi # check for best awk on system AC_PROG_AWK dnl setup an error trap for the module #RC_MODULE_TRAP([ELVIS_IROBEX]) dnl dnl set flags for c compiler # ensure no optimizations if test -n "$CFLAGS"; then CFLAGS="`echo $CFLAGS | sed -e 's/-O.//g'`" fi CFLAGS="$CFLAGS -O0" # check whether to include debug symbols AC_MSG_CHECKING([whether to compile with debug symbols]) AC_ARG_ENABLE(debug, [ --enable-debug compile with debug symbols], if test "$enableval" = "no"; then dnl use normal compilation AC_MSG_RESULT([no]) else dnl compile with debug symbols P_DEBUG="yes" AC_MSG_RESULT([yes]) fi, dnl use normal compilation AC_MSG_RESULT([auto]) ) # add debugger flag if requested if test -n "$P_DEBUG"; then CFLAGS="$CFLAGS -g -Wall" fi # allow code generation debug if requested or in developer mode if test -n "$P_DEVELOPER" || test -n "$P_DEBUG"; then P_DEBUGS="dbgCode" fi dnl checks for programs. AC_PROG_CC dnl checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/time.h limits.h unistd.h memory.h) dnl checks for typedefs, structures, and compiler characteristics. AC_HEADER_TIME AC_TYPE_SIZE_T AC_PROG_GCC_TRADITIONAL dnl checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday strchr memcpy) AC_CHECK_LIB(m, sqrt) dnl clear the error trap #RC_MODULE_UNTRAP dnl no errors were trapped, so we must be ready #if test "$ELVIS_IROBEX" != "no"; then # ELVIS_IROBEX="yes" #fi dnl checking for compatible machine dependent code fragments AC_MSG_CHECKING([for machine dependent code]) case "$host_cpu" in i?86*) machdep="i386.h" ;; sparc*) machdep="sparc.h" ;; mips*) machdep="mips.h" ;; alpha*) machdep="alpha.h" ;; *) machdep="none" ;; esac AC_MSG_RESULT([$machdep]) # error if we can't supply the code if test "$machdep" = "none"; then AC_MSG_ERROR([Specialized code is not available for this machine.]) fi # setup links to machine dependent files AC_LINK_FILES( src/inc/machine/${machdep}, src/inc/machdep.h ) # set the project base package and its path P_PKG="mob" P_PKGPATH="`echo $P_PKG | sed -e 's#\.#/#g'`" #set the top of the project and top of build RC_SECTION_ROOT([P_TOP],[P_BUILD]) # check for source directory RC_SECTION_CHECK([P_SRCPATH],[src],[source path],,,[ AC_MSG_ERROR([Could not find project source at $P_TOP/src.])]) # check for documentation RC_SECTION_CHECK([P_DOCPATH],[doc],[documentation path]) # save list of makeable sub-sections P_SECTIONS="$SECTION_LIST" # consider if all modules should be included #AC_MSG_CHECKING([whether to include all modules]) #AC_ARG_ENABLE(all_modules, # [ --enable-all-modules compile and include all optional modules], # if test "$enableval" = "no"; then # dnl mark all as no to inhibit probing # P_API="no" # AC_MSG_RESULT([no]) # else # dnl mark all as yes to force strict conformance # P_API="yes" # AC_MSG_RESULT([yes]) # fi, # dnl mark viable modules for probing # P_API="no" # AC_MSG_RESULT([auto]) # ) dnl set conditional variables AM_CONDITIONAL(P_DOC_COND,[test -n "$P_DOCPATH"]) AM_CONDITIONAL(P_LATEX_COND,[test -n "$P_DEVELOPER"]) dnl print status of included modules echo echo "Configure has enabled support for the following modules" echo "* core support" test "$P_DEVELOPER" = "yes" && echo "* developer support" test "$P_DEBUG" = "yes" && echo "* debug support" echo # override normal output with one derived from search for Makfile.in files RC_OUTPUT_AUTO([Makefile]) AC_OUTPUT([Makefile \ bin/Makefile \ doc/Makefile doc/tex/Makefile \ src/Makefile]) dnl end of configure.in