]> git.sesse.net Git - vlc/blob - bootstrap
75ff4086f653e0c3794007f39411c24e7bd7e74a
[vlc] / bootstrap
1 #! /bin/sh
2
3 ##  bootstrap.sh file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap,v 1.6 2002/08/26 23:36:20 sam Exp $
5 ##
6 ##  Authors: Samuel Hocevar <sam@zoy.org>
7
8 ###
9 ###  get a sane environment
10 ###
11 export LANG=C
12
13 ###
14 ###  argument check
15 ###
16 do_po=no
17 while test $# -gt 0; do
18   case "$1" in
19     --update-po)
20       do_po=yes
21       ;;
22     *)
23       echo "unknown option $1"
24       ;;
25   esac
26   shift
27 done
28
29 ###
30 ###  classic stuff
31 ###
32 set -x
33 rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
34
35 if expr `gettextize --version | head -1 | sed 's/[^0-9]*//'` \
36         '>' 0.11.3 >/dev/null 2>&1
37 then
38   autopoint --force
39 else
40   # What?! User is not using a recent version of gettext? We'll have to
41   # cheat a bit, then.
42   rm -f po/ChangeLog~
43   aclocaldir=`gettextize --copy --force | grep '^from the' | cut -f3 -d' '`
44   # Yuck!
45   test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
46   mkdir -p m4
47   # Yuck! - don't copy anything, it makes old autoconf barf.
48   #for file in codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 \
49   #            lcmessage.m4 progtest.m4
50   #  do cp ${aclocaldir}/${file} m4/
51   #done
52   # Yuck!
53   touch m4/Makefile.am
54   # Yuck!
55   echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
56 fi
57
58 aclocal -I m4
59 autoheader
60 automake --foreign --add-missing --copy
61 autoconf
62
63 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
64 cp Makefile.old Makefile.in
65
66 ##
67 ##  headers which need to be regenerated because of the VLC_EXPORT macro
68 ##
69 file=src/misc/modules_plugin.h
70 rm -f $file
71 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
72 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
73 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
74        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
75 echo '' >> $file
76
77 file=include/vlc_symbols.h
78 rm -f $file && touch $file
79 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
80 echo '' >> $file
81 echo 'struct module_symbols_t' >> $file
82 echo '{' >> $file
83 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
84        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
85 echo '};' >> $file
86 echo '' >> $file
87 echo '#ifdef __PLUGIN__' >> $file
88 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
89        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
90 echo '#endif /* __PLUGIN__ */' >> $file
91 echo '' >> $file
92
93
94 ##
95 ##  Glade sometimes sucks
96 ##
97 for file in gnome_interface.c gtk_interface.c
98 do
99 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
100 then
101     rm -f /tmp/$$.$file.bak
102     cat > /tmp/$$.$file.bak << EOF
103 /* This file was created automatically by glade and fixed by bootstrap.sh */
104
105 #include <vlc/vlc.h>
106 EOF
107     tail +8 modules/gui/gtk/$file \
108         | sed 's#_("-:--:--")#"-:--:--"#' \
109         | sed 's#_("---")#"---"#' \
110         | sed 's#_("--")#"--"#' \
111         | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
112         | sed 's#_(\("./."\))#\1#' \
113         >> /tmp/$$.$file.bak
114     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
115 fi
116 done
117
118 file=gtk_support.h
119 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
120 then
121     rm -f /tmp/$$.$file.bak
122     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
123     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
124 fi
125
126
127 ##
128 ##  Update the potfiles because no one ever does it
129 ##
130 if test "$do_po" = "no"
131 then
132   echo "not updating potfiles. use --update-po to force doing it."
133 else
134   cd po
135   make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
136   cd ..
137 fi
138