Project Home
Project Home
Source Code
Source Code
Discussion Forums
Project Information
Project Info
wiki2986: Bootstrap_632

Bootstrapping under 632#

Set up your kit#

Before building packages from source under QNX, it's recommended you download and install the QNX Utility Package for pkgsrc containing fixes and omissions to our kit this entire exercise has uncovered.

# cd /
# tar -xzvUf /tmp/pkgsrc_qnxutil-0.14.tar.gz

Archive contents at time of writing:#

  • usr/bin/patch
    • The shipped one doesn't do anything. PR 21085.
  • usr/qnx632/target/qnx6/x86/usr/lib/libtermcap.a
    • tgetent() can pull out terminal definition for ansi rather than qansi. PR 45283.
      • tcsh can tickle this one.
  • usr/bin/expr
    • regular expression matching done with the ':' operator must be anchored to the beginning of the string. PR 49169.
      • libtool can tickle this one.
    • work buffer for ':' operator is too small. PR 50882.
      • configure scripts can tickle this one.
    • didn't honour POSIX end of option '--' delimiter. PR 52242.
      • lang/php5 configure script tickled this one.
  • bin/uname
    • trailing space if muliple options are passed or -a specified is not POSIX. PR 44076.
  • usr/bin/comm
    • comm is needed for POSIX conformance. PR 19760.
      • perl needs this one.
  • usr/bin/ftp
    • This is the latest one from our next scheduled networking release and adds http support which pkgsrc likes to have.
  • bin/pwd
    • Lack of terminating newline if stdout isn't a tty isn't POSIX. PR 44519.
  • usr/bin/tr
    • '\\' , '\a' , '\b' , '\f' , '\n' , '\r' , '\t' , '\v' should be supported as POSIX escape sequences. PR 24740.
  • bin/ksh
    • This is a weird one. libtool-1.5.24 consistently caused ksh to fault while building ncurses. Wasn't really able to debug it but recompiling the HEAD ksh seemed to remedy it so maybe something fixed along the way?
  • usr/bin/rpcgen
    • rpcgen is looking for qcc at "/usr/bin/qcc", this is no longer true. In the past, the workaround is to "ln -sf $(QNX_TARGET)/x86/usr/bin/qcc /usr/bin/qcc". The PR48650 is opened against this. The rpcgen is fixed so it will look into PATH for "qcc".
  • usr/qnx632/target/qnx6/usr/include/stdlib.h
    • The devel/gettext-asnprintf package tickled an issue where stdlib.h wouldn't declare malloc() and friends in a C++ environment depending on order of inclusion. PR 51606.
  • <poll.h>
    • A link to <sys/poll.h>
    • This is the header actually specified by POSIX and various packages are looking for it rather than <sys/poll.h> which we ship. PR 29467.
  • <sys/platform.h>
    • Don't default __STDC_VERSION__=199901L with later gcc. PR 51798.
  • <unistd.h>
    • Allow compilation when no posix standard defined. PR 24822.
  • <stdio.h>
    • Don't double prototype fseeko() and friends when _FILE_OFFSET_BITS=64. PR 27983.

Optionally update your procnto#

  • This is probably not needed. The building of groff passes a lot of args via its environment. There was a case where processes with a large PATH would not inherit their environment correctly (PR 44407). So depending on where you check it out to, the build of groff may show issues.

Set up your environment#

  • Add /usr/pkg/bin:/usr/pkg/sbin to your PATH
  • Add /usr/pkg/lib to your CS_LIBPATH
    • I have the following in my /etc/rc,d/rc.local
      setconf CS_LIBPATH $(getconf CS_LIBPATH):/usr/pkg/lib
  • Your default compiler will be used. 3.3.5 works much better.
# qcc -V 3.3.5,gcc_ntox86 -set-default
  • 4.2.1 might be better still? Someone try it out :)


  • Download pkgsrc with QNX diffs. Familiarize yourself with the repository layout:
    • The 'vendor' and 'HEAD_640' branches are used for 640 work.
    • The 'HEAD_632' branch contains the last update to the pkgsrc snapshot with diffs for QNX 632.
  • Note: this is a subversion repository. If you've registered with the Foundry27 site, the above link should present a sample checkout command. For example, to check out the entire repository:
# svn checkout --username <username>
  • However, each branch is fairly large. To check out only the HEAD_632 branch:
# svn checkout --username <username>
  • Once that's done you should be ready to bootstrap:
# cd pkgsrc/bootstrap
# ./bootstrap

Set up the resulting /usr/pkg/etc/mk.conf#

  • We've taken the route of trying to leverage qcc for future cross platform support so add the following line:
  • You'll probably want globally disable x11 support for now. To do so add the following line:
    Alternatively you can disable it on a per package basis as per the following example:
# cd textproc/groff
# bmake PKG_OPTIONS.groff=-x11

Try your first package#

# cd misc/figlet
# bmake install
# pkg_info