Commit c9d19248 authored by Måns Rullgård's avatar Måns Rullgård

improve installation path selection

Originally committed as revision 13638 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 426be5dc
...@@ -300,6 +300,12 @@ disabled_any(){ ...@@ -300,6 +300,12 @@ disabled_any(){
done done
} }
set_default(){
for opt; do
eval test -z "\$$opt" && eval $opt=\$${opt}_default
done
}
is_in(){ is_in(){
value=$1 value=$1
shift shift
...@@ -903,12 +909,12 @@ vhook_extralibs='$ldl' ...@@ -903,12 +909,12 @@ vhook_extralibs='$ldl'
logfile="config.err" logfile="config.err"
# installation paths # installation paths
prefix="/usr/local" prefix_default="/usr/local"
libdir='$(PREFIX)/lib' bindir_default='${prefix}/bin'
shlibdir="$libdir" incdir_default='${prefix}/include'
incdir='$(PREFIX)/include' libdir_default='${prefix}/lib'
mandir='$(PREFIX)/share/man' mandir_default='${prefix}/share/man'
bindir='$(PREFIX)/bin' shlibdir_default="$libdir_default"
# toolchain # toolchain
cc="gcc" cc="gcc"
...@@ -1167,7 +1173,7 @@ enabled sparc64 && enable sparc ...@@ -1167,7 +1173,7 @@ enabled sparc64 && enable sparc
# OS specific # OS specific
case $target_os in case $target_os in
beos|haiku|zeta) beos|haiku|zeta)
prefix="$HOME/config" prefix_default="$HOME/config"
# helps building libavcodec # helps building libavcodec
add_cflags "-DPIC -fomit-frame-pointer" add_cflags "-DPIC -fomit-frame-pointer"
# 3 gcc releases known for BeOS, each with ugly bugs # 3 gcc releases known for BeOS, each with ugly bugs
...@@ -1236,7 +1242,7 @@ case $target_os in ...@@ -1236,7 +1242,7 @@ case $target_os in
disable need_memalign disable need_memalign
LIBTARGET=x64 LIBTARGET=x64
fi fi
shlibdir="$bindir" shlibdir_default="$bindir"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil' VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
if enabled swscale; then if enabled swscale; then
...@@ -1257,7 +1263,7 @@ case $target_os in ...@@ -1257,7 +1263,7 @@ case $target_os in
;; ;;
cygwin*) cygwin*)
target_os=cygwin target_os=cygwin
shlibdir="$bindir" shlibdir_default="$bindir"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil' VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
if enabled swscale; then if enabled swscale; then
...@@ -1318,6 +1324,8 @@ case $target_os in ...@@ -1318,6 +1324,8 @@ case $target_os in
;; ;;
esac esac
set_default $PATHS_LIST
add_extralibs $osextralibs add_extralibs $osextralibs
# Combine FFLDFLAGS and the LDFLAGS environment variable. # Combine FFLDFLAGS and the LDFLAGS environment variable.
...@@ -2007,7 +2015,7 @@ echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH ...@@ -2007,7 +2015,7 @@ echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIG_H" >> $TMPH echo "#define FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
echo "PREFIX=$prefix" >> config.mak echo "prefix=$prefix" >> config.mak
echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
......
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