On Mittwoch, 9. Dezember 2009, Reimar Imhof wrote:
> here comes the second version.
> For me it works with and without --libdir parameter.
>
> That change replaces configure.in from line 401 (blank line) to 408
> (--prefix="$acl_final_prefix"). New lines:
>       ff_conf_args="$ff_conf_args --prefix=$acl_final_prefix"
>
>       eval libdir_c=$libdir
>       if test "x$libdir_c" != "xNONE/lib"; then
>               ff_conf_args="$ff_conf_args --libdir=$libdir_c 
> --shlibdir=$libdir_c"
>       fi
>
>       srcdir_c=$(readlink -f $srcdir)
>       mkdir -p quicktime/ffmpeg/ > /dev/null 2>&1
>       cd quicktime/ffmpeg/
>       echo quicktime/ffmpeg/configure $ff_conf_args
>       $srcdir_c/quicktime/ffmpeg/configure $ff_conf_args

Thanks a lot. We should make sure that variables are not expanded too often 
and we should expand variables with user-provided values inside quotes 
(because they could contain whitespace) so that they are not split.

The patch below is what I intend to keep. It is not perfect because it assumes 
that user-provided --libdir does not contain double-quotes. To fix this, more 
complicated treatment of $libdir would be needed that I think is not 
warranted.

-- Hannes

From: Johannes Sixt <[email protected]>
Subject: [PATCH] Pass --libdir given to configure on to ffmpeg configure.

Previously, the sub-configure of the internal ffmpeg would always use the
default libdir ($prefix/lib).

The difficulty is that the default $libdir that autoconf generates contains
the Makefile variable ${exec_prefix} (which also happens to be a configure
shell variable). To get its value, $libdir must be expanded twice. A
further complication is that the default of exec_prefix is NONE, which we
have to replace by $prefix.

Based on suggestions by Reimar Imhof.
---
 configure.in |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/configure.in b/configure.in
index 87f09b4..885a79a 100644
--- a/configure.in
+++ b/configure.in
@@ -399,14 +399,22 @@ else
        fi
 
 
-       srcdir_c=$(readlink -f $srcdir)
-       mkdir -p quicktime/ffmpeg/ > /dev/null 2>&1
+       srcdir_c=$(readlink -f $srcdir) &&
+       mkdir -p quicktime/ffmpeg/ &&
+       (
        cd quicktime/ffmpeg/
-       echo quicktime/ffmpeg/configure $ff_conf_args \
-               --prefix="$acl_final_prefix"
-       $srcdir_c/quicktime/ffmpeg/configure $ff_conf_args \
-               --prefix="$acl_final_prefix"
-       cd ../../
+       # if --libdir was not set, then it expands to '$exec_prefix/lib'
+       # if --exec-prefix was not set, then it expands to NONE
+       # this makes sure $libdir is expanded to a useful value
+       if test "x$exec_prefix" = xNONE; then
+               exec_prefix=$acl_final_prefix
+       fi
+       cmd="quicktime/ffmpeg/configure \$ff_conf_args \
+               --prefix=\"\$acl_final_prefix\" \
+               --libdir=\"$libdir\" --shlibdir=\"$libdir\""
+       eval echo $cmd
+       eval \$srcdir_c/$cmd
+       )
 fi
 echo --------------------------------------------------
 ############# END run ffmpeg configure to generates avconfig.h
-- 
1.6.6.rc0.105.ge48d

_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to