File: configure.in

package info (click to toggle)
mtools 3.8-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,116 kB
  • ctags: 1,306
  • sloc: ansic: 11,489; sh: 2,052; makefile: 223; sed: 8
file content (191 lines) | stat: -rw-r--r-- 4,464 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
dnl Process this file with autoconf to produce a configure script.
AC_INIT(buffer.c)

AC_CONFIG_HEADER(config.h)

dnl Checks for compiler
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S

dnl Check for Systems
AC_AIX
AC_ISC_POSIX
AC_MINIX
AC_CANONICAL_SYSTEM

AC_C_CONST
AC_C_INLINE


dnl Check for configuration options
dnl Enable OS/2 extended density format disks
undefine([xdf])dnl
AC_ARG_ENABLE(xdf,
[  --enable-xdf           support for OS/2 extended density format disks],
[if test x$enableval = xyes; then
  AC_DEFINE(USE_XDF)
fi],AC_DEFINE(USE_XDF))


dnl Check for configuration options
dnl Enable usage of vold on Solaris
undefine([vold])dnl
AC_ARG_ENABLE(vold,
[  --enable-vold          compatibility with Solaris' vold],
[if test x$enableval = xyes; then
  AC_DEFINE(USING_VOLD)
fi])


dnl Check for configuration options
dnl Enable usage of vold on Solaris
undefine([new-vold])dnl
AC_ARG_ENABLE(new-vold,
[  --enable-new-vold          compatibility with Solaris' vold, new version],
[newVold=x$enableval
if test x$enableval = xyes; then
  AC_DEFINE(USING_NEW_VOLD)
fi])


dnl Check for configuration options
dnl Debugging
undefine([debug])dnl
AC_ARG_ENABLE(debug,
[  --enable-debug         debuging messages],
[if test x$enableval = xyes; then
  AC_DEFINE(DEBUG)
fi])


dnl Check for configuration options
dnl Raw terminal code (enabled by default)
undefine([raw_term])dnl
AC_ARG_ENABLE(raw_term,
[  --enable-raw-term      raw terminal (readkey behaviour, default)],
[if test x$enableval = xyes; then
  AC_DEFINE(USE_RAWTERM)
fi],
AC_DEFINE(USE_RAWTERM))


dnl Checks for libraries.

dnl AC_IRIX_SUN
AC_CHECK_LIB(sun, getpwnam)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(getopt.h sys/stat.h stdlib.h unistd.h libc.h \
fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h strings.h string.h \
sys/param.h memory.h malloc.h signal.h sys/signal.h utime.h sgtty.h)
AC_CHECK_HEADERS(termio.h sys/termio.h, [break])
AC_CHECK_HEADERS(termios.h sys/termios.h, [break])
dnl Apparently termio before termios is preferred by A/UX, AIX and SCO

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strerror random srandom strchr strrchr lockf flock \
strcasecmp strncasecmp atexit on_exit getpass memmove \
strdup strcspn strspn strtoul memcpy strpbrk memset seteuid setresuid \
tcsetattr tcflush)


AC_CHECK_FUNCS(utimes utime, [break])
AC_CHECK_FUNCS(tzset gettimeofday)

[
host_os0=`echo $host_os | sed 's/-/_/g'`
host_os1=`echo $host_os0 | sed 's/\./_/g'`
host_os2=`echo $host_os0 | sed 's/^\([^.]*\)\..*$/\1/g'`
host_os3=`echo $host_os2 | sed 's/^\([^0-9]*\)[0-9]*$/\1/g'`
host_cpu1=`echo $host_cpu | sed 's/\./_/g'`
host_vendor1=`echo $host_vendor | sed 's/\./_/g'`
HOST_ID="-DCPU_$host_cpu1 -DVENDOR_$host_vendor1 -DOS_$host_os1"
if [ $host_os1 != $host_os2 ] ; then
	HOST_ID="$HOST_ID -DOS_$host_os2"
fi
if [ $host_os1 != $host_os3 ] && [ $host_os2 != $host_os3 ] ; then
	HOST_ID="$HOST_ID -DOS_$host_os3"
fi

my_host_os=`echo $host_os1 $host_os2 $host_os3 | sort -u`
objs=`echo $srcdir/*.c | sed 's/\.c$/.o/' `
if [ "X$GCC" = "Xyes" ] ; then
    if [ "$host_cpu" = i486 ] ; then
	    CFLAGS="$CFLAGS -m486"
    fi
    Wall=-Wall
    if [ "$host_os3" = sunos ] ; then
	    Wall=""
    fi
    if [ "$host_os3" = ultrix ] ; then
	    Wall=""
    fi
    if [ "$host_os3" = linux ] ; then
	    CFLAGS="$CFLAGS -fno-strength-reduce"
    fi
    if [ "$host_os3" = aux ] ; then
	    CFLAGS="$CFLAGS -ZP"
	    MACHDEPLIBS="-lposix -UTIL"
    fi	
    CFLAGS="$CFLAGS $Wall"
else
    if [ $host_os3 = hpux ] ; then
	    CPPFLAGS="$CPPFLAGS -Ae"
    fi

    if [ $host_os3 = xenix ] ; then
	    CFLAGS="$CFLAGS -M2e"
    fi
fi

if [ $host_os3 = hpux ] ; then
	    LDFLAGS="$LDFLAGS -z"
fi


if [ $host_vendor = linux ] ; then
    LDFLAGS="$LDFLAGS -z"
fi

if [ $host_os3 = xenix ] ; then
    LDFLAGS="$LDFLAGS -M2e -i -f 5000"
fi

if [ $host_os2 = sysv4 ] ; then
    SHLIB="-lc -L/usr/ucblib -lucb"
else
    SHLIB=""
fi

if [ $host_os3 = isc ] ; then
    CFLAGS="$CFLAGS -D_SYSV3"
    SHLIB="-lc_s"
fi

if [ $host_os3 = solaris -a x$newVold = xxyes ] ; then
    SHLIB="$SHLIB -s -lvolmgt"
fi

if [ $host_os3 = nextstep ] ; then
    CFLAGS="$CFLAGS -DBSD"
    SHLIB=""
fi
]

AC_SUBST(MACHDEPLIBS)
AC_SUBST(SHLIB)
AC_SUBST(host_cpu)
AC_SUBST(HOST_ID)
AC_OUTPUT(Makefile)