aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-20 00:45:25 +0900
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-20 00:45:25 +0900
commit5aafe9fe26debd5e354330fc4e85b7ebff22c19e (patch)
treea82ba54cb537f1090db701f641c703feac1be335
parentb01a9f2f3e8b68a9b132287b63e87e18ae837153 (diff)
Integrate the raylib display to the build system
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac15
-rw-r--r--src/Makefile.am5
3 files changed, 19 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index af437a6..0182df2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,2 @@
SUBDIRS = src
+ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 0747857..1bd45c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,11 @@
AC_INIT([calculer], [1.0.0])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror, foreign])
+AC_CONFIG_MACRO_DIRS([m4])
+AM_PROG_AR
AC_PROG_CC
+LT_INIT
AH_TEMPLATE([USE_READLINE], [do we use GNU Readline ?])
AC_DEFUN([LINENOISE_URL], [https://github.com/antirez/linenoise.git])
@@ -23,11 +26,21 @@ AC_CHECK_LIB([readline],
use_readline=false
)],
[AC_DEFINE([USE_READLINE], [0])
- use_readline=true]
+ use_readline=false]
)
AM_CONDITIONAL([USE_READLINE_COND], [test x$use_readline = xtrue])
+AC_CHECK_LIB([raylib],
+ [InitWindow],
+ [],
+ [cat << EOF
+Error: the Raylib library was not found, you may install it either using
+your usual package manager or from source :
+https://www.raylib.com/
+EOF]
+)
+
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debugging, only useful for development])],
diff --git a/src/Makefile.am b/src/Makefile.am
index 88d970c..a2817d3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,12 @@
bin_PROGRAMS = calculer
AM_CFLAGS = -Wall -Wextra
AM_LDFLAGS =
-calculer_SOURCES = calculer.c
+calculer_SOURCES = calculer.c disp.c
if DEBUG_COND
+noinst_LTLIBRARIES = ray.la
+ray_la_SOURCES = ray.c
+ray_la_LDFLAGS = -module -rpath @abs_srcdir@ -lraylib
else
AM_CFLAGS += -DNDEBUG -Wno-unused-variable
endif