File: configure.in

package info (click to toggle)
afbackup 3.1beta1-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,500 kB
  • ctags: 1,685
  • sloc: ansic: 22,406; csh: 3,597; tcl: 964; sh: 403; makefile: 200
file content (420 lines) | stat: -rw-r--r-- 11,878 bytes parent folder | download | duplicates (2)
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
dnl Process this file with autoconf to produce a configure script.

AC_INIT(backup.h)

osname=`./prosname.sh`

ARCH="`./prosspec.sh` $*"
ARCH="`echo $ARCH`"		# for some stupid shells
if test -r config.setup ; then
  CONFARCH=`cat config.setup`
  if test "$CONFARCH" = "$ARCH" ; then
    echo "Already configured for this setup."
    exit 0
  fi
fi
rm -f config.setup

AC_CONFIG_HEADER(conf.h)

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
dnl AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h fcntl.h fnmatch.h limits.h malloc.h netinet/ip.h netinet/in_systm.h regex.h string.h strings.h sys/ioctl.h sys/mode.h sys/mount.h sys/param.h sys/resource.h sys/select.h sys/statfs.h sys/time.h sys/timers.h sys/vfs.h sys/wait.h termios.h termio.h time.h unistd.h values.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_FNMATCH
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF

OPTIMIZE=-O2
if test $ac_cv_prog_gcc = no -a `echo $osname|grep 'HPUX'|wc -l` -lt 1; then
  EXTRACFLAGS="+Olibcalls -Ae -Dhpux -Dunix -Dnotdef"
  OPTIMIZE=-O
fi

AC_CHECK_TYPE(timer_t, int)
AC_CHECK_TYPE(signal_t, int)

checkBoth=0
AC_CHECK_FUNC(connect, checkSocket=0, checkSocket=1)
if test "$checkSocket" = 1; then
    AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
fi
if test "$checkBoth" = 1; then
    oldLibs=$LIBS
    LIBS="$LIBS -lsocket -lnsl"
    AC_CHECK_FUNC(accept, checkNsl=0, [LIBS=$oldLibs])
fi
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))

AC_CHECK_FUNCS(bsearch drand48 getcwd gettimeofday inet_ntoa isnan lchown lfind lsearch memmove mkdir mkfifo mktime qsort rand re_comp regcomp re_compile_pattern rint select setitimer sighold sigrelse socket strdup strerror strrstr strstr timer_create uname)

if test "$ac_cv_func_re_comp" != yes ; then
    AC_CHECK_LIB(compat, re_comp, [LIBS="$LIBS -lcompat"])
    unset ac_cv_func_re_comp
    AC_CHECK_FUNCS(re_comp)
fi

prefixext=yes
AC_ARG_WITH(prefixext,
    [   --with-prefixext=YESNO extend prefix with /backup [yes]],
    [
        if test "$withval"; then
            prefixext="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-prefixext
 option.])
        fi
    ]
)
subdir="/backup"
if test $prefixext != "yes" ; then
  subdir=""
fi

