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 [PLUGINS="${PLUGINS} ]element["]
11 AC_SUBST([LTLIB]element, [lib]element[_plugin.la])
15 AC_DEFUN([VLC_ADD_CPPFLAGS], [
16 m4_foreach_w([element], [$1], [
17 [eval "CPPFLAGS_]element[="'"$'"{CPPFLAGS_]element[} $2"'"']
18 AC_SUBST([CPPFLAGS_]element)
22 AC_DEFUN([VLC_ADD_CFLAGS], [
23 m4_foreach_w([element], [$1], [
24 [eval "CFLAGS_]element[="'"$'"{CFLAGS_]element[} $2"'"']
25 AC_SUBST([CFLAGS_]element)
29 AC_DEFUN([VLC_ADD_CXXFLAGS], [
30 m4_foreach_w([element], [$1], [
31 [eval "CXXFLAGS_]element[="'"$'"{CXXFLAGS_]element[} $2"'"']
32 AC_SUBST([CXXFLAGS_]element)
36 AC_DEFUN([VLC_ADD_OBJCFLAGS], [
37 m4_foreach_w([element], [$1], [
38 [eval "OBJCFLAGS_]element[="'"$'"{OBJCFLAGS_]element[} $2"'"']
39 AC_SUBST([OBJCFLAGS_]element)
43 AC_DEFUN([VLC_ADD_LDFLAGS], [
44 m4_foreach_w([element], [$1], [
45 [eval "LDFLAGS_]element[="'"$2 $'"{LDFLAGS_]element[}"'"']
46 AC_SUBST([LDFLAGS_]element)
50 AC_DEFUN([VLC_ADD_LIBS], [
51 m4_foreach_w([element], [$1], [
52 [eval "LIBS_]element[="'"'"$2 "'$'"{LIBS_]element[}"'"']
53 AC_SUBST([LIBS_]element)
57 dnl ===========================================================================
58 dnl Macros to save and restore default flags
60 AC_DEFUN([VLC_SAVE_FLAGS], [
61 CPPFLAGS_save="${CPPFLAGS}"
62 CFLAGS_save="${CFLAGS}"
63 CXXFLAGS_save="${CXXFLAGS}"
64 OBJCFLAGS_save="${OBJCFLAGS}"
65 LDFLAGS_save="${LDFLAGS}"
69 AC_DEFUN([VLC_RESTORE_FLAGS], [
70 CPPFLAGS="${CPPFLAGS_save}"
71 CFLAGS="${CFLAGS_save}"
72 CXXFLAGS="${CXXFLAGS_save}"
73 OBJCFLAGS="${OBJCFLAGS_save}"
74 LDFLAGS="${LDFLAGS_save}"
78 dnl ===========================================================================
79 dnl Macros for shared object handling (TODO)
81 AC_DEFUN([VLC_LIBRARY_SUFFIX], [
82 AC_MSG_CHECKING(for shared objects suffix)
87 *mingw32* | *cygwin* | *wince* | *mingwce* | *os2*)
97 AC_MSG_RESULT(${LIBEXT})
98 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])