]> git.sesse.net Git - vlc/blob - bootstrap
* ./modules/audio_output/waveout.c: audio output now works under WinCE
[vlc] / bootstrap
1 #! /bin/sh
2
3 ##  bootstrap file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap,v 1.31 2002/11/20 16:43:32 sam Exp $
5 ##
6 ##  Authors: Samuel Hocevar <sam@zoy.org>
7
8 ###
9 ###  Get a sane environment, just in case
10 ###
11 LANG=C
12 export LANG
13 CYGWIN=binmode
14 export CYGWIN
15
16 ##
17 ##  Give help
18 ##
19 help()
20 {
21   if test "$do_help" = "yes"
22   then
23     cat << EOF
24 recognized flags are:
25   --config        create Makefile and configure scripts (read HACKING)
26   --update-vc     update Microsoft Visual Studio files
27   --update-po     update translation files
28 EOF
29     exit 1
30   fi
31 }
32
33 ###
34 ###  argument check
35 ###
36 test "$EMAIL" = "sam@zoy.org" && do_help=yes || do_help=no
37 do_po=no
38 do_vc=no
39 while test $# -gt 0; do
40   case "$1" in
41     --config)
42       do_help=no
43       ;;
44     --update-vc)
45       do_help=no
46       do_vc=yes
47       ;;
48     --update-po)
49       do_help=no
50       do_po=yes
51       ;;
52     *)
53       echo "$0: unknown option $1"
54       do_help=yes
55       help
56       ;;
57   esac
58   shift
59 done
60
61 ##
62 ##  Give help if needed
63 ##
64 help
65
66 ##
67 ##  Update the MSVC project files
68 ##
69 if test "$do_vc" = "yes"
70 then
71   if test ! -f Makefile
72   then
73     echo "no Makefile found, did you run ./configure?"
74     exit 1
75   fi
76
77   echo "generating Visual Studio files..."
78
79   #  The evil ^M
80   M='\r'
81
82   #  Sources that get built under Win32
83   LIBVLC_SOURCES=`make show-libvlc-sources | grep '^X: ' | cut -b3-`
84   LIBVLC_HEADERS=`make show-libvlc-headers | grep '^X: ' | cut -b3-`
85   LIBVLC_PKG_HEADERS=`make show-libvlc-pkg-headers | grep '^X: ' | cut -b3-`
86
87   # Clean up
88   rm -f evc/*.vcp msvc/*.dsp
89
90   # libvlc files
91   for target in evc/libvlc.vcp msvc/libvlc.dsp
92   do
93     echo "${target}"
94     #  Top of the project file
95     perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
96     #  The source files
97     for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
98     do
99       cat >> ${target} << EOF
100 # Begin Source File${M}
101 SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
102 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
103 # End Source File${M}
104 EOF
105     done
106     for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
107     do
108       cat >> ${target} << EOF
109 # Begin Group "${subdir}"${M}
110 EOF
111       for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
112       do
113       if test "${target}" = "evc/libvlc.vcp"
114       then
115         cat >> ${target} << EOF
116 # Begin Source File${M}
117 SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
118 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
119 !IF "\$(CFG)" == "vlc - Win32 (WCE MIPS) Release"${M}
120 # PROP Intermediate_Dir "MIPSRel\\${subdir}"${M}
121 # PROP Output_Dir "MIPSRel\\${subdir}"${M}
122 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE MIPS) Debug"${M}
123 # PROP Intermediate_Dir "MIPSDbg\\${subdir}"${M}
124 # PROP Output_Dir "MIPSDbg\\${subdir}"${M}
125 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH4) Release"${M}
126 # PROP Intermediate_Dir "SH4Rel\\${subdir}"${M}
127 # PROP Output_Dir "SH4Rel\\${subdir}"${M}
128 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH4) Debug"${M}
129 # PROP Intermediate_Dir "SH4Dbg\\${subdir}"${M}
130 # PROP Output_Dir "SH4Dbg\\${subdir}"${M}
131 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH3) Release"${M}
132 # PROP Intermediate_Dir "SH3Rel\\${subdir}"${M}
133 # PROP Output_Dir "SH3Rel\\${subdir}"${M}
134 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE SH3) Debug"${M}
135 # PROP Intermediate_Dir "SH3Dbg\\${subdir}"${M}
136 # PROP Output_Dir "SH3Dbg\\${subdir}"${M}
137 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE ARM) Release"${M}
138 # PROP Intermediate_Dir "ARMRel\\${subdir}"${M}
139 # PROP Output_Dir "ARMRel\\${subdir}"${M}
140 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE ARM) Debug"${M}
141 # PROP Intermediate_Dir "ARMDbg\\${subdir}"${M}
142 # PROP Output_Dir "ARMDbg\\${subdir}"${M}
143 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE x86em) Release"${M}
144 # PROP Intermediate_Dir "X86EMRel\\${subdir}"${M}
145 # PROP Output_Dir "X86EMRel\\${subdir}"${M}
146 !ELSEIF "\$(CFG)" == "vlc - Win32 (WCE x86em) Debug"${M}
147 # PROP Intermediate_Dir "X86EMDbg\\${subdir}"${M}
148 # PROP Output_Dir "X86EMDbg\\${subdir}"${M}
149 !ENDIF${M}
150 # End Source File${M}
151 EOF
152         else
153           cat >> ${target} << EOF
154 # Begin Source File${M}
155 SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
156 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M}
157 !IF "\$(CFG)" == "vlc - Win32 Release"${M}
158 # PROP Intermediate_Dir "Release\\${subdir}"${M}
159 # PROP Output_Dir "Release\\${subdir}"${M}
160 !ELSEIF "\$(CFG)" == "vlc - Win32 Debug"${M}
161 # PROP Intermediate_Dir "Debug\\${subdir}"${M}
162 # PROP Output_Dir "Debug\\${subdir}"${M}
163 !ENDIF${M}
164 # End Source File${M}
165 EOF
166         fi
167       done
168       cat >> ${target} << EOF
169 # End Group${M}
170 EOF
171     done
172     #  The headers
173     perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${target}.in >> ${target}
174     for file in ${LIBVLC_HEADERS}
175     do
176       cat >> ${target} << EOF
177 # Begin Source File${M}
178 SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
179 # End Source File${M}
180 EOF
181     done
182     cat >> ${target} << EOF
183 # Begin Group "vlc"${M}
184 EOF
185     for file in ${LIBVLC_PKG_HEADERS}
186     do
187       cat >> ${target} << EOF
188 # Begin Source File${M}
189 SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M}
190 # End Source File${M}
191 EOF
192     done
193     cat >> ${target} << EOF
194 # End Group${M}
195 EOF
196     perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
197   done
198
199   # plugins files
200   grep '^L_[^ ]*_pic =' Modules.am | while read a b c
201   do
202     makefile="`echo $c | sed -e 's@/[^/]*$@/Modules.am@'`"
203     plugin="`echo $a | sed 's/L_\(.*\)_pic/\1/'`"
204     # this is an attempt at getting a list of plugin sources... we take the
205     # production and remove everything that does not contain "module", which
206     # means you miss $(NULL), but other variables too.
207     cfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${makefile} | awk 'BEGIN{a=0}{if(!a&&/^SOURCES_'${plugin}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | sed -ne 's,/,\\\\,g; s/.*modules/modules/p'`
208     hfiles=`for i in ${cfiles} ; do echo $i ; done | grep '\.h$'`
209     cfiles=`for i in ${cfiles} ; do echo $i ; done | grep -v '\.h$'`
210     for dir in evc msvc
211     do
212       test "${dir}" = "evc" && suf="vcp" || suf="dsp"
213       source="${dir}/plugins.${suf}.in"
214       target="${dir}/plugin_${plugin}.${suf}"
215       echo "${target}"
216       perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${plugin}'/g' < ${source} > ${target}
217       for cfile in ${cfiles}
218       do
219         cat >> ${target} << EOF
220 # Begin Source File${M}
221 SOURCE="..\\${cfile}"${M}
222 # End Source File${M}
223 EOF
224       done
225       # sed is really nicer for this... unfortunately it's broken under cygwin
226       # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
227       perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
228       for hfile in ${hfiles}
229       do
230         cat >> ${target} << EOF
231 # Begin Source File${M}
232 SOURCE="..\\${hfile}"${M}
233 # End Source File${M}
234 EOF
235       done
236       # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
237       perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
238     done
239   done
240
241   # vlc files
242   for target in evc/vlc.vcp msvc/vlc.dsp
243   do
244     echo "${target}"
245     #  Top of the project file
246     perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
247     #  The source files
248     if test "${target}" = "evc/vlc.vcp"
249     then
250       cat >> ${target} << EOF
251 # Begin Source File${M}
252 SOURCE="..\\evc\\vlc.c"${M}
253 # End Source File${M}
254 EOF
255     else
256       cat >> ${target} << EOF
257 # Begin Source File${M}
258 SOURCE="..\\src\\vlc.c"${M}
259 # End Source File${M}
260 EOF
261     fi
262     #  Bottom of the project file - handles resource files too
263     perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
264   done
265
266   echo "done."
267   exit 0
268 fi
269
270 ##
271 ##  Update the potfiles because no one ever does it
272 ##
273 if test "$do_po" = "yes"
274 then
275   cd po
276   make update-po #2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
277   cd ..
278
279   exit 0
280 fi
281
282 ##
283 ## Check that our tools don't suck
284 ##
285 SEDSUCKS=no
286 if test ! 20000 -eq `perl -e 'printf "%s\n","a"x20000' | sed -e 's/.//' 2>/dev/null | wc -c`
287 then
288   SEDSUCKS=yes
289 fi
290
291 PERLSUCKS=no
292 AUTOMAKESUCKS=no
293
294 ##
295 ## Generate the modules makefile, by parsing modules/**/Modules.am
296 ##
297
298 printf "generating Modules.am and configure.ac"
299
300 echo > Modules.am
301 echo > configure.ac
302
303 ALL_FLAGS="`sed -n -e '/^[^=A-Z]*[A-Z]*FLAGS_[^=]*=/s/[^=A-Z]*\([A-Z]*FLAGS_[^=]*=\).*/\1/p' < configure.ac.in | sort | uniq`"
304
305 cat >> configure.ac << EOF
306 dnl ################################################################
307 dnl # Do not edit this file, it was generated from configure.ac.in #
308 dnl ################################################################
309
310 EOF
311 sed -n -e '/dnl do not touch this line/q;p' < configure.ac.in >> configure.ac
312
313 modules=""
314 for mf in `sed -ne 's@[^a-z]*\([^ ]*\)am.*@modules/\1am@p' < modules/Makefile.am`
315 do
316   printf "."
317   dir=`echo ${mf} | sed -e 's@\(.*\)/.*@\1@'`
318   topdir=`echo ${dir} | cut -f2 -d/`
319   sym=`echo ${dir} | sed -e 'y@/@_@'`
320   cat >> Modules.am << EOF
321 # Directory ${dir}
322
323 include ${dir}/Modules.am
324
325 EOF
326   sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | while read mod
327   do
328     LINKER="LINK"
329     if echo "$ALL_FLAGS" | grep '^CPPFLAGS_'${mod}'=$' >/dev/null 2>&1; then
330         echo "AC_SUBST(CPPFLAGS_${mod})" >> configure.ac; fi
331     if echo "$ALL_FLAGS" | grep '^CFLAGS_'${mod}'=$' >/dev/null 2>&1; then
332         echo "AC_SUBST(CFLAGS_${mod})" >> configure.ac; fi
333     if echo "$ALL_FLAGS" | grep '^CXXFLAGS_'${mod}'=$' >/dev/null 2>&1; then
334         LINKER="CXXLINK"
335         echo "AC_SUBST(CXXFLAGS_${mod})" >> configure.ac; fi
336     if echo "$ALL_FLAGS" | grep '^OBJCFLAGS_'${mod}'=$' >/dev/null 2>&1; then
337         LINKER="OBJCLINK"
338         echo "AC_SUBST(OBJCFLAGS_${mod})" >> configure.ac; fi
339     if echo "$ALL_FLAGS" | grep '^LDFLAGS_'${mod}'=$' >/dev/null 2>&1; then
340         echo "AC_SUBST(LDFLAGS_${mod})" >> configure.ac; fi
341     if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev/null 2>&1; then
342         PRIVATE='#'; else
343         PRIVATE=''; fi
344     if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/dev/null 2>&1; then
345         NODIST=''; else
346         NODIST='#'; fi
347     cat >> configure.ac << EOF
348 AM_CONDITIONAL(${mod}_plugin, test x\$${mod}_plugin = xyes)
349 AM_CONDITIONAL(${mod}_builtin, test x\$${mod}_builtin = xyes)
350 EOF
351 # Generation of Modules.am
352 # ~~~~~~~~~~~~~~~~~~~~~~~~
353 # - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
354 #   S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
355 #   the resulting file size.
356 # - *_CFLAGS, *_CXXFLAGS etc. include *_CPPFLAGS because per-object CPPFLAGS
357 #   does not seem to work properly with any automake version I tested.
358     cat >> Modules.am << EOF
359 # The ${mod} plugin
360
361 if ${mod}_plugin
362 if UNTRUE
363 L_${mod}_p = ${dir}/lib${mod}_plugin.a
364 endif
365 D_${mod}_p = ${dir}/lib${mod}_plugin\$(LIBEXT)
366 ${NODIST}B_${mod}_p = \$(nodist_SOURCES_${mod})
367 endif
368 if ${mod}_builtin
369 L_${mod}_b = ${dir}/lib${mod}.a
370 F_${mod}_b = \$(LDFLAGS_${mod})
371 if BUILD_MOZILLA
372 L_${mod}_pic = ${dir}/lib${mod}_pic.a
373 endif
374 ${NODIST}B_${mod}_b = \$(nodist_SOURCES_${mod})
375 endif
376
377 L_builtin += \$(L_${mod}_b)
378 L_builtin_pic += \$(L_${mod}_pic)
379 LDFLAGS_builtin += \$(F_${mod}_b)
380 ${PRIVATE}BUILT_SOURCES += \$(B_${mod}_p) \$(B_${mod}_b)
381 PLUGIN_FILES += \$(D_${mod}_p)
382
383 ${PRIVATE}${sym}_lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
384 ${NODIST}${PRIVATE}nodist_${sym}_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
385 ${sym}_lib${mod}_plugin_a_CPPFLAGS = \$(CPPFLAGS_plugin) \$(CPPFLAGS_${mod}) -DMODULE_NAME=${mod} -DMODULE_NAME_IS_${mod}
386 ${sym}_lib${mod}_plugin_a_CFLAGS = \$(CFLAGS_plugin) \$(CFLAGS_${mod}) \$(${sym}_lib${mod}_plugin_a_CPPFLAGS)
387 ${sym}_lib${mod}_plugin_a_CXXFLAGS = \$(CXXFLAGS_plugin) \$(CXXFLAGS_${mod}) \$(${sym}_lib${mod}_plugin_a_CPPFLAGS)
388 ${sym}_lib${mod}_plugin_a_OBJCFLAGS = \$(OBJCFLAGS_plugin) \$(OBJCFLAGS_${mod}) \$(${sym}_lib${mod}_plugin_a_CPPFLAGS)
389
390 ${sym}_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
391 ${NODIST}nodist_${sym}_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
392 ${sym}_lib${mod}_pic_a_CPPFLAGS = \$(CPPFLAGS_builtin_pic) \$(CPPFLAGS_${mod}) -DMODULE_NAME=${mod} -DMODULE_NAME_IS_${mod}
393 ${sym}_lib${mod}_pic_a_CFLAGS = \$(CFLAGS_builtin_pic) \$(CFLAGS_${mod}) \$(${sym}_lib${mod}_pic_a_CPPFLAGS)
394 ${sym}_lib${mod}_pic_a_CXXFLAGS = \$(CXXFLAGS_builtin_pic) \$(CXXFLAGS_${mod}) \$(${sym}_lib${mod}_pic_a_CPPFLAGS)
395 ${sym}_lib${mod}_pic_a_OBJCFLAGS = \$(OBJCFLAGS_builtin_pic) \$(OBJCFLAGS_${mod}) \$(${sym}_lib${mod}_pic_a_CPPFLAGS)
396
397 ${sym}_lib${mod}_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
398 ${NODIST}nodist_${sym}_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
399 ${sym}_lib${mod}_a_CPPFLAGS = \$(CPPFLAGS_builtin) \$(CPPFLAGS_${mod}) -DMODULE_NAME=${mod} -DMODULE_NAME_IS_${mod}
400 ${sym}_lib${mod}_a_CFLAGS = \$(CFLAGS_builtin) \$(CFLAGS_${mod}) \$(${sym}_lib${mod}_a_CPPFLAGS)
401 ${sym}_lib${mod}_a_CXXFLAGS = \$(CXXFLAGS_builtin) \$(CXXFLAGS_${mod}) \$(${sym}_lib${mod}_a_CPPFLAGS)
402 ${sym}_lib${mod}_a_OBJCFLAGS = \$(OBJCFLAGS_builtin) \$(OBJCFLAGS_${mod}) \$(${sym}_lib${mod}_a_CPPFLAGS)
403
404 libvlc_LIBRARIES += \$(L_${mod}_b) \$(L_${mod}_pic)
405 lib${mod}_DATA = \$(D_${mod}_p)
406
407 lib${mod}dir = \$(libdir)/vlc/${topdir}
408 ${PRIVATE}noinst_LIBRARIES += \$(L_${mod}_p)
409 ${PRIVATE}${dir}/lib${mod}_plugin\$(LIBEXT): \$(${sym}_lib${mod}_plugin_a_OBJECTS)
410 ${PRIVATE}      \$(${LINKER}) \$^ -shared \$(LDFLAGS_plugins) \$(LDFLAGS_${mod})
411
412
413 EOF
414   done
415 done
416
417 echo "AM_CONDITIONAL(UNTRUE, false)" >> configure.ac
418 sed -n -e '/dnl do not touch this line/,//p' < configure.ac.in >> configure.ac
419
420 echo "done."
421
422 ###
423 ###  classic bootstrap stuff
424 ###
425 set -x
426 rm -f aclocal.m4 m4/oldgettext.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
427 rm -Rf intl
428
429 # Check for gettext
430 if gettextize --version >/dev/null 2>&1
431 then
432 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
433         '>' 0.11.2 >/dev/null 2>&1
434 then
435   # We have gettext, and a recent version! Everything is cool.
436   autopoint || exit 1
437   GETTEXT=yes
438 else
439   # User's gettext is too old. try to continue anyway.
440   mkdir -p intl
441   echo > intl/Makefile.am
442   echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
443   GETTEXT=old
444 fi;else
445   # we don't have gettext. grmbl. try to continue anyway.
446   mkdir -p intl
447   echo > intl/Makefile.am
448   echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
449   GETTEXT=no
450 fi
451
452 # Check for automake
453 amvers="none"
454 if automake-1.7 --version >/dev/null 2>&1
455 then
456   amvers="-1.7"
457 else
458   if automake-1.6 --version >/dev/null 2>&1
459   then
460     amvers="-1.6"
461     if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev/null 2>&1
462     then AUTOMAKESUCKS=yes
463     fi
464   else
465     if automake-1.5 --version >/dev/null 2>&1
466     then
467       amvers="-1.5"
468     else
469       if automake --version > /dev/null 2>&1
470       then
471         amvers=`automake --version | sed -e '1s/[^0-9]*//' -e q`
472         case $amvers in
473         1.6|1.6.0|1.6.1)
474           AUTOMAKESUCKS=yes ;;
475         esac
476
477         if expr "$amvers" "<" "1.5" > /dev/null 2>&1
478         then amvers="none"
479         else amvers=""
480         fi
481       fi
482     fi
483   fi
484 fi
485
486 if test x$amvers = xnone
487 then
488   set +x
489   echo "you need automake version 1.5 or later"
490   exit 1
491 fi
492
493 # Do the rest
494 aclocal${amvers} -I m4 || exit 1
495 autoheader || exit 1
496
497 automake${amvers} --foreign --add-missing --copy || PERLSUCKS=yes
498
499 case "$PERLSUCKS" in
500   no)
501   ;;
502   yes)
503     set +x
504     echo ""
505     echo "==========================================================="
506     echo "IMPORTANT NOTE: automake failed. On certain systems this is"
507     echo "because of insufficient stack size. Please set the stack"
508     echo "size to something bigger or unlimited (\`unlimit stacksize')"
509     echo "and try again."
510     exit 1
511   ;;
512 esac
513
514 # Wrap automake's long lines, because the Solaris sed doesn't support lines
515 # longer than 3999 characters, and ./configure calls sed. We use Perl instead
516 # of sed for obvious reasons :)
517 perl -ne 'if(/^.{500}/) {s/(.{200}[^ ]* )/$1\\\n\t/g} print $_' < Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp Makefile.in
518
519 autoconf || exit 1
520
521 ##
522 ##  headers which need to be regenerated
523 ##
524 rm -f src/misc/modules_builtin.h src/misc/modules_plugin.h
525 rm -f include/vlc_symbols.h
526 rm -f mozilla/vlcintf.h
527
528 ##
529 ##  Shut up
530 ##
531 set +x
532
533 ##
534 ##  Glade sometimes sucks
535 ##
536 echo "workarounds for annoying glade features"
537 for file in gnome_interface.c gtk_interface.c
538 do
539 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
540 then
541     rm -f /tmp/$$.$file.bak
542     cat > /tmp/$$.$file.bak << EOF
543 /* This file was created automatically by glade and fixed by bootstrap */
544
545 #include <vlc/vlc.h>
546 EOF
547     sed -e 1,7d \
548         -e 's#_("-:--:--")#"-:--:--"#' \
549         -e 's#_("---")#"---"#' \
550         -e 's#_("--")#"--"#' \
551         -e 's#_("/dev/dvd")#"/dev/dvd"#' \
552         -e 's#_(\("./."\))#\1#' \
553         < modules/gui/gtk/$file >> /tmp/$$.$file.bak
554     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
555 fi
556 done
557
558 file=gtk_support.h
559 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
560 then
561     rm -f /tmp/$$.$file.bak
562     sed -e 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
563     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
564 fi
565
566 ##
567 ##  Tell the user about gettext and sed
568 ##
569 case "$GETTEXT" in
570   yes)
571   ;;
572   no)
573     echo ""
574     echo "==========================================================="
575     echo "IMPORTANT NOTE: you do not have gettext installed on your"
576     echo "system. The vlc build will work, but you will not have"
577     echo "internationalization support. We suggest installing gettext."
578   ;;
579   old)
580     echo ""
581     echo "=========================================================="
582     echo "NOTE: you have an old version of gettext installed on your"
583     echo "system. We suggest upgrading to gettext 0.11.3 or later."
584   ;;
585 esac
586
587 case "$AUTOMAKESUCKS" in
588   no)
589   ;;
590   yes)
591     echo ""
592     echo "============================================================="
593     echo "IMPORTANT NOTE: your version of automake has a bug which will"
594     echo "prevent proper plugin compilation. Either compile VLC with"
595     echo "the --disable-plugins flag, or use a version of automake newer"
596     echo "than 1.6.1 (1.6.2 is OK, and so are the 1.5 series)."
597   ;;
598 esac
599
600 case "$SEDSUCKS" in
601   no)
602   ;;
603   yes)
604     echo ""
605     echo "============================================================="
606     echo "IMPORTANT NOTE: the version of 'sed' on your system is unable"
607     echo "to handle long lines. bootstrap will try its best to generate"
608     echo "a correct Makefile, but you should expect problems. We highly"
609     echo "recommend installing GNU sed."
610   ;;
611 esac
612