Frank Heckenbach wrote:
Hi,
as I said recently, I wrote a small configure script now.
The script is completely optional, i.e. those who don't want to use
it can configure GRX manually just like before, but those like me
who don't want to edit config files by hand should not need to do
this anymore.
It will just create a link from the appropriate makefile.foo to
Makefile (so you can invoke make without `-f makefile.foo'
afterwards)
but DJGPP has no symlinks ln -s (except for executables).
Replaced usually by copy (needs a test)
and change some settings in makedefs.grx, and if Pascal
support is enabled, also the `{$L}' directives in grx.pas and
graph.pas.
Very handy
The problem with djgpp is that it had been intended for users with a
very minimal installation: djdev, gcc (gpc if pascal) and make.
(whence the horrible COMMAND.COM constructs "if exists ... del ...")
We need in addition at least bash, sed, fileutils.
I do not know if there are nowadays users with such a minimal setup.
But it does not harm if used only by an optional configure.
While running the pascal tests I have seen that if we stick to the old
policy it is necessary to introduce -lpng in makefiles to enable the
imgviewer to compile (diff24). Of course these makefiles can be greatly
simplified if one supposes the configure way.
When running imgviewer with djgpp on the images contained in the
test directory it gives very bad results for two reasons:
- the 320x240 screen: this was for old VGA-only setups: everybody
has a VESA/SVGA now.
- BPP should be 24 as in other tests of jpeg/png
With the corrections (diff25) all seems perfect.
Maurice
--
Maurice Lombardi
Laboratoire de Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95
mailto:Maurice.Lombardi@ujf-grenoble.fr
--- pascal/makefile.dj2.orig Thu Dec 13 18:08:18 2001
+++ pascal/makefile.dj2 Thu Dec 13 18:10:02 2001
@@ -21,6 +21,10 @@
ADDON_LIBS += -ljpeg
endif
+ifeq ($(HAVE_LIBPNG),y)
+ ADDON_LIBS += -lpng
+endif
+
ifeq ($(NEED_ZLIB),y)
ADDON_LIBS += -lz
endif
@@ -38,11 +42,13 @@
txt_test.exe \
vir_test.exe \
polytest.exe \
- colortest.exe \
- imgviewer.exe
+ colortest.exe
ifeq ($(HAVE_LIBJPEG),y)
PROGS += jpgtest.exe
+ifeq ($(HAVE_LIBPNG),y)
+ PROGS += imgviewer.exe
+endif
endif
all: $(PROGS)
--- pascal/makefile.lnx.orig Mon Dec 17 17:44:04 2001
+++ pascal/makefile.lnx Mon Dec 17 20:35:56 2001
@@ -21,6 +21,10 @@
ADDON_LIBS += -ljpeg
endif
+ifeq ($(HAVE_LIBPNG),y)
+ ADDON_LIBS += -lpng
+endif
+
ifeq ($(NEED_ZLIB),y)
ADDON_LIBS += -lz
endif
@@ -38,11 +42,13 @@
txt_test \
vir_test \
polytest \
- colortest \
- imgviewer
+ colortest
ifeq ($(HAVE_LIBJPEG),y)
PROGS += jpgtest
+ifeq ($(HAVE_LIBPNG),y)
+ PROGS += imgviewer
+endif
endif
all: $(PROGS)
--- pascal/makefile.x11.orig Mon Dec 17 17:44:04 2001
+++ pascal/makefile.x11 Mon Dec 17 20:35:42 2001
@@ -21,6 +21,10 @@
ADDON_LIBS += -ljpeg
endif
+ifeq ($(HAVE_LIBPNG),y)
+ ADDON_LIBS += -lpng
+endif
+
ifeq ($(NEED_ZLIB),y)
ADDON_LIBS += -lz
endif
@@ -38,11 +42,13 @@
xtxt_test \
xvir_test \
xpolytest \
- xcolortest \
- ximgviewer
+ xcolortest
ifeq ($(HAVE_LIBJPEG),y)
PROGS += xjpgtest
+ifeq ($(HAVE_LIBPNG),y)
+ PROGS += ximgviewer
+endif
endif
all: $(PROGS)
--- pascal/makefile.w32.orig Mon Dec 17 17:44:04 2001
+++ pascal/makefile.w32 Mon Dec 17 20:35:52 2001
@@ -21,6 +21,10 @@
ADDON_LIBS += -ljpeg
endif
+ifeq ($(HAVE_LIBPNG),y)
+ ADDON_LIBS += -lpng
+endif
+
ifeq ($(NEED_ZLIB),y)
ADDON_LIBS += -lz
endif
@@ -38,11 +42,13 @@
txt_test.exe \
vir_test.exe \
polytest.exe \
- colortest.exe \
- imgviewer.exe
+ colortest.exe
ifeq ($(HAVE_LIBJPEG),y)
PROGS += jpgtest.exe
+ifeq ($(HAVE_LIBPNG),y)
+ PROGS += imgviewer.exe
+endif
endif
all: $(PROGS)
--- pascal/makefile.orig Mon Dec 17 17:44:04 2001
+++ pascal/makefile Mon Dec 17 20:32:20 2001
@@ -11,8 +11,8 @@
# Compiler and options on your system
COMPILER = gpc --automake -Wall
-# Needed libraries (at least jpeg and tiff)
-LIBRARIES= -ljpeg -ltiff
+# Needed libraries
+LIBRARIES= -ljpeg -ltiff -lpng -lz
# --------------------------------------------
# I Think, you don't need to change from here
--- pascal/imgviewer.pas.orig Mon Dec 17 17:44:04 2001
+++ pascal/imgviewer.pas Mon Dec 17 18:10:02 2001
@@ -40,14 +40,9 @@
procedure OpenGraph (GWidth, GHeight: Integer);
var Width, Height: Integer;
begin
- {$ifdef DJGPP}
- Width := 320;
- Height := 240;
- {$else}
Width := (GWidth + 7) div 8 * 8;
Height := GHeight;
- {$endif}
- if GrSetMode (GR_Width_Height_Graphics, Width, Height, 0, 0, 0) <> 1 then
+ if GrSetMode (GR_Width_Height_BPP_Graphics, Width, Height, 24, 0, 0) <> 1 then
Error ('could not initialize graphics');
GraphicsActive := True
end;