Changeset 4e5b696 in freewrt


Ignore:
Timestamp:
Jun 18, 2006, 12:40:26 PM (19 years ago)
Author:
Thorsten Glaser <tg@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
bc1387d
Parents:
8d0b68e
Message:

test for existence of bzip2 unzip patch
test if building a host tool which uses zlib works and can decompress

ok wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@80 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/scan-tools.sh

    r8d0b68e r4e5b696  
    5757
    5858test: test.c
    59         ${HOSTCC} ${HOSTCFLAGS} -o $@ $^
     59        ${HOSTCC} ${HOSTCFLAGS} -o $@ $^ ${LDADD}
    6060
    6161run-test: test
     
    7878        exit 1
    7979fi
     80rm test*
    8081
    8182X=$(gmake --version 2>&1 | grep '^GNU Make' | sed 's/GNU Make //')
     
    122123fi
    123124
     125if ! which bzip2 >/dev/null 2>&1; then
     126        echo You must install bzip2 to continue.
     127        exit 1
     128fi
     129
     130if ! which unzip >/dev/null 2>&1; then
     131        echo You must install unzip to continue, sorry.
     132        exit 1
     133fi
     134
     135if ! which patch >/dev/null 2>&1; then
     136        echo You must install patch \(from Larry Wall\) to continue.
     137        exit 1
     138fi
     139
     140cat >test.c <<-'EOF'
     141        #include <stdio.h>
     142        #include <zlib.h>
     143
     144        #ifndef STDIN_FILENO
     145        #define STDIN_FILENO 0
     146        #endif
     147
     148        int
     149        main()
     150        {
     151                gzFile zstdin;
     152                char buf[1024];
     153                int i;
     154
     155                zstdin = gzdopen(STDIN_FILENO, "rb");
     156                i = gzread(zstdin, buf, sizeof (buf));
     157                if ((i > 0) && (i < sizeof (buf)))
     158                        buf[i] = '\0';
     159                buf[sizeof (buf) - 1] = '\0';
     160                printf("%s\n", buf);
     161                return (0);
     162        }
     163EOF
     164X=$(echo 'Yay! Native compiler works.' | gmake TOPDIR=$topdir LDADD=-lz 2>&1)
     165if [[ $X != *@(Native compiler works)* ]]; then
     166        echo Cannot compile a libz test programme.
     167        echo You must install the zlib development package,
     168        echo usually called libz-dev, and the run-time library.
     169        exit 1
     170fi
     171
     172
    124173cd $topdir
    125174rm -rf lbin/tmp
Note: See TracChangeset for help on using the changeset viewer.