From 7b0050f72d76f646a73563c8e69014d887eddf72 Mon Sep 17 00:00:00 2001 From: Ramon Fried Date: Sat, 20 Apr 2019 15:09:05 +0300 Subject: [PATCH] transform to autotools --- .gitignore | 11 +++++++++++ .travis.yml | 2 ++ AUTHORS | 0 ChangeLog | 0 Makefile | 13 ------------- Makefile.am | 2 ++ NEWS | 0 README.md => README | 0 bootstrap.sh | 3 +++ configure.ac | 33 +++++++++++++++++++++++++++++++++ 10 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog delete mode 100644 Makefile create mode 100644 Makefile.am create mode 100644 NEWS rename README.md => README (100%) create mode 100755 bootstrap.sh create mode 100644 configure.ac diff --git a/.gitignore b/.gitignore index c6127b3..2773ddc 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,14 @@ modules.order Module.symvers Mkfile.old dkms.conf + +# Autotools stuff +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +build-aux/ +config.status +configure +pre-inst-env + diff --git a/.travis.yml b/.travis.yml index 531e525..9e9f498 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,7 @@ before_install: - sudo apt-get -qq update script: +- "./bootstrap.sh" +- "./configure" - "make" diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile deleted file mode 100644 index a229813..0000000 --- a/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright Ramon Fried (2019) -OBJS := interactive.o main.o misc.o -CFLAGS := -g -std=c99 -Wall -Werror -lncurses -lform -LDFLAGS := -lncurses -lform - -bitwise: $(OBJS) - $(CC) -o bitwise $(OBJS) $(LDFLAGS) - -install: bitwise - install -m 711 bitwise /usr/local/bin/bitwise -clean: - rm -rf *.o bitwise - diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9dacf70 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS=bitwise +bitwise_SOURCES=main.c misc.c interactive.c diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README similarity index 100% rename from README.md rename to README diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..a8fd885 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +autoreconf --verbose --install --force diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..1a980bf --- /dev/null +++ b/configure.ac @@ -0,0 +1,33 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([bitwise], [0.1], [rfried.dev@gmail.com]) +AC_CONFIG_SRCDIR([misc.c]) +AC_CONFIG_HEADERS([config.h]) + +AM_INIT_AUTOMAKE + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lform': +AC_CHECK_LIB([form], [form_driver]) +# FIXME: Replace `main' with a function in `-lncurses': +AC_CHECK_LIB([ncurses], [newwin]) + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h curses.h form.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_TYPE_UINT64_T + +# Checks for library functions. +AC_FUNC_STRCOLL +AC_CHECK_FUNCS([memchr memmove memset stpcpy strchr strcspn strdup strerror strpbrk strrchr strspn strstr]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT