+==============================================================================
| unix/configure.txt: Notes on unix/configure and unix/Makefile
| Version:  Zip 3.1 and UnZip 6.10                                 10 Sept 2011
+==============================================================================

This brief document describing the updated unix/configure flags, and the
differences from that generated by the original unix.configure script.

Changes:
1.  A new file $PROD/flags_bz is generated containing just the bzip2
    compilation-related flags.  
2.  UNAME-related flags now in more legible order
3.  For z/OS, use "uname -I" to generate current z/OS information
4.  Now generates installation flags (BINDIR, BINPERMS)
5.  Now generates man page flags (MANEXT, MANDIR, MANPERMS)
    - unix/Makefile supports generic_man and generic_doc
6.  Now generates man page nroff option 
    - Currently "-Tascii" or "" 
7.  Flags renamed for consistency between zip and unzip:
    - CFLAGS    -> CF
    - CFLAGS_BZ -> CF_BZ
    - LFLAGS1   -> LF1  
    - LFLAGS2   -> LF2
8.  Flags generated are a superset of zip and unzip (additional header checks)
9.  OSDEP_xxxx flags contain OS-dependent values:
    - OSDEP_C   C source files
    - OSDEP_H   C header files
    - OSDEP_S   Assembler source files
    - OSDEP_OC  Object files (C)
    - OSDEP_OS  Object files (assembler)
    These allows multiple OS-dependent C or assembler source files
10. Use consistent configuration, naming and recipes for assembler files
11. Add $PROD/flags values for program extensions:
    - PMGEXT    Executables
    - DLLEXT    DLLs (Shared objects)
12. Add $PROD/flags values for RANLIB, RM and LN
13: Add $PROD/flags values for AR
    - Required by IBM XLC for AIX 64-bit compiles
14. Object archive dependencies.  Non-blank if library is required
    - LIB_AES_WG
      LIB_LZMA
      LIB_BZ
      LIB_Z
15: ZLIB and BZIP2 support now consistent
    - Supports build within tree via bzip2/Makefile or zlib/Makefile (if present)
    - Supports build with OS-owned libbz2.a (IZ_BZIP2=bzip2, ./bzip2 is empty)
    - Supports build with OS-owned libz.a (IZ_ZLIB=zlib, ./zlib is empty)
    - Returns MK_BZ to allow configure to return system-specific BZIP2 makefile name
16: Now supports AF for assembler flags
17: Support compiler listing options (+ CC on z/OS) for LIST=1
18: Cleanup targets now same on zip and unzip (clean, clean_bzip2, clean_exe)
19: All make targets are now explicit for portability
    - SysV make pattern matching is not as powerful as gmane or z/OS make (MKS)
20: .SUFFIX reset to prevent builds from using default .c -> .o rules

21: On z/OS, use CC=c89 (xlc ends with sigkill for failing compiles)
22: On AIX (with IBM XL C) use CC=c89
23: Use unzip nl_langinfo() test instead of following zip test (which fails because
    codeset is not an int).

    echo Check for nl_langinfo
    cat > conftest.c << _EOF_
    #include <langinfo.h>
    int main() { char *codeset;  codeset = nl_langinfo(CODESET); return codeset; }
    _EOF_
    $CC -o conftest conftest.c >/dev/null 2>/dev/null
    [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_NL_LANGINFO"
24: Add test for sys/param.h (for -DNO_PARAM_H)
25: Add test for sys/time.h (separate from entry timing)
26: Add tests for sys/timeb.h and utime.h
27: Set z/OS linker flags
28. Add PORT unix/configure parm [AD]
    - Allows reuse by z/OS MVS build (under z/OS UNIX)

Fixes:
1.  CF_BZ now has "-DBZ_NO_STDIO" to build correct bzip2 variation
2.  CF_BZ now contains "-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" if large files supported
3.  Customize unzip unix/unxcfg.h for time.h et al

To Do:
1.  Ensure all Unicode/wchar bits and pieces work
2.  Emit CC with system-dependent ANSI build compiler name (gcc, c89, xlc) automatically
    - Check system, compiler version
3.  Generation of man pages needs to be corrected 


+-----------------------------------------------------------------------------+
| Flag output                                                                 | 
+-----------------------------------------------------------------------------+
--- On Fedora 14 Linux X84_64: GCC 4.5.1) ---
For make -f unix/Makefile generic AES_WG=1 LZMA=1 IZ_BZIP2=bzip2 IZ_ZLIB=zlib

