2 ## vim:set ts=4 sw=4 et:
4 echo "// Copyright (C) 1996-2015 Markus F.X.J. Oberhumer"
6 echo "// Generic Posix/Unix system"
7 echo "// Generic C compiler"
9 test "X${top_srcdir}" = X
&& top_srcdir
=`echo "$0" | sed 's,[^/]*$,,'`..
/..
11 test "X${AR}" = X
&& AR
="ar"
12 test "X${CC}" = X
&& CC
="cc"
13 test "X${CFLAGS+set}" = Xset || CFLAGS
="-O"
14 # CPPFLAGS, LDFLAGS, LIBS
15 # LZO_EXTRA_CPPFLAGS, LZO_EXTRA_CFLAGS, LZO_EXTRA_LDFLAGS
16 # LZO_EXTRA_SOURCES, LZO_EXTRA_OBJECTS, LZO_EXTRA_LIBS
18 CFI
="-I${top_srcdir}/include -I${top_srcdir} -I${top_srcdir}/src"
22 CF
="$CPPFLAGS $CFI $CFLAGS"
23 # info: we restrict ourselves to pure ANSI C library functions for the examples
24 CF
="-DLZO_LIBC_ISOC90=1 $CF"
25 # info: we do not use _any_ external functions in freestanding mode
26 test -z "$LZO_CFG_FREESTANDING" || CF
="-DLZO_CFG_FREESTANDING=1 $CF"
27 LF
="$LDFLAGS $LZO_EXTRA_LDFLAGS"
28 LL
="$BLIB $LIBS $LZO_EXTRA_LIBS"
30 .
$top_srcdir/B
/generic
/clean.sh
32 for f
in $top_srcdir/src
/*.c
$LZO_EXTRA_SOURCES; do
33 echo $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f
34 $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f
37 echo $AR rcs
$BLIB *.o
$LZO_EXTRA_OBJECTS
38 $AR rcs
$BLIB *.o
$LZO_EXTRA_OBJECTS
41 if test -n "$LZO_CFG_FREESTANDING"; then
44 echo "// Building $BLIB in freestanding mode was successful. All done."
45 echo "// Now try 'nm --extern-only $BLIB'"
49 for f
in dict lzopack precomp precomp2 simple
; do
50 echo $CC $CF $LF -o $f.out
$top_srcdir/examples
/$f.c
$LL
51 $CC $CF $LF -o $f.out
$top_srcdir/examples
/$f.c
$LL
53 echo $CC $CF $LF -o lzotest.out
$top_srcdir/lzotest
/lzotest.c
$LL
54 $CC $CF $LF -o lzotest.out
$top_srcdir/lzotest
/lzotest.c
$LL
56 for f
in minilzo.c testmini.c
; do
57 XF
="-I$top_srcdir/include/lzo $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS"
58 echo $CC $XF -c $top_srcdir/minilzo
/$f
59 $CC $XF -c $top_srcdir/minilzo
/$f
61 echo $CC $CF $LF -o testmini.out testmini.o minilzo.o
$LIBS $LZO_EXTRA_LIBS
62 $CC $CF $LF -o testmini.out testmini.o minilzo.o
$LIBS $LZO_EXTRA_LIBS
66 echo "// Building LZO was successful. All done."