]> git.sesse.net Git - vlc/commitdiff
* bootstrap:
authorSam Hocevar <sam@videolan.org>
Tue, 8 Jul 2003 13:09:30 +0000 (13:09 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 8 Jul 2003 13:09:30 +0000 (13:09 +0000)
    + Removed a useless use of cut.
    + Do not fail in the "clean" rule if no targets were built.
  * Makefile.am:
    + Propagate $(srcdir) to toolbox.
  * toolbox:
    + Do not include .moc files in POTFILES.in.
    + Fixed the generation of MSVC project files (untested).

Makefile.am
bootstrap
toolbox

index 08fc2628df583b98392c004cff34d67fc24050da..a60756438a6d6414b20ca404ed5478f8c1bab5d9 100644 (file)
@@ -106,13 +106,13 @@ HEADERS_include_built = \
        $(NULL)
 
 include/vlc_symbols.h: Makefile $(HEADERS_include)
-       $(srcdir)/toolbox --update-includes
+       srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
 
 src/misc/modules_plugin.h: Makefile src/misc/modules_plugin.h.in $(HEADERS_include)
-       $(srcdir)/toolbox --update-includes
+       srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
 
 src/misc/modules_builtin.h: Makefile src/misc/modules_builtin.h.in
-       $(srcdir)/toolbox --update-includes
+       srcdir=$(srcdir) $(srcdir)/toolbox --update-includes
 
 # These dependencies are mandatory
 $(SOURCES): include/vlc_symbols.h
@@ -208,7 +208,7 @@ EXTRA_DIST += \
 
 dist-hook:
        mv $(distdir)/vlc.ebuild $(distdir)/vlc-${VERSION}.ebuild
-       cd $(distdir) && $(srcdir)/toolbox --update-vc
+       cd $(distdir) && srcdir=$(srcdir) $(srcdir)/toolbox --update-vc
 
 ###############################################################################
 # Building libvlc
index e30aa29e852193d634093b2ba201a953dfe7620b..b844b4d09107ced8cdc389046aed21dc5a8f997d 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ##  bootstrap file for the VLC media player
-##  $Id: bootstrap,v 1.66 2003/07/07 16:53:48 sam Exp $
+##  $Id: bootstrap,v 1.67 2003/07/08 13:09:30 sam Exp $
 ##
 ##  Authors: Sam Hocevar <sam@zoy.org>
 
@@ -60,7 +60,6 @@ AC_DEFUN([AX_VLC_CONFIG_HELPER], [
 EOF
 
 modules=""
-count=0
 
 rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
 # Autogenerated by bootstrap - DO NOT EDIT
@@ -73,11 +72,9 @@ for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
 do
   printf "."
   mf="modules/${dir}/Modules.am"
-  basedir="`echo ${dir} | cut -f1 -d/`"
+  basedir="${dir%%\/*}"
   # automake will not recurse for make dist if we don't define SUBDIRS = .
   subdirs="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
-  #parent=`echo ${dir} | sed -e 's@[^/]*@..@g'`
-  #echo "  modules/${dir}/Makefile" >> m4/private.m4-tmp3
   rm -f modules/${dir}/Makefile.am && cat > modules/${dir}/Makefile.am << EOF
 
 # Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
@@ -95,12 +92,11 @@ include Modules.am
 
 clean: clean-local
 clean-local:
-       rm -f *.a *.so *.dll *.sl *.dylib
+       -rm -f *.a *.so *.dll *.sl *.dylib
 
 EOF
   for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
   do
-    count="`expr ${count} + 1`"
     if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev/null 2>&1; then
         PRIVATE='#'; else
         PRIVATE=''; fi
@@ -129,7 +125,7 @@ all: all-${mod}
 EOF
     if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
 clean-${mod}:
-       rm -f \$(nodist_SOURCES_${mod})
+       -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
 
 EOF
     fi
@@ -164,13 +160,13 @@ else
 endif
 
 if UNTRUE
-L${count}p = lib${mod}_plugin.a
-D${count}p = lib${mod}_plugin\$(LIBEXT)
-L${count}b = lib${mod}.a
-L${count}pic = lib${mod}_pic.a
+L${mod}-p = lib${mod}_plugin.a
+D${mod}-p = lib${mod}_plugin\$(LIBEXT)
+L${mod}-b = lib${mod}.a
+L${mod}-pic = lib${mod}_pic.a
 EOF
     if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-B${count} = \$(nodist_SOURCES_${mod})
+B${mod} = \$(nodist_SOURCES_${mod})
 EOF
     fi
     cat >> modules/${dir}/Makefile.am << EOF
@@ -178,7 +174,7 @@ endif
 
 EOF
     if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}BUILT_SOURCES += \$(B${count})
+${PRIVATE}BUILT_SOURCES += \$(B${mod})
 EOF
     fi
     cat >> modules/${dir}/Makefile.am << EOF
@@ -215,11 +211,11 @@ lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
 lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
 lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
 
-libvlc_LIBRARIES += \$(L${count}b) \$(L${count}pic)
-lib${mod}_DATA = \$(D${count}p)
+libvlc_LIBRARIES += \$(L${mod}-b) \$(L${mod}-pic)
+lib${mod}_DATA = \$(D${mod}-p)
 
 lib${mod}dir = \$(libdir)/vlc/${topdir}
-${PRIVATE}noinst_LIBRARIES += \$(L${count}p)
+${PRIVATE}noinst_LIBRARIES += \$(L${mod}-p)
 ${PRIVATE}lib${mod}_plugin\$(LIBEXT): \$(lib${mod}_plugin_a_OBJECTS)
 ${PRIVATE}     @case \`\$(VLC_CONFIG) --linkage ${mod}\` in \\
 ${PRIVATE}       c++) echo \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
diff --git a/toolbox b/toolbox
index 2ee302ed08cb2bdb8caf69289d29ce618a0ec003..29f225ce402ff9fe51f680dda159b57392cc9215 100755 (executable)
--- a/toolbox
+++ b/toolbox
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ##  toolbox for the VLC media player
-##  $Id: toolbox,v 1.38 2003/07/05 14:47:53 sam Exp $
+##  $Id: toolbox,v 1.39 2003/07/08 13:09:30 sam Exp $
 ##
 ##  Authors: Samuel Hocevar <sam@zoy.org>
 
@@ -27,7 +27,7 @@ recognized flags are:
   --update-glade2         generate and fix Glade 2 code
   --update-flexml         generate and fix flexml and flex code
   --changelog             update the CVS changelog
-  --distclean             "make distclean"
+  --distclean             "make distclean" on steroids
   --make-woody <dir>      change distdir <dir> to a woody distdir
 EOF
   exit 1
@@ -120,7 +120,9 @@ if test "${action}" = "vc"
 then
   echo "generating Visual Studio files..."
 
-  srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+  if test -z "${srcdir}"; then
+    srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+  fi
 
   #  The evil ^M
   M="`printf '\r'`"
@@ -260,45 +262,47 @@ EOF
   done
 
   # plugins files
-  grep '^L_[^ ]*_pic =' Modules.am | while read a b c
+  for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
   do
-    makefile="`echo $c | sed -e 's@/[^/]*$@/Modules.am@'`"
-    plugin="`echo $a | sed 's/L_\(.*\)_pic/\1/'`"
-    # this is an attempt at getting a list of plugin sources... we take the
-    # production and remove everything that does not contain "module", which
-    # means you miss $(NULL), but other variables too.
-    cfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${makefile} | awk 'BEGIN{a=0}{if(!a&&$0~/^SOURCES_'${plugin}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | sed -ne 's,/,\\\\,g; s/.*modules/modules/p'`
-    hfiles=`for i in ${cfiles} ; do echo $i ; done | grep '\.h$'`
-    cfiles=`for i in ${cfiles} ; do echo $i ; done | grep -v '\.h$'`
-    for dir in evc msvc
+    mf="${srcdir}/modules/${dir}/Modules.am"
+    for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
     do
-      test "${dir}" = "evc" && suf="vcp" || suf="dsp"
-      source="${dir}/plugins.${suf}.in"
-      target="${dir}/plugin_${plugin}.${suf}"
-      echo "${target}"
-      perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${plugin}'/g' < ${source} > ${target}
-      for cfile in ${cfiles}
+      # this is an attempt at getting a list of plugin sources... we take the
+      # production and remove everything that does not contain "module", which
+      # means you miss $(NULL), but other variables too.
+      allfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${mf} | awk 'BEGIN{a=0}{if(!a&&$0~/^SOURCES_'${mod}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | grep '\.'`
+      hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
+      cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
+      for dir in evc msvc
       do
-        cat >> ${target} << EOF
+        test "${dir}" = "evc" && suf="vcp" || suf="dsp"
+        source="${dir}/plugins.${suf}.in"
+        target="${dir}/plugin_${mod}.${suf}"
+        echo "${target}"
+        perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${mod}'/g' < ${source} > ${target}
+        for cfile in ${cfiles}
+        do
+          cat >> ${target} << EOF
 # Begin Source File${M}
-SOURCE="..\\${cfile}"${M}
-# ADD CPP /D "__VLC__" /D "__PLUGIN__"  /D "MODULE_NAME=${plugin}" /D "MODULE_NAME_IS_${plugin}" ${M}
+SOURCE="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"${M}
+# ADD CPP /D "__VLC__" /D "__PLUGIN__"  /D "MODULE_NAME=${mod}" /D "MODULE_NAME_IS_${mod}" ${M}
 # End Source File${M}
 EOF
-      done
-      # sed is really nicer for this... unfortunately it's broken under cygwin
-      # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
-      perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
-      for hfile in ${hfiles}
-      do
-        cat >> ${target} << EOF
+        done
+        # sed is really nicer for this... unfortunately it's broken under cygwin
+        # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
+        perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
+        for hfile in ${hfiles}
+        do
+          cat >> ${target} << EOF
 # Begin Source File${M}
-SOURCE="..\\${hfile}"${M}
+SOURCE="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"${M}
 # End Source File${M}
 EOF
+        done
+        # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
+        perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
       done
-      # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
-      perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
     done
   done
 
@@ -352,7 +356,9 @@ then
   find include src -name '*.[chm]' -o -name '*.[ch]pp' | sort >> po/POTFILES.in
   echo "" >> po/POTFILES.in
   echo "# modules" >> po/POTFILES.in
-  find modules -name '*.[chm]' -o -name '*.[ch]pp' | grep -v 'gui/win32/' | sort >> po/POTFILES.in
+  find modules -name '*.[chm]' -o -name '*.[ch]pp' \
+    | grep -v '\(gui/win32/\|\.moc\.\)' \
+    | sort >> po/POTFILES.in
   # clean old potfiles
   cd po
   rm -f vlc.pot
@@ -371,7 +377,9 @@ if test "${action}" = "includes"
 then
   #set -x
 
-  srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+  if test -z "${srcdir}"; then
+    srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
+  fi
   LIBVLC_HEADERS=`getfiles HEADERS_include`
   BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`