configure.in 7.67 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.61
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

dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

dnl Check for compiler environment
AC_C_CONST
AC_C_BIGENDIAN

Sam Hocevar's avatar
   
Sam Hocevar committed
28
29
30
31
32
AC_MSG_CHECKING([whether compiler accepts bswap x86 instruction])
AC_TRY_COMPILE([unsigned int foo( unsigned int x )
   { __asm__("bswap %0" : "=r" (x) : "0" (x)); return x; }],,
 AC_DEFINE(HAVE_X86_BSWAP, 1, Define if compiler accepts bswap x86 instruction.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

33
34
35
36
37
38
39
40
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
41
AC_CHECK_FUNCS(vasprintf)
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
57
58
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
AC_CHECK_HEADERS(stddef.h)
Benoit Steiner's avatar
   
Benoit Steiner committed
59
60
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(sys/sockio.h)
61
62
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
63
64
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
65
AC_CHECK_HEADERS(machine/param.h)
66
67

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

Sam Hocevar's avatar
   
Sam Hocevar committed
70
dnl Do a series of bizarre compilation tests
Christophe Massiot's avatar
Christophe Massiot committed
71
save_CFLAGS=$CFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
72
73

dnl Check for ntohl, etc.
Christophe Massiot's avatar
Christophe Massiot committed
74
75
76
77
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
78
79
80
81
82
83
84
85
 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
CFLAGS="${CFLAGS} -rdynamic"
AC_MSG_CHECKING([if \$CC accepts -rdynamic])
AC_TRY_COMPILE([],,
 DYNAMIC_FLAG="-rdynamic"
Christophe Massiot's avatar
Christophe Massiot committed
86
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
87
88

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

Sam Hocevar's avatar
   
Sam Hocevar committed
91
92
93
94
95
96
97
dnl Check for boolean_t in sys/types.h
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))

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 Checks for DVD ioctls
104
105
AC_CHECK_HEADERS(sys/ioctl.h,
  [AC_CHECK_HEADERS(linux/cdrom.h)
106
107
   AC_EGREP_HEADER(dvd,linux/cdrom.h,[AC_DEFINE(LINUX_DVD,1,DVD support for linux)
   DVD=1])])
108

109
dnl default plugins 
110
PLUGINS=${PLUGINS}"ps ts yuv idct idctclassic motion "
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
111
112
113
114
115
if test x$host_os = xbeos; then
    ACCEL_PLUGINS="yuvmmx idctmmx motionmmx "
else
    ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext "
fi
116

117
118
119
120
if test x$DVD = x1; then
    PLUGINS=${PLUGINS}"dvd "
fi

121
122
ARCH=${host_cpu}
AC_ARG_ENABLE(ppro,
123
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
124
125
[ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
126
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
127
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
128
129
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ])
130
AC_ARG_ENABLE(debug,
131
[  --enable-debug          Enable debug mode (default disabled)],
132
133
[ if test x$enableval = xyes; then DEBUG=1; fi ])
AC_ARG_ENABLE(stats,
134
[  --enable-stats          Enable printing of statistics (default disabled)],
135
[ if test x$enableval = xyes; then STATS=1; fi ])
136
AC_ARG_ENABLE(optimizations,
137
[  --disable-optimizations Disable compiler optimizations (default enabled)],
138
139
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
140
141
142
143
144

SYS=${host_os}

# special cases
if test x$host_os = xbeos; then
Sam Hocevar's avatar
   
Sam Hocevar committed
145
    PLUGINS=${PLUGINS}"dummy null beos "
146
147
148
149

dnl default case
else

150
AC_ARG_ENABLE(dummy,
Sam Hocevar's avatar
   
Sam Hocevar committed
151
152
  [  --disable-dummy         dummy module (default enabled)])
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
153
154
155
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
156
AC_ARG_ENABLE(dsp,
157
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
158
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
159
AC_ARG_ENABLE(esd,
160
  [  --enable-esd            Esound library support (default disabled)],
161
  [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
162
163
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
164
  [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi])
Christophe Massiot's avatar
Christophe Massiot committed
165
166
167
168
169
170
171
172
173
174
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
  [ PLUGINS=${PLUGINS}"ggi ";
    if test "x$withval" != "xyes";
    then
      LIB_GGI="-l"$withval
    else
      LIB_GGI="-lggi"
    fi ])
AC_ARG_WITH(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
175
  [  --with-sdl[=name]       SDL support (default enabled)],
Christophe Massiot's avatar
Christophe Massiot committed
176
177
178
  [ PLUGINS=${PLUGINS}"sdl ";
    if test "x$withval" != "xyes";
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
179
      LIB_SDL="L/usr/X11R6/lib -l"$withval
Christophe Massiot's avatar
Christophe Massiot committed
180
    else
Sam Hocevar's avatar
   
Sam Hocevar committed
181
      LIB_SDL="-L/usr/X11R6/lib -lSDL"
Christophe Massiot's avatar
Christophe Massiot committed
182
    fi ])
183
    if test "x$withval" = "x";
Sam Hocevar's avatar
   
Sam Hocevar committed
184
185
    then
      PLUGINS=${PLUGINS}"sdl "
Sam Hocevar's avatar
   
Sam Hocevar committed
186
      LIB_SDL="-L/usr/X11R6/lib -lSDL"
Sam Hocevar's avatar
   
Sam Hocevar committed
187
    fi
Christophe Massiot's avatar
Christophe Massiot committed
188
189
190
191
192
193
194
195
196
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
  [ PLUGINS=${PLUGINS}"glide ";
    if test "x$withval" != "xyes";
    then
      LIB_GLIDE="-l"$withval
    else
      LIB_GLIDE="-lglide2x"
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
197
198
199
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
  [if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi])
200
201
202
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
  [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASE=${ALIASES}"kvlc"; fi])
203
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
204
205
  [  --disable-gnome         Gnome support (default enabled)])
if test x$enable_gnome != xno; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi
206
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
207
208
  [  --disable-x11           X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
209

Henri Fallon's avatar
   
Henri Fallon committed
210
AC_ARG_ENABLE(alsa,
211
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Henri Fallon's avatar
   
Henri Fallon committed
212
  [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])
213
214
215
216
fi

AC_SUBST(SYS)
AC_SUBST(ARCH)
217
AC_SUBST(PLUGINS)
218
AC_SUBST(ALIASES)
219
220
221
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
222
AC_SUBST(DYNAMIC_FLAG)
Christophe Massiot's avatar
Christophe Massiot committed
223
224
225
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GGI)
226

227
AC_OUTPUT([Makefile include/config.h])
228

229
230
231
232
233
234
echo "
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
system                : ${SYS}
architecture          : ${ARCH}
235
236
237
debug mode            : ${DEBUG}
statistics            : ${STATS}
optimizations         : ${OPTIMS}
238
plugins               : ${PLUGINS}
239
vlc aliases           : ${ALIASES}
240
"
241