Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"./flexdef.h", line 72: cannot find include file: <stdbool.h> #535

Open
blastwave opened this issue Jul 17, 2022 · 4 comments
Open

"./flexdef.h", line 72: cannot find include file: <stdbool.h> #535

blastwave opened this issue Jul 17, 2022 · 4 comments

Comments

@blastwave
Copy link


Also an email was sent to flex-help@lists.sourceforge.net because the tarball
says to do so ... so I did :)

Good day :

Long time no hear and I see that flex has fallen into the github tarpit.

Regardless I will report that flex tends to get very upset on very very
old machines. Just for fun I dragged out some old hardware and have been
watching things blow up that need C99 or odd GNU extensions. Flex is
usually very very portable and sees to dance around stdint.h neatly but
fails due to stdbool.h does not exist.

So here are the details :

ganymede#
ganymede# uname -a
SunOS ganymede 5.5.1 Generic_103640-12 sun4m sparc SUNW,SPARCstation-20
ganymede#
ganymede# cat /etc/release
                  Solaris 2.5.1 Hardware 11/97 s596hw3_11 SPARC
           Copyright 1997 Sun Microsystems, Inc.  All Rights Reserved.
                    Manufactured in the USA 04 November 1997
                       Solaris 2.5.1 Maintenance Update 5
ganymede#
ganymede# fpversion
 A SPARC-based CPU is available.
 CPU's clock rate appears to be approximately 198.4 MHz.
 Kernel says CPU's clock rate is 200.0 MHz.
 Kernel says main memory's clock rate is 50.0 MHz.

 Sun-4 floating-point controller version 0 found.
 A Fujitsu/Ross RT620 hyperSPARC chip is available.
 FPU's frequency appears to be approximately 236.4 MHz.

 Use "-xtarget=ss20/hs11 -xcache=512/32/1" code-generation option.

 Hostid = 0x7200BEEF.
ganymede#

Yes really :)

While trying to build some old old Bison I fall into the need for Flex
and figured may as well try Flex because Bison needs Flex and I bet that
Flex needs Bison or some such loop. Anyways here we are.


Some trivial env vars :

AR=/usr/ccs/bin/ar
AS=/usr/ccs/bin/as
CC=/opt/SUNWspro/bin/cc

CFLAGS=-Xa -g -xO0 -xcode=pic32 -xregs=no%appl

CPPFLAGS=-I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE

CXXFLAGS=-g -xO0

EDITOR=/usr/xpg4/bin/vi

LD=/usr/ccs/bin/ld
LD_OPTIONS=-R/usr/local/lib -L/usr/local/lib
LD_RUN_PATH=/usr/local/lib

M4=/usr/local/bin/m4

NM=/usr/xpg4/bin/nm -p

PATH=/usr/local/bin:/usr/xpg4/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/openwin/bin:/usr/dt/bin:/opt/SUNWsunpc/bin:/opt/schily/bin

PERL=/usr/local/bin/perl

POSIXLY_CORRECT=1

PWD=/usr/local/build/flex-2.6.4_SunOS_5.5.1_sun4m.001

SHELL=/bin/ksh

VISUAL=/usr/xpg4/bin/vi


Yes Perl builds on this machine :)  for some flavour of Perl :


ganymede$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris-64int-ld
    uname='sunos ganymede 5.5.1 generic_103640-12 sun4m sparc sunw,sparcstation-20 '
    config_args='-Dprefix=/usr/local -Dmksymlinks -Accflags=-Xa -g -xO0 -xcode=pic32 -xregs=no%appl -L/usr/local/lib -I/usr/local/include'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/opt/SUNWspro/bin/cc', ccflags ='-Xa -g -xO0 -xcode=pic32 -xregs=no%appl -L/usr/local/lib -I/usr/local/include -DDEBUGGING -I/usr/local/include ',
    optimize='-g -xO0',
    cppflags='-Xa -g -xO0 -xcode=pic32 -xregs=no%appl -L/usr/local/lib -I/usr/local/include -DDEBUGGING -I/usr/local/include'
    ccversion='WorkShop Compilers 5.0 98/12/15 C 5.0', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=4
    alignbytes=8, prototype=define
.
.
.

etc etc etc

Anyways the configure stage looks really promising :

ganymede$
ganymede$ pwd
/usr/local/build/flex-2.6.4_SunOS_5.5.1_sun4m.001

