configure.in 10.3 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.71
8
AC_SUBST(VLC_VERSION)
Sam Hocevar's avatar
   
Sam Hocevar committed
9
VLC_CODENAME=Ourumov
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

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)
Sam Hocevar's avatar
   
Sam Hocevar committed
31
32
33
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect,LIB=${LIB}" -lsocket")])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname,LIB=${LIB}" -lnsl")])
AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,LIB=${LIB}" -lrt",[AC_CHECK_LIB(posix4,nanosleep,LIB=${LIB}" -lposix4")])])
34
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
35
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton,LIB=${LIB}" -lresolv")])
Sam Hocevar's avatar
   
Sam Hocevar committed
36
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
37
38
39
40
41

AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
  AC_CHECK_LIB([gnugetopt],[getopt_long],
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB=${LIB}" -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
42
    [GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
43
44
AC_SUBST(GETOPT)

45
46
AC_FUNC_MMAP
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
47
48
49
50
AC_CHECK_LIB(dl,dlopen,LIB=${LIB}" -ldl")
AC_CHECK_LIB(m,powl,LIB=${LIB}" -lm")
AC_CHECK_LIB(pthread,pthread_create,LIB=${LIB}" -lpthread")
AC_CHECK_LIB(threads,thread_create,LIB=${LIB}" -lthreads")
51

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
AC_MSG_CHECKING([if \$CC accepts -rdynamic])
AC_TRY_COMPILE([],,
Sam Hocevar's avatar
   
Sam Hocevar committed
80
 LCFLAGS=${LCFLAGS}" -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 
Sam Hocevar's avatar
   
Sam Hocevar committed
104
105
#PLUGINS=${PLUGINS}"ps ts yuv idct idctclassic motion "
BUILTINS=${BUILTINS}"ps ts yuv idct idctclassic motion "
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
106
107
108
109
110
if test x$host_os = xbeos; then
    ACCEL_PLUGINS="yuvmmx idctmmx motionmmx "
else
    ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext "
fi
111

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

119
ARCH=${host_cpu}
Sam Hocevar's avatar
   
Sam Hocevar committed
120
121
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
122
123
124
if test x$enable_dummy != xno; then
  #PLUGINS=${PLUGINS}"dummy ";
  BUILTINS=${BUILTINS}"dummy "; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
125
126
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
127
128
129
if test x$enable_null != xno; then
  #PLUGINS=${PLUGINS}"null ";
  BUILTINS=${BUILTINS}"null "; fi
130
AC_ARG_ENABLE(ppro,
131
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
132
133
[ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
134
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
135
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
136
137
138
139
140
141
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx";
  #PLUGINS=${PLUGINS}${ACCEL_PLUGINS};
  BUILTINS=${BUILTINS}}${ACCEL_PLUGINS}; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH=${ARCH}" mmx";
  #PLUGINS=${PLUGINS}${ACCEL_PLUGINS};
  BUILTINS=${BUILTINS}${ACCEL_PLUGINS}; fi ])
142
AC_ARG_ENABLE(altivec,
143
[  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)],
Sam Hocevar's avatar
   
Sam Hocevar committed
144
145
146
[ if test x$enableval = xyes; then ARCH=${ARCH}" altivec";
  #PLUGINS=${PLUGINS}"idctaltivec ";
  BUILTINS=${BUILTINS}"idctaltivec "; fi ])
147
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
148
149
150
151
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
152
AC_ARG_ENABLE(debug,
153
[  --enable-debug          Enable debug mode (default disabled)],
154
155
[ if test x$enableval = xyes; then DEBUG=1; fi ])
AC_ARG_ENABLE(stats,
156
[  --enable-stats          Enable printing of statistics (default disabled)],
157
[ if test x$enableval = xyes; then STATS=1; fi ])
158
AC_ARG_ENABLE(optimizations,
159
[  --disable-optimizations Disable compiler optimizations (default enabled)],
160
161
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
162
163
164

SYS=${host_os}

Sam Hocevar's avatar
   
Sam Hocevar committed
165
dnl special cases
166
if test x$host_os = xbeos; then
Sam Hocevar's avatar
   
Sam Hocevar committed
167
    PLUGINS=${PLUGINS}"beos "
Sam Hocevar's avatar
   
Sam Hocevar committed
168
    LIB=${LIB}" -lbe -lgame -lroot"
169
170
171
172
173

dnl default case
else

AC_ARG_ENABLE(dsp,
174
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
175
if test x$enable_dsp != xno; then
176
  if test -c /dev/dsp; then
177
178
179
    PLUGINS=${PLUGINS}"dsp "
  fi
fi
180
AC_ARG_ENABLE(esd,
181
  [  --enable-esd            Esound library support (default disabled)],
182
  [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
183
184
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
185
  [if test x$enable_darwin = xyes; then PLUGINS=${PLUGINS}"darwin "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
186
AC_ARG_ENABLE(macosx,
187
188
189
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
  [if test x$enable_macosx = xyes; then PLUGINS=${PLUGINS}"macosx "; fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h, PLUGINS=${PLUGINS}"macosx ")])
190
191
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
192
  [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi])
Christophe Massiot's avatar
Christophe Massiot committed
193
194
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
195
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
196
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
197
198
199
200
201
202
203
      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
204
205
    fi ])
AC_ARG_WITH(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
206
  [  --with-sdl[=name]       SDL support (default enabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
207
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
208
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
209
210
211
      PLUGINS=${PLUGINS}"sdl ";
      if test "x$withval" != "xyes";
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
212
213
        LIB_SDL="-L/usr/X11R6/lib -L"$withval"/lib -l"$withval
        INCLUDE=${INCLUDE}" -I"$withval"/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
214
      else
215
        AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
216
217
        LIB_SDL="-L/usr/X11R6/lib -lSDL"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
218
    fi ])
219
    if test "x$withval" = "x";
Sam Hocevar's avatar
   
Sam Hocevar committed
220
    then
221
222
223
      AC_CHECK_HEADERS(SDL/SDL.h,
      [PLUGINS=${PLUGINS}"sdl "
       LIB_SDL="-L/usr/X11R6/lib -lSDL"])
Sam Hocevar's avatar
   
Sam Hocevar committed
224
    fi
Christophe Massiot's avatar
Christophe Massiot committed
225
226
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
227
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
228
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
229
230
231
232
233
234
235
      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
236
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
237
238
239
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
240
241
242
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])
243
244
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
245
  [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi])
