From 35560c46ead65e1c261c8f4c7f6e4ebd16bfc465 Mon Sep 17 00:00:00 2001 From: Aidan Mullen Date: Fri, 3 May 2024 19:42:35 -0400 Subject: [PATCH] Write Autotools configuration Add Autotools configuration files for building binaries. --- .gitignore | 39 ++++++++++++++++++++++++++++++ AUTHORS | 6 +++++ CHANGELOG | 7 ++++++ Makefile.am | 3 +++ README | 37 +++++++++++++++++++++++++++++ TODO | 4 ++++ build.sh | 15 ++++++++++++ configure.ac | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 14 +++++++++++ 9 files changed, 188 insertions(+) create mode 100644 AUTHORS create mode 100755 CHANGELOG create mode 100644 Makefile.am create mode 100755 README create mode 100644 TODO create mode 100644 build.sh create mode 100644 configure.ac create mode 100644 src/Makefile.am diff --git a/.gitignore b/.gitignore index 4709183..200f737 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,41 @@ +# Only include required source files. +# Do no include any binaries or libraries/external sources. +# Submodules are not added here, as they are managed by Git automatically. +* +*/ + +# / +!.gitignore +!.gitignores +!AUTHORS +!build.sh +!CHANGELOG +!configure.ac +!LICENSE +!Makefile.am +!README +!TODO + +# /docs +!/docs/ +/docs/* + +!/docs/1.O_LEGAL +/docs/1.0_LEGAL/* + +!/docs/1.0_LEGAL/1.1_PRIVACY + +# /src +!/src/ +/src/* + +!/src/gdextension_interface.h +!/src/Makefile.am +!/src/main.c +!/src/main.gdextension +!/src/main.h + # Godot 4+ specific ignores .godot/ + + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..21a2d90 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +AUTHORS +======= + +Aidan Mullen + +--- end of AUTHORS --- diff --git a/CHANGELOG b/CHANGELOG new file mode 100755 index 0000000..ad6bbb6 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,7 @@ +CHANGELOG +========= + +0.1.0 +----- + +--- end of CHANGELOG --- diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9712bf9 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +AUTOMAKE_OPTIONS = foreign # Do not generate GNU files (COPYING, etc.) +SUBDIRS = src # Source subdirectory. +ACLOCAL_AMFLAGS = -I m4 # Autoconf flags; m4 is the language used. diff --git a/README b/README new file mode 100755 index 0000000..313e13d --- /dev/null +++ b/README @@ -0,0 +1,37 @@ +RTR +=== + + RTR source repository. + +Dependencies +------------ + + The following dependencies will need to be installed as per the instructions +for your system; heavily shared library-oriented systems may need all of these +installed to run the compiled binary. + + - Godot + - Vulkan + +Build +----- + + The recommended build procedure requires the following installations: + - Git + - GNU Autotools + - UNIX Shell + + 1.) Install the dependencies listed above. + + 2.) Clone this repository with all submodules. + a.) Run the following command: + git clone --recurse-submodules -j8 -b {branch} {URL to this + repository} + No submodules have been added yet. + + 3.) Run "build.sh" within a UNIX shell. + + Project organized in conformance to the Straightforward C Project Standard 5 +(SCPS5). + +--- end of README --- diff --git a/TODO b/TODO new file mode 100644 index 0000000..ee515e7 --- /dev/null +++ b/TODO @@ -0,0 +1,4 @@ +TODO +==== + +--- end of TODO --- diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e3ffb50 --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Build Script + +# Run Autotools +libtoolize +aclocal +autoconf +autoheader +automake --add-missing + +# Run Generated Files +# Disable static linking and enable GUI component; builds complete version. +./configure --disable-static --enable-shared --enable-extra=yes +make diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..d76c1bb --- /dev/null +++ b/configure.ac @@ -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. diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..d07fd8d --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,14 @@ +# Makefile for primary source directory. +SUBDIRS = extra # Subdirectory for GUI. +bin_PROGRAMS = $(top_builddir)/bin/rtr # Program name. +__top_builddir__bin_rtr_CFLAGS = -DBUILD # Define BUILD preprocessor variable. +__top_builddir__bin_rtr_SOURCES = main.c # Sources + +if extra +__top_builddir__bin_rtr_LDADD = ./extra/libextra.la # Include extra. + +# -Bshared sets preference for shared libraries. +# No libraries are currently linked here. +AM_CFLAGS = "-I$(srcdir) \ + -Bshared +endif