ganymede$ ./configure --prefix=/usr/local --disable-silent-rules \
> --enable-shared --enable-static \
> --enable-dependency-tracking --without-gnu-ld \
> --with-libiconv-prefix=/usr/local --without-libintl-prefix
checking build system type... sparc-sun-solaris2.5.1
checking host system type... sparc-sun-solaris2.5.1
checking how to print strings... print -r
checking for gcc... /opt/SUNWspro/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking for /opt/SUNWspro/bin/cc option to accept ISO C89... none needed
checking whether /opt/SUNWspro/bin/cc understands -c and -o together... yes
checking for a sed that does not truncate output... /usr/xpg4/bin/sed
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for fgrep... /usr/xpg4/bin/grep -F
checking for non-GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking how to convert sparc-sun-solaris2.5.1 file names to sparc-sun-solaris2.5.1 format... func_convert_file_noop
checking how to convert sparc-sun-solaris2.5.1 file names to toolchain format... func_convert_file_noop
checking for /usr/ccs/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... print -r --
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/xpg4/bin/nm -p output from /opt/SUNWspro/bin/cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking for /opt/SUNWspro/bin/cc option to produce PIC... -KPIC -DPIC
checking if /opt/SUNWspro/bin/cc PIC flag -KPIC -DPIC works... yes
checking if /opt/SUNWspro/bin/cc static flag -Bstatic works... yes
checking if /opt/SUNWspro/bin/cc supports -c -o file.o... yes
checking if /opt/SUNWspro/bin/cc supports -c -o file.o... (cached) yes
checking whether the /opt/SUNWspro/bin/cc linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.5.1 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... build-aux/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of /opt/SUNWspro/bin/cc... dashXmstdout
checking whether NLS is requested... yes
checking for msgfmt... no
checking for gmsgfmt... :
checking for xgettext... no
checking for msgmerge... no
checking for non-GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking for shared library run path origin... done
checking for 64-bit host... no
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... /usr/local/lib/libiconv.so -R/usr/local/lib
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking for bison... no
checking for byacc... no
configure: no bison program found: only required for maintainers
checking for flex... no
checking for lex... lex
checking lex output file root... lex.yy
checking lex library... -ll
checking whether yytext is a pointer... no
checking for gcc... (cached) /opt/SUNWspro/bin/cc
checking whether we are using the GNU C compiler... (cached) no
checking whether /opt/SUNWspro/bin/cc accepts -g... (cached) yes
checking for /opt/SUNWspro/bin/cc option to accept ISO C89... (cached) none needed
checking whether /opt/SUNWspro/bin/cc understands -c and -o together... (cached) yes
checking for gcc... no
checking for cc... cc
checking whether we are using the GNU C compiler... (cached) no
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... (cached) none needed
checking whether cc understands -c and -o together... (cached) yes
checking how to run the C preprocessor... cc -E
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... CC
checking whether we are using the GNU C++ compiler... no
checking whether CC accepts -g... yes
checking how to run the C++ preprocessor... CC -E
checking whether the CC linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking for CC option to produce PIC... -KPIC -DPIC
checking if CC PIC flag -KPIC -DPIC works... yes
checking if CC static flag -Bstatic works... yes
checking if CC supports -c -o file.o... yes
checking if CC supports -c -o file.o... (cached) yes
checking whether the CC linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.5.1 ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of CC... dashXmstdout
checking whether ln -s works... yes
checking for gawk... (cached) gawk
checking for help2man... ${top_srcdir}/build-aux/missing help2man
configure: WARNING: help2man: program not found: building man page will not work
checking for gtexi2dvi... no
checking for texi2dvi... no
configure: WARNING: texi2dvi: program not found: building pdf version of manual will not work
checking for m4 that supports -P... /usr/local/bin/m4
checking for indent... /opt/SUNWspro/bin/indent
checking if /opt/SUNWspro/bin/indent is GNU indent... no
configure: WARNING: /opt/SUNWspro/bin/indent does not appear to be GNU indent; 'make indent' may not function properly
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking for strings.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for unistd.h... (cached) yes
checking for inttypes.h... (cached) no
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for pthread_mutex_lock in -lpthread... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for log10 in -lm... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for dup2... yes
checking for memset... yes
checking for regcomp... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strtol... yes
checking for pow... yes
checking for setlocale... yes
checking for reallocarray... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating examples/fastwc/Makefile
config.status: creating examples/manual/Makefile
config.status: creating po/Makefile.in
config.status: creating src/Makefile
config.status: creating tools/Makefile
config.status: creating tests/Makefile
config.status: creating src/config.h
config.status: executing libtool commands
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
ganymede$

Looks beautiful. I think.

