]> git.sesse.net Git - vlc/blob - bootstrap
* ./HACKING: we can now use automake-1.5 instead of automake-1.6. But now
[vlc] / bootstrap
1 #! /bin/sh
2
3 ##  bootstrap.sh file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap,v 1.7 2002/08/27 14:15:24 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   echo > m4/Makefile.am
54   # Yuck!
55   echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
56 fi
57
58 aclocal-1.6 -I m4 || aclocal-1.5 -I m4
59 autoheader
60 automake-1.6 --foreign --add-missing --copy \
61   || automake-1.5 --foreign --add-missing --copy
62 autoconf
63
64 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
65 cp Makefile.old Makefile.in
66
67 ##
68 ##  headers which need to be regenerated because of the VLC_EXPORT macro
69 ##
70 file=src/misc/modules_plugin.h
71 rm -f $file
72 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
73 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
74 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
75        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
76 echo '' >> $file
77
78 file=include/vlc_symbols.h
79 rm -f $file && touch $file
80 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
81 echo '' >> $file
82 echo 'struct module_symbols_t' >> $file
83 echo '{' >> $file
84 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
85        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
86 echo '};' >> $file
87 echo '' >> $file
88 echo '#ifdef __PLUGIN__' >> $file
89 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
90        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
91 echo '#endif /* __PLUGIN__ */' >> $file
92 echo '' >> $file
93
94
95 ##
96 ##  Glade sometimes sucks
97 ##
98 for file in gnome_interface.c gtk_interface.c
99 do
100 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
101 then
102     rm -f /tmp/$$.$file.bak
103     cat > /tmp/$$.$file.bak << EOF
104 /* This file was created automatically by glade and fixed by bootstrap.sh */
105
106 #include <vlc/vlc.h>
107 EOF
108     tail +8 modules/gui/gtk/$file \
109         | sed 's#_("-:--:--")#"-:--:--"#' \
110         | sed 's#_("---")#"---"#' \
111         | sed 's#_("--")#"--"#' \
112         | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
113         | sed 's#_(\("./."\))#\1#' \
114         >> /tmp/$$.$file.bak
115     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
116 fi
117 done
118
119 file=gtk_support.h
120 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
121 then
122     rm -f /tmp/$$.$file.bak
123     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
124     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
125 fi
126
127
128 ##
129 ##  Update the potfiles because no one ever does it
130 ##
131 if test "$do_po" = "no"
132 then
133   echo "not updating potfiles. use --update-po to force doing it."
134 else
135   cd po
136   make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
137   cd ..
138 fi
139