AC_ARG_WITH(serverbindir,
    [   --with-serverbindir=DIR   server binaries in DIR [prefix/subdir/server/bin]],
    [
        if test "$withval"; then
            serverbindir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-serverbindir
 option.])
        fi
    ]
)
: ${serverbindir:='$prefix$subdir/server/bin'}
serverbindir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$serverbindir"
)`
AC_SUBST(serverbindir)
AC_ARG_WITH(serverlibdir,
    [   --with-serverlibdir=DIR   server configuration files in DIR [prefix/subdir/server/lib]],
    [
        if test "$withval"; then
            serverlibdir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-serverlibdir
 option.])
        fi
    ]
)
: ${serverlibdir:='$prefix$subdir/server/lib'}
serverlibdir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$serverlibdir"
)`
AC_SUBST(serverlibdir)
AC_ARG_WITH(servervardir,
    [   --with-servervardir=DIR   variable server files in DIR [prefix/subdir/server/var]],
    [
        if test "$withval"; then
            servervardir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-servervardir
 option.])
        fi
    ]
)
: ${servervardir:='$prefix$subdir/server/var'}
servervardir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$servervardir"
)`
AC_SUBST(servervardir)
AC_ARG_WITH(servermandir,
    [   --with-servermandir=DIR   variable server files in DIR [prefix/subdir/server/man]],
    [
        if test "$withval"; then
            servermandir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-servermandir
 option.])
        fi
    ]
)
: ${servermandir:='$prefix$subdir/server/man'}
servermandir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$servermandir"
)`
AC_SUBST(servermandir)
AC_ARG_WITH(serverlogdir,
    [   --with-serverlogdir=DIR   server log files in DIR [prefix/subdir/server/var]],
    [
        if test "$withval"; then
            serverlogdir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-serverlogdir
 option.])
        fi
    ]
)
: ${serverlogdir:='$prefix$subdir/server/var'}
serverlogdir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$serverlogdir"
)`
AC_SUBST(serverlogdir)
AC_ARG_WITH(clientbindir,
    [   --with-clientbindir=DIR   client binaries in DIR [prefix/subdir/client/bin]],
    [
        if test "$withval"; then
            clientbindir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientbindir
 option.])
        fi
    ]
)
: ${clientbindir:='$prefix$subdir/client/bin'}
clientbindir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientbindir"
)`
AC_SUBST(clientbindir)
AC_ARG_WITH(clientlibdir,
    [   --with-clientlibdir=DIR   client configuration files in DIR [prefix/subdir/client/lib]],
    [
        if test "$withval"; then
            clientlibdir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientlibdir
 option.])
        fi
    ]
)
: ${clientlibdir:='$prefix$subdir/client/lib'}
clientlibdir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientlibdir"
)`
AC_SUBST(clientlibdir)
AC_ARG_WITH(clientvardir,
    [   --with-clientvardir=DIR   variable client files in DIR [prefix/subdir/client/var]],
    [
        if test "$withval"; then
            clientvardir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientvardir
 option.])
        fi
    ]
)
: ${clientvardir:='$prefix$subdir/client/var'}
clientvardir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientvardir"
)`
AC_SUBST(clientvardir)
AC_ARG_WITH(clientmandir,
    [   --with-clientmandir=DIR   variable client files in DIR [prefix/subdir/client/man]],
    [
        if test "$withval"; then
            clientmandir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientmandir
 option.])
        fi
    ]
)
: ${clientmandir:='$prefix$subdir/client/man'}
clientmandir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientmandir"
)`
AC_SUBST(clientmandir)
AC_ARG_WITH(clientlogdir,
    [   --with-clientlogdir=DIR   client log files in DIR [prefix/subdir/client/var]],
    [
        if test "$withval"; then
            clientlogdir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientlogdir
 option.])
        fi
    ]
)
: ${clientlogdir:='$prefix$subdir/client/var'}
clientlogdir=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientlogdir"
)`
AC_SUBST(clientlogdir)
AC_ARG_WITH(rexecdir,
    [   --with-rexecdir=DIR   binaries for remote execution in DIR [prefix/rexec]],
    [
        if test "$withval"; then
            REXECDIR="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-rexecdir
 option.])
        fi
    ]
)
: ${REXECDIR:='$prefix$subdir/rexec'}
REXECDIR=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$REXECDIR"
)`
AC_SUBST(REXECDIR)
AC_ARG_WITH(clientconf,
    [   --with-clientconf=NAME   NAME for client configuration [backup.conf]],
    [
        if test "$withval"; then
            clientconf="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-clientconf
 option.])
        fi
    ]
)
: ${clientconf:=backup.conf}
clientconf=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$clientconf"
)`
AC_SUBST(clientconf)
AC_ARG_WITH(serverconf,
    [   --with-serverconf=NAME   NAME for server configuration [backup.conf]],
    [
        if test "$withval"; then
            serverconf="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-serverconf
 option.])
        fi
    ]
)
: ${serverconf:=backup.conf}
serverconf=`(
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
    eval echo "$serverconf"
)`
AC_SUBST(serverconf)


dnl DES stuff

usedes=no
AC_ARG_WITH(des,
    [   --with-des   for client/server authentication [no]],
    [
        usedes=yes
	des_include=../libdes
	des_libdir=`echo $des_include|sed 's#include$#lib#g'`
	des_header=des.h
	des_ldflag=-ldes
    ]
)

AC_ARG_WITH(des-include,
    [   --with-des-include=DIR   des header file in DIR [../libdes]],
    [
        if test "$withval"; then
            des_include="$withval"
	    des_libdir=$des_include
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-des-include
 option.])
        fi
    ]
)

AC_ARG_WITH(des-header,
    [   --with-des-header=NAME   NAME is des header file [des.h]],
    [
        if test "$withval"; then
            des_header="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-des-header
 option.])
        fi
    ]
)

AC_ARG_WITH(des-libdir,
    [   --with-des-libdir=DIR   des library is in DIR [../libdes]],
    [
        if test "$withval"; then
            des_libdir="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-des-libdir
 option.])
        fi
    ]
)

AC_ARG_WITH(des-ldflag,
    [   --with-des-ldflag=LIB   des library is specified by LIB [-ldes]],
    [
        if test "$withval"; then
            des_ldflag="$withval"
        else
            AC_MSG_WARN([*** You must supply an argument to the --with-des-ldflag
 option.])
        fi
    ]
)

if test $usedes = "no" ; then
  DESINCLUDEPATH=""
  DESDEFINES=""
  DESLIB=""
  DESLIBPATH=""
  DESHEADER=""
else
  if test `echo $des_ldflag|grep '^lib'|wc -l` -gt 0 ; then
    des_ldflag=`echo $des_ldflag|sed 's/^lib/-l/g;s/[.].*//g'`
  fi

  DESINCLUDEPATH="-I$des_include"
  DESDEFINES="-DUSE_DES_ENCRYPTION"
  DESHEADER="$des_header"
  DESLIBPATH="-L$des_libdir"
  DESLIB="$des_ldflag"
fi

AC_SUBST(DESDEFINES)
AC_SUBST(DESINCLUDEPATH)
AC_SUBST(DESLIBPATH)
AC_SUBST(DESLIB)
AC_SUBST(DESHEADER)

AC_SUBST(EXTRACFLAGS)
AC_SUBST(OPTIMIZE)

AC_SUBST(osname)
AC_SUBST(CC)
AC_OUTPUT(budefs.h des_aux.h Makefile server.conf client.conf xcc xsc clientconfig serverconfig afclient.8 cartis.8 cartready.8 afserver.8 label_tape.8 full_backup.8 incr_backup.8 afrestore.8 afverify.8 print_errors.8 afclient.conf.8 afserver.conf.8 CONFIG)

echo "$ARCH" > config.setup