configure.in 9.62 KB
Newer Older
1
2
3
dnl Autoconf settings for vlc
AC_INIT(src/interface/main.c)
AC_CONFIG_HEADER(include/defs.h)
4

5
6
AC_CANONICAL_HOST

Sam Hocevar's avatar
   
Sam Hocevar committed
7
VLC_VERSION=0.2.63
8
AC_SUBST(VLC_VERSION)
Sam Hocevar's avatar
   
Sam Hocevar committed
9
VLC_CODENAME=Urumov
10
11
12
13
AC_SUBST(VLC_CODENAME)

dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
Sam Hocevar committed
14
15
16
17
18
19
if test -z "$CC"; then
  AC_PROG_CC
fi
if test -z "$CPP"; then
  AC_PROG_CPP
fi
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

dnl Check for compiler environment
AC_C_CONST
AC_C_BIGENDIAN

dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)])])
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
Sam Hocevar's avatar
   
Sam Hocevar committed
36
AC_CHECK_FUNCS(vasprintf)
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(gnugetopt, optarg)
AC_CHECK_LIB(be, _)
AC_CHECK_LIB(game, _)
AC_CHECK_LIB(root, _)
AC_CHECK_LIB(m, powl)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(threads, thread_create)

dnl check for getopt_long, substitute the distributed versions if not
AC_CHECK_FUNC(getopt_long,,[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
AC_SUBST(LIBOBJS)

Christophe Massiot's avatar
Christophe Massiot committed
52
53
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
AC_CHECK_HEADERS(stddef.h)
Benoit Steiner's avatar
   
Benoit Steiner committed
54
55
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(sys/sockio.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
56
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
57
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
58
59
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
Christophe Massiot's avatar
Christophe Massiot committed
60
AC_CHECK_HEADERS(machine/param.h)
61
62

dnl Check for threads library
63
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
64

Sam Hocevar's avatar
   
Sam Hocevar committed
65
dnl Do a series of bizarre compilation tests
Christophe Massiot's avatar
Christophe Massiot committed
66
save_CFLAGS=$CFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
67
68

dnl Check for ntohl, etc.
Christophe Massiot's avatar
Christophe Massiot committed
69
70
71
72
CFLAGS="${CFLAGS} -Wall -Werror"
AC_MSG_CHECKING([for ntohl in sys/param.h])
AC_TRY_COMPILE([#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }],,
Sam Hocevar's avatar
   
Sam Hocevar committed
73
74
75
76
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

dnl Check for -rdynamic flag
77
CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
Sam Hocevar's avatar
   
Sam Hocevar committed
78
79
80
AC_MSG_CHECKING([if \$CC accepts -rdynamic])
AC_TRY_COMPILE([],,
 DYNAMIC_FLAG="-rdynamic"
Christophe Massiot's avatar
Christophe Massiot committed
81
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
82
83

dnl End of the bizarre compilation tests
Christophe Massiot's avatar
Christophe Massiot committed
84
85
CFLAGS=$save_CFLAGS

86
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
87
88
89
90
91
AC_MSG_CHECKING([for boolean_t in sys/types.h])
AC_TRY_COMPILE([#include <sys/types.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
92
93
94
95
96
AC_MSG_CHECKING([for boolean_t in pthread.h])
AC_TRY_COMPILE([#include <pthread.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
97

98
99
100
101
102
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

103
dnl default plugins 
104
PLUGINS=${PLUGINS}"ps ts yuv idct idctclassic motion "
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
105
106
107
108
109
if test x$host_os = xbeos; then
    ACCEL_PLUGINS="yuvmmx idctmmx motionmmx "
else
    ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext "
fi
110

Sam Hocevar's avatar
   
Sam Hocevar committed
111
112
113
114
115
dnl Checks for DVD ioctls
AC_CHECK_HEADERS(sys/ioctl.h,
  [PLUGINS=${PLUGINS}"dvd "
   AC_CHECK_HEADERS(linux/cdrom.h)
   AC_EGREP_HEADER(dvd,linux/cdrom.h,[AC_DEFINE(LINUX_DVD,1,DVD support for linux)])])
116

117
ARCH=${host_cpu}
Sam Hocevar's avatar
   
Sam Hocevar committed
118
119
120
121
122
123
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
124
AC_ARG_ENABLE(ppro,
125
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
126
127
[ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
128
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
129
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
130
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
131
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ])
132
AC_ARG_ENABLE(altivec,
Sam Hocevar's avatar
   
Sam Hocevar committed
133
[  --enable-altivec        Enable altivec optimizations (default enabled for PPC)],
134
135
[ if test x$enableval = xyes; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ],
[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
136
137
138
139
AC_ARG_ENABLE(css,
[  --disable-css           Disable DVD CSS decryption (default enabled)],
[ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
140
AC_ARG_ENABLE(debug,
141
[  --enable-debug          Enable debug mode (default disabled)],
142
143
[ if test x$enableval = xyes; then DEBUG=1; fi ])
AC_ARG_ENABLE(stats,
144
[  --enable-stats          Enable printing of statistics (default disabled)],
145
[ if test x$enableval = xyes; then STATS=1; fi ])
146
AC_ARG_ENABLE(optimizations,
147
[  --disable-optimizations Disable compiler optimizations (default enabled)],
148
149
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
150
151
152
153
154

SYS=${host_os}

# special cases
if test x$host_os = xbeos; then
Sam Hocevar's avatar
   
Sam Hocevar committed
155
    PLUGINS=${PLUGINS}"beos "
156
157
158
159

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
160
161
GVLC=0

162
AC_ARG_ENABLE(dsp,
163
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
164
if test x$enable_dsp != xno; then
165
  if test -c /dev/dsp; then
166
167
168
    PLUGINS=${PLUGINS}"dsp "
  fi
fi
169
AC_ARG_ENABLE(esd,
170
  [  --enable-esd            Esound library support (default disabled)],
171
  [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
172
173
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
174
175
  [if test x$enable_darwin = xyes; then PLUGINS=${PLUGINS}"darwin "; fi],
  [AC_CHECK_HEADERS(CoreAudio/AudioHardware.h, [PLUGINS=${PLUGINS}"darwin "])])
Sam Hocevar's avatar
   
Sam Hocevar committed
176
177
178
AC_ARG_ENABLE(macosx,
  [  --enable-macosx         Mac OS X interface support (default disabled)],
  [if test x$enable_macosx = xyes; then PLUGINS=${PLUGINS}"macosx "; fi])
179
180
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
181
  [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi])
Christophe Massiot's avatar
Christophe Massiot committed
182
183
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
184
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
185
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
186
187
188
189
190
191
192
      PLUGINS=${PLUGINS}"ggi ";
      if test "x$withval" != "xyes";
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
193
194
    fi ])
AC_ARG_WITH(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
195
  [  --with-sdl[=name]       SDL support (default enabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
196
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
197
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
198
199
200
      PLUGINS=${PLUGINS}"sdl ";
      if test "x$withval" != "xyes";
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
201
202
        LIB_SDL="-L/usr/X11R6/lib -L"$withval"/lib -l"$withval
        INCLUDE=${INCLUDE}" -I"$withval"/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
203
      else
204
        AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
205
206
        LIB_SDL="-L/usr/X11R6/lib -lSDL"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
207
    fi ])
208
    if test "x$withval" = "x";
Sam Hocevar's avatar
   
Sam Hocevar committed
209
    then
210
211
212
      AC_CHECK_HEADERS(SDL/SDL.h,
      [PLUGINS=${PLUGINS}"sdl "
       LIB_SDL="-L/usr/X11R6/lib -lSDL"])
Sam Hocevar's avatar
   
Sam Hocevar committed
213
    fi
Christophe Massiot's avatar
Christophe Massiot committed
214
215
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
216
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
217
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
218
219
220
221
222
223
224
      PLUGINS=${PLUGINS}"glide ";
      if test "x$withval" != "xyes";
      then
        LIB_GLIDE="-l"$withval
      else
        LIB_GLIDE="-lglide2x"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
225
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
226
227
228
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
  [if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
229
230
231
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
  [if test x$enable_qt = xyes; then PLUGINS=${PLUGINS}"qt "; ALIASES=${ALIASES}"qvlc "; fi])
232
233
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
234
  [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi])
235
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
236
237
238
239
  [  --enable-gnome          Gnome interface support (default disabled)],
  [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi])
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
240
241
242
243
244
245
if test x$enable_gtk != xno; then
  if which gtk-config; then
    PLUGINS=${PLUGINS}"gtk "
    GVLC=1
  fi
fi
246
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
247
248
  [  --disable-x11           X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
249
250
251
AC_ARG_ENABLE(xvideo,
  [  --enable-xvideo         XVideo interface support (default disabled)],
  [if test x$enable_xvideo = xyes; then PLUGINS=${PLUGINS}"xvideo "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
252

Henri Fallon's avatar
   
Henri Fallon committed
253
AC_ARG_ENABLE(alsa,
254
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Henri Fallon's avatar
   
Henri Fallon committed
255
  [if test x$enable_alsa = xyes; then AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false") if test $have_alsa = true; then PLUGINS=${PLUGINS}"alsa "; fi; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
256
257
258

if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi

259
260
261
262
fi

AC_SUBST(SYS)
AC_SUBST(ARCH)
263
AC_SUBST(PLUGINS)
264
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
265
AC_SUBST(INCLUDE)
266
267
268
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
269
AC_SUBST(CSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
270
AC_SUBST(DYNAMIC_FLAG)
Christophe Massiot's avatar
Christophe Massiot committed
271
272
273
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GGI)
274

275
AC_OUTPUT([Makefile include/config.h])
276

277
278
279
280
281
282
echo "
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
system                : ${SYS}
architecture          : ${ARCH}
283
284
285
debug mode            : ${DEBUG}
statistics            : ${STATS}
optimizations         : ${OPTIMS}
Sam Hocevar's avatar
   
Sam Hocevar committed
286
CSS decryption        : ${CSS}
287
plugins               : ${PLUGINS}
288
vlc aliases           : ${ALIASES}
289
"
290