Write Autotools configuration
Add Autotools configuration files for building binaries.
This commit is contained in:
parent
1de5aaf36a
commit
35560c46ea
9 changed files with 188 additions and 0 deletions
63
configure.ac
Normal file
63
configure.ac
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# Title, version, etc.
|
||||
AC_INIT(\
|
||||
[RTR], \
|
||||
[0.1.0], \
|
||||
[mail@acm.contact], \
|
||||
[rtr], \
|
||||
[https://www.delay.cloud/] \
|
||||
)
|
||||
|
||||
# AC_CHECK_LIB is not utilized, since it checks the presence of libraries by
|
||||
# linking them to test program; this process introduces more overhead and longer
|
||||
# build times.
|
||||
|
||||
# Define BUILD in order to enable inclusion of config.h, which will act as the
|
||||
# Autoheader.
|
||||
AC_DEFINE([BUILD], [1], [Build system enabled.])
|
||||
AM_CONFIG_HEADER([src/config.h])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4
|
||||
])
|
||||
|
||||
# Do not generate GNU project files and disable some checks.
|
||||
# Includes flags to strictly compile Standard C89.
|
||||
AM_INIT_AUTOMAKE([\
|
||||
foreign \
|
||||
-Wall \
|
||||
-Werror \
|
||||
-Wno-portability \
|
||||
subdir-objects \
|
||||
])
|
||||
|
||||
# Option to enable extras.
|
||||
AC_ARG_ENABLE([extra],
|
||||
AS_HELP_STRING([--enable-extra], [Enable features]))
|
||||
AS_IF([test "x$enable_extra" = "xyes"], [
|
||||
AC_DEFINE([EXTRA], [1], [Enable extra features.])
|
||||
AM_CONDITIONAL([EXTRA], [test "x$enable_extra" = "xyes"])
|
||||
])
|
||||
|
||||
# Locations of generated Makefiles.
|
||||
AC_CONFIG_FILES([\
|
||||
Makefile \
|
||||
src/Makefile \
|
||||
])
|
||||
|
||||
# Primary SDT.
|
||||
AC_CONFIG_SRCDIR([src/main.c])
|
||||
|
||||
|
||||
CFLAGS="$CFLAGS -std=c89 -pedantic-errors -Wall -Wold-style-definition -Wextra \
|
||||
-Wmissing-prototypes -Wstrict-prototypes" # Compile to C89
|
||||
# without
|
||||
# GNU extensions.
|
||||
# Warnings on.
|
||||
|
||||
LT_INIT([shared disable-static]) # Start GNU Libtool. Satic libraries
|
||||
# disabled; shared/dynamic linking.
|
||||
|
||||
AC_PROG_CC([gcc]) # Autoconf for C compiler; obviously set to use GCC.
|
||||
|
||||
AC_OUTPUT # Generate files.
|
||||
|
||||
# Possibly add echo here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue