Группа :: Система/Библиотеки
Пакет: vidix
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: vidix-svn-r21861-configure.patch
Скачать
Скачать
diff -urN vidix-svn-r21861.orig/configure vidix-svn-r21861/configure
--- vidix-svn-r21861.orig/configure 1970-01-01 03:00:00 +0300
+++ vidix-svn-r21861/configure 2007-01-10 13:17:12 +0200
@@ -0,0 +1,264 @@
+#!/bin/sh
+# The simplest configure for the vidix
+
+for parm in "$@" ; do
+ if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
+ cat << EOF
+
+Usage: $0 [OPTIONS]...
+
+Configuration:
+ -h, --help display this help and exit
+
+Installation directories:
+ --prefix=DIR use this prefix for installing vidix [/usr/local]
+ --libdir=DIR object code libraries [PREFIX/lib]
+
+Miscellaneous options:
+ --cc=COMPILER use this C compiler to build VIDIX [gcc]
+ --target=PLATFORM target platform (i386-linux, arm-linux, etc)
+
+EOF
+ exit 0
+ fi
+done # for parm in ...
+
+
+# LGB: temporary files
+for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
+ test "$I" && break
+done
+
+TMPLOG="configure.log"
+rm -f "$TMPLOG"
+TMPC="$I/vidix-conf-$RANDOM-$$.c"
+TMPCPP="$I/vidix-conf-$RANDOM-$$.cpp"
+TMPO="$I/vidix-conf-$RANDOM-$$.o"
+TMPS="$I/vidix-conf-$RANDOM-$$.S"
+
+_cc=gcc
+_prefix="/usr/local"
+
+# Check how echo works in this /bin/sh
+case `echo -n` in
+ -n) _echo_n= _echo_c='\c' ;; # SysV echo
+ *) _echo_n='-n ' _echo_c= ;; # BSD echo
+esac
+
+# checking for OS name
+if test -z "$system_name" ; then
+ # OS name
+ system_name=`( uname -s ) 2>&1`
+ case "$system_name" in
+ Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX)
+ ;;
+ IRIX*)
+ system_name=IRIX
+ ;;
+ [cC][yY][gG][wW][iI][nN]*)
+ system_name=CYGWIN
+ ;;
+ *)
+ system_name="$system_name-UNKNOWN"
+ ;;
+ esac
+fi
+
+# host's CPU/instruction set
+if test -z "$host_arch" ; then
+host_arch=`( uname -p ) 2>&1`
+case "$host_arch" in
+ i386|sparc|ppc|alpha|arm|mips)
+ ;;
+
+ *) # uname -p on Linux returns 'unknown' for the processor type,
+ # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
+
+ # Maybe uname -m (machine hardware name) returns something we
+ # recognize.
+
+ case "`( uname -m ) 2>&1`" in
+ i[3-9]86|x86*) host_arch=i386 ;;
+ ppc) host_arch=ppc ;;
+ alpha) host_arch=alpha ;;
+ sparc*) host_arch=sparc ;;
+ arm*) host_arch=arm ;;
+ *) host_arch=UNKNOWN ;;
+ esac
+ ;;
+esac
+fi
+
+# Printout architecture
+case "$host_arch" in
+ i[3-9]86|x86*)
+ _def_arch="#define ARCH_X86 1"
+ _target_arch="TARGET_ARCH_X86 = yes"
+ _def_words_endian="#undef WORDS_BIGENDIAN"
+ ;;
+
+ sparc)
+ _def_arch='#define ARCH_SPARC 1'
+ _target_arch='TARGET_ARCH_SPARC = yes'
+ _def_words_endian='#define WORDS_BIGENDIAN 1'
+ ;;
+
+ arm)
+ _def_arch="#define ARCH_ARM 1"
+ _target_arch='TARGET_ARCH_ARM = yes'
+ _def_words_endian='#undef WORDS_BIGENDIAN'
+ ;;
+
+ ppc)
+ _def_arch='#define ARCH_PPC 1'
+ _target_arch='TARGET_ARCH_PPC = yes'
+ _def_words_endian='#define WORDS_BIGENDIAN 1'
+ ;;
+
+ alpha)
+ _def_arch='#define ARCH_ALPHA 1'
+ _target_arch='TARGET_ARCH_ALPHA = yes'
+ _def_words_endian='#undef WORDS_BIGENDIAN'
+ ;;
+
+ mips)
+ _def_arch="#define ARCH_SGI_MIPS 1"
+ _target_arch="TARGET_ARCH_SGI_MIPS = yes"
+ _def_words_endian='#define WORDS_BIGENDIAN 1'
+ ;;
+
+ *)
+ echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
+ echo "It seems noone has ported VIDIX to your OS or CPU type yet."
+ echo "unsupported architecture: $host_arch"
+ _def_arch="#define ARCH_GENERIC 1"
+ _target_arch="TARGET_ARCH_GENERIC = yes"
+ _def_words_endian="#undef WORDS_BIGENDIAN"
+ ;;
+esac
+
+# return result to parent script
+for ac_option do
+ case "$ac_option" in
+ --prefix=*)
+ _prefix=`echo $ac_option | cut -d '=' -f 2`
+ ;;
+ --libdir=*)
+ _libdir=`echo $ac_option | cut -d '=' -f 2`
+ ;;
+ --target=*)
+ _target=`echo $ac_option | cut -d '=' -f 2`
+ ;;
+ --cc=*)
+ _cc=`echo $ac_option | cut -d '=' -f 2`
+ ;;
+ *)
+ ;;
+ esac
+done
+
+# Determine our OS name and CPU architecture
+if test -n "$_target" ; then
+ system_name=`echo $_target | cut -d '-' -f 2`
+ host_arch=`echo $_target | cut -d '-' -f 1`
+fi
+
+echo "Detected operating system: $system_name"
+echo "Detected host architecture: $host_arch"
+
+# Atmos: moved this here, to be correct, if --prefix is specified
+test -z "$_libdir" && _libdir="$_prefix/lib"
+
+# Checking for CFLAGS
+if test -z "$CFLAGS" ; then
+ CFLAGS="-O2"
+fi
+
+# Checking for mman
+echo -n "Checking for mman.h ... "
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
+EOF
+_mman=yes
+if "$_cc" -o $TMPO $TMPC 2> /dev/null ; then
+ _def_mman='#define HAVE_SYS_MMAN_H 1'
+else
+ _def_mman='#undef HAVE_SYS_MMAN_H'
+ _mman=no
+fi
+echo "$_mman"
+
+# Checking for malloc.h
+echo -n "Checking for malloc.h ... "
+cat > $TMPC << EOF
+#include <malloc.h>
+int main(void) { (void) malloc(0); return 0; }
+EOF
+_malloc=yes
+if "$_cc" -o $TMPO $TMPC 2> /dev/null ; then
+ _def_malloc='#define HAVE_MALLOC_H 1'
+else
+ _def_malloc='#undef HAVE_MALLOC_H'
+ _malloc=no
+fi
+echo "$_malloc"
+
+# Checking for memalign
+echo -n "Checking for memalign ... "
+cat > $TMPC << EOF
+#include <malloc.h>
+int main (void) { (void) memalign(64, sizeof(char)); return 0; }
+EOF
+_memalign=yes
+if "$_cc" -o $TMPO $TMPC 2> /dev/null ; then
+ _def_memalign='#define HAVE_MEMALIGN 1'
+else
+ _def_memalign='#undef HAVE_MEMALIGN'
+ _memalign=no
+fi
+echo "$_memalign"
+
+#############################################################################
+echo "Creating config.mak"
+cat > config.mak << EOF
+# -------- Generated by configure -----------
+
+prefix = $_prefix
+LIBDIR = $_libdir
+OPTFLAGS = $CFLAGS
+CC=$_cc
+
+$_target_arch
+EOF
+
+
+#############################################################################
+echo "Creating config.h"
+cat > config.h << EOF
+/* -------- This file has been automatically generated by configure --------- */
+
+/* Common data directory (for fonts, etc) */
+#define LIBDIR "$_libdir"
+
+/* Define this if your system has the "sys/mman.h" header file */
+$_def_mman
+
+/* Define this if your system has the "malloc.h" header file */
+$_def_malloc
+
+/* memalign is mapped to malloc if unsupported */
+$_def_memalign
+#ifndef HAVE_MEMALIGN
+# define memalign(a,b) malloc(b)
+#endif
+
+$_def_arch
+/* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+$_def_words_endian
+EOF
+
+# Last move:
+rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
diff -urN vidix-svn-r21861.orig/drivers/Makefile vidix-svn-r21861/drivers/Makefile
--- vidix-svn-r21861.orig/drivers/Makefile 2007-01-10 12:56:41 +0200
+++ vidix-svn-r21861/drivers/Makefile 2007-01-10 13:19:54 +0200
@@ -1,7 +1,5 @@
-include ../../config.mak
-
-BINDIR = $(LIBDIR)/mplayer/vidix
+include ../config.mak
VIDIX_LIBS = -L../../libdha -ldha
VIDIX_LIBS_M = $(VIDIX_LIBS) -lm
@@ -61,6 +59,14 @@
clean:
rm -f *.o *.so *~
+install:
+ mkdir -p $(LIBDIR)/vidix
+ -install -m 755 $(INSTALLSTRIP) -p *.so $(LIBDIR)/vidix
+
+uninstall:
+ rm -f $(LIBDIR)/vidix/*.so
+ -rmdir -p $(LIBDIR)/vidix
+
distclean: clean
rm -f .depend
diff -urN vidix-svn-r21861.orig/Makefile vidix-svn-r21861/Makefile
--- vidix-svn-r21861.orig/Makefile 2007-01-10 12:56:41 +0200
+++ vidix-svn-r21861/Makefile 2007-01-10 13:18:57 +0200
@@ -1,6 +1,13 @@
-LIBNAME = libvidix.a
+INCDIR = $(prefix)/include/vidix
-include ../config.mak
+include config.mak
+
+MAJOR_VERSION = 1
+MINOR_VERSION = 0
+SUBMINOR_VERSION = 0
+VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)
+
+LIBNAME = libvidix.so.$(VERSION)
SRCS = vidixlib.c
OBJS = $(SRCS:.c=.o)
@@ -20,13 +27,38 @@
$(MAKE) -C drivers
$(LIBNAME): $(OBJS)
- $(AR) r $(LIBNAME) $(OBJS)
- $(RANLIB) $(LIBNAME)
+ $(LD) -shared -soname $(LIBNAME) -o $(LIBNAME) $(OBJS) -lc -ldl
+ ln -sf $(LIBNAME) libvidix.so.$(MAJOR_VERSION).$(MINOR_VERSION)
+ ln -sf $(LIBNAME) libvidix.so.$(MAJOR_VERSION)
+ ln -sf $(LIBNAME) libvidix.so
+
+libvidix.a: $(OBJS)
+ $(AR) r $@ $(OBJS)
clean:
rm -f *.o *.a *~
$(MAKE) -C drivers clean
+install:
+ $(MAKE) -C drivers install
+ install -d -m 755 $(LIBDIR)
+ install -m 644 -s -p $(LIBNAME) $(LIBDIR)
+ ln -sf $(LIBNAME) $(LIBDIR)/libvidix.so.$(MAJOR_VERSION).$(MINOR_VERSION)
+ ln -sf $(LIBNAME) $(LIBDIR)/libvidix.so.$(MAJOR_VERSION)
+ ln -sf $(LIBNAME) $(LIBDIR)/libvidix.so
+ install -d -m 755 $(INCDIR)
+ install -m 644 fourcc.h $(INCDIR)/fourcc.h
+ install -m 644 vidix.h $(INCDIR)/vidix.h
+ install -m 644 vidixlib.h $(INCDIR)/vidixlib.h
+
+uninstall:
+ $(MAKE) -C drivers uninstall
+ rm -f $(LIBDIR)/$(LIBNAME)
+ rm -f $(LIBDIR)/libvidix.a
+ rmdir -p --ignore-fail-on-non-empty $(LIBDIR)
+ rm -f $(INCDIR)/*
+ rmdir -p --ignore-fail-on-non-empty $(INCDIR)
+
distclean: clean
rm -f .depend test
$(MAKE) -C drivers distclean