1 dnl Macros needed for VLC
3 dnl ===========================================================================
4 dnl Macros to add plugins or builtins and handle their flags
5 m4_pattern_allow([^PKG_CONFIG(_LIBDIR)?$])
8 AC_DEFUN([VLC_ADD_PLUGIN], [
9 m4_foreach_w([element], [$1], [
10 AC_SUBST([LTLIB]element, [lib]element[_plugin.la])
14 AC_DEFUN([VLC_ADD_CPPFLAGS], [
15 m4_foreach_w([element], [$1], [
16 [eval "CPPFLAGS_]element[="'"$'"{CPPFLAGS_]element[} $2"'"']
17 AC_SUBST([CPPFLAGS_]element)
21 AC_DEFUN([VLC_ADD_CFLAGS], [
22 m4_foreach_w([element], [$1], [
23 [eval "CFLAGS_]element[="'"$'"{CFLAGS_]element[} $2"'"']
24 AC_SUBST([CFLAGS_]element)
28 AC_DEFUN([VLC_ADD_CXXFLAGS], [
29 m4_foreach_w([element], [$1], [
30 [eval "CXXFLAGS_]element[="'"$'"{CXXFLAGS_]element[} $2"'"']
31 AC_SUBST([CXXFLAGS_]element)
35 AC_DEFUN([VLC_ADD_OBJCFLAGS], [
36 m4_foreach_w([element], [$1], [
37 [eval "OBJCFLAGS_]element[="'"$'"{OBJCFLAGS_]element[} $2"'"']
38 AC_SUBST([OBJCFLAGS_]element)
42 AC_DEFUN([VLC_ADD_LDFLAGS], [
43 m4_foreach_w([element], [$1], [
44 [eval "LDFLAGS_]element[="'"$2 $'"{LDFLAGS_]element[}"'"']
45 AC_SUBST([LDFLAGS_]element)
49 AC_DEFUN([VLC_ADD_LIBS], [
50 m4_foreach_w([element], [$1], [
51 [eval "LIBS_]element[="'"'"$2 "'$'"{LIBS_]element[}"'"']
52 AC_SUBST([LIBS_]element)
56 dnl ===========================================================================
57 dnl Macros to save and restore default flags
59 AC_DEFUN([VLC_SAVE_FLAGS], [
60 CPPFLAGS_save="${CPPFLAGS}"
61 CFLAGS_save="${CFLAGS}"
62 CXXFLAGS_save="${CXXFLAGS}"
63 OBJCFLAGS_save="${OBJCFLAGS}"
64 LDFLAGS_save="${LDFLAGS}"
68 AC_DEFUN([VLC_RESTORE_FLAGS], [
69 CPPFLAGS="${CPPFLAGS_save}"
70 CFLAGS="${CFLAGS_save}"
71 CXXFLAGS="${CXXFLAGS_save}"
72 OBJCFLAGS="${OBJCFLAGS_save}"
73 LDFLAGS="${LDFLAGS_save}"
77 dnl ===========================================================================
78 dnl Macros for shared object handling (TODO)
80 AC_DEFUN([VLC_LIBRARY_SUFFIX], [
81 AC_MSG_CHECKING(for shared objects suffix)
86 *mingw32* | *cygwin* | *wince* | *mingwce* | *os2*)
96 AC_MSG_RESULT(${LIBEXT})
97 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])