Commit ee99e0ac authored by Niels Möller's avatar Niels Möller

Use automake.

Rev: src/Makefile.am:1.1
Rev: src/Makefile.in:1.27(DEAD)
Rev: src/acconfig.h:1.1
Rev: src/aclocal.m4:1.1
Rev: src/configure.in:1.8
Rev: src/symmetric/Makefile.am:1.1
Rev: src/symmetric/Makefile.in:1.4(DEAD)
Rev: src/symmetric/configure.in:1.3(DEAD)
parent 93a6f151
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
SUBDIRS = lib
bin_PROGRAMS = lsh lshd
# Don't use BUILT_SOURCES, as all these files are #included, and can't be
# compiled or dependency checked independently.
generated_sources = atoms_defines.h atoms_gperf.c atoms_table.c
common_sources = alist.c atoms.c bignum.c channel.c \
charset.c connection.c crypto.c \
debug.c disconnect.c encrypt.c format.c getopt.c io.c keyexchange.c \
packet_ignore.c pad.c parse.c publickey_crypto.c \
randomness.c \
read_data.c read_line.c read_packet.c service.c \
translate_signal.c unpad.c \
werror.c write_buffer.c xalloc.c
lsh_SOURCES = $(common_sources) lsh.c client.c client_keyexchange.c \
client_password.c client_userauth.c
lshd_SOURCES = $(common_sources) lshd.c reaper.c server.c server_keyexchange.c \
server_password.c server_userauth.c
atoms_defines.h: atoms.in process_atoms
bash process_atoms header <atoms.in >atoms_defines.h
atoms_gperf.c: atoms.in process_atoms Makefile
bash process_atoms gperf <atoms.in \
| gperf -t -c -l -k1,7,$$ -N gperf_atom >atoms_gperf.c
atoms_table.c: atoms.in process_atoms
bash process_atoms table <atoms.in >atoms_table.c
LDADD = @LIBOBJS@ lib/libsymmetric.a
EXTRA_DIST = atoms.in process_atoms $(generated_sources) HACKING
#### Start of system configuration section. ####
srcdir = @srcdir@
VPATH = $(srcdir)
CC = @CC@
@SET_MAKE@
# INSTALL = @INSTALL@
# INSTALL_PROGRAM = @INSTALL_PROGRAM@
# INSTALL_DATA = @INSTALL_DATA@
# MAKEINFO = makeinfo
# TEXI2DVI = texi2dvi
export DEFS = @DEFS@
LIBS = @LIBS@
CFLAGS = -g -Wall -Wmissing-prototypes \
-Wmissing-declarations -Werror -O # -O2 -fomit-frame-pointer
LDFLAGS = @LDFLAGS@
CPPFLAGS = -DDEBUG_ALLOC -DLSH -I$(srcdir) -I$(srcdir)/include
prefix = @prefix@
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info
# Prefix to be prepended to each installed program, normally empty or `g'.
binprefix =
#### End of system configuration section. ####
LOADLIBES = $(LIBS) lib/algorithms.a
COMMON_SRCS = alist.c atoms.c bignum.c channel.c \
charset.c connection.c crypto.c \
debug.c disconnect.c encrypt.c format.c getopt.c io.c keyexchange.c \
packet_ignore.c pad.c parse.c publickey_crypto.c \
randomness.c \
read_data.c read_line.c read_packet.c service.c \
translate_signal.c unpad.c \
werror.c write_buffer.c xalloc.c
CLIENT_SRCS = lsh.c client.c client_keyexchange.c \
client_password.c client_userauth.c
SERVER_SRCS = lshd.c reaper.c server.c server_keyexchange.c\
server_password.c server_userauth.c
SRCS = $(COMMON_SRCS) $(CLIENT_SRCS) $(SERVER_SRCS)
COMMON_OBJS = $(COMMON_SRCS:.c=.o)
CLIENT_OBJS = $(CLIENT_SRCS:.c=.o)
SERVER_OBJS = $(SERVER_SRCS:.c=.o)
OBJS = $(SRCS:.c=.o)
all: algorithms lsh lshd
.PHONY: all
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<
lsh: $(CLIENT_OBJS) $(COMMON_OBJS)
lshd: $(SERVER_OBJS) $(COMMON_OBJS)
atoms_defines.h: atoms.in process_atoms
bash process_atoms header <atoms.in >atoms_defines.h
atoms_gperf.c: atoms.in process_atoms Makefile
bash process_atoms gperf <atoms.in \
| gperf -t -c -l -k1,7,$$ -N gperf_atom >atoms_gperf.c
atoms_table.c: atoms.in process_atoms
bash process_atoms table <atoms.in >atoms_table.c
algorithms:
cd lib; \
EXTRA_CPPFLAGS="-DLSH -I$(srcdir) -I$(srcdir)/include" \
EXTRA_VPATH="$(srcdir):$(srcdir)/include" \
$(MAKE) algorithms.a
clean:
rm -f *.o
very_clean: clean
rm *.d
%.d: %.c
$(SHELL) -ec '$(CC) -MM -MG $(CPPFLAGS) $(DEFS) $< \
| sed '\''s/\($*\)\.o:/\1\.o $@ : /g'\'' > $@'
include $(SRCS:.c=.d)
#### Remaking the Makefile and configure scripts. ####
#${srcdir}/configure: configure.in aclocal.m4
${srcdir}/configure: configure.in
cd ${srcdir} && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in
#${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
# config.h.top config.h.bot
${srcdir}/stamp-h.in: configure.in
cd ${srcdir} && autoheader
echo timestamp > ${srcdir}/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
/* The name and version of this software distribution. These
* originates from AM_INIT_AUTOMAKE in the configure.in file. */
#define PACKAGE "configure-generated"
#define VERSION "configure-generated"
dnl aclocal.m4 generated automatically by aclocal 1.3
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
dnl This Makefile.in is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AM_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
dnl Process this file with autoconf to produce a configure script.
AC_INIT(keyexchange.h)
dnl AC_INIT_AUTOMAKE(lsh, 1.0)
dnl No real versioning yet, use dated snapshots instead.
dnl AM_INIT_AUTOMAKE(lsh, snapshot-`date +%Y-%m-%d`)
AM_INIT_AUTOMAKE(lsh, 17)
AC_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(config.h)
# We want an absolute path to the source-dir.
case "$srcdir" in
......@@ -17,9 +19,19 @@ If this does not work, please use an absolute path to the configure script. ])
;;
esac
# We want to compile the crypto lib for use with lsh
CPPFLAGS="$CPPFLAGS -I$srcdir/include -DLSH"
# _GNU_SOURCE is needed on some readhat glibc based systems, to get
# proper declarations of crypt(), initgroups() and strsignal().
# Enable it on all systems untill some harm is reported
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Checks for libraries.
AC_CHECK_LIB(gmp, mpz_set_d)
......@@ -52,7 +64,10 @@ AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(select socket strerror strtol)
AC_CONFIG_SUBDIRS(lib)
AC_REPLACE_FUNCS(poll)
dnl AC_CONFIG_SUBDIRS(lib)
AC_OUTPUT(Makefile lib/Makefile)
AC_OUTPUT(Makefile, echo timestamp > stamp-h)
syscmd([cd lib && autoconf])
dnl syscmd([cd lib && autoconf])
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
noinst_LIBRARIES = libsymmetric.a
noinst_PROGRAMS = desTest desdata
# When compiling with lsh, this is set to to -DLSH -I/path/to/lsh/include
# INCLUDES = @crypto_cpp_flags@
desTest_LDADD = libsymmetric.a
des_headers = parity.h rotors.h keymap.h
BUILT_SOURCES = desSmallFips.c desSmallCore.c desQuickFips.c desQuickCore.c \
$(des_headers)
libsymmetric_a_SOURCES = desCode.h desKerb.c desUtil.c desQuick.c \
$(BUILT_SOURCES) \
sha.c md5.c idea.c rc4.c cast.c
# Generate DES headers.
$(des_headers): desdata
./desdata $@ > $@
# Generate DES sources. Slowest to quickest.
desSmallFips.c:
@echo > $@ '#include "desCode.h"'
@echo >> $@ 'ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL,\
LOADFIPS,KEYMAPSMALL,SAVEFIPS)'
@echo >> $@ 'DECRYPT(DesSmallFipsDecrypt,TEMPSMALL,\
LOADFIPS,KEYMAPSMALL,SAVEFIPS)'
desSmallCore.c:
@echo > $@ '#include "desCode.h"'
@echo >> $@ 'ENCRYPT(DesSmallCoreEncrypt,TEMPSMALL,\
LOADCORE,KEYMAPSMALL,SAVECORE)'
@echo >> $@ 'DECRYPT(DesSmallCoreDecrypt,TEMPSMALL,\
LOADCORE,KEYMAPSMALL,SAVECORE)'
desQuickFips.c:
@echo > $@ '#include "desCode.h"'
@echo >> $@ 'ENCRYPT(DesQuickFipsEncrypt,TEMPQUICK,\
LOADFIPS,KEYMAPQUICK,SAVEFIPS)'
@echo >> $@ 'DECRYPT(DesQuickFipsDecrypt,TEMPQUICK,\
LOADFIPS,KEYMAPQUICK,SAVEFIPS)'
desQuickCore.c:
@echo > $@ '#include "desCode.h"'
@echo >> $@ 'ENCRYPT(DesQuickCoreEncrypt,TEMPQUICK,\
LOADCORE,KEYMAPQUICK,SAVECORE)'
@echo >> $@ 'DECRYPT(DesQuickCoreDecrypt,TEMPQUICK,\
LOADCORE,KEYMAPQUICK,SAVECORE)'
# $Id$
#
# Makefile for low-level crypto library
CC=@CC@
CPP=@CPP@
RANLIB=@RANLIB@
AR=ar
# Reset VPATH
SRCDIR=@srcdir@
VPATH=$(SRCDIR):$(EXTRA_VPATH)
# The flags to generate a shared library
CPPFLAGS=$(PREFLAGS) $(DEFS) $(EXTRA_CPPFLAGS)
LDFLAGS=@LDFLAGS@
default: algorithms.a
### Magic Makefile for descore
# Interesting defines are sparc, mc68000, vax and i386
# Rely on gcc defining them appropriately.
# CPPFLAGS= -Dsparc # use 6+8 general regs
# CPPFLAGS= -Dmc68000 # use 3+4 addr (1+4 live), and 3+3 data regs
# CPPFLAGS= -Dvax # use 6+0 general regs
# CPPFLAGS= -Di386 # use 3+0 regs, and 3+0 normal variables
CODEGEN.c= $(CC) $(CFLAGS) $(CPPFLAGS) -S
COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
# hand-entered files that go into the library
SC= desKerb.c desUtil.c desQuick.c
SO= desKerb.o desUtil.o desQuick.o
# special generated files
GH= parity.h rotors.h keymap.h
GC= desSmallFips.c desSmallCore.c desQuickFips.c desQuickCore.c
GI= desSmallFips.i desSmallCore.i desQuickFips.i desQuickCore.i
GO= desSmallFips.o desSmallCore.o desQuickFips.o desQuickCore.o
O= $(SO) $(GO)
# prefer compilation from .i if .i exists
#.SUFFIXES:
#.SUFFIXES: .i .o .c $(SUFFIXES)
desTest: desCore.a desTest.o
$(LINK.c) -o $@ desTest.o desCore.a
./desTest
# test all performance enhancement flags
sure:
make clean ; make desTest 'CPPFLAGS=-Di386 -Umc68000 -Usparc'
make clean ; make desTest 'CPPFLAGS=-Dvax -Umc68000 -Usparc'
make clean ; make desTest 'CPPFLAGS=-Dmc68000 -Usparc'
make clean ; make desTest 'CPPFLAGS=-Dsparc -Umc68000'
make clean ; make desTest
clean:
-rm -f *.o *.i *.x *.a ./desTest
-rm -f $(GC) $(GH) desdata
depend:
desCore.a: $O
$(AR) cru $@ $O
$(RANLIB) $@
desdata.o: desinfo.h $(SRCDIR)/../include/des.h
desUtil.o: $(GH)
$(SO): $(SRCDIR)/../include/des.h
$(GI): desCode.h $(SRCDIR)/../include/des.h Makefile
desTest.o: $(SRCDIR)/../include/des.h
$(GH): desdata
./desdata $@ > $@
desdata: desdata.o
$(LINK.c) -o $@ desdata.o
# new rules (note: tr|sed|tr is NOT necessary, just there so .i is readable)
.c.i:
$(CPP) $(CFLAGS) $(CPPFLAGS) $< > $*.x
@tr ';'\\012 \\012';' < $*.x | \
sed -e 's/[ ][ ]*/ /g' \
-e 's/^ //' \
-e 's/ $$//' \
-e '/^$$/d' \
-e '/^[^;]/s/^/;/' \
-e 's/#[^;]*;//g' \
-e 's/\([){]\) *\(register\)/\1;\2/g' \
-e 's/\([[(]\) /\1/g' \
-e 's/ \([])]\)/\1/g' \
-e 's/\([^]+0123 ]\) =/\1 =/g' \
-e 's/}/};;/g' \
-e 's/ *; */;/g' \
-e 's/;;;*/;;/g' \
-e '1s/^;*//' | \
tr ';'\\012 \\012';' > $@
@echo "" >> $@
# @echo "}" >> $@ # last definition must be a procedure
# -e 's/\(;[kmxyz][0-9]*\)\([^;]*=\)/\1 \2/g'
.i.o:
$(CODEGEN.c) $<
$(COMPILE.c) $*.s
# slowest to quickest
desSmallFips.c:
@echo '#include "desCode.h"' > $@
@echo \
'ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL,LOADFIPS,KEYMAPSMALL,SAVEFIPS)' >> $@
@echo \
'DECRYPT(DesSmallFipsDecrypt,TEMPSMALL,LOADFIPS,KEYMAPSMALL,SAVEFIPS)' >> $@
desSmallCore.c:
@echo '#include "desCode.h"' > $@
@echo \
'ENCRYPT(DesSmallCoreEncrypt,TEMPSMALL,LOADCORE,KEYMAPSMALL,SAVECORE)' >> $@
@echo \
'DECRYPT(DesSmallCoreDecrypt,TEMPSMALL,LOADCORE,KEYMAPSMALL,SAVECORE)' >> $@
desQuickFips.c:
@echo '#include "desCode.h"' > $@
@echo \
'ENCRYPT(DesQuickFipsEncrypt,TEMPQUICK,LOADFIPS,KEYMAPQUICK,SAVEFIPS)' >> $@
@echo \
'DECRYPT(DesQuickFipsDecrypt,TEMPQUICK,LOADFIPS,KEYMAPQUICK,SAVEFIPS)' >> $@
desQuickCore.c:
@echo '#include "desCode.h"' > $@
@echo \
'ENCRYPT(DesQuickCoreEncrypt,TEMPQUICK,LOADCORE,KEYMAPQUICK,SAVECORE)' >> $@
@echo \
'DECRYPT(DesQuickCoreDecrypt,TEMPQUICK,LOADCORE,KEYMAPQUICK,SAVECORE)' >> $@
### End of rules for desCore
SRCS = sha.c md5.c idea.c rc4.c cast.c $(SC) $(GC)
OBJS = $(SRCS:.c=.o)
algorithms.a: $(OBJS)
rm -f algorithms.a
$(AR) cru algorithms.a $(OBJS)
$(RANLIB) algorithms.a
#### Remaking the Makefile and configure scripts. ####
#${srcdir}/configure: configure.in aclocal.m4
${srcdir}/configure: configure.in
cd ${srcdir} && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in
#${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
# config.h.top config.h.bot
${srcdir}/stamp-h.in: configure.in
cd ${srcdir} && autoheader
echo timestamp > ${srcdir}/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
%.d: %.c
$(SHELL) -ec '$(CC) -MM -MG $(CPPFLAGS) $(DEFS) $< \
| sed '\''s/\($*\)\.o:/\1\.o $@ : /g'\'' > $@'
include $(SRCS:.c=.d)
dnl Process this file with autoconf to produce a configure script.
# $Id$
AC_INIT(sha.c)
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_OUTPUT(Makefile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment