AC_INIT(cpmfs.c)
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST
-VERSION=2.12
-UPDATED='December 20, 2009'
+VERSION=2.23
+UPDATED='November 2, 2022'
DEVICE="posix"
+TERM="curses"
if test "$prefix" = NONE
then
case $host in
*-linux-*)
;;
+ *-cygwin-*)
+ CYGWIN=yes
+ ;;
*-pc-mingw32)
CFLAGS_LIBDSK=-DNOTWINDLL
+ MINGW32=yes
;;
esac
fi
if test "$GCC" = yes
then
- CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
+ CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wextra -Wshadow -Wno-unused-parameter -Wunused -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
fi
-AC_CYGWIN
-AC_MINGW32
-dnl Choose between posix and win32 drivers...
-DEVICE="posix"
-
DISKDEFS='${datarootdir}/diskdefs'
-if test "$CYGWIN" = "yes"
-then
- DEVICE="win32"
-# DISKDEFS='%USERPROFILE%/diskdefs'
-fi
-if test "$MINGW32" = "yes"
-then
- DEVICE="win32"
-# DISKDEFS='%USERPROFILE%\\diskdefs'
-fi
-
AC_ARG_WITH(diskdefs,[ --with-diskdefs Specify diskdefs location],
[DISKDEFS="$withval"], [DISKDEFS="$DISKDEFS"])
AC_ARG_WITH(defformat,[ --with-defformat Specify default format (ibm-3740)],
[DEFFORMAT="$withval"], [DEFFORMAT="ibm-3740"])
AC_ARG_WITH(libdsk, [ --with-libdsk Specify path to libdsk library],
[LIBDSK="$withval"], [LIBDSK=""])
-AC_ARG_WITH(dmalloc, [ --with-dmalloc Specify path to dmalloc library],
- [CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include"
- LDFLAGS="$LDFLAGS -L$with_dmalloc/lib"
- LIBS="$LIBS -ldmalloc"
- AC_DEFINE(USE_DMALLOC)])
dnl Check for curses. If not found, don't build fsed.cpm
dnl Try both curses and ncurses
AC_CHECK_LIB(curses, printw, FSED_CPM=fsed.cpm LIBS="-lcurses $LIBS", FSED_CPM=)
if test x"$FSED_CPM" = x""; then
AC_CHECK_LIB(ncurses, printw, FSED_CPM=fsed.cpm LIBS="-lncurses $LIBS", FSED_CPM=)
+ if test x"$FSED_CPM" != x""; then
+ AC_DEFINE(NEED_NCURSES)
+ AC_CHECK_HEADERS(ncurses/ncurses.h,have_ncurses_ncurses_h=yes)
+ fi
fi
dnl If using libdsk, check it's available.
AC_CHECK_HEADERS(libdsk.h, ,[echo "No libdsk.h - aborting"; exit 1])
fi
-dnl If using win32, check it's available.
-if test x"$DEVICE" = x"win32"; then
- AC_CHECK_HEADERS(windows.h, ,[echo "Device win32, but <windows.h> not found - aborting"; exit 1] )
- AC_CHECK_HEADERS(winioctl.h, ,[echo "Device win32, but <winioctl.h> not found - aborting"; exit 1],
-[#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-])
-fi
-
dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/types.h sys/stat.h limits.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h sys/types.h sys/stat.h limits.h unistd.h sys/utime.h utime.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_EXEEXT
AC_OBJEXT
AC_SUBST(DEFFORMAT)
AC_SUBST(FSED_CPM)
AC_SUBST(UPDATED)
-AC_OUTPUT(Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1 )
+AC_CONFIG_FILES(Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1 diskdefs.5)
+AC_OUTPUT