From ba6e6b64033b1f9de49feccb5c9cd438354481f7 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 1 Jun 2013 23:39:51 +0100 Subject: [PATCH] configure.ac: Replace with a new version. --- .gitignore | 10 +---- .links | 4 +- Makefile.am | 20 ++++++---- configure.ac | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 119 -------------------------------------------------------- 5 files changed, 140 insertions(+), 138 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.in diff --git a/.gitignore b/.gitignore index f1dff6f..41bc25f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,12 @@ KEYRING Makefile.in aclocal.m4 -config.h.in configure COPYING.LIB -COPYING autom4te.cache -config.guess -config.sub +config getdate.h getdate.y -install-sh -ltmain.sh -missing -mkinstalldirs -depcomp prof tinymp *.kr diff --git a/.links b/.links index 5f62873..161dfb0 100644 --- a/.links +++ b/.links @@ -1,5 +1,5 @@ COPYING.LIB getdate.y getdate.h -auto-version -confsubst +config/auto-version +config/confsubst diff --git a/Makefile.am b/Makefile.am index 36580fe..11251fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -62,13 +62,14 @@ dist_man_MANS = ### Standard configuration substitutions. ## Substitute tags in files. -confsubst = $(top_srcdir)/confsubst -EXTRA_DIST += confsubst +confsubst = $(top_srcdir)/config/confsubst +EXTRA_DIST += config/confsubst SUBSTITUTIONS = \ prefix=$(prefix) exec_prefix=$(exec_prefix) \ libdir=$(libdir) includedir=$(includedir) \ - PACKAGE=$(PACKAGE) VERSION=$(VERSION) + PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ + CATACOMB_LIBS="$(CATACOMB_LIBS)" V_SUBST = $(V_SUBST_$(V)) V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY)) @@ -79,7 +80,7 @@ SUBST = $(V_SUBST)$(confsubst) ### The main library. lib_LTLIBRARIES += libcatacomb.la -libcatacomb_la_LIBADD = $(CATACOMB_LIBS) +libcatacomb_la_LIBADD = $(CATACOMB_LIBS) $(mLib_LIBS) libcatacomb_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) libcatacomb_la_SOURCES = nodist_libcatacomb_la_SOURCES = @@ -117,6 +118,7 @@ pkginclude_HEADERS += paranoia.h ## information gathered by `configure'. noinst_LTLIBRARIES += libmpbase.la libcatacomb_la_LIBADD += libmpbase.la +libmpbase_la_LIBADD = $(mLib_LIBS) libmpbase_la_SOURCES = $(libmpbase_la_OBJECTS): mptypes.h @@ -276,6 +278,7 @@ nodist_libcatacomb_la_SOURCES += primetab.c CLEANFILES += primetab.h primetab.c BUILT_SOURCES += primetab.h primetab.c noinst_PROGRAMS += genprimes +genprimes_LDADD = $(mLib_LIBS) primetab.h: primetab.c primetab.c: genprimes$e $(AM_V_GEN)./genprimes -hprimetab.h -cprimetab.c \ @@ -321,6 +324,7 @@ nodist_pkginclude_HEADERS += wheel.h nodist_libcatacomb_la_SOURCES += wheel.c CLEANFILES += wheel.h wheel.c noinst_PROGRAMS += genwheel +genwheel_LDADD = $(mLib_LIBS) wheel.h: wheel.c wheel.c: genwheel$e $(AM_V_GEN)./genwheel -hwheel.h -cwheel.c \ @@ -1009,7 +1013,7 @@ libcatcrypt_la_SOURCES += getdate.y ###-------------------------------------------------------------------------- ### Utility programs. -UTILS_LIBS = libcatcrypt.la libcatacomb.la $(LIBS) +UTILS_LIBS = libcatcrypt.la libcatacomb.la $(mLib_LIBS) $(LIBS) ## Generate and verify datestamped cookies. bin_PROGRAMS += cookie @@ -1062,7 +1066,7 @@ perftest_LDADD = $(UTILS_LIBS) ## Remember passphrases for limited periods of time. bin_PROGRAMS += pixie pixie_SOURCES = pixie.c -pixie_LDADD = libcatacomb.la +pixie_LDADD = libcatacomb.la $(mLib_LIBS) $(PIXIE_LIBS) dist_man_MANS += pixie.1 EXTRA_DIST += xpixie @@ -1077,7 +1081,7 @@ SUFFIXES += .c .$t .to .c.to: $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ .to.$t: libcatacomb.la - $(AM_V_CCLD)$(LINK) $< libcatacomb.la $(LIBS) + $(AM_V_CCLD)$(LINK) $< libcatacomb.la $(mLib_LIBS) $(LIBS) .PRECIOUS: %.to CLEANFILES += *.to *.$t @@ -1101,7 +1105,7 @@ dist-hook:: echo $(VERSION) >$(distdir)/RELEASE ## Additional build tools. -EXTRA_DIST += auto-version +EXTRA_DIST += config/auto-version ###-------------------------------------------------------------------------- ### Debian. diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9aff84a --- /dev/null +++ b/configure.ac @@ -0,0 +1,125 @@ +dnl -*-autoconf-*- +dnl +dnl Configuration script for Catacomb +dnl +dnl (c) 2013 Straylight/Edgeware +dnl + +dnl----- Licensing notice --------------------------------------------------- +dnl +dnl This file is part of Catacomb. +dnl +dnl Catacomb is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU Library General Public License as +dnl published by the Free Software Foundation; either version 2 of the +dnl License, or (at your option) any later version. +dnl +dnl Catacomb is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Library General Public License for more details. +dnl +dnl You should have received a copy of the GNU Library General Public +dnl License along with Catacomb; if not, write to the Free +dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +dnl MA 02111-1307, USA. + +dnl-------------------------------------------------------------------------- +dnl Initialization. + +mdw_AUTO_VERSION +AC_INIT([catacomb], AUTO_VERSION, [mdw@distorted.org.uk]) +AC_CONFIG_SRCDIR([catacomb.pc.in]) +AC_CONFIG_AUX_DIR([config]) +AM_INIT_AUTOMAKE([foreign parallel-tests]) +mdw_SILENT_RULES + +AC_PROG_CC +AX_CFLAGS_WARN_ALL +AM_PROG_LIBTOOL +mdw_LIBTOOL_VERSION_INFO + +AC_PROG_YACC + +AC_SUBST(AM_CFLAGS) + +dnl-------------------------------------------------------------------------- +dnl C programming environment. + +dnl Various standard types. +AC_CHECK_TYPE([pid_t], [int]) +AC_TYPE_UID_T +AC_CHECK_TYPE([ssize_t], [int]) + +dnl The maths library. +mdw_ORIG_LIBS=$LIBS +AC_SEARCH_LIBS([log], [m]) +AC_SEARCH_LIBS([sqrt], [m]) +AC_SUBST([CATACOMB_LIBS], [$LIBS]) +LIBS=$mdw_ORIG_LIBS + +dnl Functions used for noise-gathering. +AC_CHECK_FUNCS([setgroups]) +AC_CACHE_CHECK([whether the freewheel noise generator will work], + [catacomb_cv_freewheel], +[AC_TRY_LINK( +[#include +#include ], +[struct itimerval itv = { { 0, 0 }, { 0, 5000 } }; +jmp_buf j; +setitimer(ITIMER_REAL, &itv, 0); +sigsetjump(j, 1);], +[catacomb_cv_freewheel=yes], +[catacomb_cv_freewheel=no])]) +case $catacomb_cv_freewheel in + yes) + AC_DEFINE([USE_FREEWHEEL], [1], + [Define if you want to use the freewheel noise generator.]) + ;; +esac + +dnl Support for the passphrase pixie. +mdw_ORIG_LIBS=$LIBS +AC_SEARCH_LIBS([socket], [socket]) +AC_SUBST([PIXIE_LIBS], [$LIBS]) +LIBS=$mdw_ORIG_LIBS + +dnl Memory locking support. +AC_CHECK_FUNCS([mlock]) + +dnl Necessary support libraries. +PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4]) +AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS" + +dnl-------------------------------------------------------------------------- +dnl Python. + +dnl Make sure we have a suitable version. +AM_PATH_PYTHON([2.5]) + +dnl-------------------------------------------------------------------------- +dnl Special debugging options. + +AC_ARG_ENABLE([mpw], + [AS_HELP_STRING([--enable-mpw], [force small-width mp digits])], + [case "$enableval" in + y*|t*|short) + AC_DEFINE([FORCE_MPW_SHORT], [1], + [Define to force small-width mp digits.]) + ;; + cussid) + AC_DEFINE([FORCE_MPW_CUSSID], [1], + [Define to force strange-width mp digits.]) + ;; + esac]) + +dnl-------------------------------------------------------------------------- +dnl Produce output. + +AC_CONFIG_HEADER([config/config.h]) + +AC_CONFIG_FILES( + [Makefile]) +AC_OUTPUT + +dnl----- That's all, folks -------------------------------------------------- diff --git a/configure.in b/configure.in deleted file mode 100644 index 682b8d6..0000000 --- a/configure.in +++ /dev/null @@ -1,119 +0,0 @@ -dnl -*-m4-*- -dnl -dnl $Id$ -dnl -dnl Autoconfiguration for Catacomb -dnl -dnl (c) 1999 Straylight/Edgeware -dnl - -dnl ----- Licensing notice -------------------------------------------------- -dnl -dnl This file is part of Catacomb. -dnl -dnl Catacomb is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU Library General Public License as -dnl published by the Free Software Foundation; either version 2 of the -dnl License, or (at your option) any later version. -dnl -dnl Catacomb is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU Library General Public License for more details. -dnl -dnl You should have received a copy of the GNU Library General Public -dnl License along with Catacomb; if not, write to the Free -dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -dnl MA 02111-1307, USA. - -dnl --- Boring boilerplate --- - -mdw_AUTO_VERSION -AC_INIT(catacomb, AUTO_VERSION, mdw@distorted.org.uk) -mdw_SILENT_RULES -AC_CONFIG_SRCDIR(blkc.h) -AC_CONFIG_AUX_DIR(.) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(foreign) - -dnl --- Make sure I can compile and build libraries --- - -AC_PROG_CC -AM_PROG_LIBTOOL -AX_CFLAGS_WARN_ALL -mdw_LIBTOOL_VERSION_INFO - -AC_PROG_YACC - -dnl --- Actually, I assume these exist anyway --- - -AC_CHECK_HEADERS(unistd.h) -AC_HEADER_STDC - -dnl --- Check for various important system types --- - -AC_CHECK_TYPE(pid_t, int) -AC_CHECK_TYPE(size_t, unsigned) -AC_TYPE_UID_T -AC_CHECK_TYPE(time_t, long) -AC_CHECK_TYPE(ssize_t, int) - -dnl --- The maths library, for Maurer's test --- - -OLIBS=$LIBS -AC_SEARCH_LIBS(log, m) -AC_SEARCH_LIBS(sqrt, m) -AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS - -dnl --- Functions used for noise-gathering --- - -AC_CHECK_FUNCS(setgroups) - -AC_CACHE_CHECK([whether the freewheel noise generator will work], -[catacomb_cv_freewheel], -[AC_TRY_LINK([ -#include -#include -], -[struct itimerval itv = { { 0, 0 }, { 0, 5000 } }; -jmp_buf j; -setitimer(ITIMER_REAL, &itv, 0); -sigsetjmp(j, 1);], -[catacomb_cv_freewheel=yes], -[catacomb_cv_freewheel=no])]) -if test "$catacomb_cv_freewheel" = "yes"; then - AC_DEFINE([USE_FREEWHEEL], [1], - [Define if you want to use the freewheel noise generator.]) -fi - -dnl --- Support for the passphrase pixie --- - -OLIBS=$LIBS -AC_SEARCH_LIBS(socket, socket) -AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS -AC_CHECK_FUNCS(mlock) - -dnl --- Debugging things --- - -AC_ARG_ENABLE([mpw], - [AS_HELP_STRING([--enable-mpw], - [force small-width mp digits])], - [case "$enableval" in - y*|t*|short) - AC_DEFINE([FORCE_MPW_SHORT], [1], - [Define to force small-width mp digits.]) - ;; - cussid) - AC_DEFINE([FORCE_MPW_CUSSID], [1], - [Define to force strange-width mp digits.]) - ;; - esac]) - -dnl --- Done --- - -PKG_CHECK_MODULES(mLib, mLib >= 2.0.4) -CFLAGS="$CFLAGS $mLib_CFLAGS" -LIBS="$LIBS $mLib_LIBS" -AC_OUTPUT(Makefile) - -dnl ----- That's all, folks ------------------------------------------------- -- 2.11.0