summaryrefslogtreecommitdiff
path: root/configure.in
blob: 8645aaa2cecb162d40f442eb7378e0335a6c7ca1 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# Filename: configure.in
AC_INIT(client/miav_client.cc)
AM_INIT_AUTOMAKE( miav, 0.4.0 )

AC_PROG_CXX

AC_PROG_LIBTOOL
AM_PROG_LIBTOOL

AM_CONFIG_HEADER(config.h)
AC_STDC_HEADERS

CXXFLAGS="$CXXFLAGS -I../lib"
LDFLAGS="$LDFLAGS -L../lib"

AC_OUTPUT(lib/Makefile)

AC_DEFINE_UNQUOTED(ETC, "$prefix/etc/miav", [The path to the config files])
AC_DEFINE_UNQUOTED(PIXMAPS, "$prefix/share/pixmaps", [The path to the pixmap files])

AC_ARG_WITH(debug,  [  --with-debug            Build with debugging (-g -Wall -Werror)])
if test x$with_debug != xno && test -z "$DEBUG"; then
	  CXXFLAGS="$CXXFLAGS -g -Wall -Werror"

    dnl =====================
    dnl Check for efence library
    dnl =====================
#    AC_CHECK_HEADER(efencepp.h, , AC_MSG_ERROR([*** The electric fence include file not found!]))
#    AC_CHECK_LIB(efence, malloc, ,  AC_MSG_ERROR([*** The electric fence library (libefence.a) was not found!]))
#	  LDFLAGS="$LDFLAGS -lefence"

    AC_MSG_WARN([*** Building DEBUG support])

    dnl Make code aware of debug
    AC_DEFINE([USE_DEBUG], [], [Is defined if the project is configured to compile with debugging])
fi 

AC_ARG_WITH(client,  [  --without-client        Build without client support])
if test x$with_client != xno && test -z "$CLIENT"; then
	  CLIENT_DIR=client
		AC_SUBST(CLIENT_DIR)
	 
#    dnl =====================
#    dnl Check for SDL library
#    dnl =====================
#    SDL_VERSION=1.2.0
#    AM_PATH_SDL($SDL_VERSION,:,AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
##    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
##    LDFLAGS="$LDFLAGS $SDL_LIBS"
#		AC_SUBST(SDL_CFLAGS)
#		AC_SUBST(SDL_LIBS)
#    

    dnl =====================
    dnl Check for QT library
    dnl =====================
    gw_CHECK_QT
#    CXXFLAGS="$CXXFLAGS $QT_CXXLAGS"
#    LDFLAGS="$LDFLAGS $QT_LDADD"
    AC_SUBST(QT_CXXFLAGS)
    AC_SUBST(QT_LDADD)

    dnl ======================
    dnl Check for the Xv extension
    dnl ======================
    AC_CHECK_HEADER(X11/extensions/Xvlib.h, , AC_MSG_ERROR([*** The Xv extension include files not found!]))
    AC_CHECK_LIB(Xv, XvQueryExtension, ,  AC_MSG_ERROR([*** The Xv extension library (libXv.a) not found!]))

    dnl ======================
    dnl Check for raw1394 library
    dnl ======================
    AC_CHECK_HEADER(libraw1394/raw1394.h, , AC_MSG_ERROR([*** libraw1394 headers not found!]))
    AC_CHECK_LIB(raw1394, raw1394_get_userdata, ,  AC_MSG_ERROR([*** libraw1394 not found!]))

    dnl ======================
    dnl Check for the cairo library
    dnl ======================
    AC_CHECK_HEADER(cairo/cairo-features.h, , AC_MSG_ERROR([*** cairo headers not found!]))
    CAIRO_CXXFLAGS="`pkg-config --cflags cairo` -I/usr/local/include"
    AC_SUBST(CAIRO_CXXFLAGS)
    AC_CHECK_LIB(svg-cairo, svg_cairo_create, ,  AC_MSG_ERROR([*** libcairo not found!]))
    CAIRO_LDFLAGS="`pkg-config --libs cairo`  -lsvg -lsvg-cairo"
    AC_SUBST(CAIRO_LDFLAGS)

    AC_OUTPUT(client/Makefile)

    dnl Make code aware of the gui
    AC_DEFINE([USE_CLIENT], [], [Is defined if the project is configured to compile with client])
else
    AC_MSG_WARN([*** Building without client support])
fi 

AC_ARG_WITH(server,  [  --without-server        Build without server support])
if test x$with_server != xno && test -z "$SERVER"; then
	  SERVER_DIR=server
		AC_SUBST(SERVER_DIR)

    dnl ======================
    dnl Check for Jpeg library
    dnl ======================
    AC_CHECK_HEADER(jpeglib.h, , AC_MSG_ERROR([*** libJpeg not found!]))
    AC_CHECK_LIB(jpeg, jpeg_start_compress, ,  AC_MSG_ERROR([*** libJpeg not found!]))
    
    dnl ======================
    dnl Check for Fame library
    dnl ======================
    AC_CHECK_HEADER(fame.h, , AC_MSG_ERROR([*** libFAME include files not found!]))
    AC_CHECK_LIB(fame, fame_init, ,  AC_MSG_ERROR([*** libFAME not found!]))
    
    dnl ======================
    dnl Check for Lame library
    dnl ======================
    AC_CHECK_HEADER(lame/lame.h, , AC_MSG_ERROR([*** libLAME (libmp3lame) include files not found!]))
    AC_CHECK_LIB(mp3lame, lame_init, ,  AC_MSG_ERROR([*** libLAME (libmp3lame) not found!]))

		AC_OUTPUT(server/Makefile)

    dnl Make code aware of the gui
    AC_DEFINE([USE_SERVER], [], [Is defined if the project is configured to compile with server])
else
    AC_MSG_WARN([*** Building without server support])
fi 

dnl ======================
dnl Check for getopt
dnl ======================
AC_HAVE_HEADERS(getopt.h)

dnl ======================
dnl Check for pthread library
dnl ======================
AC_CHECK_HEADER(pthread.h, , AC_MSG_ERROR([*** pthread headers not found!]))
AC_CHECK_LIB(pthread, sem_init, ,  AC_MSG_ERROR([*** libpthread not found!]))

dnl ======================
dnl Check for dv library
dnl ======================
AC_CHECK_HEADER(libdv/dv.h, , AC_MSG_ERROR([*** libdv headers not found!]))
AC_CHECK_LIB(dv, dv_decode_full_frame, ,  AC_MSG_ERROR([*** libdv not found!]))

#dnl ======================
#dnl Check for mplex library
#dnl ======================
#PKG_CHECK_MODULES(MPLEX, mjpegtools >= 1.6.1.93, [
#      dnl switch over to c++ to test things
#      AC_LANG_CPLUSPLUS
#      OLD_CPPFLAGS="$CPPFLAGS"
#      CPPFLAGS="$CPPFLAGS $MPLEX_CFLAGS"
#      AC_CHECK_HEADER(interact.hpp, [
#        MPLEX_LIBS="$MPLEX_LIBS -lmplex2 -lm"
#        OLD_LIBS="$LIBS"
#        LIBS="$LIBS $MPLEX_LIBS"
#        AC_MSG_CHECKING([for valid mplex objects])
#        AC_TRY_RUN([
##include <interact.hpp>
##include <outputstrm.hpp>
##include <multiplexor.hpp>
#
#int main (int argc, char *argv[])
#{
#  class TestOutputStream : public OutputStream {
#  public:
#    TestOutputStream () : OutputStream () { }
#    void Write (uint8_t *a, unsigned int b) { }
#    void NextSegment () { }
#    off_t SegmentSize () { }
#    void Close () { }
#    int Open () { }
#  };
#  MultiplexJob *job = new MultiplexJob ();
#  vector<IBitStream *> inputs;
#  job->SetupInputStreams (inputs);
#  TestOutputStream *out = new TestOutputStream ();
#  Multiplexor *mux = new Multiplexor(*job, *out);
#  return 0;
#}
#        ],[
#          HAVE_MPLEX="yes"
#          AC_SUBST(MPLEX_CFLAGS)
#          AC_SUBST(MPLEX_LIBS)
#          AC_MSG_RESULT(yes)
#        ], AC_MSG_RESULT(no))
#        #LIBS="$OLD_LIBS"
#      ])
#      #CPPFLAGS="$OLD_CPPFLAGS"
#      AC_LANG_C
#    ], HAVE_MPLEX="no")
#AC_CHECK_LIB(mplex2, main, ,  AC_MSG_ERROR([*** libmplex2 not found (part of the mjpegtools package)!]))

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(LDFLAGS)

AC_OUTPUT(
	Makefile 
	tools/Makefile
	etc/Makefile
	pixmaps/Makefile
	man/Makefile)

#AC_OUTPUT(
#	Makefile 
#	lib/Makefile
#	client/Makefile
#	server/Makefile
#	tools/Makefile
#	etc/Makefile
#	pixmaps/Makefile
#	man/Makefile)