Thursday, June 7, 2018

Building GNU libunistring 0.9.10

The basic building strategy and general assumptions have been detailed on a previous post: Staged Building:

 $ pwd
/stage/build

$ ./gnu-build-preparation ../source/.../libunistring-0.9.10.tar.gz
...

$ cd libunistring/libunistring-0.9.10-32

$ source ../setenv-0.9.10 32

Configuration file [version 4]: /stage/build/libunistring/ld.config-32 
 Platform:     32-bit LSB 80386
 Default Library Path (ELF):   /opt/gnu/lib:/opt/usr/lib:/lib:/usr/lib
 Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (... default)

Command line:
  crle 

   -c /stage/build/libunistring/ld.config-32 
   -l /opt/gnu/lib:/opt/usr/lib:/lib:/usr/lib

LD_CONFIG_32=/stage/build/libunistring/ld.config-32

CONFIG_SHELL=

CC=/usr/bin/gcc CFLAGS=-m32 -march=nocona -mtune=nocona -std=gnu89

CXX=/usr/bin/g++ CXXFLAGS=-m32 -march=nocona -mtune=nocona -std=gnu++98

LD=/usr/bin/ld LDFLAGS=-m32 -march=nocona -mtune=nocona

PATH=/opt/gnu/bin:/opt/usr/bin:/usr/gnu/bin:/usr/bin:/usr/sbin

PKG_CONFIG_PATH=/opt/usr/lib/pkgconfig

Suggested build sequence:

Fine-tune/fix config.h.in, Makefile.in and others...

$ ./configure \
    --build=i386-pc-solaris2.11 \
    --prefix=/opt/... \
    ...

$ gmake -j2

$ su
# source ../setenv-0.9.10 32

For IPS package:

# gmake DESTDIR=/stage/prototype/libunistring/0.9.10/32 install

For immediate use:

# gmake install
# zfs snapshot -r .../opt/...@libunistring-0.9.10


