Commit b24c61fa authored by Martin Vogt's avatar Martin Vogt

* Makefile am builds not libvo but video

* acinclude contains the sdl.m4 macro
* bootstrap dynamically creates a configure.in from a template
  (sorry, I have not mad it run otherwise)
* configure.in.tmpl adjustments to build a standalone video
  lib. Hm, still missing. Ok I add this.
parent 7c4b155d
SUBDIRS = autotools include test libmpeg2 libvo src
SUBDIRS = autotools include test libmpeg2 video src
EXTRA_DIST = bootstrap
......@@ -71,3 +71,173 @@ AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
AC_TRY_COMPILE([],[switch (0) case 0: case (sizeof ($1) == $2):;],[],
[AC_MSG_ERROR([can not build a default inttypes.h])])
AC_MSG_RESULT([yes])])
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN(AM_PATH_SDL,
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_args="$sdl_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])
#! /bin/sh
echo "Concatenate files:"
cat configure.in.tmpl > configure.in
cat libmpeg2/configure.incl >> configure.in
cat video/configure.incl >> configure.in
cat <<EOF >>configure.in
dnl
dnl Output configuration files
dnl
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
AC_OUTPUT([ drivers/Makefile.am \
include/Makefile \
libmpeg2/Makefile \
src/Makefile \
test/Makefile \
video/Makefile ])
EOF
echo " to configure.in."
set -x
aclocal -I autotools
libtoolize --force --copy
......
......@@ -2,9 +2,11 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
AC_INIT(src/mpeg2dec.c)
AC_CONFIG_AUX_DIR(autotools)
AM_INIT_AUTOMAKE(mpeg2dec,0.1.8-cvs)
AM_INIT_AUTOMAKE(mpeg2dec,0.1.8-merge2)
AM_CONFIG_HEADER(include/config.h)
AM_MAINTAINER_MODE
dnl I hate this
dnl AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
......@@ -64,8 +66,249 @@ fi
dnl gcc __attribute__ ((aligned ()))
AC_C_ATTRIBUTE_ALIGNED
AM_CONDITIONAL(STANDALONE_LIBVO, true )
PLUGIN_DIR=${libdir}
AC_SUBST(PLUGIN_DIR)
AC_SUBST([LIBMPEG2_CFLAGS])
AC_SUBST([LIBMPEG2_LIBS])
dnl check for mlib
AC_ARG_ENABLE([mlib],
[ --disable-mlib make a version not using mediaLib])
if test x"$enable_mlib" != x"no"; then
AC_CHECK_LIB([mlib],[mlib_VideoColorYUV2RGB420],
[AC_DEFINE([LIBMPEG2_MLIB],,[libmpeg2 mlib support])
LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -I/opt/SUNWmlib/include"
LIBMPEG2_LIBS="$LIBMPEG2_LIBS -L/opt/SUNWmlib/lib -R/opt/SUNWmlib/lib -lmlib"],,
[-L/opt/SUNWmlib/lib -R/opt/SUNWmlib/lib])
fi
dnl
dnl How things work:
dnl
dnl We do tests if a specified driver is expected to compile.
dnl If this is true, we put the name of the plugin into
dnl the variable LIBS_VIDEO_OUTPUT.
dnl
dnl The test may define a HAVE_<FEATURE> variable (but keep
dnl this to a minimum.[maybe one])
if test "x$INCLUDES" != "xNONE"; then
all_includes="${all_includes} $INCLUDES"
fi
dnl
dnl startup with defautl values
dnl
have_3dfx=no
have_mga=no
have_sdl=no
have_ggi=no
have_x11=no
have_xv=no
have_dga=no
have_mlib=no
dnl
dnl Display driver probing...
dnl
dnl we always build the these drivers
LIBS_VIDEO_OUTPUT="${LIBS_VIDEO_OUTPUT} display_null.la display_md5.la display_pgm.la"
dnl
dnl Check for X11 lib
dnl
AC_PATH_X
AC_PATH_XTRA
if test "x$no_x" != xyes; then
LIBS_VIDEO_OUTPUT="$LIBS_VIDEO_OUTPUT libdisplay_x11.la"
all_includes="${all_includes} -I$ac_x_includes"
all_libraries="${all_libraries} -L$ac_x_libraries"
X_LIBS="-lX11 -lXext"
X_LIBS_PATH="$ac_x_libraries"
have_x11=yes
AC_DEFINE(HAVE_X11,1,[Defined if X11 found])
AC_SUBST(X_LIBS)
AC_SUBST(X_LIBS_PATH)
fi
dnl
dnl The 3dfx driver is compiled when we find /dev/3dfx
dnl _if_ if needs dga to link the dga check must succed as well!
dnl
AC_ARG_ENABLE(3dfx,
[ --disable-3dfx 3dfx driver],
enable_3dfx=no, enable_3dfx=yes)
if test x$enable_3dfx = xyes; then
AC_MSG_CHECKING(for /dev/3dfx)
if test -c "/dev/3dfx"; then
AC_MSG_RESULT(found)
LIBS_VIDEO_OUTPUT="$LIBS_VIDEO_OUTPUT display_3dfx.la"
have_3dfx=yes
AC_DEFINE(HAVE_3DFX,1,[Defined if 3DFX found])
else
AC_MSG_RESULT(not found)
fi
fi
dnl
dnl Matrox Millenium GX00 BES and YUV2RGB support
dnl
AC_ARG_ENABLE(mga,
[ --disable-mga make a version not using MGA],
enable_mga=no, enable_mga=yes)
if test x$enable_mga = xyes; then
AC_MSG_CHECKING(for /dev/mga_vid)
if test -c "/dev/mga_vid"; then
AC_MSG_RESULT(found)
LIBS_VIDEO_OUTPUT="$LIBS_VIDEO_OUTPUT display_mga.la"
have_mga=yes
AC_DEFINE(HAVE_MGA,1,[Defined if MGA found])
else
AC_MSG_RESULT(not found)
fi
fi
dnl
dnl check for sdl
dnl Note: SDL comes with its own M4 marco to perform this test
dnl Additonal note: this macro is broken, and returns
dnl a mixed output von SDL_LIBS (search patch. libtool additions
dnl and library name)
dnl argh.
AC_ARG_ENABLE(sdl,
[ --disable-sdl make a version not using SDL],
enable_sdl=no, enable_sdl=yes)
if test "x$enable_sdl" = xyes; then
AM_PATH_SDL(1.1.6,
[LIBS_VIDEO_OUTPUT="$LIBS_VIDEO_OUTPUT display_sdl.la"
have_sdl=yes
AC_DEFINE(HAVE_SDL,1,[Defined if SDL found]) ])
AC_MSG_RESULT([ SDL LIBS: $SDL_LIBS])
AC_MSG_RESULT([ SDL CFLAGS: $SDL_CFLAGS])
fi
dnl
dnl GGI library
dnl
AC_ARG_ENABLE(ggi, [ --enable-ggi make a version using GGI],
enable_ggi=yes, enable_ggi=no)
if test "x$enable_ggi" = xyes; then
GGI_LIBS="-lggi"
LIBS_VIDEO_OUTPUT="$LIBS_VIDEO_OUTPUT display_ggi.la"
have_ggi=yes
AC_DEFINE(HAVE_GGI,1,[Defined if GGI found])
fi
dnl
dnl Checks for libraries. (Xv)
dnl
AC_MSG_CHECKING(for X11 video extension)
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/Xvlib.h>
],[
],[
have_xv=no
])
AC_MSG_RESULT($have_xv)
if test x$have_xv = xyes; then
AC_DEFINE(HAVE_XV,1,[Define if you have XFree4.0 XV extension])
XV_LIBS="-lXv"
fi
AC_SUBST(XV_LIBS)
dnl
dnl Checks for libraries. (Xxf86dga)
dnl
have_dga=no
AC_ARG_ENABLE(dga,
[ --disable-dga make a version not using DGA],
enable_dga=no, enable_dga=yes)
if test "x$enable_dga" = "xyes"; then
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
DGA_LIBS="-lXxf86dga")
have_dga=yes
AC_DEFINE(HAVE_DGA,1,[Defined if DGA found])
fi
dnl
dnl Check for mediaLib
dnl
AC_ARG_ENABLE(mlib,
[ --disable-mlib make a version not using mediaLib],
enable_mlib=no, enable_mlib=yes)
if test x$enable_mlib = xyes; then
AC_CHECK_LIB(mlib, mlib_VideoColorYUV2RGB420,
[ all_includes="${all_includes} -I/opt/SUNWmlib/include"
all_libraries="${all_libraries} -L/opt/SUNWmlib/lib"
MLIB_LIBS="-lmlib"
have_mlib=yes
AC_DEFINE(HAVE_MLIB,1,[Defined if MLIB found]) ],,
-L/opt/SUNWmlib/lib -R/opt/SUNWmlib/lib)
fi
dnl
dnl fill in all libraries which should be built
dnl
LIBS_VIDEO_OUTPUT_NOINST=$LIBS_VIDEO_OUTPUT
AC_SUBST(LIBS_VIDEO_OUTPUT_NOINST)
AC_SUBST(LIBS_VIDEO_OUTPUT)
AC_SUBST(SDL_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(XV_LIBS)
AC_SUBST(DGA_LIBS)
AC_SUBST(MLIB_LIBS)
AC_SUBST(GGI_LIBS)
builtin([include],[libmpeg2/configure.incl])
builtin([include],[libvo/configure.incl])
echo "
output video
------------
x11 : ${have_x11}
xv : ${have_xv}
dga : ${have_dga}
SDL : ${have_sdl}
GGI : ${have_ggi}
3dfx : ${have_3dfx}
matrox g200/g400 : ${have_mga}
" >> config
dnl
dnl Output configuration files
dnl
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
AC_OUTPUT(Makefile autotools/Makefile include/Makefile test/Makefile src/Makefile libmpeg2/Makefile libvo/Makefile)
AC_OUTPUT([ drivers/Makefile.am include/Makefile libmpeg2/Makefile src/Makefile test/Makefile video/Makefile ])
# # Process this file with automake to produce Makefile.in.
AUTOMAKE_OPTIONS = 1.3 foreign no-dependencies
EXTRA_DIST = $(EXTRA_mga_vid_SOURCES) $(EXTRA_mga_vid_test_SOURCES)
EXTRA_mga_vid_SOURCES = mga_vid.c sis_vid.c
EXTRA_mga_vid_test_SOURCES = mga_vid_test.c
KERNEL_INCLUDES = @KERNEL_INCLUDES@
INCLUDES = -I$(KERNEL_INCLUDES)
CFLAGS = -g -O2 -Wall -D__KERNEL__ -DMODULE @MOD_CFLAGS@\
-include $(KERNEL_INCLUDES)/linux/modversions.h\
-idirafter ../compatibility
noinst_HEADERS = mga_vid.h sis_vid.h
if HAVE_MGA
all: sis_vid.o mga_vid.o mga_vid_test
endif
mga_vid.o: mga_vid.c mga_vid.h
$(CC) $(CFLAGS) $(INCLUDES) -c $(basename $@).c
sis_vid.o: sis_vid.c sis_vid.h
$(CC) $(CFLAGS) $(INCLUDES) -c $(basename $@).c
mga_vid_test: mga_vid_test.c
$(CC) -g -O -Wall $(INCLUDES) -idirafter ../compatibility -o $@ $@.c
clean:
rm -f *.o
rm -f mga_vid_test mga_vid_test
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
maintainer-clean-generic:
-@echo "This command is intended for maintainers to use;"
-@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment