From e806d5088b8fdff67d70d421ece34e557ff3dd8c Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 6 Aug 2014 22:46:15 +0000 Subject: [PATCH] Make libohash a proper internallib instead of hidding it in m4 mandoc development seems to be also using ohash so prepare to share the code when needed --- lib/Makefile | 1 + lib/libohash/Makefile | 9 +++++++++ {usr.bin/m4/lib => lib/libohash}/ohash.c | 0 {usr.bin/m4/lib => lib/libohash}/ohash.h | 0 {usr.bin/m4/lib => lib/libohash}/ohash_init.3 | 0 {usr.bin/m4/lib => lib/libohash}/ohash_interval.3 | 0 share/mk/src.libnames.mk | 4 ++++ usr.bin/m4/Makefile | 9 +++------ 8 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 lib/libohash/Makefile rename {usr.bin/m4/lib => lib/libohash}/ohash.c (100%) rename {usr.bin/m4/lib => lib/libohash}/ohash.h (100%) rename {usr.bin/m4/lib => lib/libohash}/ohash_init.3 (100%) rename {usr.bin/m4/lib => lib/libohash}/ohash_interval.3 (100%) diff --git a/lib/Makefile b/lib/Makefile index 05fab01e23fb..a5ab970f014b 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -69,6 +69,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libnetgraph} \ ${_libngatm} \ libnv \ + libohash \ libopie \ libpam \ libpcap \ diff --git a/lib/libohash/Makefile b/lib/libohash/Makefile new file mode 100644 index 000000000000..198093e289b0 --- /dev/null +++ b/lib/libohash/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= ohash +SRCS= ohash.c +INTERNALLIB= + +WARNS= 3 + +.include diff --git a/usr.bin/m4/lib/ohash.c b/lib/libohash/ohash.c similarity index 100% rename from usr.bin/m4/lib/ohash.c rename to lib/libohash/ohash.c diff --git a/usr.bin/m4/lib/ohash.h b/lib/libohash/ohash.h similarity index 100% rename from usr.bin/m4/lib/ohash.h rename to lib/libohash/ohash.h diff --git a/usr.bin/m4/lib/ohash_init.3 b/lib/libohash/ohash_init.3 similarity index 100% rename from usr.bin/m4/lib/ohash_init.3 rename to lib/libohash/ohash_init.3 diff --git a/usr.bin/m4/lib/ohash_interval.3 b/lib/libohash/ohash_interval.3 similarity index 100% rename from usr.bin/m4/lib/ohash_interval.3 rename to lib/libohash/ohash_interval.3 diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index a36642021b99..09a44ee2d526 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -44,3 +44,7 @@ LIBUCL?= ${LIBUCLDIR}/libucl.a LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LDREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a + +LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash +LDOHASH?= ${LIBOHASHDIR}/libohash.a +LIBOHASH?= ${LIBOHASHDIR}/libohash.a diff --git a/usr.bin/m4/Makefile b/usr.bin/m4/Makefile index 4f71244da9ce..47cbe3ed18c0 100644 --- a/usr.bin/m4/Makefile +++ b/usr.bin/m4/Makefile @@ -7,16 +7,13 @@ .include PROG= m4 -CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib -DPADD= ${LIBY} ${LIBL} ${LIBM} -LDADD= -ly -ll -lm +CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/../../lib/libohash +DPADD= ${LIBY} ${LIBL} ${LIBM} ${LIBOHASH} +LDADD= -ly -ll -lm ${LDOHASH} NO_WMISSING_VARIABLE_DECLARATIONS= SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l -.PATH: ${.CURDIR}/lib -SRCS+= ohash.c -WARNS= 3 tokenizer.o: parser.h