/* jpeg build script for eCS (OS/2) */ /* version history */ /* version 0.1.0 from 06.09.2010 Silvan (first edition) */ /* version 0.1.1 from 08.09.2010 Silvan (build shared) */ /* load the sysfuncs if not already loaded */ if (RxFuncQuery('SysLoadFuncs') = 1) then do call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'; call SysLoadFuncs; end /* init the version string (don't forget to change) */ version = "0.1.1" version_date = "08.09.2010" '@echo off' parse upper arg cmdline say "jpeg for eCS (OS/2) build script v" || version || " from " || version_date options = 'build.options' /* Read profile */ say "Reading profile..." /* is the file available */ ok = stream(options, 'c', 'QUERY EXISTS') if ok = "" then do say "Please create a " || options || " based on build.options.tpl" exit 0 end do while lines(options) <> 0 opt_line = translate(linein(options)) interpret opt_line call charout , opt_line' ' end say ok = stream(options,'c','close') headerdir = copyroot || '\include' libdir = copyroot || '\lib' /* No parameter or HELP -> display usage */ if pos("HELP", cmdline) > 0 | cmdline = "" then do say say "Valid commands are:" say " HELP - this page" say " CONF - run configure" say " CLEAN - clean up and recompile everything" say " MAKE - just compile changed files" say " COPY - copy header to " || headerdir || " and library file to " || libdir say exit 255 end if value('MOZENV',,'OS2ENVIRONMENT') = '' then do say "Please set GCC environment properly!" exit 254 end /* Evaluate command line parameters */ build_parms = "" conf = "" make = "" if pos("MAKE", cmdline) > 0 then do make = "MAKE" build_parms = build_parms||' 'make end if pos("CLEAN", cmdline) > 0 then do make = "CLEAN" build_parms = build_parms||' 'make end if pos("CONF", cmdline) > 0 then do conf = "YES" build_parms = build_parms||' conf' end if pos("COPY", cmdline) > 0 then do copy = "YES" end if conf = "YES" then do /* run configure */ address cmd 'sh ./configure --enable-shared=yes 2>&1 | tee configure.log' end if make = "CLEAN" then do address cmd "make clean" end if make <> "" then do say build_parms address cmd 'make 2>&1 | tee build.log' end if copy = "YES" then do say "Copy header files to " || headerdir address cmd 'copy jpeglib.h ' || headerdir address cmd 'copy jerror.h ' || headerdir address cmd 'copy jconfig.h ' || headerdir address cmd 'copy jmorecfg.h ' || headerdir say "Copy lib to " || libdir address cmd 'copy .libs\jpeg.lib ' || libdir end /* Default exit point */ say "All done." exit 0