1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
AC_INIT(cpmfs.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
VERSION=2.13
UPDATED='March 30, 2010'
DEVICE="posix"
if test "$prefix" = NONE
then
case $host in
*-linux-*)
;;
*-pc-mingw32)
CFLAGS_LIBDSK=-DNOTWINDLL
;;
esac
fi
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CPP
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"
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=)
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_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, ,[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)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_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
FSED_CPM="$FSED_CPM$EXEEXT"
fi
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(mktime strerror)
AC_SUBST(LDLIBS)
AC_SUBST(LDDEPS)
AC_SUBST(DEVICE)
eval DATADIR=$datadir
AC_SUBST(DATADIR)
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 )
|