diff --git a/Makefile b/Makefile index 1433167..ee38f99 100644 --- a/Makefile +++ b/Makefile @@ -24,14 +24,14 @@ endif ifeq ($(MAKECMDGOALS),dist-install) MAKE_DIST=000 endif -ifeq ($(MAKECMDGOALS),Makedep.force) -MAKE_DIST=000 -endif - BASH=bash PERL_BADLANG=x export PERL_BADLANG +INSTALL=install +INSTALL_PROGRAM=$(INSTALL) +INSTALL_DATA=$(INSTALL) -m 644 + CXXX=$(CXD_assert) LDALL=$(LDXX) -s $(LDFLAGS) $(LIBS) ifeq ($(ENABLE_DEBUG), no) @@ -59,16 +59,18 @@ ALL= GLOBFILES=Makefile Makehelp Makedep MAKEDEP_CMD = perl -x -S ./ccdep.pl --FAL=assert,no,yes,checker $(CXX) +# On a fresh checkout config.status doesn't exist yet, so fall back to a bare +# ./configure (which honours configure's own defaults). On subsequent runs we +# use ./config.status --recheck so the user's original ./configure arguments +# are preserved. +RECONFIGURE = if [ -x config.status ]; then MAKE=$(MAKE) ./config.status --recheck; else ./configure; fi ifeq ($(MAKE_DIST),) most all: sam2p # First target, build this target by default `make'. - # Actually ./configure creates Makehelp as well, but by adding it to the - # left side below, make 3.81 would run configure twice (once for each - # `include' below). - # # echo to config.h is needed to make config.h younger than config.h.in; # configure doesn't change the timestamp of config.h if it's unchanged. - Makedep config.h: configure Makehelp.in config.h.in ccdep.pl sam2p_version.h; ./configure MAKE=$(MAKE) --enable-gif --enable-lzw && echo "" >>config.h - Makehelp:; + config.h: configure config.h.in; $(RECONFIGURE) && echo "" >>config.h + Makehelp: configure Makehelp.in; $(RECONFIGURE) + Makedep: ccdep.pl sam2p_version.h config.h Makehelp; rm -f Makedep && $(MAKEDEP_CMD) include Makehelp # Defines CXX. File generated by ./configure. include Makedep # Contains ALL+=... . else @@ -91,10 +93,6 @@ else most all:; # `make MAKE_DIST=x' should be a no-op by default. endif -.PHONY: Makedep.force -# Called by ./configure -Makedep.force: sam2p_version.h; $(MAKEDEP_CMD) - all1: $(ALL) # vvv for Epsilon at Thu Oct 31 09:58:58 CET 2002 IDE_MODES := release debug @@ -216,10 +214,9 @@ dist-install: dist-noautoconf chmod 600 ../sam2p-*.tar.gz scp ../sam2p-*.tar.gz kozma:public_html -# Mac OS/X cp doesn't have -a, so we don't use it -install: sam2p - -mkdir -p '$(bindir)' - cp sam2p '$(bindir)' - chmod 755 '$(bindir)'/sam2p +install: all + $(INSTALL) -d '$(DESTDIR)$(bindir)' '$(DESTDIR)$(mandir)/man1' + $(INSTALL_PROGRAM) sam2p '$(DESTDIR)$(bindir)/sam2p' + $(INSTALL_DATA) sam2p.1 '$(DESTDIR)$(mandir)/man1/sam2p.1' # __END__ of Makefile diff --git a/Makehelp.in b/Makehelp.in index 638345a..32d6767 100644 --- a/Makehelp.in +++ b/Makehelp.in @@ -7,3 +7,4 @@ GFLAG=@GFLAG@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ +mandir=@mandir@ diff --git a/README b/README index ef1b1af..1cd0f31 100644 --- a/README +++ b/README @@ -620,14 +620,14 @@ the ./compile_*.sh scripts. If you want to use the ./configure script, run - #sh configure --enable-gif --enable-lzw # optional, make does it + #sh configure # optional, make does it make # the stand-alone utility `./sam2p' is now built make install # optional, may not work If you have GNU Make as gmake on the $PATH, run this: - sh configure MAKE=gmake --enable-gif --enable-lzw # optional, gmake does it + sh configure MAKE=gmake # optional, gmake does it gmake # the stand-alone utility `./sam2p' is now built gmake install # optional, may not work @@ -772,7 +772,7 @@ To build sam2p: 8. Run - ./configure --enable-gif --enable-lzw + ./configure make 9. The file sam2p.exe is now created in the current directory. Use it. You @@ -1649,10 +1649,11 @@ A3. Check that sam2p has been compiled with GIF support: run sam2p, and Available Loaders: ... GIF ... - If GIF doesn't appear in the line, please recompile sam2p with: + GIF and LZW are enabled by default. If your binary was built with + --disable-gif, recompile without that flag: make clean - ./configure --enable-gif --enable-lzw + ./configure make cp sam2p /usr/local/bin @@ -2017,17 +2018,12 @@ A16. Please send an e-mail to the author (pts@fazekas.hu, see more in -- if you have a similar input image, for which sam2p works fine, attach it to the bug report -Q17. How long does the LZW patent held by Unisys last? +Q17. How long did the LZW patent held by Unisys last? -A17. mcb@cloanto.com (author of http://lzw.info) wrote: - - Thank you for your interest and mail. I must stress that the "exact" - answers you may be looking for may come only from lawyers and courts, - and I am none of these. If you consider the IBM, the BT and Unisys US - patents, then the last of the three would be the Unisys one, expiring, - as the article I think mentions, on June 19, 2003, 24:00. There cannot - be other (new) patents on LZW, as far as I know. Please let me know if - you find different information. +A17. The patents have expired worldwide. The Unisys US patent expired on + June 20, 2003; the corresponding patents in Europe, Japan and Canada + expired during 2004. IBM and BT held earlier patents, both already + expired by then. There are no known active patents on LZW. Q18. I want to create an RGB PostScript image, but sam2p creates a Gray one, or it gives me an error message. @@ -2298,15 +2294,16 @@ A36. Yes, it can, but usually not directly. GIF allows a maximum of 256 From out1.gif and out2.gif keep the one with the smaller file size. It is common that convert(1) creates huge GIF files because LZW compression is disabled inside it. sam2p should be compiled with LZW compression - and GIF input/output enabled. To check this, run sam2p, and - examine its console output. It should contain a line: + and GIF input/output enabled (both are on by default). To check this, + run sam2p, and examine its console output. It should contain a line: Available Appliers: ... GIF89a+LZW ... - If GIF89a+LZW doesn't appear in the line, please recompile sam2p with: + If GIF89a+LZW doesn't appear in the line, your binary was built with + --disable-gif and/or --disable-lzw. Recompile without those flags: make clean - ./configure --enable-gif --enable-lzw + ./configure make cp sam2p /usr/local/bin @@ -2473,7 +2470,7 @@ A45. Yes, it is. Use `-m:dpi:144' to have the output EPS or PDF scaled to Q46. Is it legal to use LZW compression? -A46. I think so. Also look at Q17. +A46. Yes. The Unisys patents expired worldwide by mid-2004; see Q17. Q47. Help! I cannot compile it on SunOS/Solaris. I get diff --git a/configure b/configure index 3c1ada4..fca245e 100755 --- a/configure +++ b/configure @@ -803,10 +803,10 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug=val val: no, assert(default), yes, checker - --enable-lzw enable built-in LZW (de)compression (def: no) + --enable-lzw enable built-in LZW (de)compression (def: yes) --enable-zip enable built-in ZIP compression (def: yes) --enable-fax enable built-in Fax compression (def: yes) - --enable-gif enable reading and writing GIF images (def: no) + --enable-gif enable reading and writing GIF images (def: yes) Some influential environment variables: CXX C++ compiler command @@ -1338,7 +1338,10 @@ if test "${enable_gif+set}" = set; then enableval="$enable_gif" fi; -if test x"$enable_gif" = x"yes"; then +if test x"$enable_gif" = x"no"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF @@ -1349,11 +1352,6 @@ _ACEOF #define USE_OUT_GIF 1 _ACEOF - { echo "$as_me:$LINENO: WARNING: GIF is a resistered trademark of Compuserve; ask permission from them to use it!" >&5 -echo "$as_me: WARNING: GIF is a resistered trademark of Compuserve; ask permission from them to use it!" >&2;} -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi ac_ext=cc @@ -7471,23 +7469,7 @@ if test "$no_create" != yes; then fi -rm -f Makedep -ac_n="${ac_n:-$ECHO_N}" -echo $ac_n "running ${MAKE:-make} Makedep.force""... $ac_c" 1>&6 -echo "configure:7504: running ${MAKE:-make} Makedep.force" >&5 -if >&5 2>&5 ${MAKE:-make} Makedep.force; then : - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 - -else - echo "$as_me:$LINENO: result: error" >&5 -echo "${ECHO_T}error" >&6 - { { echo "$as_me:$LINENO: error: cannot compute depends" >&5 -echo "$as_me: error: cannot compute depends" >&2;} - { (exit 1); exit 1; }; } -fi - echo "configure:7517: all OK" >&5 -echo "configure done. Now you should run: $MAKE; $MAKE install" +echo "configure done. Now you should run: ${MAKE:-make}; ${MAKE:-make} install" diff --git a/configure.in b/configure.in index 3bf7808..9a98ba7 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ AC_PTS_ENABLE_DEBUG AC_MSG_CHECKING([for --enable-lzw]) AC_ARG_ENABLE(lzw, - [ --enable-lzw enable built-in LZW (de)compression (def: no)], + [ --enable-lzw enable built-in LZW (de)compression (def: yes)], [], []) if test x1 = x"`perl -e 'print time>1056165811'`"; then # After 19 June 2003: default: yes @@ -67,15 +67,14 @@ fi AC_MSG_CHECKING([for --enable-gif]) AC_ARG_ENABLE(gif, - [ --enable-gif enable reading and writing GIF images (def: no)], + [ --enable-gif enable reading and writing GIF images (def: yes)], [], []) -if test x"$enable_gif" = x"yes"; then +if test x"$enable_gif" = x"no"; then + AC_MSG_RESULT(no) +else AC_MSG_RESULT(yes) AC_DEFINE(USE_IN_GIF) AC_DEFINE(USE_OUT_GIF) - AC_MSG_WARN(GIF is a resistered trademark of Compuserve; ask permission from them to use it!) -else - AC_MSG_RESULT(no) fi dnl Checks for programs. @@ -215,10 +214,7 @@ dnl AC_OUTPUT(config.h) -- bad!! dnl skipping AC_OUTPUT -- bad!! AC_OUTPUT(Makehelp) -dnl AC_PTS_RUN_OK([perl -x -S ./ccdep.pl $CXX], [], [AC_MSG_ERROR(cannot compute depends)]) -rm -f Makedep -AC_PTS_RUN_OK([${MAKE:-make} Makedep.force], [], [AC_MSG_ERROR(cannot compute depends)]) AC_PTS_OK -echo "configure done. Now you should run: $MAKE; $MAKE install" +echo "configure done. Now you should run: ${MAKE:-make}; ${MAKE:-make} install" dnl end of configure.in diff --git a/gensio.cpp b/gensio.cpp index 69d58ce..e38f20a 100644 --- a/gensio.cpp +++ b/gensio.cpp @@ -16,7 +16,9 @@ extern "C" int _l_stat(const char *file_name, struct stat *buf); /* OK: Imp: not in ANSI C, but we cannot emulate it! */ extern "C" int _v_s_n_printf ( char *str, size_t n, const char *format, va_list ap ); #else -#undef __STRICT_ANSI__ /* for __MINGW32__ */ +#ifdef __MINGW32__ +#undef __STRICT_ANSI__ +#endif #define _BSD_SOURCE 1 /* vsnprintf(); may be emulated with fixup_vsnprintf() */ #ifndef __APPLE__ /* SUXX: Max OS X has #ifndef _POSIX_SOURCE around lstat() :-( */ #define _POSIX_SOURCE 1 /* also popen() */