bootstrap 3.86 KB
Newer Older
1
2
3
#! /bin/sh

##  bootstrap.sh file for vlc, the VideoLAN Client
4
##  $Id: bootstrap,v 1.7 2002/08/27 14:15:24 sam Exp $
5
6
7
##
##  Authors: Samuel Hocevar <sam@zoy.org>

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
###
###  get a sane environment
###
export LANG=C

###
###  argument check
###
do_po=no
while test $# -gt 0; do
  case "$1" in
    --update-po)
      do_po=yes
      ;;
    *)
      echo "unknown option $1"
      ;;
  esac
  shift
done

29
30
31
###
###  classic stuff
###
32
33
set -x
rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
34

35
36
37
38
39
40
41
42
43
44
45
46
if expr `gettextize --version | head -1 | sed 's/[^0-9]*//'` \
        '>' 0.11.3 >/dev/null 2>&1
then
  autopoint --force
else
  # What?! User is not using a recent version of gettext? We'll have to
  # cheat a bit, then.
  rm -f po/ChangeLog~
  aclocaldir=`gettextize --copy --force | grep '^from the' | cut -f3 -d' '`
  # Yuck!
  test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
  mkdir -p m4
47
48
49
50
51
  # Yuck! - don't copy anything, it makes old autoconf barf.
  #for file in codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 \
  #            lcmessage.m4 progtest.m4
  #  do cp ${aclocaldir}/${file} m4/
  #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
61
automake-1.6 --foreign --add-missing --copy \
  || automake-1.5 --foreign --add-missing --copy
62
autoconf
63

64
65
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
cp Makefile.old Makefile.in
66
67
68
69
70
71

##
##  headers which need to be regenerated because of the VLC_EXPORT macro
##
file=src/misc/modules_plugin.h
rm -f $file
72
sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
73
74
75
76
77
78
79
80
81
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
echo '' >> $file

file=include/vlc_symbols.h
rm -f $file && touch $file
echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
echo '' >> $file
82
echo 'struct module_symbols_t' >> $file
83
84
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
85
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
86
87
88
89
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
90
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
91
92
93
94
95
96
97
98
99
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file


##
##  Glade sometimes sucks
##
for file in gnome_interface.c gtk_interface.c
do
100
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
101
102
103
104
105
106
107
then
    rm -f /tmp/$$.$file.bak
    cat > /tmp/$$.$file.bak << EOF
/* This file was created automatically by glade and fixed by bootstrap.sh */

#include <vlc/vlc.h>
EOF
108
    tail +8 modules/gui/gtk/$file \
109
110
111
112
113
114
        | sed 's#_("-:--:--")#"-:--:--"#' \
        | sed 's#_("---")#"---"#' \
        | sed 's#_("--")#"--"#' \
        | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
        | sed 's#_(\("./."\))#\1#' \
        >> /tmp/$$.$file.bak
115
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
116
117
118
119
fi
done

file=gtk_support.h
120
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
121
122
then
    rm -f /tmp/$$.$file.bak
123
124
    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
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
125
126
127
128
129
130
fi


##
##  Update the potfiles because no one ever does it
##
131
132
133
134
135
136
137
138
if test "$do_po" = "no"
then
  echo "not updating potfiles. use --update-po to force doing it."
else
  cd po
  make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
  cd ..
fi
139