replaces Makefiles with autoconf files

Wed, 31 May 2017 11:40:07 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 31 May 2017 11:40:07 +0200
changeset 47
e5455e692b45
parent 46
e0928e4b9a59
child 48
0d2c13c24fd0

replaces Makefiles with autoconf files

.hgignore file | annotate | diff | comparison | revisions
Makefile file | annotate | diff | comparison | revisions
Makefile.am file | annotate | diff | comparison | revisions
autogen.sh file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
gcc-debug.mk file | annotate | diff | comparison | revisions
gcc.mk file | annotate | diff | comparison | revisions
mingw-debug.mk file | annotate | diff | comparison | revisions
mingw.mk file | annotate | diff | comparison | revisions
src/Makefile.am file | annotate | diff | comparison | revisions
src/cline.h file | annotate | diff | comparison | revisions
     1.1 --- a/.hgignore	Sat Dec 17 18:37:19 2016 +0100
     1.2 +++ b/.hgignore	Wed May 31 11:40:07 2017 +0200
     1.3 @@ -7,3 +7,5 @@
     1.4  \.chg\..*$
     1.5  \.rej$
     1.6  \.conflict\~$
     1.7 +^autom4te.cache/
     1.8 +\.in$
     2.1 --- a/Makefile	Sat Dec 17 18:37:19 2016 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,64 +0,0 @@
     2.4 -#
     2.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     2.6 -#
     2.7 -# Copyright 2013 Mike Becker. All rights reserved.
     2.8 -# 
     2.9 -# Redistribution and use in source and binary forms, with or without
    2.10 -# modification, are permitted provided that the following conditions are met:
    2.11 -# 
    2.12 -# 1. Redistributions of source code must retain the above copyright
    2.13 -# notice, this list of conditions and the following disclaimer.
    2.14 -# 
    2.15 -# 2. Redistributions in binary form must reproduce the above copyright
    2.16 -# notice, this list of conditions and the following disclaimer in the
    2.17 -# documentation and/or other materials provided with the distribution.
    2.18 -# 
    2.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    2.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    2.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    2.22 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    2.23 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    2.24 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    2.25 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    2.26 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.27 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    2.28 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    2.29 -#
    2.30 -# available configurations:
    2.31 -#   gcc (default)    (will use libc regex implicitly)
    2.32 -#   mingw            (will use libregex as static lib)
    2.33 -#
    2.34 -# debug configurations:
    2.35 -#   gcc-debug
    2.36 -#   mingw-debug
    2.37 -#
    2.38 -
    2.39 -#ifndef CONF
    2.40 -CONF = gcc
    2.41 -#endif
    2.42 -
    2.43 -SRCDIR=src
    2.44 -BUILDDIR=build
    2.45 -PREFIX=/usr
    2.46 -OBJ = arguments.o bfile_heuristics.o cline.o regex_parser.o scanner.o settings.o string_list.o suffix_fnc.o
    2.47 -BIN = $(BUILDDIR)/cline
    2.48 -
    2.49 -include $(CONF).mk
    2.50 -
    2.51 -all: $(BUILDDIR) $(BIN)
    2.52 -
    2.53 -install: $(BIN)
    2.54 -	cp $(BIN) $(DESTDIR)$(PREFIX)/bin
    2.55 -
    2.56 -$(BIN): $(OBJ:%=$(BUILDDIR)/%)
    2.57 -	$(LD) -o $(BIN) $^ $(LDFLAGS)
    2.58 -	
    2.59 -$(BUILDDIR):
    2.60 -	mkdir $(BUILDDIR)
    2.61 -
    2.62 -$(BUILDDIR)/%.o: $(SRCDIR)/%.c
    2.63 -	$(CC) $(CFLAGS) -c -o $@ $<
    2.64 -
    2.65 -clean:
    2.66 -	rm -f $(BUILDDIR)/*.o
    2.67 -	
    2.68 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Makefile.am	Wed May 31 11:40:07 2017 +0200
     3.3 @@ -0,0 +1,3 @@
     3.4 +AUTOMAKE_OPTIONS = foreign
     3.5 +SUBDIRS = src
     3.6 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/autogen.sh	Wed May 31 11:40:07 2017 +0200
     4.3 @@ -0,0 +1,2 @@
     4.4 +autoreconf -i
     4.5 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/configure.ac	Wed May 31 11:40:07 2017 +0200
     5.3 @@ -0,0 +1,37 @@
     5.4 +#                                               -*- Autoconf -*-
     5.5 +# Process this file with autoconf to produce a configure script.
     5.6 +
     5.7 +AC_PREREQ([2.69])
     5.8 +AC_INIT(cline, 1.1, universe@uap-core.de)
     5.9 +AC_CONFIG_SRCDIR([src/cline.c])
    5.10 +AC_CONFIG_HEADERS([config.h])
    5.11 +AM_INIT_AUTOMAKE
    5.12 +
    5.13 +# Conditionals
    5.14 +AC_ARG_ENABLE([debug],
    5.15 +[  --enable-debug    Turn on debugging],
    5.16 +[case "${enableval}" in
    5.17 +  yes) debug=true ;;
    5.18 +  no)  debug=false ;;
    5.19 +  *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
    5.20 +esac],[debug=false])
    5.21 +AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
    5.22 +
    5.23 +# Checks for programs.
    5.24 +AC_PROG_CC
    5.25 +
    5.26 +# Checks for libraries.
    5.27 +
    5.28 +# Checks for header files.
    5.29 +AC_CHECK_HEADERS([stdlib.h string.h])
    5.30 +
    5.31 +# Checks for typedefs, structures, and compiler characteristics.
    5.32 +AC_CHECK_HEADER_STDBOOL
    5.33 +AC_TYPE_SIZE_T
    5.34 +
    5.35 +# Checks for library functions.
    5.36 +AC_FUNC_MALLOC
    5.37 +AC_FUNC_REALLOC
    5.38 +AC_CHECK_FUNCS([memset regcomp strcasecmp strchr])
    5.39 +
    5.40 +AC_OUTPUT(Makefile src/Makefile)
     6.1 --- a/gcc-debug.mk	Sat Dec 17 18:37:19 2016 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,31 +0,0 @@
     6.4 -#
     6.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     6.6 -#
     6.7 -# Copyright 2013 Mike Becker. All rights reserved.
     6.8 -# 
     6.9 -# Redistribution and use in source and binary forms, with or without
    6.10 -# modification, are permitted provided that the following conditions are met:
    6.11 -# 
    6.12 -# 1. Redistributions of source code must retain the above copyright
    6.13 -# notice, this list of conditions and the following disclaimer.
    6.14 -# 
    6.15 -# 2. Redistributions in binary form must reproduce the above copyright
    6.16 -# notice, this list of conditions and the following disclaimer in the
    6.17 -# documentation and/or other materials provided with the distribution.
    6.18 -# 
    6.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    6.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    6.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    6.22 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    6.23 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    6.24 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    6.25 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    6.26 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    6.27 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    6.28 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    6.29 -#
    6.30 -
    6.31 -CC = gcc
    6.32 -LD = gcc
    6.33 -CFLAGS = -Wall -Werror -pedantic -std=gnu99 -O0 -ggdb
    6.34 -LDFLAGS = 
     7.1 --- a/gcc.mk	Sat Dec 17 18:37:19 2016 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,31 +0,0 @@
     7.4 -#
     7.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     7.6 -#
     7.7 -# Copyright 2013 Mike Becker. All rights reserved.
     7.8 -# 
     7.9 -# Redistribution and use in source and binary forms, with or without
    7.10 -# modification, are permitted provided that the following conditions are met:
    7.11 -# 
    7.12 -# 1. Redistributions of source code must retain the above copyright
    7.13 -# notice, this list of conditions and the following disclaimer.
    7.14 -# 
    7.15 -# 2. Redistributions in binary form must reproduce the above copyright
    7.16 -# notice, this list of conditions and the following disclaimer in the
    7.17 -# documentation and/or other materials provided with the distribution.
    7.18 -# 
    7.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    7.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    7.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    7.22 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    7.23 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    7.24 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    7.25 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    7.26 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    7.27 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    7.28 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    7.29 -#
    7.30 -
    7.31 -CC = gcc
    7.32 -LD = gcc
    7.33 -CFLAGS = -Wall -std=gnu99 -O2
    7.34 -LDFLAGS = 
     8.1 --- a/mingw-debug.mk	Sat Dec 17 18:37:19 2016 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,31 +0,0 @@
     8.4 -#
     8.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     8.6 -#
     8.7 -# Copyright 2013 Mike Becker. All rights reserved.
     8.8 -# 
     8.9 -# Redistribution and use in source and binary forms, with or without
    8.10 -# modification, are permitted provided that the following conditions are met:
    8.11 -# 
    8.12 -# 1. Redistributions of source code must retain the above copyright
    8.13 -# notice, this list of conditions and the following disclaimer.
    8.14 -# 
    8.15 -# 2. Redistributions in binary form must reproduce the above copyright
    8.16 -# notice, this list of conditions and the following disclaimer in the
    8.17 -# documentation and/or other materials provided with the distribution.
    8.18 -# 
    8.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    8.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    8.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    8.22 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    8.23 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    8.24 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    8.25 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    8.26 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    8.27 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    8.28 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    8.29 -#
    8.30 -
    8.31 -CC = gcc
    8.32 -LD = gcc
    8.33 -CFLAGS = -Wall -std=gnu99 -O0 -g
    8.34 -LDFLAGS = -static -lregex
     9.1 --- a/mingw.mk	Sat Dec 17 18:37:19 2016 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,31 +0,0 @@
     9.4 -#
     9.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     9.6 -#
     9.7 -# Copyright 2013 Mike Becker. All rights reserved.
     9.8 -# 
     9.9 -# Redistribution and use in source and binary forms, with or without
    9.10 -# modification, are permitted provided that the following conditions are met:
    9.11 -# 
    9.12 -# 1. Redistributions of source code must retain the above copyright
    9.13 -# notice, this list of conditions and the following disclaimer.
    9.14 -# 
    9.15 -# 2. Redistributions in binary form must reproduce the above copyright
    9.16 -# notice, this list of conditions and the following disclaimer in the
    9.17 -# documentation and/or other materials provided with the distribution.
    9.18 -# 
    9.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    9.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    9.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    9.22 -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    9.23 -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    9.24 -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    9.25 -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    9.26 -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    9.27 -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    9.28 -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    9.29 -#
    9.30 -
    9.31 -CC = gcc
    9.32 -LD = gcc
    9.33 -CFLAGS = -Wall -std=gnu99 -O2
    9.34 -LDFLAGS = -static -lregex
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/Makefile.am	Wed May 31 11:40:07 2017 +0200
    10.3 @@ -0,0 +1,9 @@
    10.4 +if DEBUG
    10.5 +AM_CFLAGS = -std=gnu99 -O0 -Wall
    10.6 +else
    10.7 +AM_CFLAGS = -std=gnu99 -O2
    10.8 +endif
    10.9 +
   10.10 +bin_PROGRAMS = cline
   10.11 +cline_SOURCES = arguments.c bfile_heuristics.c cline.c regex_parser.c scanner.c settings.c string_list.c suffix_fnc.c
   10.12 +
    11.1 --- a/src/cline.h	Sat Dec 17 18:37:19 2016 +0100
    11.2 +++ b/src/cline.h	Wed May 31 11:40:07 2017 +0200
    11.3 @@ -32,7 +32,7 @@
    11.4  #ifndef CLINE_H_
    11.5  #define CLINE_H_
    11.6  
    11.7 -const char* VERSION="1.0.44";
    11.8 +const char* VERSION="1.1";
    11.9  
   11.10  #include "stdinc.h"
   11.11  #include "settings.h"

mercurial