$ ./configure \
  --build=i386-pc-solaris2.11 \
  --prefix=/opt/gnu \
  --enable-threads=posix \
  --with-libiconv-prefix=/opt/gnu \
  --without-libpth-prefix
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/gnu/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /usr/bin/gcc... gcc3
checking how to run the C preprocessor... /usr/bin/gcc -E
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
checking for grep that handles long lines and -e... /usr/gnu/bin/grep
checking for egrep... /usr/gnu/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking for ranlib... ranlib
checking how to print strings... print -r
checking for a sed that does not truncate output... /usr/gnu/bin/sed
checking for fgrep... /usr/gnu/bin/grep -F
checking for ld used by /usr/bin/gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/gnu/bin/nm -B
checking the name lister (/usr/gnu/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking how to convert i386-pc-solaris2.11 file names to i386-pc-solaris2.11 format... func_convert_file_noop
checking how to convert i386-pc-solaris2.11 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... print -r --
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/gnu/bin/nm -B output from /usr/bin/gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/gnu/bin/dd
checking how to truncate binary pipes... /usr/gnu/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /usr/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/bin/gcc static flag -static works... no
checking if /usr/bin/gcc supports -c -o file.o... yes
checking if /usr/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... solaris2.11 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for windres... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for complete errno.h... yes
checking whether frexp() can be used without linking with libm... yes
checking whether alarm is declared... yes
checking whether long double and double are the same... no
checking for __fseterr... no
checking for iswcntrl... yes
checking for iswblank... yes
checking for symlink... yes
checking for mbsinit... yes
checking for mbrtowc... yes
checking for mprotect... yes
checking for snprintf... yes
checking for stpcpy... yes
checking for strdup... yes
checking for wcwidth... yes
checking for btowc... yes
checking for _set_invalid_parameter_handler... no
checking for getprogname... yes
checking for getexecname... yes
checking for isblank... yes
checking for newlocale... no
checking for pthread_sigmask... yes
checking for setenv... yes
checking for sleep... yes
checking for usleep... yes
checking for wcrtomb... yes
checking for wctob... yes
checking host CPU and C ABI... i386
checking for ld... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for shared library run path origin... done
checking for the common suffixes of directories in the library search path... checking for 64-bit host... no
lib,lib
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... /opt/gnu/lib/libiconv.so -R/opt/gnu/lib
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, const char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for iconv.h... yes
checking for crtdefs.h... no
checking for wctype.h... yes
checking for langinfo.h... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking for math.h... yes
checking for sys/mman.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for features.h... no
checking for inttypes.h... (cached) yes
checking for xlocale.h... no
checking for semaphore.h... yes
checking for sys/socket.h... yes
checking for sys/time.h... yes
checking for inline... inline
checking where to find the exponent in a 'double'... word 1 bit 20
checking where to find the exponent in a 'float'... word 0 bit 23
checking whether byte ordering is bigendian... no
checking for wint_t... yes
checking whether wint_t is too small... no
checking whether iswcntrl works... yes
checking for towlower... yes
checking for wctype_t... yes
checking for wctrans_t... yes
checking whether wctype is declared without a macro... yes
checking whether iswctype is declared without a macro... yes
checking whether wctrans is declared without a macro... yes
checking whether towctrans is declared without a macro... yes
checking whether limits.h has ULLONG_WIDTH etc.... no
checking for nl_langinfo and CODESET... yes
checking for working fcntl.h... yes
checking whether getc_unlocked is declared... yes
checking whether we are using the GNU C Library >= 2.1 or uClibc... no
checking for LC_MESSAGES... yes
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking whether imported symbols can be declared weak... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_kill in -lpthread... yes
checking for multithread API to use... posix
checking whether malloc, realloc, calloc are POSIX compliant... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for mbstate_t... yes
checking for a traditional japanese locale... none
checking for a transitional chinese locale... none
checking for a french Unicode locale... fr_FR.UTF-8
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking whether defines MIN and MAX... no
checking whether defines MIN and MAX... no
checking whether to activate relocatable installation... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for wchar_t... yes
checking whether stdint.h conforms to C99... no
checking sys/inttypes.h usability... yes
checking sys/inttypes.h presence... yes
checking for sys/inttypes.h... yes
checking sys/bitypes.h usability... no
checking sys/bitypes.h presence... no
checking for sys/bitypes.h... no
checking for bit size of ptrdiff_t... 32
checking for bit size of size_t... 32
checking for bit size of sig_atomic_t... 32
checking for bit size of wchar_t... 32
checking for bit size of wint_t... 32
checking whether sig_atomic_t is signed... yes
checking whether wchar_t is signed... yes
checking whether wint_t is signed... yes
checking for ptrdiff_t integer literal suffix...
checking for size_t integer literal suffix... u
checking for sig_atomic_t integer literal suffix...
checking for wchar_t integer literal suffix... l
checking for wint_t integer literal suffix... l
checking for C/C++ restrict keyword... no
checking whether ffsl is declared without a macro... yes
checking whether ffsll is declared without a macro... yes
checking whether memmem is declared without a macro... yes
checking whether mempcpy is declared without a macro... no
checking whether memrchr is declared without a macro... no
checking whether rawmemchr is declared without a macro... no
checking whether stpcpy is declared without a macro... yes
checking whether stpncpy is declared without a macro... yes
checking whether strchrnul is declared without a macro... yes
checking whether strdup is declared without a macro... yes
checking whether strncat is declared without a macro... yes
checking whether strndup is declared without a macro... yes
checking whether strnlen is declared without a macro... yes
checking whether strpbrk is declared without a macro... yes
checking whether strsep is declared without a macro... yes
checking whether strcasestr is declared without a macro... yes
checking whether strtok_r is declared without a macro... yes
checking whether strerror_r is declared without a macro... yes
checking whether strsignal is declared without a macro... yes
checking whether strverscmp is declared without a macro... no
checking for mmap... (cached) yes
checking for MAP_ANONYMOUS... yes
checking whether strncat works... yes
checking whether strstr works... yes
checking for pid_t... yes
checking for mode_t... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking whether snprintf returns a byte count as in C99... yes
checking for snprintf... (cached) yes
checking for strnlen... yes
checking for wcslen... yes
checking for wcsnlen... yes
checking for mbrtowc... (cached) yes
checking for wcrtomb... (cached) yes
checking whether _snprintf is declared... no
checking whether printf supports 'long double' arguments... yes
checking whether printf supports infinite 'double' arguments... no
checking whether printf supports infinite 'long double' arguments... no
checking whether printf supports the 'a' and 'A' directives... no
checking whether printf supports the 'F' directive... yes
checking whether printf supports the 'ls' directive... no
checking whether printf supports the grouping flag... yes
checking whether printf supports the left-adjust flag correctly... yes
checking whether printf supports the zero flag correctly... no
checking whether printf supports large precisions... yes
checking whether printf survives out-of-memory conditions... yes
checking whether uses 'inline' correctly... yes
checking for a traditional french locale... none
checking whether // is distinct from /... no
checking if environ is properly declared... no
checking whether strerror_r is declared... (cached) yes
checking for strerror_r... yes
checking whether strerror_r returns char *... no
checking whether imaxabs is declared without a macro... yes
checking whether imaxdiv is declared without a macro... yes
checking whether strtoimax is declared without a macro... yes
checking whether strtoumax is declared without a macro... yes
checking for inttypes.h... (cached) yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for sigset_t... yes
checking whether setenv is declared... yes
checking search.h usability... yes
checking search.h presence... yes
checking for search.h... yes
checking for tsearch... yes
checking for uid_t in sys/types.h... yes
checking whether strerror(0) succeeds... yes
checking for struct timespec in


$ gmake -j2
gmake  all-recursive
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32'
Making all in doc
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
gmake[2]: Nothing to be done for `all'.
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
Making all in gnulib-local
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
gmake[2]: Nothing to be done for `all'.
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
Making all in lib
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
rm -f alloca.h-t alloca.h && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          cat ./alloca.in.h; \
        } > alloca.h-t && \
        mv -f alloca.h-t alloca.h
