]> git.donarmstrong.com Git - lilypond.git/commitdiff
(dos_to_posix)[__CYGWIN__]: Return
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 Oct 2005 08:05:05 +0000 (08:05 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 Oct 2005 08:05:05 +0000 (08:05 +0000)
unconverted value if cygwin_conv_to_posix_path () fails.  Fixes
absolute file name bug.  Backportme.

ChangeLog
cygwin/mknetrel
cygwin/mknetrel.doc
cygwin/mknetrel.libtool
cygwin/mknetrel.split
flower/file-name.cc
scripts/GNUmakefile

index a00ddf286f62c0051201c368e8410e0b0a6e341c..f2e57bce55ffd21b144f4fc24c44e3245b3ba48e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-09  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower/file-name.cc (dos_to_posix)[__CYGWIN__]: Return
+       unconverted value if cygwin_conv_to_posix_path () fails.  Fixes
+       absolute file name bug.  Backportme.
+
 2005-10-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * input/regression/figured-bass-continuation-center.ly: new file.
index 50c682683010f65c32bb3cdfc637360b3c3aa500..390a1db84af68fdb592ae6d21b7a31894cd353e6 100644 (file)
@@ -50,13 +50,7 @@ preconfig () {
            $src/configure --prefix=$prefix --enable-config=for-build)
     fi
 
-    if [ "$cygwin" == "mingw" ]; then
-       cp /usr/include/FlexLexer.h .
-       mkdir python2.3
-       cp /usr/include/python2.3/Python.h python2.3
-    fi
-
-    GUILE=$($cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}')
+    GUILE=$(GUILE_LOAD_PATH=$cygwin_prefix/share/guile/* $cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}')
     cat > $target-guile-config <<EOF
 [ "\$1" == "--version" ] && echo "$target-guile-config - Guile version $GUILE"
 [ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
@@ -68,13 +62,36 @@ EOF
     build_cxx="$build_cxx -I$(pwd)"
     if [ "$cygwin" == "mingw" ]; then
        CONFIGOPTS="--without-kpathsea $CONFIGOPTS"
-       CPPFLAGS="-DARGV0_RELOCATION=1 $CPPFLAGS"
+       #CPPFLAGS="-DARGV0_RELOCATION=1 $CPPFLAGS"
+       CONFIGOPTS="--enable-relocation $CONFIGOPTS"
        # There's a problem with inlining the string utils.
        # The -O2 flag is still passed by default through opt.
        CONFIGOPTS="--disable-optimising $CONFIGOPTS"
         ## debugging
        ##opt='-g'
     fi
+    
+    if [ "$cygwin" == "mingw" ]; then
+       cp /usr/include/FlexLexer.h .
+       mkdir python2.3
+       cp /usr/include/python2.3/Python.h python2.3
+
+       CXX="$(echo $build_cxx | sed 's/ -mwindows//')" \
+           CXX_FOR_TARGET="${build_cxx}" \
+           CC="${build_cc}" \
+           CC_FOR_TARGET="${build_cc}" \
+           GCC_FOR_TARGET="${build_cc}" \
+           RANLIB="${build_ranlib}" \
+           RANLIB_FOR_TARGET="${build_ranlib}" \
+           DLLWRAP="${build_dllwrap}" \
+           AR="${build_ar}" NM="${build_nm}" \
+           LD=$(${build_cc} -print-prog-name=ld) \
+           $src/configure --enable-config=console $CONFIGOPTS
+
+       rm -f config.cache
+        iscygwin || crosscache
+    fi
+
     :
 }
 
@@ -83,8 +100,12 @@ prebuild () {
 
     # shortcircuit python for mingw
     if [ "$cygwin" == "mingw" ]; then
-       mkdir -p python/out
+       #sed -e s/-mwindows// < config.make > config-console.make
+       #cp config.hh config-console.hh
+
+       mkdir -p python/out python/out-console
        touch python/out/midi.lo python/out/midi.so python/out/midi.dll
+       touch python/out-console/midi.lo python/out-console/midi.so python/out-console/midi.dll
     fi
 
     # cross-compiling: build for build-host, generate doc
@@ -103,14 +124,28 @@ prebuild () {
            CXX=$HOST_CXX \
            LDFLAGS="" \
            eval make conf=for-build $args) || exit 1
-       
-       mkdir -p mf/out
-       cp -pv mf/out-for-build/* mf/out
 
+       # fake mf and texi
+        mkdir -p mf/out
+       cp -pv mf/out-for-build/* mf/out
        mkdir -p Documentation/user/out
        cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out
     fi
 
+    if [ "$cygwin" == "mingw" ]; then
+       # fake mf and texi
+        mkdir -p mf/out-console
+       cp -pv mf/out-for-build/* mf/out-console
+       mkdir -p Documentation/user/out-console
+       cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out-console
+       # fake manual pages, only works without --enable-config
+       mkdir -p scripts/out-console
+       cp scripts/out-for-build/*.1 scripts/out-console
+       mkdir -p lily/out-console
+       cp lily/out-for-build/*.1 lily/out-console
+       make conf=console || exit 1
+    fi
+
     addmakeflags "target=$target" ' '
     if [ -f "$cygwin_prefix/bin/libpython2.4.dll" ]; then
        addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.4.dll" ' '
@@ -129,8 +164,25 @@ preinstall () {
 }
 
 postinstall () {
+    if [ "$cygwin" == "mingw" ]; then
+       cp $inst/usr/share/lilypond/$v/python/* $inst/usr/bin
+       install -m755 $build/lily/out/lilypond $inst/usr/bin/lilypond-windows
+       install -m755 $build/lily/out-console/lilypond $inst/usr/bin/
+    fi
+    
     extras_postinstall
 
+    if [ "$cygwin" == "mingw" ]; then
+       for i in $inst/usr/bin/*; do
+           m=$(file -b $i)
+           if echo "$m" | grep "guile"; then
+               mv $i $i.scm
+           elif echo "$m" | grep "python"; then
+               mv $i $i.py
+           fi
+       done
+    fi
+
     cd $build || exit 1
     if ! iscygwin && doc; then
        make conf=for-build webdir=$inst-doc/$packagedocdir web-install
@@ -172,15 +224,15 @@ extra_name () {
 }
 
 extra_split () {
-    mkdir -p 
     # should be in devel...
     mkdir -p ./$prefix/share/lilypond/$v
     for i in make python tex vim; do
-       mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/
+    #for i in make tex vim; do
+       mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/$v
     done
     mkdir -p ./$prefix/share/lilypond/$v/fonts
     for i in source svg tfm; do
-       mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/fonts
+       mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/$v/fonts
     done
 
     mkdir -p ./$prefix/share
index 793a8dc3dfd5de9ae2e5ae644feaa03b7558ed96..48f8a50917722d9679198970f11d273226d4cb60 100644 (file)
@@ -10,7 +10,7 @@ docdir=$docprefix/doc
 cygdocdir=$docdir/$Cygwin
 infodir=$docprefix/info
 mandir=$docprefix/man
-packagedocdir=$docdir/$base-$ver
+packagedocdir=$docdir/$base
 
 fixdoc () {
     #
@@ -28,5 +28,10 @@ fixdoc () {
        mkdir -p $packagedocdir
        tar -C $inst/$docprefix/$base -cf - . | tar -C $inst/$packagedocdir -xf -
     fi
+    for i in $inst/$docprefix/info/*.info \
+       $inst/$docprefix/info/*.info-[0-9] \
+       $inst/$docprefix/info/*.info-[0-9][0-9]; do
+       gzip $i
+    done
     true
 }
index d28bf08376fa4ecfbd5ac52306bf3682f507e6f7..4745d6573688b4e5686b931c09db154270a9faae 100644 (file)
@@ -37,8 +37,16 @@ fix_libtool_la () {
            for j in $(ls -1 *.la); do
                sed -i~ \
                    -e 's/ *-L *[^"'"'"' ][^"'"'"' ]*//g'\
-                   -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\
+                   -e "s@\( \|=\|'\)\(/[^ ]*usr/lib/lib\)\([^ ']*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\
                    $j
+##                 -e "s@\( \|=\|'\)\(cyg\)\([^ ']*\)\(\.dll.a\|.a\)[^ ']*@\1lib\3\4@g"\
+##                 -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^ ']*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\
+##                 -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^.]*\)\.\(a\|la\|so\)[^ ']*@\1-l\3@g"\
+##                 -e "s@\( \|=\|'\)\(/usr/lib/lib\)\([^.]*\)[^ ']*@\1-l\3@g"\
+##                 -e "s@\( \|=\|'\)\(/usr/lib/\)\(lib\)@\1\3@g"\
+##                 -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\
+##                 -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\
+##                 -e "s@\( \|=\)\(/usr/lib/lib\)\([^ ]*\)[.]\(a\|dll\|la\|so[^ ]*\)@-l\2@g"\
            done
        fi
     done
@@ -49,7 +57,9 @@ fix_libtool_la () {
     # more libtool fixups.  I love libtool.
     sed -i~ \
        -e "s@^dlname=.*@dlname='../bin/$dll_prefix$base-$sover.dll'@" \
-       -e "s@^library_names=.*@library_names='$dll_prefix$base.dll.a'@" \
-       -e "s@^old_library=.*@old_library='$dll_prefix$base.a'@" \
+       -e "s@^library_names=.*@library_names='lib$base.dll.a'@" \
+       -e "s@^old_library=.*@old_library='lib$base.a'@" \
        $inst/$prefix/lib/lib$base.la
+##     -e "s@^library_names=.*@library_names='$dll_prefix$base.dll.a'@" \
+##     -e "s@^old_library=.*@old_library='$dll_prefix$base.a'@" \
 }
index a64822b2addd3a277fa9aaca04f13e375f975f0d..8f67fc0282f66c7897d35e9ce4779506ab4d277e 100644 (file)
@@ -105,11 +105,11 @@ extras_postinstall () {
 
     readmes="$(find . -maxdepth 1 -type f -a -name '[A-Z]*' | egrep -v 'Makefile|GNUmakefile')"
     install -m644 $readmes $inst/$packagedocdir
+    install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.$Cygwin
 
     ## Cygwin readmes
     cd $src || exit 1
     install -d -m755 $inst/$cygdocdir
-    install -m644 $cygwin/changelog $inst/$cygdocdir/changelog.$Cygwin
 
     cd $src || exit 1
     install -m644 $cygwin/README $inst/$packagedocdir/README.$Cygwin
@@ -119,17 +119,64 @@ extras_postinstall () {
     install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
 }
 
+auto_requires () {
+    dlls=
+    requires=
+    dlls=$(find . -name '*dll' -o -name '*.exe' \
+       | xargs $cygcheck 2>&1 | grep '^  [^ ]' \
+       | tr -d '[ \r]' | sed 's@.*\\@@g' | sort -u)
+    for x in $(ls -1 bin/* sbin/*); do
+       case $x in
+           *.exeXXX|*.dllXXX)
+               dlls="$($cygcheck $x 2>&1 | grep '^  [^ ]' | tr -d '[ \r]' | sed 's@.*bin\\@@g') $dlls"
+               ;;
+       esac
+       case "$(file -b $x)" in
+           "*Bourne shell script*")
+               requires="bash\n$requires"
+               ;;
+           "*guile*script*")
+               requires="guile\n$requires"
+               ;;
+           "*perl*script*")
+               requires="perl\n$requires"
+               ;;
+           "*python*script*")
+               requires="python\n$requires"
+               ;;
+       esac
+    done
+    for x in $dlls; do
+       requires="$(cyg-apt find $x | sed 's/:.*//')\n$requires"
+    done
+    requires=$(echo -e "$requires" | sort -u)
+    echo $requires
+}
+
 hint () {
     if [ -r $shint ]; then
        cp $shint $hint
     else
        cat > $hint <<EOF
-sdesc: "$subname"
-ldesc: "$subname - no description (missing $package/$(dirname $shint) file)"
+sdesc: "$name"
+ldesc: "$name - no description (missing $package/$cygwin/$(basename $shint) file)"
 EOF
     fi
     grep ^requires: $hint || echo "requires: $depends" >> $hint
-    grep ^build-requires: $hint || echo "build-requires: $build_depends" >> $hint
+    if [ "$cygwin" == "cygwin" ]; then
+       if grep ^build-requires: $hint; then
+           mv $hint $hint~
+           grep -v build-requires $hint~ > $hint
+       fi
+       if iscygwin; then
+           cygcheck=cygcheck.exe
+       else
+           cygcheck="wine $cygwin_prefix/bin/cygcheck.exe"
+       fi
+       echo "#auto-requires: $(cd usr; auto_requires)" >> $hint
+    else
+       grep ^build-requires: $hint || echo "build-requires: $build_depends" >> $hint
+    fi
 }
 
 domkdist () {
@@ -174,7 +221,8 @@ domkdist () {
     echo creating $tarstem.tar.bz2
     cd $inst || exit 1
 
-    shint=$src/$cygwin/setup.hint
+    name=$base
+    shint=$src/$cygwin/$name.hint
     hint=$uploads/setup.hint
     hint
     find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $tarstem.tar.bz2
@@ -189,9 +237,10 @@ domkdist () {
        depends=$(eval echo '$'${i}_depends)
        mkdir -p $subload || exit 1
        echo creating $subtarstem.tar.bz2
+       name=$subname
+       cd $inst-$i
        hint
        grep ^external-source: $hint || echo "external-source: $base" >> $hint
-       cd $inst-$i
        hard2soft
        find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $subtarstem.tar.bz2
     done
@@ -200,8 +249,8 @@ domkdist () {
     cd $src/.. || exit 1
     echo creating "$tarstem"-src.tar.bz2
     ##find $package_src/* -print -follow | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2
-    find $package_src/* -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2
-    ##cd $package_src && tar -cj --exclude='\.cvsignore' --exclude='\.bak$' --exclude='\.orig$' --exclude='\.o$' --exclude='~$' --exclude='^.#' --exclude='CVS' --exclude='%redact' --exclude='/tags$' --owner=0 --group=0 -f "$tarstem"-src.tar.bz2 .
+    find $package_src/* -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|%redact|/tags$|/TAGS$|autom4te.cache$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2
+    ##cd $package_src && tar -cj --exclude='\.cvsignore' --exclude='\.bak$' --exclude='\.orig$' --exclude='\.o$' --exclude='~$' --exclude='^.#' --exclude='CVS' --exclude='%redact' --exclude='/tags$' --exclude='/TAGS$' --exclude='autom4te.cache' --owner=0 --group=0 -f "$tarstem"-src.tar.bz2 .
     postpackage
 }
 
index b29307814513ccca6d0150a8203eb56482422000..2064e072613fa598908a01b467068f3d65512b69 100644 (file)
@@ -40,12 +40,14 @@ using namespace std;
 static String
 dos_to_posix (String file_name)
 {
-  char buf[PATH_MAX];
+  char buf[PATH_MAX] = "";
   char *s = file_name.get_copy_str0 ();
-  /* urg, wtf? char const* argument gets modified! */
-  cygwin_conv_to_posix_path (s, buf);
+  /* ugh: char const* argument gets modified.  */
+  int fail = cygwin_conv_to_posix_path (s, buf);
   delete s;
-  return buf;
+  if (!fail)
+    return buf;
+  return file_name;
 }
 #endif /* __CYGWIN__ */
 
index 028ae2bbc4edaa53824a7d7827a159e1daccc3ac..009d4c46b876c80710bb93bf0cce1737cf5bdd9a 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly  lilypond-invoke-editor
+SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-invoke-editor
 
 STEPMAKE_TEMPLATES=script help2man po
 LOCALSTEPMAKE_TEMPLATES = lilypond