ganymede$ make
Making all in src
make  all-am
source='libmain.c' object='libmain.lo' libtool=yes \
DEPDIR=.deps depmode=dashXmstdout /bin/ksh ../build-aux/depcomp \
/bin/ksh ../libtool  --tag=CC    --mode=compile /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H  -I.  -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c -o libmain.lo libmain.c
libtool: compile:  /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c libmain.c  -KPIC -DPIC -o .libs/libmain.o
libtool: compile:  /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c libmain.c -o libmain.o >/dev/null 2>&1
source='libyywrap.c' object='libyywrap.lo' libtool=yes \
DEPDIR=.deps depmode=dashXmstdout /bin/ksh ../build-aux/depcomp \
/bin/ksh ../libtool  --tag=CC    --mode=compile /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H  -I.  -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c -o libyywrap.lo libyywrap.c
libtool: compile:  /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c libyywrap.c  -KPIC -DPIC -o .libs/libyywrap.o
libtool: compile:  /opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c libyywrap.c -o libyywrap.o >/dev/null 2>&1
/bin/ksh ../libtool  --tag=CC    --mode=link /opt/SUNWspro/bin/cc  -Xa -g -xO0 -xcode=pic32 -xregs=no%appl  -version-info 2:0:0  -o libfl.la -rpath /usr/local/lib libmain.lo libyywrap.lo  -lm
libtool: link: /usr/ccs/bin/ld -G -h libfl.so.2 -o .libs/libfl.so.2.0.0  .libs/libmain.o .libs/libyywrap.o   -lm -lc
libtool: link: (cd ".libs" && rm -f "libfl.so.2" && ln -s "libfl.so.2.0.0" "libfl.so.2")
libtool: link: (cd ".libs" && rm -f "libfl.so" && ln -s "libfl.so.2.0.0" "libfl.so")
libtool: link: /usr/ccs/bin/ar cru .libs/libfl.a  libmain.o libyywrap.o
libtool: link: ranlib .libs/libfl.a
libtool: link: ( cd ".libs" && rm -f "libfl.la" && ln -s "../libfl.la" "libfl.la" )
source='buf.c' object='flex-buf.o' libtool=no \
DEPDIR=.deps depmode=dashXmstdout /bin/ksh ../build-aux/depcomp \
/opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE   -Xa -g -xO0 -xcode=pic32 -xregs=no%appl -c -o flex-buf.o `test -f 'buf.c' || echo './'`buf.c
"./flexdef.h", line 72: cannot find include file: <stdbool.h>
"./flexdef.h", line 470: undefined or not a type: bool
"./flexdef.h", line 470: syntax error before or at: *
"./flexdef.h", line 470: warning: old-style declaration or incorrect type for: rule_has_nl
"./flexdef.h", line 470: warning: old-style declaration or incorrect type for: ccl_has_nl
"./flexdef.h", line 1064: undefined or not a type: bool
"./flexdef.h", line 1064: syntax error before or at: no_section3_escape
"./flexdef.h", line 1064: warning: old-style declaration or incorrect type for: no_section3_escape
"./flexdef.h", line 1094: undefined or not a type: bool
"./flexdef.h", line 1094: syntax error before or at: has_case
"./flexdef.h", line 1094: warning: old-style declaration or incorrect type for: has_case
"./flexdef.h", line 1100: undefined or not a type: bool
"./flexdef.h", line 1100: syntax error before or at: range_covers_case
"./flexdef.h", line 1100: warning: old-style declaration or incorrect type for: range_covers_case
"./flexdef.h", line 1124: undefined or not a type: bool
"./flexdef.h", line 1124: syntax error before or at: filter_apply_chain
"./flexdef.h", line 1124: warning: old-style declaration or incorrect type for: filter_apply_chain
"./flexdef.h", line 1135: undefined or not a type: bool
"./flexdef.h", line 1135: syntax error before or at: flex_init_regex
"./flexdef.h", line 1135: warning: old-style declaration or incorrect type for: flex_init_regex
"./flexdef.h", line 1141: undefined or not a type: bool
"./flexdef.h", line 1141: syntax error before or at: regmatch_empty
"./flexdef.h", line 1141: warning: old-style declaration or incorrect type for: regmatch_empty
"buf.c", line 108: warning: using out of scope declaration: snprintf
"buf.c", line 179: warning: using out of scope declaration: snprintf
"buf.c", line 200: warning: using out of scope declaration: snprintf
cc: acomp failed for buf.c
*** Error code 2
make: Fatal error: Command failed for target `flex-buf.o'
Current working directory /usr/local/build/flex-2.6.4_SunOS_5.5.1_sun4m.001/src
*** Error code 1
make: Fatal error: Command failed for target `all'
Current working directory /usr/local/build/flex-2.6.4_SunOS_5.5.1_sun4m.001/src
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'

ganymede$


So thats the deal on this old old old machine.


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional 
@blastwave
Copy link
Author

Also ... this is unpleasant

Your message has been rejected, probably because you are not
subscribed to the mailing list and the list's policy is to prohibit
non-members from posting to it.  If you think that your messages are
being rejected in error, contact the mailing list owner at
    flex-help-owner@lists.sourceforge.net

I guess the email list needs a subscription ? 

Dennis

@Explorer09
Copy link
Contributor

So the issue here is the lack of stdbool.h in the old Solaris 2.5.1?
Does it build if you apply the workaround code as described in Autoconf documentation, specifically the AC_HEADER_STDBOOL section?
Flex used to check the header in the configure script.

@Explorer09
Copy link
Contributor

With commit 19491a0, I think this issue can be closed. Can anyone check the build on Solaris?

@blastwave
Copy link
Author

blastwave commented Apr 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants