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