Commit | Line | Data |
---|---|---|
6dca1d21 JB |
1 | # Description: Fast Lexical Analyzer Generator |
2 | # URL: http://flex.sourceforge.net/ | |
3 | # Maintainer: CRUX System Team, core-ports at crux dot nu | |
b751b192 | 4 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
4c60cfdc | 5 | # Depends on: |
6dca1d21 JB |
6 | |
7 | name=flex | |
8ba9a35a | 8 | version=2.6.3 |
fe8f5c15 | 9 | release=2 |
8ba9a35a VM |
10 | source=(https://github.com/westes/flex/releases/download/v$version/$name-$version.tar.gz |
11 | $name-$version-add_defines.patch) | |
6dca1d21 JB |
12 | |
13 | build() { | |
14 | cd $name-$version | |
237e9a63 | 15 | |
6dca1d21 JB |
16 | echo "ac_cv_func_malloc_0_nonnull=yes" > config.cache |
17 | echo "ac_cv_func_realloc_0_nonnull=yes" >> config.cache | |
237e9a63 | 18 | |
8ba9a35a VM |
19 | patch -p1 -i $SRC/$name-$version-add_defines.patch |
20 | touch doc/flex.1 | |
21 | ||
22 | # Don't build tests | |
23 | sed '51d' -i Makefile.am | |
24 | ||
25 | # Build stage1flex for current host | |
26 | CC=gcc CFLAGS="" ./configure --disable-nls \ | |
27 | --prefix=/tools \ | |
28 | --enable-shared | |
29 | ||
30 | make -C lib | |
31 | make -C src stage1flex | |
32 | mv src/stage1flex src/stage1flex.host | |
a9cdad24 | 33 | ./autogen.sh |
8ba9a35a VM |
34 | make distclean |
35 | ||
6dca1d21 JB |
36 | ./configure --build=$CHOST \ |
37 | --host=$CTARGET \ | |
38 | --prefix=/usr \ | |
39 | --disable-nls \ | |
40 | --cache-file=config.cache | |
237e9a63 | 41 | |
8ba9a35a VM |
42 | make -C lib |
43 | # Use stage1flex built for host | |
44 | sed 's|./stage1flex$(EXEEXT) $(AM_LFLAGS)|./stage1flex.host$(EXEEXT) $(AM_LFLAGS)|g' -i src/Makefile | |
45 | make -C src | |
6dca1d21 | 46 | make DESTDIR=$PKG install |
237e9a63 | 47 | |
6dca1d21 | 48 | ln -sf flex $PKG/usr/bin/lex |
fe8f5c15 | 49 | ln -sf flex.1.gz $PKG/usr/share/man/man1/lex.1.gz |
237e9a63 | 50 | |
fe8f5c15 | 51 | rm -r $PKG/usr/share/{info,doc} |
6dca1d21 | 52 | } |