rm -f configmake.h-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "/opt/gnu"'; \
          echo '#define EXEC_PREFIX "/opt/gnu"'; \
          echo '#define BINDIR "/opt/gnu/bin"'; \
          echo '#define SBINDIR "/opt/gnu/sbin"'; \
          echo '#define LIBEXECDIR "/opt/gnu/libexec"'; \
          echo '#define DATAROOTDIR "/opt/gnu/share"'; \
          echo '#define DATADIR "/opt/gnu/share"'; \
          echo '#define SYSCONFDIR "/opt/gnu/etc"'; \
          echo '#define SHAREDSTATEDIR "/opt/gnu/com"'; \
          echo '#define LOCALSTATEDIR "/opt/gnu/var"'; \
          echo '#define RUNSTATEDIR "/opt/gnu/var/run"'; \
          echo '#define INCLUDEDIR "/opt/gnu/include"'; \
          echo '#define OLDINCLUDEDIR "/usr/include"'; \
          echo '#define DOCDIR "/opt/gnu/share/doc/libunistring"'; \
          echo '#define INFODIR "/opt/gnu/share/info"'; \
          echo '#define HTMLDIR "/opt/gnu/share/doc/libunistring"'; \
          echo '#define DVIDIR "/opt/gnu/share/doc/libunistring"'; \
          echo '#define PDFDIR "/opt/gnu/share/doc/libunistring"'; \
          echo '#define PSDIR "/opt/gnu/share/doc/libunistring"'; \
          echo '#define LIBDIR "/opt/gnu/lib"'; \
          echo '#define LISPDIR "/opt/gnu/share/emacs/site-lisp"'; \
          echo '#define LOCALEDIR "/opt/gnu/share/locale"'; \
          echo '#define MANDIR "/opt/gnu/share/man"'; \
          echo '#define MANEXT ""'; \
          echo '#define PKGDATADIR "/opt/gnu/share/libunistring"'; \
          echo '#define PKGINCLUDEDIR "/opt/gnu/include/libunistring"'; \
          echo '#define PKGLIBDIR "/opt/gnu/lib/libunistring"'; \
          echo '#define PKGLIBEXECDIR "/opt/gnu/libexec/libunistring"'; \
        } | sed '/""/d' > configmake.h-t && \
        mv -f configmake.h-t configmake.h

...


$ su
...

# source ../setenv-0.9.10

...

