From 303a1a67eda567c80eb24bb360237ddb3b970d27 Mon Sep 17 00:00:00 2001 From: loic Date: Wed, 29 Apr 2026 10:13:30 +0000 Subject: [PATCH] Initial commit --- .gitignore | 18 ++++++++++++++++++ Makefile.am | 11 +++++++++++ autogen.sh | 3 +++ configure.ac | 46 +++++++++++++++++++++++++++++++++++++++++++++ include/compiler.h | 11 +++++++++++ include/libft_ssl.h | 6 ++++++ libft_ssl.pc.in | 10 ++++++++++ src/Makefile.am | 8 ++++++++ src/libft_ssl.c | 6 ++++++ 9 files changed, 119 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 include/compiler.h create mode 100644 include/libft_ssl.h create mode 100644 libft_ssl.pc.in create mode 100644 src/Makefile.am create mode 100644 src/libft_ssl.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f8ba6f --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +configure +config.log +config.status +aclocal.m4 +autom4te.cache/ +Makefile.in +Makefile +/libtool +/ltmain.sh +*.o +*.lo +*.la +*.Plo +build-aux/ +m4/ +ft_getopt.pc +.libs/ +compile_commands.json diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..755af49 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = src + +pkgincludedir = $(includedir)/$(PACKAGE_NAME) +pkginclude_HEADERS = \ + include/libft_ssl.h \ + include/compiler.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libft_ssl.pc diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3eeefb2 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/sh +set -e +autoreconf --install --verbose diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..8b2d5f8 --- /dev/null +++ b/configure.ac @@ -0,0 +1,46 @@ +AC_PREREQ([2.69]) +AC_INIT([libft_ssl], [0.0.1], []) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIRS([m4]) +AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects]) +AC_PROG_CC +AM_PROG_AR + +LT_PREREQ([2.2]) +LT_INIT + +# --enable-debug +AC_ARG_ENABLE( + [debug], + [AS_HELP_STRING([--enable-debug], [Enable debug build: -g -O0 (default: no)])], + [enable_debug=$enableval], + [enable_debug=no] + ) +AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"]) + +AS_IF([test "x$enable_debug" = "xyes"], + [CFLAGS="-g -O0"], + [CFLAGS="-O2"], + ) + +STRICT_CFLAGS="-Wall -Wextra -Werror -pipe -Wpedantic -Wconversion -Wshadow -Wvla" +AC_SUBST([STRICT_CFLAGS]) + + +AC_CONFIG_FILES([ + Makefile + src/Makefile + libft_ssl.pc + ]) + +AC_OUTPUT + +AC_MSG_NOTICE([ + + libft_ssl $VERSION + --------------- + prefix : $prefix + CC : $CC + CFLAGS : $STRICT_CFLAGS $CFLAGS + debug : $enable_debug +]) diff --git a/include/compiler.h b/include/compiler.h new file mode 100644 index 0000000..2ec5498 --- /dev/null +++ b/include/compiler.h @@ -0,0 +1,11 @@ +#ifndef COMPILER_H +#define COMPILER_H + +#define __unused __attribute__((unused)) + +#define COUNT_OF(arr) (sizeof(arr) / sizeof((arr)[0])) + +#define STATIC_ARRAY_FOREACH(arr, ptr) \ + for ((ptr) = (arr); (ptr) < (arr) + COUNT_OF(arr); (ptr)++) + +#endif diff --git a/include/libft_ssl.h b/include/libft_ssl.h new file mode 100644 index 0000000..5ba6737 --- /dev/null +++ b/include/libft_ssl.h @@ -0,0 +1,6 @@ +#ifndef LIBFT_SSL_H +#define LIBFT_SSL_H + +int do_nothing(void); + +#endif diff --git a/libft_ssl.pc.in b/libft_ssl.pc.in new file mode 100644 index 0000000..82ecb4a --- /dev/null +++ b/libft_ssl.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libft_ssl +Description: idk +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lft_ssl +Cflags: -I${includedir} diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..e9d455e --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,8 @@ +lib_LTLIBRARIES = libft_ssl.la + +libft_ssl_la_SOURCES = libft_ssl.c + +AM_CFLAGS = -std=c99 $(STRICT_CFLAGS) +libft_ssl_la_CPPFLAGS = -I$(top_srcdir)/include + +libft_ssl_la_LDFLAGS = -version-info 0:0:0 diff --git a/src/libft_ssl.c b/src/libft_ssl.c new file mode 100644 index 0000000..73951d3 --- /dev/null +++ b/src/libft_ssl.c @@ -0,0 +1,6 @@ + +int +do_nothing(void) +{ + return 0; +}