New:
[al@leeloo base]$ cat flags 
CC="cc" CF="-I. -DUNIX -O3  -DCRYPT_AES_WG -DUSE_LZMA -D_7ZIP_ST -DUSE_BZIP2 -DUSE_ZLIB -DLARGE_FILE_SUPPORT -DUIDGID_NOT_16BIT -DENABLE_ENTRY_TIMING -DHAVE_SYS_TIME_H -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -fno-builtin -DNO_STRCHR -DNO_STRRCHR -DNO_LCHMOD -DHAVE_DIRENT_H -DNO_PARAM_H -DHAVE_TERMIOS_H  -D_MBCS -DUNAME_S='\"Linux\"' -DUNAME_V='\"#1 SMP Tue Aug 16 21:01:58 UTC 2011\"' -DUNAME_R='\"2.6.35.14-95.fc14.x86_64\"' -DUNAME_O='\"GNU/Linux\"' -DUNAME_M='\"x86_64\"' -DUNAME_P='\"x86_64\"'" CC_BZ="cc" CF_BZ="-I. -DUNIX -O3 -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" CPP="/usr/bin/cpp" AS="cc -c" AF="" LD="cc" LF1=" -L. -L." LF2="-s -laes -llzma -lbz2 -lz" AR="ar -cq" RANLIB="ranlib" LN="ln -s" RM="rm -f" PROD="." DEP_AS="" DEP_AES_WG="./libaes.a" DEP_LZMA="./liblzma.a" DEP_BZ="" DEP_Z="" MK_BZ="Makefile" OSDEP_C="unix/unix.c" OSDEP_H="unix/unxcfg.h" OSDEP_O="./unix.o" OSDEP_S="" PGMEXT="" DLLEXT=".so" BINDIR="/usr/local/bin" BINPERMS="755" MANEXT=".1" MANDIR="manl" MANPERMS="644"

[al@leeloo base]$ cat flags_bz
CC="cc" CFLAGS="-I. -DUNIX -O3 -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" AR="ar -cq" RANLIB="ranlib" RM="rm -f"

Old:
[al@leeloo orig]$ cat flags
CC="cc" CF="-I. -DUNIX -O3 -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -D_MBCS -DUNAME_M='\"x86_64\"' -DUNAME_O='\"GNU/Linux\"' -DUNAME_P='\"x86_64\"' -DUNAME_R='\"2.6.35.14-95.fc14.x86_64\"' -DUNAME_S='\"Linux\"' -DUNAME_V='\"#1 SMP Tue Aug 16 21:01:58 UTC 2011\"'" CRCA_O="" AS="cc -c" LFLAGS1="" LF2="-s" CC_BZ="cc" CFLAGS_BZ=" -O3" IZ_BZIP2="" LIBBZ2="" LIB_AES_WG="" LIB_LZMA=""

--- On AIX 6.1 (cc=cc:IBM XL C for AIX) ---
For make -f unix/Makefile generic AES_WG=1 LZMA=1

New:
[q4xtwnb:/apps/eq00/infozip/unzip/6.10/unzip610c06/base]$cat flags 
CC="cc" CF="-I. -DUNIX -O3 -q64 -qlonglong  -DCRYPT_AES_WG -DUSE_LZMA -D_7ZIP_ST -qlanglvl=ansi -DLARGE_FILE_SUPPORT -DUIDGID_NOT_16BIT -DENABLE_ENTRY_TIMING -DHAVE_SYS_TIME_H -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -DNO_LCHMOD -DHAVE_DIRENT_H -DNO_PARAM_H -DHAVE_TERMIOS_H -DHAVE_MBSTR_H -D_MBCS -DUNAME_S='\"AIX\"' -DUNAME_V='\"6\"' -DUNAME_R='\"1\"' -DUNAME_M='\"00F64BF34C00\"' -DUNAME_P='\"powerpc\"'" CC_BZ="cc" CF_BZ="-I. -DUNIX -O3 -q64 -qlonglong -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" CPP="/usr/bin/cpp" AS="cc -c" AF="" LD="cc" LF1=" -L. -L." LF2="-s -q64 -laes -llzma" AR="ar -cq -X64" RANLIB="ranlib" LN="ln -s" RM="rm -f" PROD="." DEP_AS="" LIB_AES_WG="libaes.a" LIB_LZMA="liblzma.a" LIB_BZ="" LIB_Z="" MK_BZ="Makefile" OSDEP_C="unix/unix.c" OSDEP_H="unix/unxcfg.h" OSDEP_O="./unix.o" OSDEP_S="" PGMEXT="" DLLEXT=".so" BINDIR="/usr/local/bin" BINPERMS="755" MANEXT=".1" MANDIR="manl" MANPERMS="644"

[q4xtwnb:/apps/eq00/infozip/unzip/6.10/unzip610c06/base]$cat flags_bz
CC="cc" CFLAGS="-I. -DUNIX -O3 -q64 -qlonglong -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" AR="ar -cq -X64" RANLIB="ranlib" RM="rm -f"

--- On AIX 6.1 (cc=gcc:GCC 4.2.0)
For make -f unix/Makefile generic AES_WG=1 LZMA=1

