Browse Source

It no longer uses boksi on the server. Hurrah.

master
dirkson 3 years ago
parent
commit
432bd51060
  1. 4
      .gitignore
  2. 113
      build
  3. 4
      meson.build
  4. 0
      meson/dynload.wrap
  5. 0
      meson/lob.wrap
  6. 0
      meson/parasol.wrap
  7. 0
      meson/win32.txt
  8. 4
      subprojects/boksi.wrap

4
.gitignore

@ -76,9 +76,7 @@ tags
.ninja_log
# Build framework
meson/*
subprojects/*/*
meson-log.txt
meson/*/*
#directories
lib/*

113
build

@ -4,20 +4,18 @@
#***CONFIG***
#************
#If COMPILER isn't set, the script will attempt to figure it out itself.
#If CC isn't set, the script will attempt to figure it out itself.
#If you change the compiler, you'll need to clean your build.
#COMPILER=musl-gcc
#CC=musl-gcc
#If this isn't set, the script will attempt to find ninja and samu, in that order.
#Alternatives include samurai's "samu"
#NINJACOMMAND=ninja
#NINJA=ninja
#Directories
BUILDDIR=meson
DOCDIR=doc
MDIR=meson
BINDIR=bin
LIBDIR=lib
DEPDIR=subprojects
#***********
#***OSMIA***
@ -66,14 +64,13 @@ osmia_help () {
echo "-r OR --release : Builds using Meson's release mode"
echo "-d OR --debug : Builds using Meson's debug mode, with --werror added"
echo "-c OR --clean : Cleans up current project meson/ninja/osmia files"
echo "-fc OR --full-clean : Fully clean - Removes osmia dependencies too"
echo "-a OR --add-san : Clang's address sanitizer"
echo "-w32 OR --win32 : Cross-compile for win32 using subprojects/win32cross.txt"
echo "-w OR --win : cross-compile for win64 using subprojects/win64cross.txt"
echo "-w32 OR --win32 : Cross-compile for win32 using $MDIR/win32.txt"
echo "-w OR --win : cross-compile for win64 using $MDIR/win64.txt"
echo "-o OR --osx : cross-compile for OSX"
}
osmia_clean () {
rm -rf $BUILDDIR $BINDIR $LIBDIR
rm -rf $MDIR/release $MDIR/debug $BINDIR $LIBDIR
}
osmia_symlink () {
@ -101,9 +98,16 @@ osmia_get () {
fi
}
#Begin
#If we needed to clean, clean.
if [ -e "$MDIR/osmia/clean" ]; then
osmia_clean
rm $MDIR/osmia/clean
fi
clear
#clear
err=0;
@ -130,12 +134,12 @@ case "$1" in
-w32|-win32|--win32|-window32|--windows32)
DIR=release
BLD=release
MESONOPTS="--cross-file $DEPDIR/win32cross.txt"
MESONOPTS="--cross-file $MDIR/win32.txt"
;;
-w|-win|--win|--window|--windows|-w64|-win64|--win64|--windows64|--windows64)
DIR=release
BLD=release
MESONOPTS="--cross-file $DEPDIR/win64cross.txt"
MESONOPTS="--cross-file $MDIR/win64.txt"
;;
-c|-clean|--clean)
if [ "$#" -ne 1 ]; then
@ -146,16 +150,6 @@ case "$1" in
echo "osmia: cleaned."
exit 0
;;
-fc|-fullclean|--fullclean|-full-clean|--full-clean)
if [ "$#" -ne 1 ]; then
echo "osmia: you passed additional arguments to clean. I have no idea what you want. Did not clean."
exit 1
fi
osmia_clean
#rm -rf $DEPDIR
echo "osmia: fully cleaned."
exit 0
;;
-?|-h|-help|--help)
osmia_help
err=1
@ -167,18 +161,18 @@ case "$1" in
esac
#do some basic error checking for the user
if [ -z "$NINJACOMMAND" ]; then
NINJACOMMAND=ninja
if [ ! -x "$(command -v $NINJACOMMAND)" ]; then
NINJACOMMAND=samu
if [ ! -x "$(command -v $NINJACOMMAND)" ]; then
if [ -z "$NINJA" ]; then
NINJA=ninja
if [ ! -x "$(command -v $NINJA)" ]; then
NINJA=samu
if [ ! -x "$(command -v $NINJA)" ]; then
echo "osmia: neither ninja nor samu are installed. One of the two is required to build."
echo "osmia: Please install either samurai's samu or ninja-build's ninja."
err=1;
fi
fi
else
if [ ! -x "$(command -v $NINJACOMMAND)" ]; then
if [ ! -x "$(command -v $NINJA)" ]; then
echo "osmia: manually specified ninja command not found"
err=1;
fi
@ -187,23 +181,21 @@ if [ ! -x "$(command -v meson)" ]; then
echo "osmia: meson not installed. The meson build system is required to build, please install.";
err=1;
fi
if [ -z "$COMPILER" ]; then
if [ -z "$CC" ]; then
if [ -x "$(command -v clang)" ]; then
COMPILER="clang"
elif [ -x "$(command -v musl-gcc)" ]; then
COMPILER="musl-gcc -static"
CC="clang"
elif [ -x "$(command -v gcc)" ]; then
COMPILER="gcc"
CC="gcc"
elif [ -x "$(command -v tcc)" ]; then
COMPILER="tcc"
CC="tcc"
elif [ -x "$(command -v icc)" ]; then
COMPILER="icc"
CC="icc"
else
echo "osmia: unable to find any compiler at all. Please install one: clang, musl-gcc, gcc, tcc, icc"
err=1
fi
else
if [ ! -x "$(command -v $COMPILER)" ]; then
if [ ! -x "$(command -v $CC)" ]; then
echo "osmia: manually specified compiler does not exist. Failing."
err=1
fi
@ -214,7 +206,6 @@ if [ ! -x "$(command -v ccache)" ]; then
else
CACHE="ccache"
fi
if [ "$#" -gt 2 ]; then
osmia_help
echo "osmia: failed, too many parameters."
@ -226,40 +217,45 @@ if [ $err -ne 0 ]; then
exit 1
fi
#Grab dependencies
if [ -d "$DEPDIR" ] && [ -e $DEPDIR/dependencies ]; then
cd "$DEPDIR"
source ../$DEPDIR/dependencies
cd ../
#Check if our CC changed. If it did, clean
if [ -e "$MDIR/osmia/cc" ]; then
if [ "$CC" = $(cat $MDIR/osmia/cc) ]; then
echo "S"
fi
fi
#Set up basic directory structure, if needed
mkdir -p $BUILDDIR 2> /dev/null
#Grab dependencies
if [ -e $MDIR/dependencies ]; then
cd "$MDIR"
source ./dependencies
cd ../
fi
#MESONOPTS=MESONOPTS:"-Dc_args=$3"
mkdir -p $MDIR/osmia/ 2> /dev/null
if [ ! -d "$BUILDDIR/$DIR" ]; then
export CC="$CACHE $COMPILER"
if [ ! -d "$MDIR/$DIR" ]; then
export CC="$CACHE $CC"
#Run meson if required
mkdir $BUILDDIR/$DIR
meson $BUILDDIR/$DIR $MESONOPTS --buildtype $BLD
mkdir $MDIR/$DIR
meson $MDIR/$DIR $MESONOPTS --buildtype $BLD
if [ ! $? -eq 0 ]; then
#Generally an error here means we need to clean before the next run
tail $BUILDDIR/$DIR/meson-logs/meson-log.txt
cp $BUILDDIR/$DIR/meson-logs/meson-log.txt meson-log.txt
echo "osmia: meson returned an error. Please check meson-log.txt for more info."
osmia_clean
tail $MDIR/$DIR/meson-logs/meson-log.txt
touch $MDIR/osmia/clean
echo "osmia: meson returned an error. Please check $MDIR/$DIR/meson-logs/meson-log.txt for more info."
exit 1
fi
echo $CC > $MDIR/osmia/cc
#else
#May wish to look into this in the future
#meson configure $MESONOPTS
fi
#Actually build
cd $BUILDDIR/$DIR
$NINJACOMMAND $2
cd $MDIR/$DIR
$NINJA $2
if [ ! $? -eq 0 ]; then
cd ../../
exit 1
@ -267,9 +263,8 @@ fi
cd ../../
#set up symlinks
osmia_symlink "$BUILDDIR/$DIR/*" "-name *.a -o -name *.so -o -name *.dll" $LIBDIR
osmia_symlink "$BUILDDIR/$DIR/*" "-not -name *.so -not -name *.dll -executable -not -name sanitycheckc.exe" $BINDIR
osmia_symlink "$BUILDDIR/$DIR/*" "-name *.html -o -name *.htm" $DOCDIR
osmia_symlink "$MDIR/$DIR/*" "-name *.a -o -name *.so -o -name *.dll" $LIBDIR
osmia_symlink "$MDIR/$DIR/*" "-not -name *.so -not -name *.dll -executable -not -name sanitycheckc.exe" $BINDIR
echo "osmia: successful build."

4
meson.build

@ -1,4 +1,4 @@
project('simsecl', 'c', default_options : ['default_library=static', 'c_std=gnu89'])
project('simsecl', 'c', default_options : ['default_library=static', 'c_std=gnu89'], subproject_dir : 'meson')
incdir = include_directories(['src', 'include'])
if get_option('buildtype').startswith('debug')
@ -35,7 +35,7 @@ if not meson.is_subproject()
# Server
subproject('lob', default_options : ['default_library=static', 'c_std=gnu89'])
subproject('lob', default_options : ['default_library=static', 'c_std=gnu89', 'use_boksi=false'])
deplob = dependency('lob', fallback : ['lob', 'lob_dep'], required:false)
if deplob.found()

0
subprojects/dynload.wrap → meson/dynload.wrap

0
subprojects/lob.wrap → meson/lob.wrap

0
subprojects/parasol.wrap → meson/parasol.wrap

0
subprojects/win32cross.txt → meson/win32.txt

4
subprojects/boksi.wrap

@ -1,4 +0,0 @@
[wrap-git]
directory = boksi
url = https://git.orangehattech.com/dirkson/boksi.git
revision = head
Loading…
Cancel
Save