forked from rsnapshot/rsnapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
366 lines (333 loc) · 7.78 KB
/
configure.ac
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
AC_INIT([rsnapshot],[m4_chomp_all(m4_esyscmd([git describe --tags --always --dirty]))],[[email protected]])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_MAKE_SET
AC_CONFIG_FILES(Makefile)
dnl
dnl get the current working directory for the regression test suite
dnl
CWD=`eval echo \`pwd\``
AC_SUBST(CWD, "$CWD/")
dnl general test-directory
AC_SUBST(TEST, "$CWD/t/")
dnl snapshot_root in conf-files
AC_SUBST(SNAP, "$CWD/t/support/snapshots")
dnl template-source to backup
AC_SUBST(TEMP, "$CWD/t/support/files/template")
dnl
dnl PERL CHECK (required program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(perl,
[ --with-perl=PATH Specify the path to perl ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
PERL=$withval
else
AC_MSG_ERROR(perl not found)
fi
else
AC_MSG_ERROR(perl is required)
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$PERL" = ""; then
AC_PATH_PROG(PERL, perl, no)
fi
dnl bail out if we can't find it
if test "$PERL" = "no"; then
AC_MSG_ERROR(perl is required)
fi
dnl
dnl RSYNC CHECK (required program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(rsync,
[ --with-rsync=PATH Specify the path to rsync ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
RSYNC=$withval
AC_SUBST(CMD_RSYNC, "cmd_rsync $RSYNC")
else
AC_MSG_ERROR(rsync not found)
fi
else
AC_MSG_ERROR(rsync is required)
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$RSYNC" = ""; then
AC_PATH_PROG(RSYNC, rsync, no)
AC_SUBST(RSYNC, "$RSYNC")
AC_SUBST(CMD_RSYNC, "cmd_rsync $RSYNC")
fi
dnl bail out if we can't find it
if test "$RSYNC" = "no"; then
AC_MSG_ERROR(rsync is required)
fi
dnl
dnl CP CHECK (optional program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(cp,
[ --with-cp=PATH Specify the path to cp ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
CP=$withval
else
AC_MSG_ERROR(cp not found)
fi
else
CP=no
fi
]
)
dnl save the program for testing
AC_SUBST(TEST_CP, "$CP")
dnl if the user didn't specify a path, hunt for it
if test "$CP" != "no"; then
AC_PATH_PROG(CP, cp, no)
fi
dnl if we couldn't find it, provide an example
if test "$CP" = "no"; then
CP=/bin/cp
fi
dnl either way, set the cmd_cp var
AC_SUBST(CMD_CP, "cmd_cp $CP")
dnl
dnl RM CHECK (optional program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(rm,
[ --with-rm=PATH Specify the path to rm ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
RM=$withval
else
AC_MSG_ERROR(rm not found)
fi
else
RM=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$RM" != "no"; then
AC_PATH_PROG(RM, rm, no)
fi
dnl save the program for testing
AC_SUBST(TEST_RM, "$RM")
dnl if we couldn't find it, provide an example
if test "$RM" = "no"; then
RM=/bin/rm
fi
dnl either way, set the cmd_rm var
AC_SUBST(CMD_RM, "cmd_rm $RM")
dnl
dnl SSH CHECK (optional program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(ssh,
[ --with-ssh=PATH Specify the path to ssh ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
SSH=$withval
else
AC_MSG_ERROR(ssh not found)
fi
else
SSH=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$SSH" != "no"; then
AC_PATH_PROG(SSH, ssh, no)
fi
dnl save the program for testing
AC_SUBST(TEST_SSH, "$SSH")
dnl if we couldn't find it, provide an example
if test "$SSH" = "no"; then
SSH=/path/to/ssh
fi
dnl either way, set the cmd_ssh var
AC_SUBST(CMD_SSH, "cmd_ssh $SSH")
dnl
dnl LVM COMMANDS CHECK (optional programs)
dnl
dnl lvcreate
AC_PATH_PROG(LVCREATE, lvcreate, no)
if test "$LVCREATE" = "no"; then
LVCREATE=/path/to/lvcreate
fi
AC_SUBST(CMD_LVCREATE, "$LVCREATE")
dnl lvremove
AC_PATH_PROG(LVREMOVE, lvremove, no)
if test "$LVREMOVE" = "no"; then
LVREMOVE=/path/to/lvremove
fi
AC_SUBST(CMD_LVREMOVE, "$LVREMOVE")
dnl mount
AC_PATH_PROG(MOUNT, mount, no)
if test "$MOUNT" = "no"; then
MOUNT=/path/to/mount
fi
AC_SUBST(CMD_MOUNT, "$MOUNT")
dnl umount
AC_PATH_PROG(UMOUNT, umount, no)
if test "$UMOUNT" = "no"; then
UMOUNT=/path/to/umount
fi
AC_SUBST(CMD_UMOUNT, "$UMOUNT")
dnl
dnl LOGGER CHECK (optional program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(logger,
[ --with-logger=PATH Specify the path to logger ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
LOGGER=$withval
else
AC_MSG_ERROR(logger not found)
fi
else
LOGGER=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$LOGGER" != "no"; then
AC_PATH_PROG(LOGGER, logger, no)
fi
dnl save the program for testing
AC_SUBST(TEST_LOGGER, "$LOGGER")
dnl if we couldn't find it, provide an example
if test "$LOGGER" = "no"; then
LOGGER=/path/to/logger
fi
dnl either way, set the cmd_logger var
AC_SUBST(CMD_LOGGER, "cmd_logger $LOGGER")
dnl
dnl DU CHECK (optional program)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(du,
[ --with-du=PATH Specify the path to du ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
DU=$withval
else
AC_MSG_ERROR(du not found)
fi
else
DU=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$DU" != "no"; then
AC_PATH_PROG(DU, du, no)
fi
dnl save the program for testing
AC_SUBST(TEST_DU, "$DU")
dnl if we couldn't find it, provide an example
if test "$DU" = "no"; then
DU=/path/to/du
fi
dnl either way, set the cmd_du var
AC_SUBST(CMD_DU, "cmd_du $DU")
dnl
dnl TEST_SSH_USER CHECK (optional param)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(test-ssh-user,
[ --with-test-ssh-user=USER Specify ssh user for tests ],
[
if test "x$withval" != "xno"; then
TEST_SSH_USER="$withval"
AC_SUBST(TEST_SSH_USER, "$TEST_SSH_USER")
fi
]
)
dnl if the user didn't specify a test ssh user use current user
if test "$TEST_SSH_USER" = ""; then
AC_SUBST(TEST_SSH_USER, "$USER")
fi
dnl
dnl TRUE CHECK (required program in tests)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(test-true,
[ --with-test-true=PATH Specify the path to true ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
TRUE=$withval
else
AC_MSG_ERROR(true not found)
fi
else
TRUE=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$TRUE" != "no"; then
AC_PATH_PROG(TRUE, true, no)
fi
dnl if we couldn't find it, provide an example
if test "$TRUE" = "no"; then
TRUE=/bin/true
fi
dnl
dnl FALSE CHECK (required program in tests)
dnl
dnl if the user specified a path, try that first
AC_ARG_WITH(test-false,
[ --with-test-false=PATH Specify the path to false ],
[
if test "x$withval" != "xno"; then
if test -x "$withval"; then
FALSE=$withval
else
AC_MSG_ERROR(false not found)
fi
else
FALSE=no
fi
]
)
dnl if the user didn't specify a path, hunt for it
if test "$FALSE" != "no"; then
AC_PATH_PROG(FALSE, false, no)
fi
dnl if we couldn't find it, provide an example
if test "$FALSE" = "no"; then
FALSE=/bin/false
fi
# replace perl paths
AC_CONFIG_FILES(rsnapshot:rsnapshot-program.pl)
AC_CONFIG_FILES(rsnapshot-diff:rsnapshot-diff.pl)
dnl try to find dependent programs for the config file
AC_CONFIG_FILES(rsnapshot.conf.default:rsnapshot.conf.default.in)
dnl testsuite-files are following
m4_include(t/include.ac)
AC_OUTPUT
echo ""
echo "Now type \"make test\" to run the regression test suite."
echo "Then type \"make install\" to install the program."
echo ""
if test ! -e "$RSNAPSHOT_SYSCONFDIR/rsnapshot.conf"; then
echo "After rsnapshot is installed, don't forget to copy"
echo "$RSNAPSHOT_SYSCONFDIR/rsnapshot.conf.default to $RSNAPSHOT_SYSCONFDIR/rsnapshot.conf"
echo ""
fi