first commit
[scm/bb/meta-tizen.git] / recipes-tizen / flex / flex.inc
1 DESCRIPTION = "Fast Lexical Analyzer Generator"
2 HOMEPAGE = "http://flex.sourceforge.net/"
3 SECTION = "Development/Languages/C and C++"
4 LICENSE = "BSD-3-Clause"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 PROVIDES = ""
11
12 #PROVIDES by flex 
13 PROVIDES += "flex"
14 RPROVIDES_flex += "flex"
15
16 RDEPENDS = ""
17 #RDEPENDS of flex (${PN})
18 RDEPENDS_${PN} += "m4"
19
20
21 DEPENDS = ""
22 #DEPENDS of flex 
23 DEPENDS += "gcc-c++"
24 #Replace "DEPENDS" on gettext by "inherit gettext"
25 inherit gettext
26 DEPENDS += "bison-native"
27 DEPENDS += "makeinfo"
28 DEPENDS += "automake-native"
29
30 do_patch() {
31  chmod -Rf a+rX,u+w,g-w,o-w ${S}
32  #setup -q
33  cp ${S}/packaging/flex.manifest .
34  
35  
36 }
37
38 do_configure() {
39 }
40
41 do_compile() {
42  LANG=C
43  export LANG
44  unset DISPLAY
45  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
46  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
47  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
48  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
49  
50  autoreconf -fi
51  
52    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
53    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
54    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
55    autotools_do_configure --build=${TARGET_SYS} --host=${HOST_SYS} \
56          --target=x86_64-tizen-linux \
57          --program-prefix= \
58          --prefix=/usr \
59          --exec-prefix=/usr \
60          --bindir=/usr/bin \
61          --sbindir=/usr/sbin \
62          --sysconfdir=/etc \
63          --datadir=/usr/share \
64          --includedir=/usr/include \
65          --libdir=/usr/lib \
66          --libexecdir=/usr/libexec \
67          --localstatedir=/var \
68          --sharedstatedir=/usr/com \
69          --mandir=/usr/share/man \
70          --infodir=/usr/share/info --disable-nls
71  make -j16
72  
73  exit 0
74  make check
75  
76  
77  
78 }
79
80 do_install() {
81  echo export RPM_BUILD_ROOT=${D}
82  LANG=C
83  export LANG
84  unset DISPLAY
85  rm -rf ${D} 
86  mkdir -p ${D} 
87  
88  
89    oe_runmake \
90          DESTDIR=${D} \
91          INSTALL_ROOT=${D} \
92          BINDIR=/usr/bin \
93    install  
94    rm -f ${D}/usr/share/info/dir 
95    find ${D} -regex ".*\.la$" | xargs rm -f -- 
96    
97  install ${S}/packaging/lex-wrapper.sh  ${D}//usr/bin/lex
98  
99  
100    rm -rf ${D}/usr/share/info 
101    rm -rf ${D}/usr/share/doc/packages 
102    rm -rf ${D}/usr/share/doc/flex 
103    rm -rf ${D}/usr/share/doc/flex-2.5.37 
104    rm -rf ${D}/usr/share/gtk-doc 
105    rm -rf ${D}/usr/share/doc 
106    rm -rf ${D}/usr/share/man 
107    find ${D} -regex ".*/man/man./.*.[0-9]" | xargs rm -f -- 
108    find ${D} -regex ".*/man/../man./.*.[0-9]" | xargs rm -f -- 
109    find ${D} -regex ".*/man/man./.*.[0-9]pm" | xargs rm -f --
110  
111 }
112
113 PACKAGES = ""
114 PACKAGES += "flex"
115
116 flex_files = ""
117 flex_files += "flex.manifest"
118 flex_files += "/usr/bin/flex"
119 flex_files += "/usr/bin/flex++"
120 flex_files += "/usr/bin/lex"
121 flex_files += "/usr/include/FlexLexer.h"
122 flex_files += "/usr/lib/libfl.a"
123
124 FILES_${PN} = "${flex_files}"
125
126 PKG_flex= "flex"
127
128 require flex-extraconf.inc