File: configure.in

package info (click to toggle)
cpmtools 2.0-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 844 kB
  • ctags: 383
  • sloc: ansic: 5,005; sh: 2,419; makefile: 134
file content (120 lines) | stat: -rw-r--r-- 2,912 bytes parent folder | download
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
AC_INIT(cpmfs.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
VERSION=2.0
UPDATED='October 11, 2001'

DEVICE="posix"

if test "$prefix" = NONE
then
  case $host in
    *-linux-*)
      PIPE="-pipe "
    ;;
  esac
  case $host in
    *-netbsd*)
      PIPE="-pipe "
    ;;
  esac
fi

AC_PROG_CC
AC_PROG_INSTALL
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'
fi

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=)
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"
  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)

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

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 )