dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood dnl dnl Distributed under the Artistic License v2.0; see `doc/COPYING'. AC_INIT AC_CONFIG_SRCDIR([src/main/version.c]) AC_CONFIG_AUX_DIR(autoconf/scripts) AC_CONFIG_HEADERS([src/include/config.h:autoconf/header.in]) AH_BOTTOM([#include "config-aux.h"]) dnl Package identity PACKAGE=`cat $srcdir/doc/PACKAGE` VERSION=`cat $srcdir/doc/VERSION` UCPACKAGE=`tr a-z A-Z < $srcdir/doc/PACKAGE` AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(UCPACKAGE) AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Package name]) AC_DEFINE_UNQUOTED([PROGRAM_NAME], ["$PACKAGE"], [Name of this program]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version of this program]) AC_DEFINE([COPYRIGHT_YEAR], [_("2023")], [Copyright year]) AC_DEFINE([COPYRIGHT_HOLDER], [_("Andrew Wood ")], [Copyright holder]) AC_DEFINE([PROJECT_HOMEPAGE], ["http://www.ivarch.com/programs/" PROGRAM_NAME ".shtml"], [Project homepage]) AC_DEFINE([BUG_REPORTS_TO], [_("")], [Bug reporting email address]) AC_LANG(C) CFLAGS=${CFLAGS:-"-O"} AC_PROG_CC AC_PROG_INSTALL AC_USE_SYSTEM_EXTENSIONS AC_C_CONST AC_HEADER_STDBOOL AC_SYS_LARGEFILE AC_HEADER_TIOCGWINSZ AC_CHECK_FUNCS(getopt_long getopt) AC_CHECK_HEADERS(getopt.h) AC_CHECK_FUNCS(memcpy basename vsnprintf strlcat) AC_CHECK_FUNCS(fdatasync) AC_CHECK_FUNCS(fpathconf sysconf posix_memalign) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(wctype.h) AC_CHECK_HEADERS(termios.h) AC_ARG_ENABLE(debugging, [ --enable-debugging compile with debugging support], if test "$enable_debugging" = "yes"; then CFLAGS="$CFLAGS -g -Wall" AC_DEFINE([ENABLE_DEBUGGING], [1], [Debugging support enabled]) fi ) AC_ARG_ENABLE(profiling, [ --enable-profiling compile with profiling support], if test "$enable_profiling" = "yes"; then CFLAGS="-pg $CFLAGS" fi ) STATIC_NLS="no" AC_ARG_ENABLE(static-nls, [ --enable-static-nls hardcode NLS with no support files], if test "$enable_static_nls" = "yes"; then STATIC_NLS="yes" fi, STATIC_NLS="no" ) NLS_SUPPORT="no" AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], if test "$enable_nls" = "yes"; then NLS_SUPPORT="yes" fi, NLS_SUPPORT="yes" ) SPLICE_SUPPORT="no" AC_ARG_ENABLE(splice, [ --disable-splice do not use splice system call], if test "$enable_splice" = "yes"; then SPLICE_SUPPORT="yes" fi, SPLICE_SUPPORT="yes" ) IPC_SUPPORT="no" AC_ARG_ENABLE(ipc, [ --disable-ipc turn off IPC messaging], if test "$enable_ipc" = "yes"; then IPC_SUPPORT="yes" fi, IPC_SUPPORT="yes" ) dnl AIX needs -lc128 AC_EGREP_CPP([^yes$], [#ifdef _AIX yes #endif ], [LIBS="$LIBS -lc128"]) dnl Native Language Support if test "$NLS_SUPPORT" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Enable native language support]) AC_PATH_PROG(MSGFMT, msgfmt, NOMSGFMT) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AC_PATH_PROG(XGETTEXT, xgettext, xgettext) if test "x$MSGFMT" = "xNOMSGFMT"; then MSGFMT="" STATIC_NLS="yes" fi if test "$STATIC_NLS" = "yes"; then CATALOGS="" NLSOBJ="src/nls/table.o" else AC_CHECK_LIB(intl, main) AC_CHECK_LIB(i, main) fi CATOBJEXT=.mo INSTOBJEXT=.mo for lang in de fr pl pt; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES \$(srcdir)/src/nls/$lang.po" CATALOGS="$CATALOGS src/nls/$lang$CATOBJEXT"; done if test "$STATIC_NLS" = "yes"; then CATALOGS="" else AC_CHECK_FUNC(gettext, [AC_DEFINE([HAVE_GETTEXT], [1], [The gettext function is available]) NLSOBJ="" ], [CATALOGS=""; NLSOBJ="src/nls/table.o" ] ) fi fi AC_CHECK_HEADERS(libintl.h) AC_CHECK_HEADERS(locale.h) AC_SUBST(MSGFMT) AC_SUBST(GMSGFMT) AC_SUBST(XGETTEXT) AC_SUBST(CATOBJEXT) AC_SUBST(INSTOBJEXT) AC_SUBST(GMOFILES) AC_SUBST(POFILES) AC_SUBST(CATALOGS) AC_SUBST(NLSOBJ) if test "$IPC_SUPPORT" = "yes"; then AC_CHECK_HEADERS(sys/ipc.h sys/param.h libgen.h) fi if test "$SPLICE_SUPPORT" = "yes"; then AC_CHECK_FUNCS(splice) fi dnl This must go after all the compiler based tests above. AC_LANG_WERROR dnl Fudging for separate build directories. dnl subdirs="" for i in `find $srcdir/src -type d -print | sed s,$srcdir/,,`; do subdirs="$subdirs $i" done dnl Stitch together the Makefile fragments. dnl mk_segments="autoconf/Makefile.in" for i in vars.mk package.mk filelist.mk~ unreal.mk modules.mk~ \ rules.mk link.mk depend.mk~; do mk_segments="$mk_segments:autoconf/make/$i" done dnl Output files (and create build directory structure too). dnl AC_CONFIG_FILES([Makefile:$mk_segments doc/lsm:doc/lsm.in doc/quickref.1:doc/quickref.1.in src/.dummy:doc/NEWS.md]) AC_CONFIG_COMMANDS([default],[rm -f src/.dummy for i in $subdirs; do test -d $i || mkdir $i done ],[subdirs="$subdirs"]) AC_OUTPUT dnl EOF