dnl Process this file with autoconf to produce a configure script. dnl written jan/1997 dnl by T.E.Dickey dnl and Jim Spath AC_PREREQ(2.12) AC_INIT(userdefs.h) AC_CONFIG_HEADER(lynx_cfg.h:config.hin) AC_PREFIX_DEFAULT(/usr/local) AC_CANONICAL_HOST dnl -------------------------------------------------------------------------- dnl Checks for location of programs dnl -------------------------------------------------------------------------- AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB AC_PROG_MAKE_SET CF_MAKE_INCLUDE AC_PROG_INSTALL AC_MSG_CHECKING(if you want full utility pathnames) CF_ARG_DISABLE(full-paths, [ --disable-full-paths control whether full utility pathnames are used], [with_full_paths=no], [with_full_paths=yes]) AC_MSG_RESULT($with_full_paths) CF_DEFINE_PROG(system mailer, SYSTEM_MAIL, /usr/mmdf/bin/submit \ /usr/sbin/sendmail \ /usr/lib/sendmail \ ) CF_SYSTEM_MAIL_FLAGS CF_PATH_PROG(CHMOD, chmod) CF_PATH_PROG(COMPRESS, compress) CF_PATH_PROG(COPY, cp) CF_PATH_PROG(GZIP, gzip) CF_PATH_PROG(INSTALL, install) CF_PATH_PROG(MKDIR, mkdir) CF_PATH_PROG(MV, mv) CF_PATH_PROG(RM, rm) CF_PATH_PROG(TAR, tar) CF_PATH_PROG(TOUCH, touch) CF_PATH_PROG(UNCOMPRESS,gunzip) CF_PATH_PROG(UNZIP, unzip) CF_PATH_PROG(UUDECODE, uudecode) CF_PATH_PROG(ZCAT, zcat) CF_PATH_PROG(ZIP, zip) dnl -------------------------------------------------------------------------- dnl Checks for compiler & standard-library characteristics dnl -------------------------------------------------------------------------- dnl If we're able to run this script, this is true! AC_DEFINE(UNIX) CF_ANSI_CC AC_C_CONST dnl Only add to this case statement things that we cannot design tests for. case $host_os in aix4*) CFLAGS="$CFLAGS -DAIX4 -D_BSD=44" LIBS="$LIBS -lbsd" ;; aix*) LIBS="$LIBS -lbsd" ;; apollo*) CFLAGS="$CFLAGS -D_BUILTINS -W0,-opt,4" ;; bsdi*) CFLAGS="$CFLAGS -DBSDI" ;; clix*) # Tested on CLIX 3.1 (T.Dickey). The original makefile entry # contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also # references -lmalloc and -lbsd. AC_CHECK_LIB(c_s,strcmp) ;; convex*) CFLAGS="$CFLAGS -D__STDC__ -Dunix" ;; dgux*) CFLAGS="$CFLAGS -DDGUX" ;; hpux*) CFLAGS="$CFLAGS -DSNAKE" ;; isc*) # -DPOSIX_JC is necessary, else LYBookmark.c never finds out what a mode_t is. CFLAGS="$CFLAGS -DISC -DPOSIX_JC" LIBS="$LIBS -linet -lnsl_s -lcposix" ;; irix*) # The original makefile used the $CFLAGS option -cckr for some form # of K&R compatibility. However, this causes compilation warnings for # varargs on IRIX 5.2, and does not appear to be needed. #removed: CFLAGS="$CFLAGS -cckr" ;; linux*) CFLAGS="$CFLAGS -DLINUX" ;; next*) CFLAGS="$CFLAGS -DNEXT -DXMOSAIC_HACK" ;; openbsd*) LIBS="$LIBS -lcompat" ;; osf*) # Increase the maximum size of functions that will be optimized. test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000" CFLAGS="$CFLAGS -DDSYS5" ;; sco3.2v5*) test $ac_cv_prog_gcc != yes && CC="cc -belf" ;; sco*) LIBS="$LIBS -lmalloc" # It's a little late to do much, but try to warn user if he's using # SCO's cc (which is reported to have broken const/volatile). case "$CC" in #(vi cc|*/cc) AC_MSG_WARN(You should consider using gcc or rcc if available) unset ac_cv_prog_CC AC_CHECK_PROGS(CC,gcc rcc,$CC) ;; esac ;; sequent-ptx) CFLAGS="$CFLAGS -DSVR4_BSDSELECT -DNO_IOCTL -DUSE_FCNTL" ;; sequent-ptx2) CFLAGS="$CFLAGS -DSVR4_BSDSELECT" ;; svr4) CFLAGS="$CFLAGS -DSVR4_BSDSELECT -DSVR4" ;; sunos3*) CFLAGS="$CFLAGS -DSUN" ;; sunos4*) CFLAGS="$CFLAGS -DSUN -DSUN4" ;; ultrix*) # Increase the maximum size of functions that will be optimized. test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 600 -G 7" CFLAGS="$CFLAGS -DULTRIX" ;; esac dnl -------------------------------------------------------------------------- dnl Checks for library configuration (added right-to-left) dnl -------------------------------------------------------------------------- CF_NETLIBS AC_MSG_CHECKING(for screen type) AC_CACHE_VAL(cf_cv_screen,[ AC_ARG_WITH(screen, [ --with-screen=XXX select screen type (XXX is curses (default), ncurses or slang)], [ case $withval in curses|ncurses|slang) cf_cv_screen=$withval ;; *) AC_ERROR(Unexpected value) ;; esac], [cf_cv_screen=curses])]) AC_MSG_RESULT($cf_cv_screen) case $cf_cv_screen in curses) CF_CURSES_LIBS CF_CURS_PERFORMANCE cf_cv_ncurses_header=curses.h ;; ncurses) CF_NCURSES_CPPFLAGS CF_NCURSES_LIBS ;; slang) CF_TERMCAP_LIBS CF_SLANG_CPPFLAGS CF_SLANG_LIBS ;; esac dnl -------------------------------------------------------------------------- dnl Checks for standard headers dnl -------------------------------------------------------------------------- AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_DIRENT AC_CHECK_HEADERS( \ fcntl.h \ limits.h \ string.h \ sys/fcntl.h \ sys/filio.h \ sys/ioctl.h \ sys/param.h \ sys/time.h \ termio.h \ termios.h \ unistd.h \ ) CF_TERMIO_AND_TERMIOS dnl -------------------------------------------------------------------------- dnl Checks for library units dnl -------------------------------------------------------------------------- AC_FUNC_VFORK CF_REMOVE_BROKEN AC_CHECK_FUNCS( \ cuserid \ getcwd \ putenv \ readdir \ ) dnl -------------------------------------------------------------------------- dnl Checks for external-data dnl -------------------------------------------------------------------------- CF_BOOL_DEFS CF_ERRNO CF_LOCALE CF_NGROUPS CF_SYS_ERRLIST CF_UTMP ### These tests must be run after establishing the curses library. if test $cf_cv_screen != slang ; then CF_ALT_CHAR_SET CF_FANCY_CURSES CF_NCURSES_VERSION CF_NCURSES_BROKEN CF_COLOR_CURSES CF_SIZECHANGE CF_TTYTYPE AC_CHECK_FUNCS( \ cbreak \ keypad \ ) fi dnl -------------------------------------------------------------------------- dnl Miscellaneous options that don't need to test system features dnl -------------------------------------------------------------------------- AC_SUBST(EXTRA_OBJS) AC_SUBST(EXTRA_DEPS) AC_MSG_CHECKING(if character-translation code should be used) AC_CACHE_VAL(cf_cv_char_trans,[ AC_ARG_WITH(char-trans, [ --with-char-trans enable optional character-translations], [cf_cv_char_trans=$withval], [cf_cv_char_trans=yes])]) AC_MSG_RESULT($cf_cv_char_trans) if test ".$cf_cv_char_trans" != ".no" ; then AC_DEFINE(EXP_CHARTRANS) EXTRA_OBJS="$EXTRA_OBJS \$(CHARTRANS_OBJS)" EXTRA_DEPS="$EXTRA_DEPS do_chartrans_stuff" fi AC_MSG_CHECKING(if color-style code should be used) AC_CACHE_VAL(cf_cv_color_style,[ AC_ARG_WITH(color-style, [ --with-color-style enable optional/experimental color style], [cf_cv_color_style=$withval], [cf_cv_color_style=no])]) if test $cf_cv_color_style != no ; then if test .$cf_cv_color_curses != .yes ; then AC_ERROR(Configuration does not support color-styles) fi if test $cf_cv_screen = slang ; then AC_ERROR(Configuration does not support color-styles) fi AC_DEFINE(USEHASH) AC_DEFINE(UNPAINT_CACHE) AC_DEFINE(LINKEDSTYLES) fi case $cf_cv_color_style in no) AC_MSG_RESULT(no) ;; *) AC_DEFINE(USE_COLOR_STYLE) AC_MSG_RESULT(curses-style) ;; esac # All DirEd functions that were enabled on compilation can be disabled # or modified at run time via DIRED_MENU symbols in lynx.cfg. AC_MSG_CHECKING(if directory-editor code should be used) AC_CACHE_VAL(cf_cv_dired,[ AC_ARG_WITH(dired, [ --with-dired enable optional directory-editor, DirEd (default)], [cf_cv_dired=$withval], [cf_cv_dired=yes])]) AC_MSG_RESULT($cf_cv_dired) if test ".$cf_cv_dired" != ".no" ; then AC_DEFINE(DIRED_SUPPORT) AC_MSG_CHECKING(if you wish to allow extracting from archives via DirEd) CF_ARG_DISABLE(dired-archive, [ --disable-dired-archive DirEd: disable dearchiving commands],[AC_DEFINE(ARCHIVE_ONLY)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow users to redefine DirEd keys) CF_ARG_DISABLE(dired-override, [ --disable-dired-override DirEd: disable private keymaps],,[AC_DEFINE(OK_OVERRIDE)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow permissions commands via DirEd) CF_ARG_DISABLE(dired-permit, [ --disable-dired-permit DirEd: disable chmod/attrib commands],,[AC_DEFINE(OK_PERMIT)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow executable-permission commands via DirEd) CF_ARG_DISABLE(dired-xpermit, [ --disable-dired-xpermit DirEd: disable chmod/attrib commands],[AC_DEFINE(NO_CHANGE_EXECUTE_PERMS)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow \"tar\" commands from DirEd) CF_ARG_DISABLE(dired-tar, [ --disable-dired-tar DirEd: disable \"tar\" command],,[AC_DEFINE(OK_TAR)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow \"uudecode\" commands from DirEd) CF_ARG_DISABLE(dired-uudecode, [ --disable-dired-uudecode DirEd: disable \"uudecode\" command],,[AC_DEFINE(OK_UUDECODE)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow \"zip\" and \"unzip\" commands from DirEd) CF_ARG_DISABLE(dired-zip, [ --disable-dired-zip DirEd: disable \"zip\", \"unzip\" commands],,[AC_DEFINE(OK_ZIP)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if you wish to allow \"gzip\" and \"gunzip\" commands from DirEd) CF_ARG_DISABLE(dired-gzip, [ --disable-dired-gzip DirEd: disable \"gzip\", \"gunzip\" commands],,[AC_DEFINE(OK_GZIP)]) AC_MSG_RESULT($enableval) fi AC_MSG_CHECKING(if you want long-directory listings) CF_ARG_DISABLE(long-list, [ --disable-long-list disable long \"ls -l\" directory listings],, [AC_DEFINE(LONG_LIST)]) AC_MSG_RESULT($enableval) AC_MSG_CHECKING(if parent-directory references are permitted) CF_ARG_DISABLE(parent-dir-refs, [ --disable-parent-dir-refs disable \"Up-to\" links in directory listings], [AC_DEFINE(NO_PARENT_DIR_REFERENCE)]) AC_MSG_RESULT($enableval) dnl -------------------------------------------------------------------------- dnl Debug/development/test dnl -------------------------------------------------------------------------- AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo develop: display \"compiling\" commands], [SHOW_CC=' @echo compiling $@' ECHO_CC='@'], [SHOW_CC='# compiling' ECHO_CC='']) AC_MSG_RESULT($enableval) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) AC_MSG_CHECKING(if you want to check memory-leaks) CF_ARG_ENABLE(find-leaks, [ --enable-find-leaks develop: logic for testing memory leaks], [with_leak_checks=yes], [with_leak_checks=no]) AC_MSG_RESULT($with_leak_checks) test "$with_leak_checks" = "yes" && AC_DEFINE(LY_FIND_LEAKS) AC_MSG_CHECKING(if you want to enable debug-code) CF_ARG_ENABLE(debug, [ --enable-debug develop: logic for traces/debugging], [with_debug=yes], [with_debug=no]) AC_MSG_RESULT($with_debug) if test "$with_debug" != "yes" ; then if test -n "$GCC" ; then CF_STRIP_G_OPT(CFLAGS) fi fi if test -n "$GCC" then AC_MSG_CHECKING(if you want to turn on gcc warnings) CF_ARG_ENABLE(warnings, [ --enable-warnings develop: GCC compiler warnings], [with_warnings=yes], [with_warnings=no]) AC_MSG_RESULT($with_warnings) if test "$with_warnings" = "yes" then CF_GCC_WARNINGS fi fi ### Finally, build config.h and the makefiles CFLAGS="$CFLAGS $EXTRA_CFLAGS" AC_OUTPUT( makefile \ WWW/Library/unix/makefile \ src/makefile \ src/chrtrans/makefile \ )