2006-08-18 17:03:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# compile_cdrskin.sh
|
2012-01-27 15:12:50 +00:00
|
|
|
# Copyright 2005 - 2012 Thomas Schmitt, scdbackup@gmx.net, GPL
|
2006-09-15 09:26:25 +00:00
|
|
|
# to be executed within ./libburn-* resp ./cdrskin-*
|
2006-08-18 17:03:41 +00:00
|
|
|
|
2007-09-26 17:39:35 +00:00
|
|
|
debug_opts="-O2"
|
2006-08-18 17:03:41 +00:00
|
|
|
def_opts=
|
2006-11-01 16:39:07 +00:00
|
|
|
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
|
2010-03-03 14:43:21 +00:00
|
|
|
fifo_opts=""
|
2012-07-20 16:49:40 +00:00
|
|
|
libvers="-DCdrskin_libburn_1_2_5"
|
2009-11-17 09:34:46 +00:00
|
|
|
|
|
|
|
# To be used if Makefile.am uses libburn_libburn_la_CFLAGS
|
|
|
|
# burn="libburn/libburn_libburn_la-"
|
|
|
|
burn="libburn/"
|
|
|
|
|
2009-11-16 16:55:58 +00:00
|
|
|
cleanup_src_or_obj="$burn"cleanup.o
|
|
|
|
libdax_msgs_o="$burn"libdax_msgs.o
|
|
|
|
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
2006-08-18 17:03:41 +00:00
|
|
|
do_strip=0
|
|
|
|
static_opts=
|
2011-08-08 12:20:01 +00:00
|
|
|
warn_opts="-Wall -Wextra -Wno-unused-parameter"
|
2009-12-25 10:12:22 +00:00
|
|
|
libcdio=
|
2006-08-18 17:03:41 +00:00
|
|
|
fifo_source="cdrskin/cdrfifo.c"
|
|
|
|
compile_cdrskin=1
|
|
|
|
compile_cdrfifo=0
|
2006-10-15 18:49:30 +00:00
|
|
|
compile_dewav=0
|
2006-08-18 17:03:41 +00:00
|
|
|
|
2010-03-03 14:43:21 +00:00
|
|
|
libcam=
|
|
|
|
os=$(uname -s)
|
|
|
|
case $os in
|
|
|
|
*FreeBSD)
|
|
|
|
libcam="-lcam"
|
|
|
|
esac
|
|
|
|
|
2006-08-18 17:03:41 +00:00
|
|
|
for i in "$@"
|
|
|
|
do
|
|
|
|
if test "$i" = "-compile_cdrfifo"
|
|
|
|
then
|
|
|
|
compile_cdrfifo=1
|
2006-10-15 18:49:30 +00:00
|
|
|
elif test "$i" = "-compile_dewav"
|
|
|
|
then
|
|
|
|
compile_dewav=1
|
2012-07-20 16:49:40 +00:00
|
|
|
elif test "$i" = "-libburn_1_2_4"
|
2006-09-15 09:26:25 +00:00
|
|
|
then
|
2012-07-20 16:49:40 +00:00
|
|
|
libvers="-DCdrskin_libburn_1_2_4"
|
2009-11-16 16:55:58 +00:00
|
|
|
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
|
|
|
libdax_msgs_o="$burn"libdax_msgs.o
|
|
|
|
cleanup_src_or_obj="$burn"cleanup.o
|
2006-11-23 10:26:18 +00:00
|
|
|
elif test "$i" = "-libburn_svn"
|
2006-09-21 09:37:42 +00:00
|
|
|
then
|
2012-07-20 16:49:40 +00:00
|
|
|
libvers="-DCdrskin_libburn_1_2_5"
|
2009-11-16 16:55:58 +00:00
|
|
|
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
|
|
|
libdax_msgs_o="$burn"libdax_msgs.o
|
|
|
|
cleanup_src_or_obj="$burn"cleanup.o
|
2006-09-10 10:30:30 +00:00
|
|
|
elif test "$i" = "-newapi" -o "$i" = "-experimental"
|
2006-08-24 13:41:22 +00:00
|
|
|
then
|
|
|
|
def_opts="$def_opts -DCdrskin_new_api_tesT"
|
2006-11-01 16:39:07 +00:00
|
|
|
elif test "$i" = "-no_largefile"
|
|
|
|
then
|
|
|
|
largefile_opts=
|
2009-11-16 16:55:58 +00:00
|
|
|
elif test "$i" = "-dvd_obs_64k"
|
|
|
|
then
|
|
|
|
def_opts="$def_opts -DCdrskin_dvd_obs_default_64K"
|
2006-08-18 17:03:41 +00:00
|
|
|
elif test "$i" = "-do_not_compile_cdrskin"
|
|
|
|
then
|
|
|
|
compile_cdrskin=0
|
|
|
|
elif test "$i" = "-do_diet"
|
|
|
|
then
|
|
|
|
fifo_source=
|
|
|
|
def_opts="$def_opts -DCdrskin_extra_leaN"
|
|
|
|
warn_opts=
|
|
|
|
elif test "$i" = "-do_strip"
|
|
|
|
then
|
|
|
|
do_strip=1
|
2009-11-26 21:12:57 +00:00
|
|
|
elif test "$i" = "-use_libburn_fifo"
|
|
|
|
then
|
2009-12-06 09:37:33 +00:00
|
|
|
fifo_opts="-DCdrskin_use_libburn_fifO"
|
|
|
|
elif test "$i" = "-use_no_libburn_fifo"
|
|
|
|
then
|
|
|
|
fifo_opts=""
|
2009-11-26 21:12:57 +00:00
|
|
|
elif test "$i" = "-use_no_cdrfifo"
|
|
|
|
then
|
|
|
|
fifo_source=
|
2009-12-06 09:37:33 +00:00
|
|
|
fifo_opts="-DCdrskin_use_libburn_fifO -DCdrskin_no_cdrfifO"
|
2010-03-03 14:43:21 +00:00
|
|
|
elif test "$i" = "-use_libburn_cleanup"
|
|
|
|
then
|
|
|
|
fifo_source=
|
2010-03-03 15:29:16 +00:00
|
|
|
fifo_opts="-DCdrskin_use_libburn_cleanuP -DCdrskin_use_libburn_fifO -DCdrskin_no_cdrfifO"
|
2009-12-25 10:12:22 +00:00
|
|
|
elif test "$i" = "-use_libcdio"
|
|
|
|
then
|
|
|
|
libcdio="-lcdio"
|
2006-08-18 17:03:41 +00:00
|
|
|
elif test "$i" = "-g"
|
|
|
|
then
|
2007-09-26 17:39:35 +00:00
|
|
|
debug_opts="-g"
|
2006-08-18 17:03:41 +00:00
|
|
|
elif test "$i" = "-help" -o "$i" = "--help" -o "$i" = "-h"
|
|
|
|
then
|
2006-10-19 09:46:57 +00:00
|
|
|
echo "cdrskin/compile_cdrskin.sh : to be executed within top level directory"
|
2006-08-18 17:03:41 +00:00
|
|
|
echo "Options:"
|
|
|
|
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
|
2006-10-15 18:49:30 +00:00
|
|
|
echo " -compile_dewav compile program test/dewav without libburn."
|
2012-07-20 16:49:40 +00:00
|
|
|
echo " -libburn_1_2_4 set macro to match libburn-1.2.4"
|
2006-11-23 10:26:18 +00:00
|
|
|
echo " -libburn_svn set macro to match current libburn-SVN."
|
2009-11-17 16:54:52 +00:00
|
|
|
echo " -dvd_obs_64k 64 KB default size for DVD/BD writing."
|
2009-12-25 10:12:22 +00:00
|
|
|
echo " -use_libcdio link with -lcdio because libburn uses it."
|
2006-08-18 17:03:41 +00:00
|
|
|
echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin."
|
2009-12-06 09:37:33 +00:00
|
|
|
echo " -use_no_libburn_fifo use cdrfifo even for single track non-CD"
|
|
|
|
echo " -use_no_cdrfifo always use fifo of libburn and never cdrfifo"
|
2006-09-11 14:10:42 +00:00
|
|
|
echo " -experimental use newly introduced libburn features."
|
2006-08-18 17:03:41 +00:00
|
|
|
echo " -do_diet produce capability reduced lean version."
|
|
|
|
echo " -do_strip apply program strip to compiled programs."
|
2007-09-26 17:39:35 +00:00
|
|
|
echo " -g produce debuggable programm."
|
2006-08-18 17:03:41 +00:00
|
|
|
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 Cdrskin_timestamP "//' -e 's/"$//' cdrskin/cdrskin_timestamp.h)"
|
|
|
|
echo "Build timestamp : $timestamp"
|
|
|
|
|
|
|
|
if test "$compile_cdrskin"
|
|
|
|
then
|
2010-03-03 14:43:21 +00:00
|
|
|
echo "compiling program cdrskin/cdrskin.c $fifo_source $static_opts $debug_opts $libvers $fifo_opts $def_opts $cleanup_src_or_obj $libcdio $libcam"
|
2006-11-01 16:39:07 +00:00
|
|
|
cc -I. \
|
|
|
|
$warn_opts \
|
|
|
|
$static_opts \
|
|
|
|
$debug_opts \
|
|
|
|
$libvers \
|
|
|
|
$largefile_opts \
|
2009-12-06 09:37:33 +00:00
|
|
|
$fifo_opts \
|
2006-11-01 16:39:07 +00:00
|
|
|
$def_opts \
|
|
|
|
\
|
2006-08-18 17:03:41 +00:00
|
|
|
-DCdrskin_build_timestamP='"'"$timestamp"'"' \
|
|
|
|
\
|
|
|
|
-o cdrskin/cdrskin \
|
|
|
|
\
|
|
|
|
cdrskin/cdrskin.c \
|
|
|
|
$fifo_source \
|
2006-10-03 16:37:08 +00:00
|
|
|
\
|
|
|
|
$cleanup_src_or_obj \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"async.o \
|
2011-12-15 15:56:49 +00:00
|
|
|
"$burn"cdtext.o \
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"debug.o \
|
|
|
|
"$burn"drive.o \
|
|
|
|
"$burn"file.o \
|
|
|
|
"$burn"init.o \
|
|
|
|
"$burn"options.o \
|
|
|
|
"$burn"source.o \
|
|
|
|
"$burn"structure.o \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"sg.o \
|
|
|
|
"$burn"write.o \
|
|
|
|
"$burn"read.o \
|
2006-10-17 14:13:30 +00:00
|
|
|
$libdax_audioxtr_o \
|
2006-09-24 17:16:01 +00:00
|
|
|
$libdax_msgs_o \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"mmc.o \
|
|
|
|
"$burn"sbc.o \
|
|
|
|
"$burn"spc.o \
|
|
|
|
"$burn"util.o \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"sector.o \
|
|
|
|
"$burn"toc.o \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"crc.o \
|
|
|
|
"$burn"ecma130ab.o \
|
2006-08-18 17:03:41 +00:00
|
|
|
\
|
2009-12-25 10:12:22 +00:00
|
|
|
$libcdio \
|
2010-03-03 14:43:21 +00:00
|
|
|
$libcam \
|
2006-08-18 17:03:41 +00:00
|
|
|
-lpthread
|
2006-09-21 09:37:42 +00:00
|
|
|
|
|
|
|
ret=$?
|
|
|
|
if test "$ret" = 0
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
echo >&2
|
|
|
|
echo "+++ FATAL : Compilation of cdrskin failed" >&2
|
|
|
|
echo >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-08-18 17:03:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$compile_cdrfifo" = 1
|
|
|
|
then
|
|
|
|
echo "compiling program cdrskin/cdrfifo.c $static_opts $debug_opts"
|
|
|
|
cc $static_opts $debug_opts \
|
|
|
|
-DCdrfifo_standalonE \
|
|
|
|
-o cdrskin/cdrfifo \
|
|
|
|
cdrskin/cdrfifo.c
|
2006-09-21 09:37:42 +00:00
|
|
|
|
|
|
|
ret=$?
|
|
|
|
if test "$ret" = 0
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
echo >&2
|
|
|
|
echo "+++ FATAL : Compilation of cdrfifo failed" >&2
|
|
|
|
echo >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
2006-08-18 17:03:41 +00:00
|
|
|
fi
|
|
|
|
|
2006-10-15 18:49:30 +00:00
|
|
|
if test "$compile_dewav" = 1
|
|
|
|
then
|
|
|
|
echo "compiling program test/dewav.c -DDewav_without_libburN $static_opts $debug_opts"
|
|
|
|
cc $static_opts $debug_opts \
|
|
|
|
-DDewav_without_libburN \
|
|
|
|
-o test/dewav \
|
|
|
|
test/dewav.c \
|
2009-11-16 16:55:58 +00:00
|
|
|
"$burn"libdax_audioxtr.o \
|
|
|
|
"$burn"libdax_msgs.o \
|
2006-10-15 18:49:30 +00:00
|
|
|
\
|
|
|
|
-lpthread
|
|
|
|
|
|
|
|
ret=$?
|
|
|
|
if test "$ret" = 0
|
|
|
|
then
|
|
|
|
dummy=dummy
|
|
|
|
else
|
|
|
|
echo >&2
|
|
|
|
echo "+++ FATAL : Compilation of test/dewav failed" >&2
|
|
|
|
echo >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-08-18 17:03:41 +00:00
|
|
|
if test "$do_strip" = 1
|
|
|
|
then
|
|
|
|
echo "stripping result cdrskin/cdrskin"
|
|
|
|
strip cdrskin/cdrskin
|
|
|
|
if test "$compile_cdrfifo" = 1
|
|
|
|
then
|
|
|
|
echo "stripping result cdrskin/cdrfifo"
|
|
|
|
strip cdrskin/cdrfifo
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo 'done.'
|