legacy/libisoburn/trunk/test/compile_xorriso.sh

189 lines
4.8 KiB
Bash
Raw Normal View History

#!/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
2008-01-14 16:35:07 +00:00
isoburn=./libisoburn-develop/og_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"
nglibisofs=0
gen=
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 -O0"
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."
echo " -nglibisofs ... will fail at compile time."
echo " -oglibisofs ... might fail at run time."
exit 0
elif test "$i" = "-nglibisofs"
then
nglibisofs=1
isofs=./nglibisofs-develop/src
isoburn=./libisoburn-develop/ng_src
gen=-nglibisofs
elif test "$i" = "-oglibisofs"
then
nglibisofs=0
isofs=./libisofs-develop/libisofs
isoburn=./libisoburn-develop/og_src
gen=-oglibisofs
elif test "$i" = "-static"
then
static_opts="-static"
fi
done
libisofs=
if test "$nglibisofs" = 1
then
libisofs="$libisofs $isofs"/buffer.o
libisofs="$libisofs $isofs"/builder.o
libisofs="$libisofs $isofs"/data_source.o
libisofs="$libisofs $isofs"/ecma119.o
libisofs="$libisofs $isofs"/ecma119_tree.o
libisofs="$libisofs $isofs"/eltorito.o
libisofs="$libisofs $isofs"/filesrc.o
libisofs="$libisofs $isofs"/fs_image.o
libisofs="$libisofs $isofs"/fs_local.o
libisofs="$libisofs $isofs"/fsource.o
libisofs="$libisofs $isofs"/image.o
libisofs="$libisofs $isofs"/joliet.o
libisofs="$libisofs $isofs"/libiso_msgs.o
libisofs="$libisofs $isofs"/messages.o
libisofs="$libisofs $isofs"/node.o
libisofs="$libisofs $isofs"/rockridge.o
libisofs="$libisofs $isofs"/rockridge_read.o
libisofs="$libisofs $isofs"/stream.o
libisofs="$libisofs $isofs"/tree.o
libisofs="$libisofs $isofs"/util.o
2008-01-14 16:35:07 +00:00
libisofs="$libisofs $isofs"/util_htable.o
libisofs="$libisofs $isofs"/util_rbtree.o
xorrisoburn_c="ng_xorrisoburn.c"
else
libisofs="$libisofs $isofs"/data_source.o
libisofs="$libisofs $isofs"/ecma119.o
libisofs="$libisofs $isofs"/ecma119_read.o
libisofs="$libisofs $isofs"/ecma119_read_rr.o
libisofs="$libisofs $isofs"/ecma119_tree.o
libisofs="$libisofs $isofs"/eltorito.o
libisofs="$libisofs $isofs"/exclude.o
libisofs="$libisofs $isofs"/file.o
libisofs="$libisofs $isofs"/file_src.o
libisofs="$libisofs $isofs"/hash.o
libisofs="$libisofs $isofs"/joliet.o
libisofs="$libisofs $isofs"/libiso_msgs.o
libisofs="$libisofs $isofs"/messages.o
libisofs="$libisofs $isofs"/rockridge.o
libisofs="$libisofs $isofs"/susp.o
libisofs="$libisofs $isofs"/tree.o
libisofs="$libisofs $isofs"/util.o
libisofs="$libisofs $isofs"/volume.o
xorrisoburn_c="xorrisoburn.c"
fi
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 $gen"
cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \
$warn_opts \
$static_opts \
$debug_opts \
$def_opts \
2007-10-17 21:38:55 +00:00
$largefile_opts \
\
-DXorriso_build_timestamP='"'"$timestamp"'"' \
\
-o "$xorr"/xorriso \
\
"$xorr"/xorriso.c \
\
"$xorr"/"$xorrisoburn_c" \
2007-10-17 21:38:55 +00:00
\
"$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"/cleanup.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 \
\
$libisofs \
\
-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.'