skypher / fdisk (http://gnu.org/software/fdisk/)

GNU fdisk

Clone this repository (size: 530.5 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/skypher/fdisk/
commit 75: 34cb08624820
parent 74: 24cd2aa6f772
branch: default
fix to acinclude.m4
pol...@gnu.org
3 years ago

Changed (Δ2.2 KB):

raw changeset »

acinclude.m4 (97 lines added, 0 lines removed)

configure.ac (1 lines added, 1 lines removed)

Up to file-list acinclude.m4:

@@ -207,6 +207,103 @@ fi
207
207
208
208
209
209
dnl Usage:
210
dnl CHECK_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
211
dnl
212
dnl Adds the required libraries to $CHECK_LIBS and $CHECK_CFLAGS does an
213
dnl AC_SUBST(CHECK_LIBS) and AC_SUBST(CHECK_CFLAGS)
214
dnl
215
216
217
AC_DEFUN([CHECK_CHECK],
218
[
219
AC_REQUIRE([AC_CANONICAL_HOST])
220
221
222
AC_ARG_WITH(check,
223
	AS_HELP_STRING([--with-check=PATH],
224
	               [prefix where check is installed [default=auto]]))
225
226
if test x$with_check = xno; then
227
228
$3
229
230
else
231
232
233
234
dnl save LIBS
235
saved_LIBS="$LIBS"
236
saved_CFGLAGS="$CFLAGS"
237
238
if test x$with_check != x; then
239
	CFLAGS="$CFLAGS -I$with_check/include"
240
	LIBS="$LIBS -L$with_check/lib -lcheck"
241
fi
242
243
AC_MSG_CHECKING(for check >= $1)
244
245
dnl Get major, minor, and micro version from arg MINIMUM-VERSION
246
check_config_major_version=`echo $1 | \
247
    sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
248
check_config_minor_version=`echo $1 | \
249
    sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
250
check_config_micro_version=`echo $1 | \
251
    sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
252
253
dnl Compare MINIMUM-VERSION with libparted version
254
AC_TRY_RUN([
255
#include <stdio.h>
256
#include <stdlib.h>
257
#include <check.h>
258
259
int main ()
260
{
261
	int		major = CHECK_MAJOR_VERSION,
262
			minor = CHECK_MINOR_VERSION,
263
			micro = CHECK_MICRO_VERSION;
264
	const char	*version;    
265
	
266
267
	if ((major > $check_config_major_version) ||
268
	   ((major == $check_config_major_version) && (minor > $check_config_minor_version)) ||
269
	   ((major == $check_config_major_version) && (minor == $check_config_minor_version) && (micro >= $check_config_micro_version))) {
270
271
		return 0;
272
	} else {
273
		printf(" *** Looked for check version >= %d.%d.%d, found %d.%d.%d\n",
274
			$check_config_major_version, $check_config_minor_version,
275
			$check_config_micro_version, major, minor, micro);
276
		return 1;
277
	}
278
}
279
], 
280
    AC_MSG_RESULT(yes),
281
    AC_MSG_RESULT(no) ; $3,
282
    [echo $ac_n "cross compiling; assumed OK... $ac_c"])
283
284
dnl restore orignial LIBS and set @CHECK_LIBS@
285
286
if test x$with_check != x; then
287
	CHECK_CFLAGS="-I$with_check/include"
288
	CHECK_LIBS="-L$with_check/lib -lcheck"
289
else
290
	CHECK_LIBS="-lcheck"
291
	CHECK_CFLAGS=""
292
fi
293
AC_SUBST(CHECK_LIBS)
294
AC_SUBST(CHECK_CFLAGS)
295
LIBS="$saved_LIBS"
296
297
298
dnl Execute ACTION-IF-FOUND
299
$2
300
301
fi
302
303
])
304
305
306
dnl Usage:
210
307
dnl CHECK_CURSES([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
211
308
dnl
212
309
dnl Example:

Up to file-list configure.ac:

@@ -51,7 +51,7 @@ dnl ncurses
51
51
CHECK_CURSES(have_curses=true , have_curses=false)
52
52
AC_SUBST(CURSES_LIBS)
53
53
54
dnl Check if we have check... FIXME: Running autogen requires check installed
54
dnl Check if we have check...
55
55
56
56
dnl PKG_CHECK_MODULES([CHECK],[check >= 0.8.2], have_check=true, have_check=false)
57
57
CHECK_CHECK([0.8.2], have_check=true, have_check=false)