# gmake install
Making install in doc
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
gmake[2]: Nothing to be done for `install-exec-am'.
/usr/gnu/bin/mkdir -p /opt/gnu/share/doc/libunistring
for file in `if test -f libunistring_toc.html; then echo .; else echo .; fi`/libunistring_*.html; do \
          /usr/bin/ginstall -c -m 644 $file /opt/gnu/share/doc/libunistring/`basename $file`; \
        done
 /usr/gnu/bin/mkdir -p '/opt/gnu/share/info'
 /usr/bin/ginstall -c -m 644 ./libunistring.info '/opt/gnu/share/info'
 install-info --info-dir='/opt/gnu/share/info' '/opt/gnu/share/info/libunistring.info'
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
gmake[1]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/doc'
Making install in gnulib-local
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
gmake[2]: Nothing to be done for `install-exec-am'.
gmake[2]: Nothing to be done for `install-data-am'.
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
gmake[1]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/gnulib-local'
Making install in lib
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
gmake  install-am
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
gmake[3]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
if test no = no; then \
          case 'solaris2.11' in \
            darwin[56]*) \
              need_charset_alias=true ;; \
            darwin* | cygwin* | mingw* | pw32* | cegcc*) \
              need_charset_alias=false ;; \
            *) \
              need_charset_alias=true ;; \
          esac ; \
        else \
          need_charset_alias=false ; \
        fi ; \
        if $need_charset_alias; then \
          /bin/sh /stage/build/libunistring/libunistring-0.9.10-32/build-aux/install-sh -d /opt/gnu/lib ; \
        fi ; \
        if test -f /opt/gnu/lib/charset.alias; then \
          sed -f ref-add.sed /opt/gnu/lib/charset.alias > /opt/gnu/lib/charset.tmp ; \
          /usr/bin/ginstall -c -m 644 /opt/gnu/lib/charset.tmp /opt/gnu/lib/charset.alias ; \
          rm -f /opt/gnu/lib/charset.tmp ; \
        else \
          if $need_charset_alias; then \
            sed -f ref-add.sed charset.alias > /opt/gnu/lib/charset.tmp ; \
            /usr/bin/ginstall -c -m 644 /opt/gnu/lib/charset.tmp /opt/gnu/lib/charset.alias ; \
            rm -f /opt/gnu/lib/charset.tmp ; \
          fi ; \
        fi
 /usr/gnu/bin/mkdir -p '/opt/gnu/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/ginstall -c   libunistring.la '/opt/gnu/lib'
libtool: install: /usr/bin/ginstall -c .libs/libunistring.so.2.1.0 /opt/gnu/lib/libunistring.so.2.1.0
libtool: install: (cd /opt/gnu/lib && { ln -s -f libunistring.so.2.1.0 libunistring.so.2 || { rm -f libunistring.so.2 && ln -s libunistring.so.2.1.0 libunistring.so.2; }; })
libtool: install: (cd /opt/gnu/lib && { ln -s -f libunistring.so.2.1.0 libunistring.so || { rm -f libunistring.so && ln -s libunistring.so.2.1.0 libunistring.so; }; })
libtool: install: chmod +x /opt/gnu/lib/libunistring.so.2.1.0
libtool: install: /usr/bin/ginstall -c .libs/libunistring.lai /opt/gnu/lib/libunistring.la
libtool: install: /usr/bin/ginstall -c .libs/libunistring.a /opt/gnu/lib/libunistring.a
libtool: install: chmod 644 /opt/gnu/lib/libunistring.a
libtool: install: ranlib /opt/gnu/lib/libunistring.a
 /usr/gnu/bin/mkdir -p '/opt/gnu/include'
 /usr/gnu/bin/mkdir -p '/opt/gnu/include/unistring'
 /usr/bin/ginstall -c -m 644  unistring/inline.h '/opt/gnu/include/unistring'
 /usr/bin/ginstall -c -m 644  unitypes.h unistr.h uniconv.h unistdio.h uniname.h unictype.h uniwidth.h unigbrk.h uniwbrk.h unilbrk.h uninorm.h unicase.h '/opt/gnu/include/.'
 /usr/gnu/bin/mkdir -p '/opt/gnu/include'
 /usr/gnu/bin/mkdir -p '/opt/gnu/include/unistring'
 /usr/bin/ginstall -c -m 644  unistring/stdbool.h unistring/stdint.h unistring/localcharset.h unistring/iconveh.h unistring/version.h unistring/cdefs.h unistring/woe32dll.h '/opt/gnu/include/unistring'
gmake[3]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
gmake[1]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/lib'
Making install in tests
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake  install-recursive
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
Making install in .
gmake[3]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[4]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[4]: Nothing to be done for `install-exec-am'.
gmake[4]: Nothing to be done for `install-data-am'.
gmake[4]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[3]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[1]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32/tests'
gmake[1]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32'
gmake[2]: Entering directory `/stage/build/libunistring/libunistring-0.9.10-32'
gmake[2]: Nothing to be done for `install-exec-am'.
gmake[2]: Nothing to be done for `install-data-am'.
gmake[2]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32'
gmake[1]: Leaving directory `/stage/build/libunistring/libunistring-0.9.10-32'


# zfs snapshot -r .../opt/gnu@libunistring-0.9.10