diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/as-auto-alt.m4 | 50 | ||||
-rw-r--r-- | m4/check-libheader.m4 | 40 |
2 files changed, 90 insertions, 0 deletions
diff --git a/m4/as-auto-alt.m4 b/m4/as-auto-alt.m4 new file mode 100644 index 000000000..3f7920dd2 --- /dev/null +++ b/m4/as-auto-alt.m4 | |||
@@ -0,0 +1,50 @@ | |||
1 | dnl as-auto-alt.m4 0.0.2 | ||
2 | dnl autostars m4 macro for supplying alternate autotools versions to configure | ||
3 | dnl thomas@apestaart.org | ||
4 | dnl | ||
5 | dnl AS_AUTOTOOLS_ALTERNATE() | ||
6 | dnl | ||
7 | dnl supplies --with arguments for autoconf, autoheader, automake, aclocal | ||
8 | |||
9 | AC_DEFUN([AS_AUTOTOOLS_ALTERNATE], | ||
10 | [ | ||
11 | dnl allow for different autoconf version | ||
12 | AC_ARG_WITH(autoconf, | ||
13 | AC_HELP_STRING([--with-autoconf], | ||
14 | [use a different autoconf for regeneration of Makefiles]), | ||
15 | [ | ||
16 | unset AUTOCONF | ||
17 | AM_MISSING_PROG(AUTOCONF, ${withval}) | ||
18 | AC_MSG_NOTICE([Using $AUTOCONF as autoconf]) | ||
19 | ]) | ||
20 | |||
21 | dnl allow for different autoheader version | ||
22 | AC_ARG_WITH(autoheader, | ||
23 | AC_HELP_STRING([--with-autoheader], | ||
24 | [use a different autoheader for regeneration of Makefiles]), | ||
25 | [ | ||
26 | unset AUTOHEADER | ||
27 | AM_MISSING_PROG(AUTOHEADER, ${withval}) | ||
28 | AC_MSG_NOTICE([Using $AUTOHEADER as autoheader]) | ||
29 | ]) | ||
30 | |||
31 | dnl allow for different automake version | ||
32 | AC_ARG_WITH(automake, | ||
33 | AC_HELP_STRING([--with-automake], | ||
34 | [use a different automake for regeneration of Makefiles]), | ||
35 | [ | ||
36 | unset AUTOMAKE | ||
37 | AM_MISSING_PROG(AUTOMAKE, ${withval}) | ||
38 | AC_MSG_NOTICE([Using $AUTOMAKE as automake]) | ||
39 | ]) | ||
40 | |||
41 | dnl allow for different aclocal version | ||
42 | AC_ARG_WITH(aclocal, | ||
43 | AC_HELP_STRING([--with-aclocal], | ||
44 | [use a different aclocal for regeneration of Makefiles]), | ||
45 | [ | ||
46 | unset ACLOCAL | ||
47 | AM_MISSING_PROG(ACLOCAL, ${withval}) | ||
48 | AC_MSG_NOTICE([Using $ACLOCAL as aclocal]) | ||
49 | ]) | ||
50 | ]) | ||
diff --git a/m4/check-libheader.m4 b/m4/check-libheader.m4 new file mode 100644 index 000000000..1e24d8a97 --- /dev/null +++ b/m4/check-libheader.m4 | |||
@@ -0,0 +1,40 @@ | |||
1 | dnl | ||
2 | dnl CHECK-LIBHEADER(FEATURE-NAME, LIB-NAME, LIB-FUNCTION, HEADER-NAME, | ||
3 | dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND, | ||
4 | dnl EXTRA-LDFLAGS, EXTRA-CPPFLAGS) | ||
5 | dnl | ||
6 | dnl FEATURE-NAME - feature name; library and header files are treated | ||
7 | dnl as feature, which we look for | ||
8 | dnl LIB-NAME - library name as in AC_CHECK_LIB macro | ||
9 | dnl LIB-FUNCTION - library symbol as in AC_CHECK_LIB macro | ||
10 | dnl HEADER-NAME - header file name as in AC_CHECK_HEADER | ||
11 | dnl ACTION-IF-FOUND - when feature is found then execute given action | ||
12 | dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action | ||
13 | dnl EXTRA-LDFLAGS - extra linker flags (-L or -l) | ||
14 | dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include | ||
15 | dnl | ||
16 | dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1. | ||
17 | dnl | ||
18 | AC_DEFUN([CHECK_LIBHEADER], | ||
19 | [ | ||
20 | AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7]) | ||
21 | check_libheader_feature_name=translit([$1], A-Z, a-z) | ||
22 | |||
23 | if test "x$HAVE_[$1]" = "xyes"; then | ||
24 | check_libheader_save_CPPFLAGS=$CPPFLAGS | ||
25 | CPPFLAGS="[$8] $CPPFLAGS" | ||
26 | AC_CHECK_HEADER([$4], :, HAVE_[$1]=no) | ||
27 | CPPFLAGS=$check_libheader_save_CPPFLAGS | ||
28 | fi | ||
29 | |||
30 | if test "x$HAVE_[$1]" = "xyes"; then | ||
31 | ifelse([$5], , :, [$5]) | ||
32 | AC_MSG_NOTICE($check_libheader_feature_name was found) | ||
33 | else | ||
34 | ifelse([$6], , :, [$6]) | ||
35 | AC_MSG_WARN($check_libheader_feature_name not found) | ||
36 | fi | ||
37 | AC_SUBST(HAVE_[$1]) | ||
38 | ] | ||
39 | ) | ||
40 | |||