X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fconfigure;h=02e4c514e73cdbe9de39efbc7f2c993a425becce;hb=475fa6dfcef9891664bb055b4e93e7f2f8a7cf3b;hp=5c31eb4483341ed8435259cda047c38fcc403fdc;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/configure b/cinelerra-5.1/configure index 5c31eb44..02e4c514 100755 --- a/cinelerra-5.1/configure +++ b/cinelerra-5.1/configure @@ -1,21 +1,42 @@ -#!/bin/sh +#!/bin/bash +# configure reset - resets probed config +# configure static - build all builtin static libraries +# configure shared - build only static libraries needed + +#edit global_config and set HAVE_var to override probe + +PROBED="STATIC_LIBRARIES HAVE_VIDEO4LINUX2 HAVE_DVB HAVE_GL" +PROBED="$PROBED HAVE_DL HAVE_NUMA" if [ $# -gt 0 ]; then + if [ "$1" = "reset" ]; then + for v in $PROBED; do + sed -e "s/^$v := .*/#$v := y/" -i global_config + done + echo "configuration reset" + exit 0; + fi if [ "$1" = "static" ]; then - STATIC_LIBRARIES=1 + STATIC_LIBRARIES=y elif [ "$1" = "shared" ]; then - STATIC_LIBRARIES=0 + STATIC_LIBRARIES=n else echo usage: "./configure " exit 1 fi fi -ERROR=0 if [ -z "$STATIC_LIBRARIES" ]; then -STATIC_LIBRARIES=0 +STATIC_LIBRARIES=y fi +for v in $PROBED; do + vv=`grep "^$v := .*" global_config` + if [ $? = 0 ]; then + echo "config probe override: $vv" + fi +done + # test for nasm OBJDIR=`uname -m` TOPDIR=`pwd` @@ -115,18 +136,61 @@ 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 +# test for libdl + +rm -f a.out +cat > conftest.c << EOF +int main() +{ + return 0; +} +EOF + +gcc conftest.c -ldl > /dev/null 2>&1 + +if [ -x a.out ]; then HAVE_DL=y; else HAVE_DL=n; fi + +rm -f a.out conftest.c + + +# test for libnuma + +rm -f a.out +cat > conftest.c << EOF +int main() +{ + return 0; +} +EOF + +gcc conftest.c -lnuma > /dev/null 2>&1 + +if [ -x a.out ]; then HAVE_NUMA=y; else HAVE_NUMA=n; fi + +rm -f a.out conftest.c + + +# update global_config with probe data + +for v in $PROBED; do + sed -e "s/^#$v := .*/$v := ${!v}/" -i global_config +done + +# configure thirdparty build + +cd thirdparty +case "$STATIC_LIBRARIES" in + "y") ./configure static ;; + "n") ./configure shared ;; + *) echo "configuration failed"; exit 1;; +esac if [ $? -ne 0 ]; then echo "Error in thirdparty configuration." exit 1 fi +cd .. + +# configure libzmpeg3 build echo CONFIGURING LIBZMPEG3 cd libzmpeg3* && ./configure && cd .. @@ -135,8 +199,8 @@ if [ $? -ne 0 ]; then exit 1 fi - # success + echo "Configured successfully." echo "Type 'make' to build me." echo "If all ok, 'make install'";