summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 1e6600a0e718aef543290cae825adca6379ff83c (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
AC_PREREQ(2.53)
AC_INIT(gupnp-tools, 0.8.2, http://www.gupnp.org/)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR(src/common/icons.h)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL
AC_FUNC_MMAP

GSSDP_REQUIRED=0.10
GUPNP_REQUIRED=0.13
GUPNP_AV_REQUIRED=0.5.5
GTK_REQUIRED=3.0.0
GTHREAD_REQUIRED=2.12
GIO_REQUIRED=2.12
ICON_THEME_REQUIRED=2.20
GTKSOURCEVIEW_REQUIRED=3.0.0

AC_MSG_CHECKING([for Win32])
case "$host" in
    *-*-mingw*)
        os_win32=yes
        ;;
    *)
        os_win32=no
        ;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])

PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.0 >= $GSSDP_REQUIRED)
PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GTHREAD_REQUIRED)
PKG_CHECK_MODULES(GNOME_ICON_THEME, gnome-icon-theme >= $ICON_THEME_REQUIRED)
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview-3.0 >= GTKSOURCEVIEW_REQUIRED,
                  AC_DEFINE([HAVE_GTK_SOURCEVIEW], [1], [Use GtkSourceView])
                  AC_SUBST([TEXT_VIEW],[GtkSourceView]),
                  AC_SUBST([TEXT_VIEW],[GtkTextView]))

if test "x$os_win32" = "xno"; then
    PKG_CHECK_MODULES(UUID, uuid)
else
    AC_CHECK_TOOL(WINDRES, windres)
    AC_SUBST([UUID_LIBS], ["-lrpcrt4"])
fi

AC_ARG_WITH( av,
  AC_HELP_STRING([--disable-av],[Don't build AV tools]),
  try_av=$withval, try_av=yes )

HAVE_LIBGUPNP_AV=no
if test x$try_av = xyes ; then
    dnl check for gupnp-av
    PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED ,
      [
        HAVE_LIBGUPNP_AV=yes
        AC_SUBST(LIBGUPNP_AV_CFLAGS)
        AC_SUBST(LIBGUPNP_AV_LIBS)
      ],
      [
        HAVE_LIBGUPNP_AV=no
        AC_MSG_WARN([gupnp-av $GUPNP_AV_REQUIRED or greater not found.])
        AC_MSG_WARN([AV tools will not be built.])
      ])
else
    AC_MSG_NOTICE([AV tools disabled.])
fi

if test x$HAVE_LIBGUPNP_AV = xno; then
  BUILD_AV=no
else
  BUILD_AV=yes
  AC_DEFINE(HAVE_LIBGUPNP_AV, , [Build AV tools])
fi

AC_SUBST(HAVE_LIBGUPNP_AV)
AM_CONDITIONAL(BUILD_AV, test x$BUILD_AV = xyes)

# glib-genmarshal
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

CFLAGS="$CFLAGS -Wall"

# Run uninstalled
AC_ARG_ENABLE(uninstalled,
	[  --enable-uninstalled          run uninstalled],,
        enable_uninstalled=no)
if test "x$enable_uninstalled" = "xyes"; then
        AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
fi

AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])

# Gettext
GETTEXT_PACKAGE=gupnp-tools
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
  [Define the gettext package to be used])

ALL_LINGUAS=""
AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])

AC_OUTPUT([
Makefile
src/Makefile
src/av-cp/Makefile
src/common/Makefile
src/discover/Makefile
src/network-light/Makefile
src/universal-cp/Makefile
src/upload/Makefile
data/Makefile
data/gupnp-universal-cp.desktop.in
data/gupnp-av-cp.desktop.in
data/gupnp-av-cp.ui
data/gupnp-network-light.desktop.in
data/pixmaps/Makefile
data/xml/Makefile
])