From d8a101f54ea6d29457d41f8a9ddd3d1de44f766a Mon Sep 17 00:00:00 2001 From: Michael Weber Date: Fri, 26 Nov 2010 11:29:55 +0100 Subject: [PATCH] autoconfiscated --- .gitignore | 41 +++++++++++++++++++++++++++++++++ Makefile | 42 ---------------------------------- Makefile.am | 24 ++++++++++++++++++++ configure.ac | 44 ++++++++++++++++++++++++++++++++++++ m4/.gitignore | 5 +++++ m4/ax_let.m4 | 24 ++++++++++++++++++++ m4/ax_try_cflags_ifelse.m4 | 46 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 184 insertions(+), 42 deletions(-) create mode 100644 .gitignore delete mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 m4/.gitignore create mode 100644 m4/ax_let.m4 create mode 100644 m4/ax_try_cflags_ifelse.m4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4735a03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# ltl2ba + +autotools/ +ltl2ba +*.o +*.lo +*.la +ltl2ba-*.tar.gz + +# editor + +\#*\# +*~ + +# http://www.gnu.org/software/automake + +TAGS +.deps/ +Makefile +Makefile.in + +# http://www.gnu.org/software/autoconf + +/autom4te.cache +/aclocal.m4 +/compile +/configure +/depcomp +/install-sh +/missing +/stamp-h1 + +config.h +config.h.in +config.log +config.lt +config.status + +# libtool +/libtool +.libs/ \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 188b1c1..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# LTL2BA - Version 1.0 - October 2001 - -# Written by Denis Oddoux, LIAFA, France -# Copyright (c) 2001 Denis Oddoux -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Based on the translation algorithm by Gastin and Oddoux, -# presented at the CAV Conference, held in 2001, Paris, France 2001. -# Send bug-reports and/or questions to: Denis.Oddoux@liafa.jussieu.fr -# or to Denis Oddoux -# LIAFA, UMR 7089, case 7014 -# Universite Paris 7 -# 2, place Jussieu -# F-75251 Paris Cedex 05 -# FRANCE - -CC=gcc -CFLAGS= -O3 -ansi -DNXT - -LTL2BA= parse.o lex.o main.o trans.o buchi.o set.o \ - mem.o rewrt.o cache.o alternating.o generalized.o - -ltl2ba: $(LTL2BA) - $(CC) $(CFLAGS) -o ltl2ba $(LTL2BA) - -$(LTL2BA): ltl2ba.h - -clean: - rm -f ltl2ba *.o core diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c75bf9d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,24 @@ +ACLOCAL_AMFLAGS = -I m4 +AM_CPPFLAGS = -DNXT + +bin_PROGRAMS = ltl2ba +noinst_LTLIBRARIES = libltl2ba.la + +ltl2ba_SOURCES = main.c +ltl2ba_SOURCES += ltl2ba.h +ltl2ba_LDADD = libltl2ba.la + +libltl2ba_la_SOURCES = parse.c +libltl2ba_la_SOURCES += lex.c +libltl2ba_la_SOURCES += trans.c +libltl2ba_la_SOURCES += buchi.c +libltl2ba_la_SOURCES += set.c +libltl2ba_la_SOURCES += mem.c +libltl2ba_la_SOURCES += rewrt.c +libltl2ba_la_SOURCES += cache.c +libltl2ba_la_SOURCES += alternating.c +libltl2ba_la_SOURCES += generalized.c +libltl2ba_la_SOURCES += ltl2ba.h + +# make +.DELETE_ON_ERROR: diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..d3e1be0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,44 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +AC_PREREQ([2.60]) +AC_INIT([ltl2ba], [1.1], [paul.gastin@lsv.ens-cachan.fr]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([autotools]) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_SRCDIR([main.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_AWK +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +dnl Newer libtool allows this instead: +dnl LT_PREREQ(2.2) +dnl LT_INIT([disable-shared]) +AC_DISABLE_SHARED +AC_PROG_LIBTOOL +AC_PROG_RANLIB + +AX_TRY_CFLAGS_IFELSE([-W -Wall]) +AX_TRY_CFLAGS_IFELSE([-pipe]) +AX_TRY_CFLAGS_IFELSE([-ansi]) + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([stdlib.h string.h sys/time.h]) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset]) + +AC_CONFIG_FILES([ + Makefile +]) +AC_OUTPUT diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..38066dd --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,5 @@ +libtool.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 diff --git a/m4/ax_let.m4 b/m4/ax_let.m4 new file mode 100644 index 0000000..14aa1b0 --- /dev/null +++ b/m4/ax_let.m4 @@ -0,0 +1,24 @@ +#serial 1 +# Author: Michael Weber +# +# SYNOPSIS +# +# AX_LET(VAR1, EXPR1, +# [VAR2, EXPR2,]... +# BODY) +# +m4_define([AX_LET_counter_],0) +m4_define([AX_LET_AUX], [dnl +m4_if([$#], 2, [$1 +$2], [dnl +ax_let_$2_[]AX_LET_counter_[]_tmp_=$3 +AX_LET_AUX([m4_if([$1],[],[],[$1 +])dnl +ax_let_$2_[]AX_LET_counter_="[$]$2" +$2="[$]ax_let_$2_[]AX_LET_counter_[]_tmp_"], m4_shiftn(3,$@)) +$2="[$]ax_let_$2_[]AX_LET_counter_"])])dnl + +AC_DEFUN([AX_LET], +[m4_define([AX_LET_counter_], m4_incr(AX_LET_counter_))dnl +# AX_LET +AX_LET_AUX([],$@)]) diff --git a/m4/ax_try_cflags_ifelse.m4 b/m4/ax_try_cflags_ifelse.m4 new file mode 100644 index 0000000..e5de5d2 --- /dev/null +++ b/m4/ax_try_cflags_ifelse.m4 @@ -0,0 +1,46 @@ +#serial 1 +# Author: Michael Weber +# +# SYNOPSIS +# +# AX_TRY_CFLAGS_IFELSE(VAR, FLAGS...[, ACTION-IF-TRUE[, ACTION-IF-FALSE]]) +# +AC_DEFUN([AX_TRY_CFLAGS_IFELSE], +[AX_LET([CFLAGS],["$CFLAGS $1"], + [AC_MSG_CHECKING([whether compiler accepts $1]) + AC_LANG_PUSH(C) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])], + [ax_try_cflags_ifelse_res=yes], + [ax_try_cflags_ifelse_res=no])]) + AC_LANG_POP(C) + AC_MSG_RESULT([$ax_try_cflags_ifelse_res]) + AS_IF([test x"$ax_try_cflags_ifelse_res" = xyes], + [ifelse([$2],, + [AC_SUBST(CFLAGS, ["$CFLAGS $1"])], + [$2]) + :] + [$3 + :]) +]) + +# SYNOPSIS +# +# AX_TRY_CXXFLAGS_IFELSE(VAR, FLAGS...[, ACTION-IF-TRUE[, ACTION-IF-FALSE]]) +# +AC_DEFUN([AX_TRY_CXXFLAGS_IFELSE], +[AX_LET([CXXFLAGS],["$CXXFLAGS $1"], + [AC_MSG_CHECKING([whether compiler accepts $1]) + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[return 0;])], + [ax_try_cflags_ifelse_res=yes], + [ax_try_cflags_ifelse_res=no]) + AC_LANG_POP(C++)]) + AC_MSG_RESULT([$ax_try_cflags_ifelse_res]) + AS_IF([test x"$ax_try_cflags_ifelse_res" = xyes], + [ifelse([$2],, + [AC_SUBST(CXXFLAGS, ["$CXXFLAGS $1"])], + [$2]) + :] + [$3 + :]) +])