# $Id: configure.in,v 1.43 2003/04/27 22:32:34 jtalkington Exp $ # Process this file with autoconf to produce a configure script. AC_INIT(man2web, 0.88, http://sourceforge.net/tracker/?group_id=76820&atid=548377) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/common.h]) # this is the project homepage AC_DEFINE_UNQUOTED(PROJECT_HOMEPAGE, "http://man2web.sourceforge.net", The project homepage.) # put helper scripts in helpers AC_CONFIG_AUX_DIR([helpers]) # make aux dir available to Makefile.am AC_CONFIG_LIBOBJ_DIR(src) AC_PREFIX_DEFAULT([/usr/local]) AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([gnu check-news -Wall]) AM_CONFIG_HEADER([src/config.h]) dummy="dummy" # Checks for programs. AC_PROG_CC # put CFLAGS into user_cflags in case the user specified CFLAGS # or AC_PROG_CC automatically added something if test "$CFLAGS"; then user_cflags="$CFLAGS" else user_cflags= fi # check if valgrind is installed (for testing only) # if found, set it to the absolute path AC_PATH_PROG([valgrind], [valgrind]) AM_CONDITIONAL(HAVE_VALGRIND, test "$valgrind") # Checks for libraries. # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T # Checks for library functions. AC_CHECK_FUNCS([gethostname memset strchr strdup strstr strtol getopt]) # use provided getopt if one is not available AC_CHECK_FUNCS([getopt_long], [],[ AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) ]) AC_REPLACE_FUNCS(strndup) AC_CHECK_DECL(strndup) AC_CONFIG_FILES([Makefile src/Makefile]) AC_ARG_WITH(man, AC_HELP_STRING([--with-man=MAN],[use MAN for man command. [[man]]]), [ man=$withval ],[ man="man" ]) AC_ARG_WITH(manpath, AC_HELP_STRING([--with-manpath=PATH],[use PATH for the man MANPATH [[none]]]), [case "$withval" in yes) AC_MSG_ERROR([manpath must be specified for option --with-manpath]) ;; no) manpath= ;; *) manpath="$withval" ;; esac], [ manpath= ]) AC_ARG_WITH(manpath-switch, AC_HELP_STRING([--with-manpath-switch=SWITCH],[use SWITCH to pass the path to man. [[none]]]), [case "$withval" in yes) AC_MSG_ERROR([switch must be specified for --with-manpath-switch]) ;; no) manpath_switch= ;; *) manpath_switch="$withval" ;; esac],[ manpath_switch= ]) AC_ARG_WITH(section-switch, AC_HELP_STRING([--with-section-switch=SWITCH],[use SWITCH to pass the section to man. [[none]]]), [case "$withval" in yes) AC_MSG_ERROR([switch must be specified for --with-section-switch]) ;; no) section_switch= ;; *) section_switch="$withval" ;; esac],[ section_switch= ]) AC_ARG_ENABLE(apropos, AC_HELP_STRING([--enable-apropos[[=APROPOS]]], [use APROPOS command to do keyword searches. [[apropos]]]), [case "${enableval}" in yes) apropos="apropos" ;; no) apropos=disabled ;; *) apropos="$enableval" ;; esac],[ apropos="apropos" ]) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), [case "${enableval}" in yes) debug=true dummy="M2W_CLEANUP-yes" ;; no) debug=false dummy="M2W_CLEANUP-no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac], [debug=false]) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AC_PATH_PROG([lynx], [lynx]) AC_ARG_ENABLE(lynx, AC_HELP_STRING([--enable-lynx], [enable lynx cgi]), [case "${enableval}" in yes) lynx=true ;; no) lynx= ;; *) lynx=true ;; esac], []) AM_CONDITIONAL(USE_LYNX, test "$lynx") AC_ARG_ENABLE(config, AC_HELP_STRING([--disabe-config], [disable the use of the configuration file.]), [case "${enableval}" in yes) cfg_file=true dummy="config-yes" ;; no) cfg_file=false dummy="config-no" ;; *) AC_MSG_ERROR(bad value ${enable_val} for --enable-config) ;; esac], [ cfg_file=true]) AM_CONDITIONAL(USE_CONFIG, test x$cfg_file = xtrue) AC_ARG_ENABLE(indexes, AC_HELP_STRING([--disable-indexes], [disable section indexes]), [case "${enableval}" in yes) #do nothing indexes=true ;; no) indexes=disabled ;; *) AC_MSG_ERROR([no options may be specified for --enable-section-indexes]) ;; esac],[indexes=true]) # this is down at the bottom because we set up some defaults for specific # distros if the user didn't specify them AC_ARG_WITH(distro, AC_HELP_STRING([--with-distro=DISTRO],[Specify a distribution type for the default section layout (generic | redhat-8 | redhat-9 | debian-3 | openbsd-3 | macosx | solaris2). [[generic]]]), [case "$withval" in redhat-*) if test x$section_switch = x then section_switch="-S" fi if test x$manpath_switch = x then manpath_switch="-M" fi distro=redhat-8-9 ;; openbsd-3) if test x$section_switch = x then section_switch="-s" fi if test x$manpath_switch = x then manpath_switch="-M" fi distro=openbsd-3 ;; macosx) if test x$section_switch = x then section_switch="-S" fi if test x$manpath_switch = x then manpath_switch="-M" fi if test x$man = xman then man="man -P 'col -x'" fi distro=macosx ;; solaris2) if test x$section_switch = x then section_switch="-s" fi if test x$manpath_switch = x then manpath_switch="-M" fi distro=solaris2 ;; debian-3) if test x$section_switch = x then section_switch="-S" fi if test x$manpath_switch = x then manpath_switch="-M" fi distro=debian-3 ;; *) distro=generic ;; esac], [ distro=generic ]) AC_CONFIG_LINKS([src/sections.h:src/section_h/$distro.h]) AC_DEFINE_UNQUOTED(DUMMY, "$dummy", This is a dummy to rebuild objects when build flags are changed.) # for make check bin_program="../src/$PACKAGE_NAME" # for man pages AC_CONFIG_FILES([doc/Makefile doc/man_sources/Makefile]) uc_package_name=`echo $PACKAGE_NAME | sed -e y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/` uc_package_name_conf=`echo $PACKAGE_NAME.conf | sed -e y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/` AC_CONFIG_FILES([doc/$PACKAGE_NAME.1:doc/man_sources/package_name.1.in]) AC_CONFIG_FILES([doc/$PACKAGE_NAME.conf.5:doc/man_sources/package_name_conf.5.in]) # the default config file AC_CONFIG_FILES("doc/$PACKAGE_NAME.conf.default":doc/man_sources/config_file.in) # make check stuff AC_CONFIG_FILES([check/Makefile]) # paste the output from lcheck.pl here AC_CONFIG_FILES([check/check-all.sh]) AC_CONFIG_FILES([check/n_apropos_check.sh]) AC_CONFIG_FILES([check/n_c_apropos_check.sh]) AC_CONFIG_FILES([check/n_c_manpage_check.sh]) AC_CONFIG_FILES([check/n_c_section-index_check.sh]) AC_CONFIG_FILES([check/n_manpage_check.sh]) AC_CONFIG_FILES([check/n_section-index_check.sh]) AC_CONFIG_FILES([check/v_apropos_check.sh]) AC_CONFIG_FILES([check/v_c_apropos_check.sh]) AC_CONFIG_FILES([check/v_c_manpage_check.sh]) AC_CONFIG_FILES([check/v_c_section-index_check.sh]) AC_CONFIG_FILES([check/v_manpage_check.sh]) AC_CONFIG_FILES([check/v_section-index_check.sh]) AC_CONFIG_FILES([check/valgrind-check-all.sh]) valgrind_opts="--skin=memcheck --leak-check=yes --show-reachable=yes --quiet" # define the variables in the header AC_DEFINE_UNQUOTED(DEFAULT_MAN_COMMAND, "$man", The default man command to use.) if test x$manpath != x then AC_DEFINE_UNQUOTED(DEFAULT_MANPATH, "$manpath", The default MANPATH.) fi if test x$manpath_switch != x then AC_DEFINE_UNQUOTED(DEFAULT_MANPATH_SWITCH, "$manpath_switch", The default switch to pass a path to man.) fi if test x$section_switch != x then AC_DEFINE_UNQUOTED(DEFAULT_SECTION_SWITCH, "$section_switch", The default switch used to pass sections to man.) fi if test x$apropos = xdisabled then AC_DEFINE_UNQUOTED(DISABLE_APROPOS, 1, Disable apropos.) else AC_DEFINE_UNQUOTED(DEFAULT_APROPOS, "$apropos", The apropos command) fi if test xindexes = xdisabled then AC_DEFINE_UNQUOTED(DISABLE_SECTION_INDEXES, 1, Disable section indexes) fi # make vars available to scripts and makefiles AC_SUBST(ac_aux_dir) AC_SUBST(user_cflags) AC_SUBST(valgrind) AC_SUBST(man) AC_SUBST(manpath) AC_SUBST(manpath_switch) AC_SUBST(section_switch) AC_SUBST(apropos) AC_SUBST(lynx) AC_SUBST(indexes) AC_SUBST(sysconfdir) AC_SUBST(bin_program) AC_SUBST(target_os) AC_SUBST(uc_package_name) AC_SUBST(uc_package_name_conf) AC_SUBST(PACKAGE_NAME) AC_SUBST([valgrind_opts]) AC_OUTPUT