diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile deleted file mode 100644 index 6ebfd98..0000000 --- a/Makefile +++ /dev/null @@ -1,115 +0,0 @@ -# SUBDIRS lists the components of Elk that are compiled and installed by -# running "make" and "make install". The subdirectory "src" holds the -# interpreter proper; a mininum configuration requires the SUBDIRS include, -# scripts, src, and scm. -# -# Subdirectories if lib/ hold the standard extensions. Delete them or -# parts of them from SUBDIRS if you don't want them to be compiled and -# installed; delete lib/xm and lib/xm/xt if you don't have Motif on your -# system. - -SUBDIRS= include\ - scripts\ - src\ - scm\ - lib/misc\ - lib/unix\ - lib/xlib\ - lib/xt\ - lib/xaw\ - lib/xm\ - lib/xm/xt - -# ---------------------------------------------------------------------- - -SHELL= /bin/sh -MAKE= make -GTAR= gtar -TAR= tar -GZIP= gzip -ZIP= zip - -default: - @for i in $(SUBDIRS) ;\ - do \ - echo Making $$i...; \ - ( cd $$i ; $(MAKE) ) || exit $$?; \ - done - -install: - @for i in $(SUBDIRS) ;\ - do \ - echo Installing $$i...; \ - ( cd $$i ; $(MAKE) install ) || exit $$?; \ - done - -localize: - @for i in $(SUBDIRS) ;\ - do \ - echo Localizing $$i...; \ - ( cd $$i ; $(MAKE) localize ) || exit $$?; \ - done - -lint: - @for i in $(SUBDIRS) ;\ - do \ - echo Linting $$i...; \ - ( cd $$i ; $(MAKE) lint ) || exit $$?; \ - done - -clean: - @for i in $(SUBDIRS) ;\ - do \ - echo Cleaning $$i...; \ - ( cd $$i ; $(MAKE) clean ) || exit $$?; \ - done - -distclean: - @for i in $(SUBDIRS) ;\ - do \ - echo Cleaning $$i...; \ - ( cd $$i ; $(MAKE) distclean ) || exit $$?; \ - done - - -# Package up all localized files (Makefile.local, include files, etc.) -# and source files into a zip file (to be compiled on a DOS system). -# The X11 extensions are not included. - -LOCALF= Makefile config/system config/site include/*.h lib/misc/Makefile*\ - lib/misc/*.c scm/[a-z]* src/Makefile* `ls -1 src/*.c |grep -v hp9k` - -localized.zip: - $(MAKE) distclean - $(MAKE) localize - $(ZIP) -kr $@ $(LOCALF) - - -# Make a full distribution - -DISTF= README ROADMAP CHANGES INSTALL MACHINES COPYRIGHT CONTRIBUTORS\ - PATCHLEVEL TODO BUGS MIGRATE Makefile config doc examples include lib\ - scm scripts src util - -dist: - echo elk-`util/getversion README'` > .rel - rm -rf `cat .rel` - mkdir `cat .rel` - for i in $(DISTF) ;\ - do \ - (cd `cat .rel`; ln -s ../$$i) \ - done - if [ -f config/site.dist ]; then \ - cp config/site config/site.old; \ - cp config/site.dist config/site; \ - fi - if [ ! -f ExcludeFiles ]; then \ - $(TAR) -cvf `cat .rel`.tar -h `cat .rel`; \ - else \ - $(GTAR) -cvf `cat .rel`.tar -h -X ExcludeFiles `cat .rel`; \ - fi - $(GZIP) -f `cat .rel`.tar - rm -rf `cat .rel` .rel - if [ -f config/site.old ]; then \ - mv config/site.old config/site; \ - fi diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..bcbe25a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,15 @@ +NULL = + +SUBDIRS = src lib scm scripts +DIST_SUBDIRS = $(SUBDIRS) autotools config debian doc examples util + +EXTRA_DIST = \ + CONTRIBUTORS \ + MACHINES \ + MIGRATE \ + PATCHLEVEL \ + ROADMAP \ + $(NULL) + +AUTOMAKE_OPTIONS = dist-bzip2 + diff --git a/autotools/Makefile.am b/autotools/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..3375883 --- /dev/null +++ b/bootstrap @@ -0,0 +1,47 @@ +#! /bin/sh +set -x +set -e + +# Check for automake +amvers="none" +if automake-1.7 --version >/dev/null 2>&1 +then + amvers="-1.7" +else + if automake-1.6 --version >/dev/null 2>&1 + then + amvers="-1.6" + else + if automake-1.5 --version >/dev/null 2>&1 + then + amvers="-1.5" + else + if automake --version > /dev/null 2>&1 + then + amvers=`automake --version | sed -e '1s/[^0-9]*//' -e q` + + if expr "$amvers" "<" "1.5" > /dev/null 2>&1 + then amvers="none" + else amvers="" + fi + fi + fi + fi +fi + +if test "$amvers" = "none" +then + set +x + echo "bootstrap: you need automake version 1.5 or later" + exit 1 +fi + +# Remove old cruft +rm -f aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh +(cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh) + +aclocal${amvers} +libtoolize --copy --force +autoconf +autoheader +automake${amvers} --add-missing --copy diff --git a/config/Makefile.am b/config/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..f5370bd --- /dev/null +++ b/configure.ac @@ -0,0 +1,65 @@ +AC_INIT(src/main.c) + +AC_PREREQ(2.50) +AC_CONFIG_AUX_DIR(autotools) +AC_CANONICAL_SYSTEM + +AM_INIT_AUTOMAKE(cfingerd, 1.5.0) +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_LIBTOOL +AC_STDC_HEADERS + +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T + +AC_CHECK_HEADERS(unistd.h pwd.h) + +dnl +dnl Check for available warning flags +dnl +CFLAGS_save="${CFLAGS}" + +AC_CACHE_CHECK([if \$CC accepts -Wall], + [ac_cv_c_Wall], + [CFLAGS="-Wall ${CFLAGS_save}" + AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)]) +if test "x${ac_cv_c_Wall}" != "xno"; then + CFLAGS_save="-Wall ${CFLAGS_save}" +fi + +AC_CACHE_CHECK([if \$CC accepts -Wsign-compare], + [ac_cv_c_Wsign_compare], + [CFLAGS="-Wsign-compare ${CFLAGS_save}" + AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)]) +if test "x${ac_cv_c_Wsign_compare}" != "xno"; then + CFLAGS_save="-Wsign-compare ${CFLAGS_save}" +fi + +CFLAGS="${CFLAGS_save}" +INCLUDES="${INCLUDES} -I\$(top_srcdir)/include" + +dnl +dnl Default values +dnl +AC_DEFINE(BLAH, 1, [Define if blah]) + +dnl Export variables +AC_SUBST(INCLUDES) + +AC_OUTPUT([ + Makefile + autotools/Makefile + config/Makefile + debian/Makefile + doc/Makefile + examples/Makefile + lib/Makefile + scm/Makefile + scripts/Makefile + src/Makefile + util/Makefile +]) + diff --git a/debian/Makefile.am b/debian/Makefile.am new file mode 100644 index 0000000..f208c1a --- /dev/null +++ b/debian/Makefile.am @@ -0,0 +1,9 @@ +NULL = +EXTRA_DIST = \ + changelog \ + compat \ + control \ + copyright \ + rules \ + $(NULL) + diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/include/Makefile b/include/Makefile deleted file mode 100644 index 2a53bb2..0000000 --- a/include/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -SHELL=/bin/sh -MAKE=make - -all: default - -Makefile.local: build ../config/system ../config/site - $(SHELL) ./build - -default: Makefile.local - $(MAKE) -f Makefile.local - -install: Makefile.local - $(MAKE) -f Makefile.local install - -localize: Makefile.local - $(MAKE) -f Makefile.local localize - -lint: - -clean: - -distclean: Makefile.local - $(MAKE) -f Makefile.local distclean diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/scm/Makefile b/scm/Makefile deleted file mode 100644 index 06d3a14..0000000 --- a/scm/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -SHELL=/bin/sh -MAKE=make - -all: default - -Makefile.local: build ../config/system ../config/site - $(SHELL) ./build - -default: Makefile.local - $(MAKE) -f Makefile.local - -install: Makefile.local - $(MAKE) -f Makefile.local install - -localize: Makefile.local - $(MAKE) -f Makefile.local localize - -lint: Makefile.local - $(MAKE) -f Makefile.local lint - -clean: Makefile.local - $(MAKE) -f Makefile.local clean - -distclean: Makefile.local - $(MAKE) -f Makefile.local distclean diff --git a/scm/Makefile.am b/scm/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index 2a53bb2..0000000 --- a/scripts/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -SHELL=/bin/sh -MAKE=make - -all: default - -Makefile.local: build ../config/system ../config/site - $(SHELL) ./build - -default: Makefile.local - $(MAKE) -f Makefile.local - -install: Makefile.local - $(MAKE) -f Makefile.local install - -localize: Makefile.local - $(MAKE) -f Makefile.local localize - -lint: - -clean: - -distclean: Makefile.local - $(MAKE) -f Makefile.local distclean diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 1019aaf..0000000 --- a/src/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -SHELL=/bin/sh -MAKE=make - -all: default - -Makefile.local: build ../config/system ../config/site - $(SHELL) ./build - -default: Makefile.local - $(MAKE) -f Makefile.local - -install: Makefile.local - $(MAKE) -f Makefile.local install - -localize: Makefile.local - -lint: Makefile.local - $(MAKE) -f Makefile.local lint - -clean: Makefile.local - $(MAKE) -f Makefile.local clean - -distclean: Makefile.local - $(MAKE) -f Makefile.local distclean diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..bc914b2 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,46 @@ +NULL = + +lib_LTLIBRARIES = libelk.la +libelk_la_CFLAGS = -I/usr/include/libelf -DINIT_OBJECTS -DNOMAIN +libelk_la_LDFLAGS = +libelk_la_LIBADD = -lm -lelf -ldl +libelk_la_SOURCES = \ + autoload.c \ + bignum.c \ + bool.c \ + char.c \ + cont.c \ + cstring.c \ + debug.c \ + dump.c \ + env.c \ + error.c \ + exception.c \ + feature.c \ + heap.c \ + io.c \ + libelk.c \ + list.c \ + load.c \ + malloc.c \ + math.c \ + onfork.c \ + prim.c \ + print.c \ + proc.c \ + promise.c \ + read.c \ + special.c \ + stab.c \ + stkmem.c \ + string.c \ + symbol.c \ + terminate.c \ + type.c \ + vector.c \ + $(NULL) + +bin_PROGRAMS = elk +elk_LDADD = libelk.la +elk_SOURCES = main.c + diff --git a/src/main.c b/src/main.c index afa67ec..759c715 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,4 @@ -#include +#include int main(int ac, char **av) { Elk_Init(ac, av, 1, ""); diff --git a/util/Makefile.am b/util/Makefile.am new file mode 100644 index 0000000..e69de29