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

##  bootstrap.sh file for vlc, the VideoLAN Client
4
##  $Id: bootstrap,v 1.8 2002/08/28 12:50:13 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
# Check for gettext
if `which gettextize >/dev/null 2>&1`
then
if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
39
40
        '>' 0.11.3 >/dev/null 2>&1
then
41
  # We have gettext, and a recent version! Everything is cool.
42
  autopoint --force
43
44
45
  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
46
47
48
49
50
51
52
53
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
54
55
56
57
58
  # 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
59
  # Yuck!
60
  echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/gettext.m4
61
62
63
64
65
66
67
  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
68
fi
69

70
71
`which automake-1.6 >/dev/null 2>&1` && amvers=1.6 || amvers=1.5
aclocal-${amvers} -I m4
72
autoheader
73
automake-${amvers} --foreign --add-missing --copy
74
autoconf
75

76
77
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
cp Makefile.old Makefile.in
78
79
80
81
82
83

##
##  headers which need to be regenerated because of the VLC_EXPORT macro
##
file=src/misc/modules_plugin.h
rm -f $file
84
sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
85
86
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
87
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
88
89
90
91
92
93
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
94
echo 'struct module_symbols_t' >> $file
95
96
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
97
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
98
99
100
101
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
102
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
103
104
105
106
107
108
109
110
111
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file


##
##  Glade sometimes sucks
##
for file in gnome_interface.c gtk_interface.c
do
112
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
113
114
115
116
117
118
119
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
120
121
122
123
124
125
126
    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
127
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
128
129
130
131
fi
done

file=gtk_support.h
132
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
133
134
then
    rm -f /tmp/$$.$file.bak
135
    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
136
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
137
138
fi

139
140
141
142
##
##  Shut up
##
set +x
143
144
145
146

##
##  Update the potfiles because no one ever does it
##
147
148
149
150
151
152
153
154
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
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
##
##  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