246
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
247
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
248
  [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gnome-vlc "; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
249
250
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
251
252
if test x$enable_gtk != xno; then
  if which gtk-config; then
Sam Hocevar's avatar
   
Sam Hocevar committed
253
    PLUGINS=${PLUGINS}"gtk "; ALIASES=${ALIASES}"gvlc "
254
255
  fi
fi
256
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
257
  [  --disable-x11           X11 support (default enabled)])
258
259
260
if test x$enable_x11 != xno; then
  AC_CHECK_HEADERS(X11/Xlib.h, [PLUGINS=${PLUGINS}"x11 "])
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
261
262
263
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
264

Henri Fallon's avatar
   
Henri Fallon committed
265
AC_ARG_ENABLE(alsa,
266
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Henri Fallon's avatar
   
Henri Fallon committed
267
  [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
268

269
270
271
272
fi

AC_SUBST(SYS)
AC_SUBST(ARCH)
273
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
274
AC_SUBST(BUILTINS)
275
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
276
AC_SUBST(INCLUDE)
277
278
279
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
280
AC_SUBST(CSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
281
282
283
284

AC_SUBST(LCFLAGS)
AC_SUBST(LIB)

Christophe Massiot's avatar
Christophe Massiot committed
285
286
287
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GGI)
288

Sam Hocevar's avatar
   
Sam Hocevar committed
289
AC_OUTPUT([Makefile.opts Makefile.modules include/config.h])
290

291
292
293
294
295
296
echo "
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
system                : ${SYS}
architecture          : ${ARCH}
297
298
299
debug mode            : ${DEBUG}
statistics            : ${STATS}
optimizations         : ${OPTIMS}
Sam Hocevar's avatar
   
Sam Hocevar committed
300
CSS decryption        : ${CSS}
Sam Hocevar's avatar
   
Sam Hocevar committed
301
302
303
need builtin getopt   : ${GETOPT}
plugin modules        : ${PLUGINS}
built-in modules      : ${BUILTINS}
304
vlc aliases           : ${ALIASES}
Sam Hocevar's avatar
   
Sam Hocevar committed
305
306

You may now tune Makefile.opts at your convenience."
307