File: configure.in

package info (click to toggle)
zlibc 0.9k-4.3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 624 kB
  • ctags: 461
  • sloc: sh: 3,195; ansic: 3,077; csh: 128; makefile: 60; sed: 4
file content (243 lines) | stat: -rw-r--r-- 6,005 bytes parent folder | download | duplicates (5)
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
dnl Process this file with autoconf to produce a configure script.
AC_INIT(open.c)

AC_CONFIG_HEADER(config.h)

dnl checks for programs
dnl ===================
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(INSTALL_INFO, install-info, "")


AC_PATH_PROGS(XGZIP, gzip compress compact, gzip,
 $PATH:/usr/bin:/usr/local/bin:/usr/local/gnu/bin:/usr/gnu/bin)

dnl check for gzip extension
dnl ========================


dnl check for systems
dnl =================
AC_AIX
AC_ISC_POSIX
AC_MINIX
AC_CANONICAL_SYSTEM


dnl checks for libraries
dnl ====================
dnl AC_IRIX_SUN
AC_CHECK_LIB(sun, getpwnam)
AC_CHECK_LIB(dl, dlsym)

dnl checks for header files
dnl =======================

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h unistd.h errno.h sys/stat.h \
sys/param.h string.h strings.h syscall.h sys/syscall.h fcntl.h sys/wait.h \
time.h sys/time.h utime.h pwd.h gnu-stabs.h ansidecl.h dlfcn.h features.h)
AC_HEADER_TIME


dnl checks for typedefs
dnl ===================

AC_TYPE_SIZE_T
AC_TYPE_OFF_T

dnl checks for structures
dnl =====================

AC_STRUCT_TM

dnl checks for compiler characteristics
dnl ===================================

AC_C_CONST
AC_C_INLINE





dnl checks for library functions
dnl ============================


AC_CHECK_FUNCS(strsep strpbrk memset)

dnl recommended by the autoconf doc, for HEADER_STDC
AC_CHECK_FUNCS(strchr memcpy fchdir)

dnl We first check for "weak" symbols.
dnl AC_CHECK_FUNCS(__open _open, [break])

dnl We check for double underbar symbols.  Apparently, it's these that
dnl are called from other library routines, so we better override these
AC_CHECK_FUNCS(__access __chmod __chown __lstat __open __readlink \
__unlink __link __symlink __libc_open getxattr \
stat64 _xstat __xstat _xstat64 __xstat64 \
readdir64 )


dnl system call, which may not be available everywhere
dnl if they are absent, no need to provide them either...
AC_CHECK_FUNCS(utime utimes)

dnl checks for system services
dnl ==========================


dnl Check for configuration options
dnl Enable OS/2 extended density format disks
AC_ARG_ENABLE(runtime-conf,
[  --enable-runtime-conf  enable runtime configuration (default on)],
[if test x$enableval = xyes; then
  AC_DEFINE(RUNTIME_CONF,1,
	[Define this if you want runtime configuration using .zlibrc])
fi],AC_DEFINE(RUNTIME_CONF))



dnl Enable configuration with environmental variables
AC_ARG_ENABLE(env-conf,
[  --enable-env-conf      configuration with environmental variable (default on)],
[if test x$enableval = xyes; then
  AC_DEFINE(ENV_CONF,1,
	[Define this if you want configuration using environmental variables])
fi],AC_DEFINE(ENV_CONF))

dnl Do we have a proc filesystem?
AC_ARG_ENABLE(have-proc,
[  --enable-have-proc     have a proc filesystem],
[if test x$enableval = xyes; then
  define_have_proc="#define HAVE_PROC"
fi],[test -d /proc/self &&  define_have_proc="#define HAVE_PROC"])


dnl compressor extension
AC_ARG_WITH(compr-ext,
[  --with-compr-ext=ext   set the extension used by the compression program],
,[
LD_ZLIB_DISABLE=1 rm -f testfile*
echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz >testfile
$XGZIP -f testfile
with_ext=`LD_ZLIB_DISABLE=1 sh -c 'echo testfile.*' | sed 's/testfile//g'`
LD_ZLIB_DISABLE=1 rm -f testfile.*
])


dnl temporary directory
AC_ARG_WITH(tmpdir,
[  --with-tmpdir=dir      set the directory for temporary files],
,[with_tmpdir="/tmp"])


dnl maximal length of extension
AC_ARG_WITH(extlen,
[  --with-extlen=len      set the maximal acceptable length for the extension
                         identifying compressed files],
,[with_extlen=5])


dnl uncompressor command line
AC_ARG_WITH(uncompressor,
[  --with-uncompressor=cmdline   set the command line for
                                 uncompressing files],
[uncompressor=`echo $with_var |
	sed -e 's/^ *//g' -e 's/ *$//g' -e 's/  */","/g'`],
[uncompressor=$XGZIP'","-dc'])

dnl compressor command line
AC_ARG_WITH(compressor,
[  --with-compressor=cmdline   set the command line for
                               compressing files (experimenatal)],
[compressor=`echo $with_var |
	sed -e 's/^ *//g' -e 's/ *$//g' -e 's/  */","/g'`],
[compressor=$XGZIP'","-c'])

[
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="-D$host_cpu1 -D$host_vendor1 -D$host_os1"
if [ $host_os1 != $host_os2 ] ; then
	HOST_ID="$HOST_ID -D$host_os2"
fi
if [ $host_os1 != $host_os3 ] && [ $host_os2 != $host_os3 ] ; then
	HOST_ID="$HOST_ID -D$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
    CFLAGS="$CFLAGS $Wall"
fi

if [ $host_vendor = linux ] ; then
    CFLAGS="$CFLAGS -DUSE_XDF"
fi


if [ $host_vendor = att ] ; then
    CFLAGS="$CFLAGS -Datt"
fi

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

if [ $host_os3 = hpux ] ; then
    LDFLAGS="$LDFLAGS -z"
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
]

AC_SUBST(uncompressor)
AC_SUBST(compressor)
AC_SUBST(with_homeconf)
AC_SUBST(with_systemconf)
AC_SUBST(with_ext)
AC_SUBST(with_extlen)
AC_SUBST(with_tmpdir)

AC_SUBST(define_have_proc)
AC_SUBST(XGZIP)
AC_SUBST(SHLIB)
AC_SUBST(host_cpu)
AC_SUBST(HOST_ID)
AC_OUTPUT(Makefile params.h)