diff --git a/external/bsd/lutok/Makefile b/external/bsd/lutok/Makefile new file mode 100644 index 000000000000..f70faee9f419 --- /dev/null +++ b/external/bsd/lutok/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:45 jmmv Exp $ + +SUBDIR= lib .WAIT share tests + +.include diff --git a/external/bsd/lutok/lib/Makefile b/external/bsd/lutok/lib/Makefile new file mode 100644 index 000000000000..681733915090 --- /dev/null +++ b/external/bsd/lutok/lib/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:46 jmmv Exp $ + +SUBDIR= liblutok + +.include diff --git a/external/bsd/lutok/lib/liblutok/Makefile b/external/bsd/lutok/lib/liblutok/Makefile new file mode 100644 index 000000000000..64f7059981cd --- /dev/null +++ b/external/bsd/lutok/lib/liblutok/Makefile @@ -0,0 +1,60 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:46 jmmv Exp $ + +#NOLINT= # defined + +.include + +LIB= lutok +LIBISCXX= yes + +LIBDPLIBS+= lua ${.CURDIR}/../../../../mit/lua/lib/liblua +.if ${HAVE_GCC} == 4 +LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../gnu/lib/libstdc++-v3_4 +.else +LIBDPLIBS+= stdc++ ${.CURDIR}/../../../../../external/gpl3/gcc/lib/libstdc++-v3 +.endif +LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm + +SRCDIR= ${NETBSDSRCDIR}/external/bsd/lutok/dist +.PATH: ${SRCDIR} + +CPPFLAGS+= -I${.CURDIR} +CPPFLAGS+= -I. + +CPPFLAGS+= -DHAVE_CONFIG_H + +WARNS?= 4 + +SRCS= c_gate.cpp \ + debug.cpp \ + exceptions.cpp \ + operations.cpp \ + stack_cleaner.cpp \ + state.cpp + +INCS= c_gate.hpp \ + debug.hpp \ + exceptions.hpp \ + operations.hpp \ + stack_cleaner.hpp \ + state.hpp \ + state.ipp +INCSDIR= /usr/include/lutok + +.if ${MKSHARE} != "no" +FILES+= lutok.pc +FILESDIR= /usr/lib/pkgconfig + +realall: lutok.pc +lutok.pc: Makefile lutok.pc.in + ${TOOL_SED} \ + -e 's,__INCLUDEDIR__,/usr/include,g' \ + -e 's,__LIBDIR__,/usr/lib,g' \ + -e 's,__LUA_CFLAGS__,-I/usr/include,g' \ + -e 's,__LUA_LIBS,-llua,g' \ + -e 's,__VERSION__,0.2,g' \ + <${SRCDIR}/lutok.pc.in >lutok.pc +CLEANFILES+= lutok.pc +.endif + +.include diff --git a/external/bsd/lutok/lib/liblutok/config.h b/external/bsd/lutok/lib/liblutok/config.h new file mode 100644 index 000000000000..f718a3a73f8c --- /dev/null +++ b/external/bsd/lutok/lib/liblutok/config.h @@ -0,0 +1,63 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_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 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 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 the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "lutok" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "lutok-discuss@googlegroups.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "Lutok" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "Lutok 0.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "lutok" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://code.google.com/p/lutok/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.2" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.2" diff --git a/external/bsd/lutok/lib/liblutok/shlib_version b/external/bsd/lutok/lib/liblutok/shlib_version new file mode 100644 index 000000000000..fec6b6631d2d --- /dev/null +++ b/external/bsd/lutok/lib/liblutok/shlib_version @@ -0,0 +1,3 @@ +# $NetBSD: shlib_version,v 1.1 2013/02/16 21:29:47 jmmv Exp $ +major=1 +minor=0 diff --git a/external/bsd/lutok/prepare-import.sh b/external/bsd/lutok/prepare-import.sh new file mode 100755 index 000000000000..b157fc21437c --- /dev/null +++ b/external/bsd/lutok/prepare-import.sh @@ -0,0 +1,107 @@ +#!/bin/sh +# $NetBSD: prepare-import.sh,v 1.1 2013/02/16 21:29:45 jmmv Exp $ +# +# Use this script to recreate the 'dist' subdirectory from a newly released +# distfile. The script takes care of unpacking the distfile, removing any +# files that are not relevant to NetBSD and checking if there are any new +# files in the new release that need to be addressed. +# + +set -e + +ProgName=${0##*/} + +CLEAN_PATTERNS= +CLEAN_PATTERNS="${CLEAN_PATTERNS} *.m4" +CLEAN_PATTERNS="${CLEAN_PATTERNS} INSTALL TODO" +CLEAN_PATTERNS="${CLEAN_PATTERNS} Doxyfile*" +CLEAN_PATTERNS="${CLEAN_PATTERNS} Makefile* */Makefile* */*/Makefile*" +CLEAN_PATTERNS="${CLEAN_PATTERNS} admin" +CLEAN_PATTERNS="${CLEAN_PATTERNS} api-docs" +CLEAN_PATTERNS="${CLEAN_PATTERNS} config.h.in" +CLEAN_PATTERNS="${CLEAN_PATTERNS} configure*" +CLEAN_PATTERNS="${CLEAN_PATTERNS} include" +CLEAN_PATTERNS="${CLEAN_PATTERNS} m4" + +err() { + echo "${ProgName}:" "${@}" 1>&2 + exit 1 +} + +log() { + echo "${ProgName}:" "${@}" +} + +backup_dist() { + if [ -d dist.old ]; then + log "Removing dist; dist.old exists" + rm -rf dist + else + log "Backing up dist as dist.old" + mv dist dist.old + fi +} + +extract_distfile() { + local distfile="${1}"; shift + local distname="${1}"; shift + + log "Extracting ${distfile}" + tar -xzf "${distfile}" + [ -d "${distname}" ] || err "Distfile did not create ${distname}" + log "Renaming ${distname} to dist" + mv "${distname}" dist +} + +get_distname() { + local distfile="${1}"; shift + basename "${distfile}" | sed -e 's,\.tar.*,,' +} + +cleanup_dist() { + log "Removing unnecessary files from dist" + ( cd dist && rm -rf ${CLEAN_PATTERNS} ) +} + +diff_dirs() { + local old_dir="${1}"; shift + local new_dir="${1}"; shift + + local old_list=$(mktemp -t lutok-import.XXXXXX) + local new_list=$(mktemp -t lutok-import.XXXXXX) + local diff=$(mktemp -t lutok-import.XXXXXX) + trap "rm -f '${old_list}' '${new_list}' '${diff}'; exit 1" \ + HUP INT QUIT TERM + + ( cd "${old_dir}" && find . | sort >>"${old_list}" ) + ( cd "${new_dir}" && find . | sort >>"${new_list}" ) + + diff -u "${old_list}" "${new_list}" | grep '^+\.' >>"${diff}" || true + if [ -s "${diff}" ]; then + log "New files found" + diff -u "${old_list}" "${new_list}" | grep '^+\.' + log "Check if any files have to be cleaned up and update" \ + "the prepare-import.sh script accordingly" + else + log "No new files; all good!" + fi + + rm -f "${old_list}" "${new_list}" "${diff}" +} + +main() { + [ ${#} -eq 1 ] || err "Must provide a distfile name" + local distfile="${1}"; shift + + [ -f Makefile -a -f prepare-import.sh ] || \ + err "Must be run from the src/external/bsd/lutok subdirectory" + + local distname="$(get_distname ${distfile})" + + backup_dist + extract_distfile "${distfile}" "${distname}" + cleanup_dist + diff_dirs dist.old dist +} + +main "${@}" diff --git a/external/bsd/lutok/share/Makefile b/external/bsd/lutok/share/Makefile new file mode 100644 index 000000000000..244eac4be607 --- /dev/null +++ b/external/bsd/lutok/share/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:48 jmmv Exp $ + +.include + +.if ${MKSHARE} != "no" || \ + make(clean) || make(cleandir) || make(distclean) || make(obj) +SUBDIR= examples +.endif + +.include diff --git a/external/bsd/lutok/share/examples/Makefile b/external/bsd/lutok/share/examples/Makefile new file mode 100644 index 000000000000..3ab359a1afb9 --- /dev/null +++ b/external/bsd/lutok/share/examples/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:48 jmmv Exp $ + +SUBDIR= lutok + +.include diff --git a/external/bsd/lutok/share/examples/lutok/Makefile b/external/bsd/lutok/share/examples/lutok/Makefile new file mode 100644 index 000000000000..1beb9dfc259f --- /dev/null +++ b/external/bsd/lutok/share/examples/lutok/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:48 jmmv Exp $ + +.include + +SRCDIR= ${NETBSDSRCDIR}/external/bsd/lutok/dist +.PATH: ${SRCDIR}/examples + +FILESDIR= /usr/share/examples/lutok +FILESMODE= 444 +FILES= bindings.cpp \ + hello.cpp \ + interpreter.cpp \ + raii.cpp + +.include diff --git a/external/bsd/lutok/tests/Makefile b/external/bsd/lutok/tests/Makefile new file mode 100644 index 000000000000..adf0158b6d16 --- /dev/null +++ b/external/bsd/lutok/tests/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:49 jmmv Exp $ + +SUBDIR= lib share + +.include diff --git a/external/bsd/lutok/tests/lib/Makefile b/external/bsd/lutok/tests/lib/Makefile new file mode 100644 index 000000000000..341b852a50cb --- /dev/null +++ b/external/bsd/lutok/tests/lib/Makefile @@ -0,0 +1,5 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:49 jmmv Exp $ + +SUBDIR= liblutok + +.include diff --git a/external/bsd/lutok/tests/lib/liblutok/Makefile b/external/bsd/lutok/tests/lib/liblutok/Makefile new file mode 100644 index 000000000000..7b67f665f0c9 --- /dev/null +++ b/external/bsd/lutok/tests/lib/liblutok/Makefile @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:50 jmmv Exp $ + +.include + +TESTSDIR= ${TESTSBASE}/lib/liblutok + +SRCDIR= ${NETBSDSRCDIR}/external/bsd/lutok/dist +.PATH: ${SRCDIR} + +CPPFLAGS+= -DHAVE_CONFIG_H +CPPFLAGS+= -I${NETBSDSRCDIR}/lib/liblutok + +FILESDIR= ${TESTSDIR} + +TESTS_CXX= c_gate_test \ + debug_test \ + exceptions_test \ + operations_test \ + stack_cleaner_test \ + state_test + +LDADD+= -llutok +DPADD+= ${LIBLUTOK} + +.include diff --git a/external/bsd/lutok/tests/share/Makefile b/external/bsd/lutok/tests/share/Makefile new file mode 100644 index 000000000000..3c64dde9cc77 --- /dev/null +++ b/external/bsd/lutok/tests/share/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:50 jmmv Exp $ + +.include + +.if ${MKSHARE} != "no" || \ + make(clean) || make(cleandir) || make(distclean) || make(obj) +SUBDIR= lutok +.endif + +.include diff --git a/external/bsd/lutok/tests/share/lutok/Makefile b/external/bsd/lutok/tests/share/lutok/Makefile new file mode 100644 index 000000000000..349f25ddf524 --- /dev/null +++ b/external/bsd/lutok/tests/share/lutok/Makefile @@ -0,0 +1,23 @@ +# $NetBSD: Makefile,v 1.1 2013/02/16 21:29:51 jmmv Exp $ + +.include + +TESTSDIR= ${TESTSBASE}/share/examples/lutok + +SRCDIR= ${NETBSDSRCDIR}/external/bsd/lutok/dist +.PATH: ${SRCDIR} + +FILESDIR= ${TESTSDIR} + +TESTS_SH= examples_test +TESTS_SH_SRC_examples_test= examples_test.patched + +examples_test.patched: examples_test.sh + ${TOOL_SED} \ + -e 's,__ATF_SH__,/bin/sh,g' \ + -e 's,__EXAMPLESDIR__,/usr/share/examples/lutok,g' \ + -e 's,__LIBDIR__,/usr/lib,g' \ + <${SRCDIR}/examples_test.sh >examples_test.patched +CLEANFILES+= examples_test.patched + +.include