Linux compilation issues

Help
2006-08-05
2013-04-25
  • Tiziano Müller

    Tiziano Müller - 2006-08-05

    I tried to do a package (ebuild) for Gentoo Linux and encountered some problems.

    a) If you run MAKEOPTS="-jN" (with N something bigger than 1), the compilation fails in tools/ because the PDCurses.man target is built at the same time as manext which fails because mainext is not built yet (this is a race condition). The fix is rather easy, change the line
    PDCurses.man:
    to
    PDCurses.man: manext

    b) There are some flaws in the configure.ac, I can open a bug for it if you want and attach the patch.

    c) Your configure's behaviour differs from that of other packages concerning CFLAGS. It somehow ignores the CFLAGS defined in the environment and when I call "make CFLAGS='...'" I have to add "-fPIC" to my CFLAGS as well but then it uses "-fPIC" for the demos too which isn't what I want and what it should do.

    d) Probably the most import one: You should compile the lib with:
    gcc -shared -Wl,-soname,libXcurses.so.2 -o libXcurses.so.2.8 to make it easier to install and compile against the lib.
    Some lines about it: http://www.faqs.org/docs/Linux-HOWTO/GCC-HOWTO.html#INDEX.73

    Thanks in advance,
    Greets

    Tiziano

     
    • William McBrine

      William McBrine - 2006-08-05

      a) OK, done. Thanks.

      b) By all means, open any bugs you like... if I don't agree I can just mark them "invalid". :-)

      c) You don't need to specify -fPIC. It's in the Makefile, but outside of CFLAGS. (I just tested with "make CFLAGS='-O3'", and it worked fine.) As for not working like other packages, please explain what you're expecting.

      d) Yeah... of course, by adopting soname, I'd effectively be committing to stability in the API for major release numbers. PDCurses hasn't had that so far. But the next version is going to be 3.0, so it might be the right time to adopt it.

       
    • William McBrine

      William McBrine - 2006-08-06

      Seriously though, please post whatever you have.

       
    • Tiziano Müller

      Tiziano Müller - 2006-08-12

      Sorry, I had a lot to do.

      Well, I've checked other packages. Usually, the ./configure script takes the CFLAGS from the env and writes them in the Makefile.

      To achieve that, change to following piece:

      if test "$ac_cv_prog_CC" = "gcc"; then
              if test "$with_debug" = yes; then
                      CFLAGS="${CFLAGS} -Wall"
              else
                      CFLAGS="-O2 -Wall -fomit-frame-pointer"
              fi
      fi

      to:

      if test "$ac_cv_prog_CC" = "gcc"; then
              if test "$with_debug" = yes; then
                      CFLAGS="${CFLAGS} -Wall"
              else
                      CFLAGS="${CFLAGS}"
              fi
      fi

       
    • Tiziano Müller

      Tiziano Müller - 2006-08-12

      And what is the reason of using MH_PROG_CC instead of AC_PROG_CC ?

       
    • William McBrine

      William McBrine - 2006-08-16

      According to MH (Mark Hessling): "Because at the time I wrote this common autoconf feature (8 years ago?) autoconf was very ordinary, and I was developing on SunOS which had both a BSD K&R compiler, and a System V compiler.  If the System V compiler was selected the headers for the BSD compiler were used wrongly. MH_PROG_CC was a work-around for this problem.

      It probably doesn't need to be used now."

       

Log in to post a comment.