Commit 03fe761e authored by Sam Hocevar's avatar Sam Hocevar

* ./bootstrap: we should be able to bootstrap CVS even without gettext.

parent d54e32e1
#! /bin/sh
## bootstrap.sh file for vlc, the VideoLAN Client
## $Id: bootstrap,v 1.7 2002/08/27 14:15:24 sam Exp $
## $Id: bootstrap,v 1.8 2002/08/28 12:50:13 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
......@@ -32,10 +32,17 @@ done
set -x
rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
if expr `gettextize --version | head -1 | sed 's/[^0-9]*//'` \
# Check for gettext
if `which gettextize >/dev/null 2>&1`
then
if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
'>' 0.11.3 >/dev/null 2>&1
then
# We have gettext, and a recent version! Everything is cool.
autopoint --force
rm -f m4/Makefile.am
echo 'EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4' > m4/Makefile.am
GETTEXT=yes
else
# What?! User is not using a recent version of gettext? We'll have to
# cheat a bit, then.
......@@ -50,15 +57,20 @@ else
# do cp ${aclocaldir}/${file} m4/
#done
# Yuck!
echo > m4/Makefile.am
# Yuck!
echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
GETTEXT=old
fi;else
# we don't have gettext. grmbl. try to continue anyway.
mkdir -p m4
echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
echo 'AC_DEFUN([AM_GNU_GETTEXT], [])' >> m4/gettext.m4
GETTEXT=no
fi
aclocal-1.6 -I m4 || aclocal-1.5 -I m4
`which automake-1.6 >/dev/null 2>&1` && amvers=1.6 || amvers=1.5
aclocal-${amvers} -I m4
autoheader
automake-1.6 --foreign --add-missing --copy \
|| automake-1.5 --foreign --add-missing --copy
automake-${amvers} --foreign --add-missing --copy
autoconf
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
......@@ -69,10 +81,10 @@ cp Makefile.old Makefile.in
##
file=src/misc/modules_plugin.h
rm -f $file
sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
echo '' >> $file
file=include/vlc_symbols.h
......@@ -82,12 +94,12 @@ echo '' >> $file
echo 'struct module_symbols_t' >> $file
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' | sort >> $file
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' | sort >> $file
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file
......@@ -105,13 +117,13 @@ then
#include <vlc/vlc.h>
EOF
tail +8 modules/gui/gtk/$file \
| sed 's#_("-:--:--")#"-:--:--"#' \
| sed 's#_("---")#"---"#' \
| sed 's#_("--")#"--"#' \
| sed 's#_("/dev/dvd")#"/dev/dvd"#' \
| sed 's#_(\("./."\))#\1#' \
>> /tmp/$$.$file.bak
sed -e 1,7d \
-e 's#_("-:--:--")#"-:--:--"#' \
-e 's#_("---")#"---"#' \
-e 's#_("--")#"--"#' \
-e 's#_("/dev/dvd")#"/dev/dvd"#' \
-e 's#_(\("./."\))#\1#' \
< modules/gui/gtk/$file >> /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
done
......@@ -120,10 +132,14 @@ file=gtk_support.h
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
then
rm -f /tmp/$$.$file.bak
sed 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
sed -e 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
fi
##
## Shut up
##
set +x
##
## Update the potfiles because no one ever does it
......@@ -137,3 +153,24 @@ else
cd ..
fi
##
## Tell the user about gettext
##
case "$GETTEXT" in
yes)
;;
no)
echo ""
echo "==========================================================="
echo "IMPORTANT NOTE: you do not have gettext installed on your"
echo "system. The vlc build will work, but you will not have"
echo "internationalization support. We suggest installing gettext."
;;
old)
echo ""
echo "=========================================================="
echo "NOTE: you have an old version of gettext installed on your"
echo "system. We suggest upgrading to gettext 0.11.3 or later."
;;
esac
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