summaryrefslogtreecommitdiff
path: root/configure.ac
blob: a581fef4c08520d4ded6af21a9709fd32304c943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(libmm-radio, 0.1.0, heechul.jeon@samsung.com)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/mm_radio.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_LIBTOOL
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
AC_PROG_CC
AC_PROG_CXX

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h sys/ioctl.h sys/time.h termios.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_PID_T
AC_HEADER_TIME

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset strstr])

PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)

PKG_CHECK_MODULES(MMCOMMON, mm-common)
AC_SUBST(MMCOMMON_CFLAGS)
AC_SUBST(MMCOMMON_LIBS)

PKG_CHECK_MODULES(MM_RESOURCE_MANAGER, mm-resource-manager)
AC_SUBST(MM_RESOURCE_MANAGER_CFLAGS)
AC_SUBST(MM_RESOURCE_MANAGER_LIBS)

PKG_CHECK_MODULES(DLOG, dlog)
AC_SUBST(DLOG_CFLAGS)
AC_SUBST(DLOG_LIBS)

PKG_CHECK_MODULES(SOUNDMGR, capi-media-sound-manager)
AC_SUBST(SOUNDMGR_CFLAGS)
AC_SUBST(SOUNDMGR_LIBS)

AC_ARG_ENABLE(emulator, AC_HELP_STRING([--enable-emulator], [using emulator interface]),
[
 case "${enableval}" in
         yes) ENABLE_EMULATOR=yes ;;
         no)  ENABLE_EMULATOR=no ;;
         *)   AC_MSG_ERROR(bad value ${enableval} for --enable-emulator) ;;
 esac
 ],[ENABLE_EMULATOR=no])
AM_CONDITIONAL(ENABLE_EMULATOR, test "x$ENABLE_EMULATOR" = "xyes")

if test "x$ENABLE_EMULATOR" == "xyes"; then
  PKG_CHECK_MODULES(GST, gstreamer-1.0)
  AC_SUBST(GST_CFLAGS)
  AC_SUBST(GST_LIBS)

  PKG_CHECK_MODULES(GSTAPP, gstreamer-app-1.0)
  AC_SUBST(GSTAPP_CFLAGS)
  AC_SUBST(GSTAPP_LIBS)
fi

AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [unittest build]),
[case "${enableval}" in
  yes) IS_TESTS=yes ;;
  no)  IS_TESTS=no ;;
  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
esac], [IS_TESTS=no])
AM_CONDITIONAL([IS_TESTS], [test "x$IS_TESTS" = "xyes"])

AS_IF([test "x$enable_tests" = "xyes"], [
	PKG_CHECK_MODULES(GTESTS, gmock)
	AC_SUBST(GTESTS_CFLAGS)
	AC_SUBST(GTESTS_LIBS)
])

AC_CONFIG_FILES([
	Makefile
	src/Makefile
	unittest/Makefile
	mm-radio.pc
])
AC_OUTPUT