New:
[q4xtwnb:/apps/eq00/infozip/unzip/6.10/unzip610c06/base]$cat flags
CC="gcc" CF="-I. -DUNIX -O3  -DCRYPT_AES_WG -DUSE_LZMA -D_7ZIP_ST -DLARGE_FILE_SUPPORT -DUIDGID_NOT_16BIT -DENABLE_ENTRY_TIMING -DHAVE_SYS_TIME_H -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -fno-builtin -DNO_STRCHR -DNO_STRRCHR -DNO_LCHMOD -DHAVE_DIRENT_H -DNO_PARAM_H -DHAVE_TERMIOS_H -DHAVE_MBSTR_H -D_MBCS -DMBSCHR=mbschr -DMBSRCHR=mbsrchr -DUNAME_S='\"AIX\"' -DUNAME_V='\"6\"' -DUNAME_R='\"1\"' -DUNAME_M='\"00F64BF34C00\"' -DUNAME_P='\"powerpc\"'" CC_BZ="gcc" CF_BZ="-I. -DUNIX -O3 -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" CPP="/usr/bin/cpp" AS="gcc -c" AF="" LD="gcc" LF1=" -L. -L." LF2="-s -laes -llzma" AR="ar -cq" RANLIB="ranlib" LN="ln -s" RM="rm -f" PROD="." DEP_AS="" LIB_AES_WG="libaes.a" LIB_LZMA="liblzma.a" LIB_BZ="" LIB_Z="" MK_BZ="Makefile" OSDEP_C="unix/unix.c" OSDEP_H="unix/unxcfg.h" OSDEP_O="./unix.o" OSDEP_S="" PGMEXT="" DLLEXT=".so" BINDIR="/usr/local/bin" BINPERMS="755" MANEXT=".1" MANDIR="manl" MANPERMS="644"

[q4xtwnb:/apps/eq00/infozip/unzip/6.10/unzip610c06/base]$cat flags_bz
CC="gcc" CFLAGS="-I. -DUNIX -O3 -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" AR="ar -cq" RANLIB="ranlib" RM="rm -f"

Old:
[q4xtwnb:/apps/eq00/infozip/unzip/6.10/unzip610c06/orig]$cat flags
CC="gcc" CF="-I. -DUNIX -O3 -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DHAVE_MBSTR_H -D_MBCS -DMBSCHR=mbschr -DMBSRCHR=mbsrchr -DUNAME_M='\"00F64BF34C00\"' -DUNAME_P='\"powerpc\"' -DUNAME_R='\"1\"' -DUNAME_S='\"AIX\"' -DUNAME_V='\"6\"'" CRCA_O="" AS="gcc -c" LFLAGS1="" LF2="-s" CC_BZ="gcc" CFLAGS_BZ=" -O3" IZ_BZIP2="" LIBBZ2="" LIB_AES_WG="" LIB_LZMA=""

--- On z/OS 1.12 (cc=c89:IBM z/OS XL C)
For make -f unix/Makefile generic AES_WG=1 LZMA=1

New:
(Q4XTWNB:/u/q4xtwnb/infozip/unzip/6.10/unzip610c06/base)$cat flags
CC="c89" CF="-I. -DUNIX -O3 -Wc,longlong,'langlvl(extended)',checkout,'flag(i)',inline -Wc,'suppress(ccn3389,ccn3374,ccn3495,ccn3409,ccn3469,ccn3457)'  -DZOS_UNIX -DEBCDIC -DSYSV -D_ALL_SOURCE -D_OPEN_SYS_TIMED_EXT -D_XOPEN_SOURCE_EXTENDED=1 -DCRYPT_AES_WG -DUSE_LZMA -D_7ZIP_ST -DLARGE_FILE_SUPPORT -DUIDGID_NOT_16BIT -DENABLE_ENTRY_TIMING -DHAVE_SYS_TIME_H -DUNICODE_SUPPORT -DUTF8_MAYBE_NATIVE -DNO_LCHMOD -DHAVE_DIRENT_H -DNO_PARAM_H -DHAVE_TERMIOS_H -DHAVE_MBSTR_H -D_MBCS -DUNAME_S='\"z/OS\"' -DUNAME_V='\"01\"' -DUNAME_R='\"12.00\"' -DUNAME_M='\"2817\"'" CC_BZ="cc" CF_BZ="-I. -DUNIX -O3 -Wc,longlong,'langlvl(extended)',checkout,'flag(i)',inline -Wc,'suppress(ccn3389,ccn3374,ccn3495,ccn3409,ccn3469,ccn3457)' -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" CPP="c89 -E" AS="cc -c" AF="" LD="c89" LF1="-Wl,EDIT=NO -L. -L." LF2=" -laes -llzma" AR="ar -cq" RANLIB="echo" LN="ln -s" RM="rm -f" PROD="." DEP_AS="" LIB_AES_WG="libaes.a" LIB_LZMA="liblzma.a" LIB_BZ="" LIB_Z="" MK_BZ="Makefile" OSDEP_C="unix/unix.c" OSDEP_H="unix/unxcfg.h" OSDEP_O="./unix.o" OSDEP_S="" PGMEXT="" DLLEXT=".so" BINDIR="/usr/local/bin" BINPERMS="755" MANEXT=".1" MANDIR="manl" MANPERMS="644"

(Q4XTWNB:/u/q4xtwnb/infozip/unzip/6.10/unzip610c06/base)$cat flags_bz
CC="cc" CFLAGS="-I. -DUNIX -O3 -Wc,longlong,'langlvl(extended)',checkout,'flag(i)',inline -Wc,'suppress(ccn3389,ccn3374,ccn3495,ccn3409,ccn3469,ccn3457)' -DBZ_NO_STDIO  -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" AR="ar -cq" RANLIB="echo" RM="rm -f"
