From af866846dee61d4f4315dcdff21c07b32e9952e0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 12 Oct 2007 22:19:19 +0000 Subject: [PATCH] A build facility to circumvent autotools during development --- libisoburn/trunk/test/compile_xorriso.sh | 138 ++++++++++++++++++++++ libisoburn/trunk/test/make_timestamp.sh | 9 ++ libisoburn/trunk/test/xorriso_timestamp.h | 1 + 3 files changed, 148 insertions(+) create mode 100755 libisoburn/trunk/test/compile_xorriso.sh create mode 100755 libisoburn/trunk/test/make_timestamp.sh create mode 100644 libisoburn/trunk/test/xorriso_timestamp.h diff --git a/libisoburn/trunk/test/compile_xorriso.sh b/libisoburn/trunk/test/compile_xorriso.sh new file mode 100755 index 00000000..1dc415fd --- /dev/null +++ b/libisoburn/trunk/test/compile_xorriso.sh @@ -0,0 +1,138 @@ +#!/bin/sh + +# compile_xorriso.sh +# Copyright 2005 - 2007 Thomas Schmitt, scdbackup@gmx.net, GPL +# to be executed in a common parent of the directories given with +# $isofs $isoburn $burn + +isofs=./libisofs-develop/libisofs +burn=./libburn-develop/libburn +isoburn=./libisoburn-develop/src +xorr=./libisoburn-develop/test + +debug_opts="-O2" +def_opts= +largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1" +do_strip=0 +static_opts= +warn_opts="-Wall" + +for i in "$@" +do + if test "$i" = "-do_diet" + then + def_opts="$def_opts -DXorriso_no_helP" + warn_opts= + elif test "$i" = "-do_strip" + then + do_strip=1 + elif test "$i" = "-g" + then + debug_opts="-g" + elif test "$i" = "-help" -o "$i" = "--help" -o "$i" = "-h" + then + echo \ + "$xorr/compile_xorriso.sh : to be executed above top level directories" + echo "Options:" + echo " -do_diet produce capability reduced lean version." + echo " -do_strip apply program strip to compiled programs." + echo " -g produce debuggable programm." + echo " -static compile with cc option -static." + exit 0 + elif test "$i" = "-static" + then + static_opts="-static" + fi +done + + +timestamp="$(date -u '+%Y.%m.%d.%H%M%S')" +echo "Version timestamp : $(sed -e 's/#define Xorriso_timestamP "//' -e 's/"$//' "$xorr"/xorriso_timestamp.h)" +echo "Build timestamp : $timestamp" + +echo "compiling program $xorr/xorriso.c $static_opts $debug_opts $def_opts" +cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \ + $warn_opts \ + $static_opts \ + $debug_opts \ + $def_opts \ + \ + -DXorriso_build_timestamP='"'"$timestamp"'"' \ + \ + -o "$xorr"/xorriso \ + \ + "$xorr"/xorriso.c \ + \ + "$burn"/async.o \ + "$burn"/debug.o \ + "$burn"/drive.o \ + "$burn"/file.o \ + "$burn"/init.o \ + "$burn"/options.o \ + "$burn"/source.o \ + "$burn"/structure.o \ + \ + "$burn"/sg.o \ + "$burn"/write.o \ + "$burn"/read.o \ + "$burn"/libdax_audioxtr.o \ + "$burn"/libdax_msgs.o \ + \ + "$burn"/mmc.o \ + "$burn"/sbc.o \ + "$burn"/spc.o \ + "$burn"/util.o \ + \ + "$burn"/sector.o \ + "$burn"/toc.o \ + \ + "$burn"/crc.o \ + "$burn"/lec.o \ + \ + "$isoburn"/isoburn.o \ + "$isoburn"/burn_wrap.o \ + "$isoburn"/data_source.o \ + "$isoburn"/isofs_wrap.o \ + \ + "$isofs"/data_source.o \ + "$isofs"/ecma119.o \ + "$isofs"/ecma119_read.o \ + "$isofs"/ecma119_read_rr.o \ + "$isofs"/ecma119_tree.o \ + "$isofs"/eltorito.o \ + "$isofs"/exclude.o \ + "$isofs"/file.o \ + "$isofs"/file_src.o \ + "$isofs"/hash.o \ + "$isofs"/joliet.o \ + "$isofs"/libiso_msgs.o \ + "$isofs"/messages.o \ + "$isofs"/rockridge.o \ + "$isofs"/susp.o \ + "$isofs"/tree.o \ + "$isofs"/util.o \ + "$isofs"/volume.o \ + \ + -lreadline \ + \ + -lpthread + + ret=$? + if test "$ret" = 0 + then + dummy=dummy + else + echo >&2 + echo "+++ FATAL : Compilation of xorriso failed" >&2 + echo >&2 + exit 1 + fi + + +if test "$do_strip" = 1 +then + echo "stripping result $xorr/xorriso" + strip "$xorr"/xorriso +fi + +echo 'done.' diff --git a/libisoburn/trunk/test/make_timestamp.sh b/libisoburn/trunk/test/make_timestamp.sh new file mode 100755 index 00000000..cee74657 --- /dev/null +++ b/libisoburn/trunk/test/make_timestamp.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Create version timestamp test/xorriso_timestamp.h +# to be executed within ./libisoburn-develop + +timestamp="$(date -u '+%Y.%m.%d.%H%M%S')" +echo "Version timestamp : $timestamp" +echo '#define Xorriso_timestamP "'"$timestamp"'"' >test/xorriso_timestamp.h + diff --git a/libisoburn/trunk/test/xorriso_timestamp.h b/libisoburn/trunk/test/xorriso_timestamp.h new file mode 100644 index 00000000..33346a63 --- /dev/null +++ b/libisoburn/trunk/test/xorriso_timestamp.h @@ -0,0 +1 @@ +#define Xorriso_timestamP "2007.10.12.221407"