summaryrefslogtreecommitdiff
path: root/m4/mpd_with_flags.m4
blob: 4f82b7973c2ffd0ae151be8bf58c2ba3f86261e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
dnl Run code with the specified CFLAGS/CXXFLAGS and LIBS appended.
dnl Restores the old values afterwards.
dnl
dnl Parameters: cflags, libs, code
AC_DEFUN([MPD_WITH_FLAGS], [
	ac_save_CFLAGS="$[]CFLAGS"
	ac_save_CXXFLAGS="$[]CXXFLAGS"
	ac_save_LIBS="$[]LIBS"
	CFLAGS="$[]CFLAGS $1"
	CXXFLAGS="$[]CXXFLAGS $1"
	LIBS="$[]LIBS $2"
	$3
	CFLAGS="$[]ac_save_CFLAGS"
	CXXFLAGS="$[]ac_save_CXXFLAGS"
	LIBS="$[]ac_save_LIBS"
])

dnl Run code with the specified library's CFLAGS/CXXFLAGS and LIBS
dnl appended.  Restores the old values afterwards.
dnl
dnl Parameters: libname, code
AC_DEFUN([MPD_WITH_LIBRARY],
	[MPD_WITH_FLAGS([$[]$1_CFLAGS], [$[]$1_LIBS], [$2])])