]> git.sesse.net Git - vlc/blobdiff - configure.in
* Coding style fixes here and there.
[vlc] / configure.in
index 0fa2af7d13e8e4a4d77c3b6817b6ef5ed71276a5..8b9ca2e2a6e62cc9736352592549f9fb8eaa7580 100644 (file)
@@ -13,22 +13,37 @@ dnl Check for tools
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_CPP
+AC_PROG_RANLIB
 
 dnl AM_PROG_LIBTOOL
 AC_PROG_INSTALL
 
 dnl Check for compiler environment
 AC_C_CONST
-AC_C_BIGENDIAN
+
+dnl Check for endianness if not cross-compiling
+if test x${cross_compiling} != xyes; then
+  AC_C_BIGENDIAN
+fi
 
 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,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")])])
+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")
+  ])
+])
 AC_CHECK_FUNCS(usleep)
-AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")])
+AC_CHECK_FUNC(inet_aton,,[
+  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
+])
 AC_CHECK_FUNCS(vasprintf)
 
 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
@@ -54,10 +69,10 @@ AC_EGREP_CPP(yes,
 AC_CHECK_LIB(threads,thread_create,LIB="${LIB} -lthreads")
 
 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
-AC_CHECK_HEADERS(stddef.h)
-AC_CHECK_HEADERS(getopt.h)
-AC_CHECK_HEADERS(sys/sockio.h)
-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
+
+dnl Check for headers
+AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
+AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h unistd.h)
 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
 AC_CHECK_HEADERS(dlfcn.h image.h)
 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
@@ -66,6 +81,16 @@ AC_CHECK_HEADERS(machine/param.h)
 dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
+dnl Check for misc headers
+AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
+  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
+            Define if <pthread.h> defines pthread_cond_t.)
+])
+AC_EGREP_HEADER(strncasecmp,strings.h,[
+  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
+            Define if <strings.h> defines strncasecmp.)
+])
+
 dnl Do a series of bizarre compilation tests
 save_CFLAGS=$CFLAGS
 
@@ -74,7 +99,7 @@ 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, Define if ntohl is in <sys/param.h>.)
+ AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
 
 dnl Check for -rdynamic flag
@@ -110,11 +135,17 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
-if test x$host_os = xbeos; then
+case x$host_os in
+  xbeos|xnto-qnx)
     ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
-else
+    ;;
+  xmingw32msvc)
+    ACCEL_PLUGINS="idctmmx idctmmxext motionmmx motionmmxext"
+    ;;
+  *)
     ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
-fi
+    ;;
+esac
 
 dnl
 dnl  DVD module: check for DVD ioctls
@@ -166,7 +197,7 @@ AC_ARG_ENABLE(mmx,
 [  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
 [ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
   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";
+[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
   BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
 
 dnl
@@ -507,9 +538,9 @@ trace mode            : ${TRACE}
 optimizations         : ${OPTIMS}
 CSS decryption        : ${CSS}
 need builtin getopt   : ${GETOPT}
-plugin modules        : ${PLUGINS}
-built-in modules      : ${BUILTINS}
-vlc aliases           : ${ALIASES}
+plugin modules        :${PLUGINS}
+built-in modules      :${BUILTINS}
+vlc aliases           :${ALIASES}
 
 You may now tune Makefile.opts at your convenience."