1 # Description: Fast Lexical Analyzer Generator
2 # URL: http://flex.sourceforge.net/
3 # Maintainer: CRUX System Team, core-ports at crux dot nu
4 # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
10 source=(https://github.com/westes/flex/releases/download/v$version/$name-$version.tar.gz
11 $name-$version-add_defines.patch)
16 echo "ac_cv_func_malloc_0_nonnull=yes" > config.cache
17 echo "ac_cv_func_realloc_0_nonnull=yes" >> config.cache
19 patch -p1 -i $SRC/$name-$version-add_defines.patch
23 sed '51d' -i Makefile.am
25 # Build stage1flex for current host
26 CC=gcc CFLAGS="" ./configure --disable-nls \
31 make -C src stage1flex
32 mv src/stage1flex src/stage1flex.host
36 ./configure --build=$CHOST \
40 --cache-file=config.cache
43 # Use stage1flex built for host
44 sed 's|./stage1flex$(EXEEXT) $(AM_LFLAGS)|./stage1flex.host$(EXEEXT) $(AM_LFLAGS)|g' -i src/Makefile
46 make DESTDIR=$PKG install
48 ln -sf flex $PKG/usr/bin/lex
49 ln -sf flex.1.gz $PKG/usr/share/man/man1/lex.1.gz
51 rm -r $PKG/usr/share/{info,doc}