configure.in 5.89 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.1.99i
8 9 10 11 12 13
AC_SUBST(VLC_VERSION)
VLC_CODENAME=Onatopp
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

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)])
AC_FUNC_MMAP
AC_FUNC_VPRINTF
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)
56 57
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
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

Christophe Massiot's avatar
Christophe Massiot committed
65 66 67 68 69 70 71 72 73 74
dnl Check for ntohl, etc.
save_CFLAGS=$CFLAGS
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); }],,
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Gabuzomeu)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
CFLAGS=$save_CFLAGS

75 76 77 78 79
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

80 81 82 83 84
dnl default plugins 
PLUGINS=${PLUGINS}"yuv ";

ARCH=${host_cpu}
AC_ARG_ENABLE(ppro,
85
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
86 87
[ if test x$enableval = xyes; then ARCH=${ARCH}" ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
88
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
89 90 91
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ])
92
AC_ARG_ENABLE(debug,
93
[  --enable-debug          Enable debug mode (default disabled)],
94 95
[ if test x$enableval = xyes; then DEBUG=1; fi ])
AC_ARG_ENABLE(stats,
96
[  --enable-stats          Enable printing of statistics (default disabled)],
97
[ if test x$enableval = xyes; then STATS=1; fi ])
98
AC_ARG_ENABLE(optimizations,
99
[  --disable-optimizations Disable compiler optimizations (default enabled)],
100 101
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
102 103 104 105 106 107 108 109 110 111

SYS=${host_os}

# special cases
if test x$host_os = xbeos; then
    PLUGINS=${PLUGINS}"dummy beos "

dnl default case
else

112
AC_ARG_ENABLE(dummy,
113
  [  --disable-dummy         dummy audio and video support (default enabled)])
114
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
115
AC_ARG_ENABLE(dsp,
116
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
117
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
118
AC_ARG_ENABLE(esd,
119
  [  --enable-esd            Esound library support (default disabled)],
120
  [if test x$enable_esd = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
121 122
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
123
  [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
Christophe Massiot's avatar
Christophe Massiot committed
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
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,
  [  --with-sdl[=name]       SDL support (default disabled)],
  [ PLUGINS=${PLUGINS}"sdl ";
    if test "x$withval" != "xyes";
    then
      LIB_SDL="-l"$withval
    else
      LIB_SDL="-lSDL"
    fi ])
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
151 152 153
AC_ARG_ENABLE(null,
  [  --enable-null           Null plugin (default disabled)],
  [if test x$enable_null = xyes; then PLUGINS=${PLUGINS}"null "; fi])
154 155
AC_ARG_ENABLE(gnome,
  [  --enable-gnome          Gnome support (default disabled)],
156
  [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
157
AC_ARG_ENABLE(x11,
158 159
  [  --disable-x11           X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
Henri Fallon's avatar
 
Henri Fallon committed
160
AC_ARG_ENABLE(alsa,
161
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Henri Fallon's avatar
 
Henri Fallon committed
162
  [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])
163 164 165 166 167

fi

AC_SUBST(SYS)
AC_SUBST(ARCH)
168
AC_SUBST(PLUGINS)
169
AC_SUBST(ALIASES)
170 171 172
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
Christophe Massiot's avatar
Christophe Massiot committed
173 174 175
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GGI)
176

177
AC_OUTPUT([Makefile include/config.h])
178

179 180 181 182 183 184
echo "
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
system                : ${SYS}
architecture          : ${ARCH}
185 186 187
debug mode            : ${DEBUG}
statistics            : ${STATS}
optimizations         : ${OPTIMS}
188
plugins               : ${PLUGINS}
189
vlc aliases           : ${ALIASES}
190
"
191