CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
elfutils: inital import
[crossrootfs.git] / flex / Pkgfile
CommitLineData
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
7name=flex
865db95a 8version=2.6.3
fe8f5c15 9release=2
865db95a
VM
10source=(https://github.com/westes/flex/releases/download/v$version/$name-$version.tar.gz
11 $name-$version-add_defines.patch)
6dca1d21
JB
12
13build() {
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
865db95a
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
10e4bd4c 33 ./autogen.sh
865db95a
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
865db95a
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}