From 553fe7b857d03b7aa7d3068ae55282b5bd46d44f Mon Sep 17 00:00:00 2001 From: John Marino Date: Wed, 16 Jan 2013 02:50:25 +0100 Subject: [PATCH] flex: Add world makefiles, but don't tie it into build yet. --- usr.bin/flex/Makefile | 71 +++++++++++++ usr.bin/flex/config.h | 207 ++++++++++++++++++++++++++++++++++++++ usr.bin/flex/lib/Makefile | 16 +++ 3 files changed, 294 insertions(+) create mode 100644 usr.bin/flex/Makefile create mode 100644 usr.bin/flex/config.h create mode 100644 usr.bin/flex/lib/Makefile diff --git a/usr.bin/flex/Makefile b/usr.bin/flex/Makefile new file mode 100644 index 0000000000..a4211bf338 --- /dev/null +++ b/usr.bin/flex/Makefile @@ -0,0 +1,71 @@ +CONTRIBDIR= ${.CURDIR}/../../contrib/flex +.PATH: ${CONTRIBDIR} +.PATH: ${CONTRIBDIR}/doc + +PROG= flex + +VMAJ= 2 +VMIN= 5 +VPT= 37 + +LINKS+= ${BINDIR}/flex ${BINDIR}/lex +LINKS+= ${BINDIR}/flex ${BINDIR}/lex++ +LINKS+= ${BINDIR}/flex ${BINDIR}/flex++ + +MLINKS+= flex.1 lex.1 +MLINKS+= flex.1 lex++.1 +MLINKS+= flex.1 flex++.1 + +INCS= FlexLexer.h +INCSDIR= ${INCLUDEDIR}/c++ + +SUBDIR= lib + +CFLAGS+= -I${CONTRIBDIR} -I${.OBJDIR} -I${.CURDIR} +CFLAGS+= -DHAVE_CONFIG_H + +WARNS?= 2 + +# verbatim from vendor makefile +flex_SOURCES = \ + ccl.c \ + dfa.c \ + ecs.c \ + scanflags.c \ + gen.c \ + main.c \ + misc.c \ + nfa.c \ + parse.y \ + scan.l \ + skel.c \ + sym.c \ + tblcmp.c \ + yylex.c \ + options.c \ + scanopt.c \ + buf.c \ + tables.c \ + tables_shared.c \ + filter.c \ + regex.c + +SRCS= ${flex_SOURCES} + +skel.c: flex.skl mkskel.sh flexint.h tables_shared.h + sed -e 's/m4_/m4postproc_/g' \ + -e 's/m4preproc_/m4_/g' \ + ${CONTRIBDIR}/flex.skl \ + | m4 -P -I ${CONTRIBDIR} \ + -D FLEX_MAJOR_VERSION=${VMAJ} \ + -D FLEX_MINOR_VERSION=${VMIN} \ + -D FLEX_SUBMINOR_VERSION=${VPT} \ + | sed 's/m4postproc_/m4_/g' \ + | sh ${CONTRIBDIR}/mkskel.sh > skel.c + +DPADD= ${LIBM} +LDADD= -lm + +CLEANFILES= skel.c + +.include diff --git a/usr.bin/flex/config.h b/usr.bin/flex/config.h new file mode 100644 index 0000000000..52c97927ca --- /dev/null +++ b/usr.bin/flex/config.h @@ -0,0 +1,207 @@ +/* config.h. Generated from conf.in by configure. */ +/* conf.in. Generated from configure.in by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* Define to 1 if you have the `dup2' function. */ +#define HAVE_DUP2 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define if you have the iconv() function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* pthread library */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `pow' function. */ +#define HAVE_POW 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_REGEX_H 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to the m4 executable name. */ +#define M4 "/usr/bin/m4" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "flex" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "flex-help@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "the fast lexical analyser generator" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "the fast lexical analyser generator 2.5.37" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "flex" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.5.37" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5.37" + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ diff --git a/usr.bin/flex/lib/Makefile b/usr.bin/flex/lib/Makefile new file mode 100644 index 0000000000..1bc71541fc --- /dev/null +++ b/usr.bin/flex/lib/Makefile @@ -0,0 +1,16 @@ +CONTRIBDIR= ${.CURDIR}/../../../contrib/flex +.PATH: ${CONTRIBDIR} + +LIB= fl +SRCS= libmain.c libyywrap.c +NOPIC= yes + +LINKS= ${LIBDIR}/libfl.a ${LIBDIR}/libl.a +LINKS+= ${LIBDIR}/libfl.a ${LIBDIR}/libln.a + +.if !defined(NOPROFILE) +LINKS+= ${PROFLIBDIR}/libfl.a ${PROFLIBDIR}/libl.a +LINKS+= ${PROFLIBDIR}/libfl.a ${PROFLIBDIR}/libln.a +.endif + +.include -- 2.41.0