/bin/sh error when compiling

Help
madgrepper
2006-07-08
2013-04-17
  • madgrepper

    madgrepper - 2006-07-08

    On my 6.06 LTS (Ubuntu) laptop, I did a cvs co from the repository and ran ./configure.  It seemed to work ok, but when I do a make (or scons), it throws a shell error.  Here's the ./configure and make:

    dave@baldspot:~/wl/wlassistant$ ./configure
    Checking for Python               :  /usr/bin/python
    Checking for SCons                :  /usr/bin/scons
    scons: Reading SConscript files ...
    Checking for kde-config           :  kde-config was found as /usr/bin/kde-config
    Checking for kde version          :  3.5.2
    Checking for the qt library       :  qt was found as /usr
    Checking for uic                  :  uic was found as /usr/bin/uic
    Checking for moc                  :  moc was found as /usr/bin/moc
    Checking for the qt includes      :  the qt headers were found in /usr/include/qt3/
    Checking for the kde includes     :  the kde headers were found in /usr/include/kde/
    dave@baldspot:~/wl/wlassistant$ ls
    admin  cache      config.bks  CVS  icons     po          src        VERSION
    bksys  ChangeLog  configure   doc  Makefile  SConstruct  templates  wlassistant.kdevelop
    dave@baldspot:~/wl/wlassistant$ make
    scons: Reading SConscript files ...
    scons: done reading SConscript files.
    scons: Building targets ...
    msgfmt build/po/ca.po -o build/po/ca.gmo
    msgfmt build/po/es.po -o build/po/es.gmo
    msgfmt build/po/fr.po -o build/po/fr.gmo
    msgfmt build/po/pl.po -o build/po/pl.gmo
    msgfmt build/po/pt_BR.po -o build/po/pt_BR.gmo
    msgfmt build/po/zh_CN.po -o build/po/zh_CN.gmo
    msgfmt build/po/zh_TW.po -o build/po/zh_TW.gmo
    uic_processing(["build/src/ui_main.h", "build/src/ui_main.cpp", "build/src/ui_main.moc"], ["build/src/ui_main.ui"])
    /usr/bin/uic -L /usr/lib/kde3/plugins -nounload -o build/src/ui_main.h build/src/ui_main.ui
    /usr/bin/uic -L /usr/lib/kde3/plugins -nounload -tr tr2i18n -impl build/src/ui_main.h build/src/ui_main.ui >> build/src/ui_main.cpp
    /usr/bin/moc -o build/src/ui_main.moc build/src/ui_main.h
    -I/usr/include/kde/ -I/usr/include/qt3 -O2 -DNDEBUG -DNO_DEBUG -DQT_NO_TRANSLATION -I. -I. -c -o build/src/main.o build/src/main.cpp
    sh: -/: invalid option
    Usage:  sh [GNU long option] [option] ...
            sh [GNU long option] [option] script-file ...
    GNU long options:
            --debug
            --debugger
            --dump-po-strings
            --dump-strings
            --help
            --init-file
            --login
            --noediting
            --noprofile
            --norc
            --posix
            --protected
            --rcfile
            --restricted
            --verbose
            --version
            --wordexp
    Shell options:
            -irsD or -c command or -O shopt_option          (invocation only)
            -abefhkmnptuvxBCHP or -o option
    scons: *** [build/src/main.o] Error 2
    scons: building terminated because of errors.
    make: *** [all] Error 2
    dave@baldspot:~/wl/wlassistant$ uname -a
    Linux baldspot 2.6.15-23-k7 #1 SMP PREEMPT Tue May 23 14:20:54 UTC 2006 i686 GNU/Linux

     
    • Jan Merka

      Jan Merka - 2007-04-04

      I have got the same error with wlassistant 0.5.7. How can I compile it?

      Thank you,

      Jan

       
      • Pawel Nawrocki

        Pawel Nawrocki - 2007-04-04

        Hi, I can't reproduce this problem.
        However, you may try to run ./configure on the clean source, with scons uninstalled from your system (or just temporarily rename the executable, so it can't be found during the configure step), i.e. using the included mini-distribution. Let me know if that helped.

         
        • Jan Merka

          Jan Merka - 2007-04-05

          I ran ./configure with system-wide installed scons or with the provided mini-installation of scons with the same result.

          Here is again a part of the error message:

          scons: Reading SConscript files ...
          scons: done reading SConscript files.
          scons: Building targets ...
          -I/usr/include/ -I/usr/include/qt -O2 -DNDEBUG -DNO_DEBUG -DQT_NO_TRANSLATION -I. -I. -c -o build/src/main.o build/src/main.cpp
          sh: -/: invalid option
          Usage:  sh [GNU long option] [option] ...
                  sh [GNU long option] [option] script-file ...
          GNU long options:
                  --debug
                  --debugger

          After some googling, I found that the fourth line should probably start with g++ and scons' FAQs suggest that scons does NOT read the environment variables by default, i.e. it does not read the PATH variable. So even though g++ is installed on my system scons cannot find it.

          The FAQ suggested using something like this
                  import os
                  env = Environment(ENV = {'PATH' : os.environ['PATH']})
          so I put that into the SConstruct file and run configure again. But the make failed with the same error.

          I have zero experience with Python and scons so I would really appreciate if someone could suggest a solution, alternatively tell me where to look or what kind of information to provide for further debugging.

          Jan

           
    • Jan Merka

      Jan Merka - 2007-04-05

      I have temporarily made a link /bin/g++ -> /opt/gcc/current/bin/g++ and only then wlassistnat built successfully.

      So I guess the question now is what is the correct way of passing the g++ path to scons?

       
      • Jan Merka

        Jan Merka - 2007-04-06

        Found a solution, finally. I had to modify SConstruct file by replacing line

        env = Environment(tools=['default', 'generic', 'kde', 'parser'], toolpath=['./', './bksys'])

        with these two lines:

        import os
        env = Environment(ENV = os.environ, tools=['default', 'generic', 'kde', 'parser'], toolpath=['./', './bksys'])

        J.

         
        • Pawel Nawrocki

          Pawel Nawrocki - 2007-04-17

          Hi.
          Thank you for finding the solution! I just incorporated your changes into the CVS version, so the next release will compile without problems.
          Cheers.

           

Log in to post a comment.