Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / configure
diff --git a/cinelerra-5.1/configure b/cinelerra-5.1/configure
new file mode 100755 (executable)
index 0000000..5c31eb4
--- /dev/null
@@ -0,0 +1,143 @@
+#!/bin/sh
+
+if [ $# -gt 0 ]; then
+  if [ "$1" = "static" ]; then
+    STATIC_LIBRARIES=1
+  elif [ "$1" = "shared" ]; then
+    STATIC_LIBRARIES=0
+  else
+    echo usage: "./configure <shared | static>"
+    exit 1
+  fi
+fi
+
+ERROR=0
+if [ -z "$STATIC_LIBRARIES" ]; then
+STATIC_LIBRARIES=0
+fi
+
+# test for nasm
+OBJDIR=`uname -m`
+TOPDIR=`pwd`
+
+if [ $OBJDIR = i686 ]; then
+  if [ ! -x /usr/bin/nasm -a ! -x /usr/local/bin/nasm ]; then
+    echo " *** Nasm is required."; 
+    exit 1
+  fi
+
+fi
+
+if [ ! -x /usr/bin/yasm -a ! -x /usr/local/bin/yasm ]; then
+  echo " *** Yasm is required."; 
+  exit 1
+fi
+
+
+# test for videodev2.h
+
+rm -f a.out
+cat > conftest.c << EOF
+#include <asm/types.h>
+#include <sys/time.h>
+#include <linux/videodev2.h>
+int main()
+{
+  return 0;
+}
+EOF
+
+gcc conftest.c > /dev/null 2>&1
+
+if [ -x a.out ]; then HAVE_VIDEO4LINUX2=y; else HAVE_VIDEO4LINUX2=n; fi
+
+
+# test for dvb
+
+rm -f a.out
+cat > conftest.c << EOF
+#include <time.h>
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
+int main()
+{
+  return 0;
+}
+EOF
+
+gcc conftest.c > /dev/null 2>&1
+
+if [ -x a.out ]; then HAVE_DVB=y; else HAVE_DVB=n; fi
+
+rm -f a.out conftest.c
+
+
+# test for -msse support
+
+rm -f a.out
+cat > conftest.c << EOF
+int main()
+{
+  return 0;
+}
+EOF
+
+gcc -msse conftest.c > /dev/null 2>&1
+
+if [ -x a.out ]; then HAVE_GCC=y; else HAVE_GCC=n; fi
+
+rm -f a.out conftest.c
+
+if [ $HAVE_GCC = n ]; then
+  echo " *** GCC 3.2.2 or greater is required.  Download it from gcc.gnu.org"; 
+  exit 1
+fi
+
+
+# test for OpenGL 2.0
+
+rm -f a.out
+cat > conftest.c << EOF
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <GL/glu.h>
+int main()
+{
+  glUseProgram(0);
+  return 0;
+}
+EOF
+
+gcc conftest.c -lGL -lGLU > /dev/null 2>&1
+
+if [ -x a.out ]; then HAVE_GL=y; else HAVE_GL=n; fi
+
+rm -f a.out conftest.c
+
+
+# probe for libraries
+if [ $STATIC_LIBRARIES = 0 ]; then
+  sed -e "s/^STATIC_LIBRARIES := .*/STATIC_LIBRARIES := n/" -i global_config
+  cd thirdparty && ./configure shared && cd ..
+else
+  sed -e "s/^STATIC_LIBRARIES := .*/STATIC_LIBRARIES := y/" -i global_config
+  cd thirdparty && ./configure static && cd ..
+fi
+if [ $? -ne 0 ]; then
+  echo "Error in thirdparty configuration."
+  exit 1
+fi
+
+echo CONFIGURING LIBZMPEG3
+cd libzmpeg3* && ./configure && cd ..
+if [ $? -ne 0 ]; then
+  echo "Error in libzmpeg3 configuration."
+  exit 1
+fi
+
+
+# success
+echo "Configured successfully."
+echo "Type 'make' to build me."
+echo "If all ok, 'make install'";
+