pull patches back in from 2.20-2 build
[debian/cpmtools] / configure.in
index aec7ef97f405e7cde7facb9f03d0390925f43f12..444aab92997b8914ff02fa17f41d587d754b9b4e 100644 (file)
@@ -1,21 +1,23 @@
 AC_INIT(cpmfs.c)
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 AC_CANONICAL_HOST
-VERSION=2.4
-UPDATED='Oct 6, 2004'
+VERSION=2.23
+UPDATED='November 2, 2022'
 
 DEVICE="posix"
+TERM="curses"
 
 if test "$prefix" = NONE
 then
   case $host in
     *-linux-*)
-      PIPE="-pipe "
     ;;
-  esac
-  case $host in
-    *-netbsd*)
-      PIPE="-pipe "
+    *-cygwin-*)
+      CYGWIN=yes
+    ;;
+    *-pc-mingw32)
+      CFLAGS_LIBDSK=-DNOTWINDLL
+      MINGW32=yes
     ;;
   esac
 fi
@@ -26,67 +28,45 @@ AC_PROG_CPP
 
 if test "$GCC" = yes
 then
-  CFLAGS="${CFLAGS} ${PIPE}-Wmissing-prototypes -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wnested-externs -pedantic -fno-common"
-  LDFLAGS='-g'
+  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
 
+DISKDEFS='${datarootdir}/diskdefs'
+
+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], 
-               [DMALLOC="$withval"], [DMALLOC=""])
-
-AC_CYGWIN
-AC_MINGW32
-dnl Choose between posix and win32 drivers...
-DEVICE="posix"
-
-if test "$CYGWIN" = "yes"
-then
-  DEVICE="win32"
-fi
-if test "$MINGW32" = "yes"
-then
-  DEVICE="win32"
-fi
-
 
 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. 
 if test "$LIBDSK" != ""; then
   DEVICE="libdsk"
   CPPFLAGS="$CPPFLAGS -I$LIBDSK/include"
-  CFLAGS="$CFLAGS -I$LIBDSK/include"
+  CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK"
   LDFLAGS="$LDFLAGS -L$LIBDSK/lib"
   AC_CHECK_LIB(dsk, dsk_open)
   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 winioctl.h, ,[echo "Windows headers not found - aborting"; exit 1] )
-fi
-
-dnl Check for dmalloc
-if test x"$DMALLOC" != x""; then
-   CPPFLAGS  = "-I$DMALLOC/include $CPPFLAGS"
-   CFLAGS  = "-I$DMALLOC/include $CFLAGS"
-   LDFLAGS = "-L$DMALLOC/lib $LDFLAGS"
-   AC_CHECK_LIB(dmalloc, malloc)
-   AC_CHECK_HEADERS(dmalloc.h)
-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
@@ -94,9 +74,11 @@ AC_TYPE_MODE_T
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
 AC_STRUCT_TM
 AC_EXEEXT
 AC_OBJEXT
+AC_SYS_LARGEFILE
 
 dnl add EXE extension to fsed.cpm
 if test x"$FSED_CPM" != x""; then
@@ -117,4 +99,5 @@ AC_SUBST(DISKDEFS)
 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