From 852941cf584d412499eb6c91a5ee68862f36bf88 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 23 Jun 2009 06:57:34 +0000 Subject: [PATCH] Introduced alternative Makefile.am for libxorriso production --- xorriso/makefile_libxorriso_am.txt | 196 +++++++++++++++++++++++++++++ xorriso/xorriso.c | 12 +- xorriso/xorriso.h | 44 +++++++ xorriso/xorriso_private.h | 15 ++- xorriso/xorriso_timestamp.h | 2 +- 5 files changed, 262 insertions(+), 7 deletions(-) create mode 100644 xorriso/makefile_libxorriso_am.txt diff --git a/xorriso/makefile_libxorriso_am.txt b/xorriso/makefile_libxorriso_am.txt new file mode 100644 index 00000000..06e96685 --- /dev/null +++ b/xorriso/makefile_libxorriso_am.txt @@ -0,0 +1,196 @@ + +# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4 +# was: pkgconfigdir=$(libdir)/pkgconfig +pkgconfigdir=$(LIBBURNIA_PKGCONFDIR) + +libincludedir=$(includedir)/libisoburn + +lib_LTLIBRARIES = libisoburn/libisoburn.la libxorriso/libxorriso.la + +## ========================================================================= ## + +# Build libraries +libisoburn_libisoburn_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +libisoburn_libisoburn_la_SOURCES = \ + libisoburn/burn_wrap.c \ + libisoburn/data_source.c \ + libisoburn/isoburn.c \ + libisoburn/isoburn.h \ + libisoburn/isofs_wrap.c \ + libisoburn/libisoburn.h \ + version.h + +libisoburn_libisoburn_la_LIBADD = \ + -lisofs \ + -lburn + +libxorriso_libxorriso_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +libxorriso_libxorriso_la_SOURCES = \ + xorriso/xorriso.h \ + xorriso/xorriso_private.h \ + xorriso/xorriso.c \ + xorriso/xorrisoburn.h \ + xorriso/xorrisoburn.c \ + xorriso/xorriso_timestamp.h \ + xorriso/xorriso_buildstamp.h \ + version.h + +libxorriso_libxorriso_la_LIBADD = \ + -lisofs \ + -lburn \ + -lisoburn + +libinclude_HEADERS = \ + libisoburn/libisoburn.h \ + xorriso/xorriso.h + +## ========================================================================= ## + + +# This is the reference application of libisoburn. See man xorriso/xorriso.1 +# +bin_PROGRAMS = \ + xorriso/xorriso + +# This looks quite ugly with make install: xorriso.c is compiled twice again +# +# Trying to create a build timestamp file +# +# BUILT_SOURCES = xorriso/xorriso_buildstamp.h +# +# phony targets get rebuilt every time +# +# .PHONY: xorriso/xorriso_buildstamp.h +# xorriso/xorriso_buildstamp.h: +# date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h +# cat xorriso/xorriso_buildstamp.h + +xorriso_xorriso_CPPFLAGS = -Ilibisoburn +xorriso_xorriso_CFLAGS = -DXorriso_with_maiN -DXorriso_without_subS \ + $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \ + $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) + +xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn \ + libxorriso/libxorriso.la \ + $(THREAD_LIBS) $(LIBBURN_ARCH_LIBS) + +xorriso_xorriso_SOURCES = \ + xorriso/xorriso.h \ + xorriso/xorriso_private.h \ + xorriso/xorriso.c \ + xorriso/xorrisoburn.h \ + xorriso/xorriso_timestamp.h \ + xorriso/xorriso_buildstamp.h + +# xorriso/xorrisoburn.c \ +# + +# Install symbolic links to the xorriso binary +# +install-exec-hook: + if test -e "$(DESTDIR)$(bindir)"/xorrisofs ; then rm "$(DESTDIR)$(bindir)"/xorrisofs ; else echo ; fi + ln -s xorriso "$(DESTDIR)$(bindir)"/xorrisofs + if test -e "$(DESTDIR)$(bindir)"/osirrox ; then rm "$(DESTDIR)$(bindir)"/osirrox ; else echo ; fi + ln -s xorriso "$(DESTDIR)$(bindir)"/osirrox + if test -e "$(DESTDIR)$(bindir)"/xorrecord ; then rm "$(DESTDIR)$(bindir)"/xorrecord ; else echo ; fi + ln -s xorriso "$(DESTDIR)$(bindir)"/xorrecord + + +# Alternative to the disabled .PHONY above. +# Trying to create a build timestamp file semi-manually: make buildstamped +# +buildstamp: + date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h + cat xorriso/xorriso_buildstamp.h + +# For now make buildstamped has to be performed explicitely. +buildstamped: buildstamp + make + + + +## Build test applications +noinst_PROGRAMS = \ + test/compare_file + +# A program to compare two files in mirrored trees in mounted filesystems +# To compare tree /media/dvd and /original/dir : +# find /media/dvd -exec test/compare_file '{}' /media/dvd /original/dir ';' +# +test_compare_file_CPPFLAGS = +test_compare_file_CFLAGS = +test_compare_file_LDADD = +test_compare_file_SOURCES = test/compare_file.c + + +## ========================================================================= ## + +## Build documentation (You need Doxygen for this to work) +webhost = http://libburn-api.pykix.org +webpath = / +docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION) + +doc: doc/html + +doc/html: doc/doxygen.conf + if [ -f ./doc/doc.lock ]; then \ + $(RM) -r doc/html; \ + doxygen doc/doxygen.conf; \ + fi + +doc-upload: doc/html + scp -r $volset_change_pending); +} + + int Xorriso_protect_stdout(struct XorrisO *xorriso, int flag) { if(xorriso->dev_fd_1>=0) @@ -20101,6 +20110,7 @@ int Xorriso_make_return_value(struct XorrisO *xorriso, int flag) return(exit_value); } +#endif /* ! Xorriso_without_subS */ #ifdef Xorriso_with_maiN @@ -20176,7 +20186,7 @@ int Xorriso_main(int argc, char **argv) } end_sucessfully:; Xorriso_process_msg_queues(xorriso, 0); - if(xorriso->volset_change_pending) + if(Xorriso_change_is_pending(xorriso, 0)) Xorriso_option_end(xorriso, 2); Xorriso_process_msg_queues(xorriso, 0); ret= Xorriso_make_return_value(xorriso, 0); diff --git a/xorriso/xorriso.h b/xorriso/xorriso.h index 679807ad..52dcb266 100644 --- a/xorriso/xorriso.h +++ b/xorriso/xorriso.h @@ -41,6 +41,50 @@ int Xorriso_new(struct XorrisO ** xorriso, char *progname, int flag); int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag); +/* Interpret argv as xorriso command options and their parameters. + @param xorriso The context object in which to perform the commands. + @param argc Number of arguments. + @param argv The arguments. argv[0] contains the program name. + argv[1] to argv[argc-1] contain commands and parameters. + @param idx Argument cursor. When this function is called, *idx must + be at least 1, argv[*idx] must be to a command. + *idx will iterate over commands and parameters until this + function aborts or until argc is reached. + @param flag ( Do Not Set: bit0= recursion ) + ( Do Not Set: bit1= these are command line arguments + (for xorriso->argument_emulation) ) + @return <=0 = error + 1 = success + 2 = problem event ignored + 3 = end program run (e.g. because command -end was encountered) +*/ +int Xorriso_interpreter(struct XorrisO *xorriso, + int argc, char **argv, int *idx, int flag); + + +/* Parse a command line into words and use them as argv for a call of + Xorriso_interpreter(). Put out some info lines about the outcome. + @param xorriso The context object in which to perform the commands. + @param line A text of one or more words according to man xorriso + paragraph "Command processing" up to and including + "Backslash Interpretation". + @param flag bit0 to bit15 are forwarded to Xorriso_interpreter() + bit16= no pageing of info lines + bit17= print === bar even if xorriso->found<0 + @return see return of Xorriso_interpreter() +*/ +int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag); + + +/* Inquire whether option -commit would make sense. + @param xorriso The context object to inquire. + @param flag unused yet, submit 0 + @return 0= -commit would have nothing to do + 1= a new image session would emerge at -commit +*/ +int Xorriso_change_is_pending(struct XorrisO *xorriso, int flag); + + /* Destroy xorriso object when it is no longer needed. @param flag bit0= Make global librariy shutdown. Use only with last xorriso object to be destroyed. diff --git a/xorriso/xorriso_private.h b/xorriso/xorriso_private.h index e548b30c..c5991d5c 100644 --- a/xorriso/xorriso_private.h +++ b/xorriso/xorriso_private.h @@ -431,6 +431,14 @@ struct XorrisO { /* the global context of xorriso */ }; +int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv, + int flag); + +int Xorriso_read_rc(struct XorrisO *xorriso, int flag); + +int Xorriso_dialog(struct XorrisO *xorriso, int flag); + +int Xorriso_make_return_value(struct XorrisO *xorriso, int flag); int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag); @@ -440,11 +448,6 @@ int Xorriso_info(struct XorrisO *xorriso, int flag); int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag); -int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv, - int flag); - -int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag); - /* @return 0=match , else no match */ int Xorriso_regexec(struct XorrisO *xorriso, char *to_match, int *failed_at, @@ -711,6 +714,8 @@ int Sfile_type(char *filename, int flag); */ int Sfile_bsl_encoder(char **result, char *text, size_t text_len, int flag); +int Sfile_argv_bsl(int argc, char ***argv, int flag); + struct Xorriso_lsT { char *text; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index bd11b0a1..a124ddea 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.06.22.112850" +#define Xorriso_timestamP "2009.06.23.065744"