From 89d6631f67962669f9e69d4e6115cd2878f69cfd Mon Sep 17 00:00:00 2001 From: philippe lhardy Date: Thu, 7 Jun 2018 22:28:36 +0200 Subject: [PATCH] minimal autotools project with bootstrapbuild.sh launch --- Makefile.am | 2 ++ bootstrapbuild.sh | 23 +++++++++++++++++++++++ c/Makefile.am | 11 +++++++++++ c/allaby_main.c | 6 ++++++ c/allaby_reader.c | 2 ++ c/allaby_reader.h | 9 +++++++++ configure.ac | 37 +++++++++++++++++++++++++++++++++++++ 7 files changed, 90 insertions(+) create mode 100644 Makefile.am create mode 100755 bootstrapbuild.sh create mode 100644 c/Makefile.am create mode 100644 c/allaby_main.c create mode 100644 c/allaby_reader.c create mode 100644 c/allaby_reader.h create mode 100644 configure.ac diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..e413b6a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = c +dist_doc_DATA = README diff --git a/bootstrapbuild.sh b/bootstrapbuild.sh new file mode 100755 index 0000000..c7957c4 --- /dev/null +++ b/bootstrapbuild.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [[ ! -f configure.ac ]] +then + echo "[ERROR] Missing configure.ac . Please create one " >&2 + exit 1 +fi + +if which autoreconf +then + + echo "bootstrap using automake tools" + echo "from configure.ac will generate configure" + + autoreconf --install + + echo "lauch ./configure && make" + +else + + echo "[ERROR] Missing autoreconf script from autotools. Please install autotools ( package autotools-dev and autoreconf" >&2 + +fi diff --git a/c/Makefile.am b/c/Makefile.am new file mode 100644 index 0000000..b2fd2cc --- /dev/null +++ b/c/Makefile.am @@ -0,0 +1,11 @@ +# This Makefile.am is REALLY where changes should be done + +bin_PROGRAMS = laby + +laby_SOURCES = allaby_reader.c allaby_main.c + +laby_CPPFLAGS = $(ARTLOG_CPPFLAGS) $(ALEXPANDER_CPPFLAGS) + +# in LDADD and not in LDFLAGS to be linked AFTER +laby_LDADD = $(ARTLOG_LDFLAGS) $(ALEXPANDER_LDFLAGS) + diff --git a/c/allaby_main.c b/c/allaby_main.c new file mode 100644 index 0000000..23c59fa --- /dev/null +++ b/c/allaby_main.c @@ -0,0 +1,6 @@ + +// NOT YET IMPLEMENTED +int main(int argc, char ** argv) +{ + return 1; +} diff --git a/c/allaby_reader.c b/c/allaby_reader.c new file mode 100644 index 0000000..feefc82 --- /dev/null +++ b/c/allaby_reader.c @@ -0,0 +1,2 @@ +#include "allaby_reader.h" + diff --git a/c/allaby_reader.h b/c/allaby_reader.h new file mode 100644 index 0000000..92f85e0 --- /dev/null +++ b/c/allaby_reader.h @@ -0,0 +1,9 @@ +#ifndef __ALLABY_READER_H__ +#define __ALLABY_READER_H__ + +/** goal : read a labyrinth/maze created +by java laby project +**/ + + +#endif // __ALLABY_READER_H__ diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..01758a0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,37 @@ +# written manually, this is root entry files for automake together with Makefile.am +# inspired from +# http://www.gnu.org/software/automake/manual/html_node/Creating-amhello.html#Creating-amhello + +AC_INIT([allaby], [0.1], [pl@artisanlogiciel.net]) + +# set ARTLOG_TOOLBOX where artlog_toolbox is to use it. +[ARTLOG_TOOLBOX=`pwd`/`./locate_artlog_toolbox.sh`] + +# non need to propagate it in .h ... +# AC_DEFINE_UNQUOTED([ARTLOG_TOOLBOX],["$ARTLOG_TOOLBOX"],[where artog toolbox is]) + +ARTLOG_CPPFLAGS="-I${ARTLOG_TOOLBOX}/build/include" +ARTLOG_LDFLAGS="-Wl,-Bstatic -L${ARTLOG_TOOLBOX}/build/lib -lalsave -laltest -laljson -lalstack -lalhash -laldev -Wl,-Bdynamic" + +AC_SUBST(ARTLOG_CPPFLAGS) +AC_SUBST(ARTLOG_LDFLAGS) + +[if [ "$ALEXPANDER_DIR" = "" ]] +[then] +[ALEXPANDER_DIR=`pwd`/../sharedrawweb] +[fi] +ALEXPANDER_CPPFLAGS="-I${ALEXPANDER_DIR}/build/include -D CHARSPERRECORD=80" +ALEXPANDER_LDFLAGS="-Wl,-Bstatic -L${ALEXPANDER_DIR}/build/lib -lalima -lalcommon -Wl,-Bdynamic" + +AC_SUBST(ALEXPANDER_CPPFLAGS) +AC_SUBST(ALEXPANDER_LDFLAGS) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AC_CONFIG_HEADERS([config.h]) +AC_DEFINE([MAX_FLAT_VIEWS],[20],[maximum number of view]) +AC_CONFIG_FILES([ + Makefile + c/Makefile +]) +AC_OUTPUT