[devel] Don't try to use version-script with cygwin/mingw.

Revised contrib/gregbook to work under cygwin/mingw.
This commit is contained in:
Glenn Randers-Pehrson 2010-08-11 08:06:11 -05:00
parent b757b1b5ee
commit 9f65059a5b
9 changed files with 1070 additions and 809 deletions

View File

@ -337,9 +337,12 @@ version 1.5.0beta39 [August 2, 2010]
version 1.5.0beta40 [August 6, 2010] version 1.5.0beta40 [August 6, 2010]
Correct use of _WINDOWS_ in pngconf.h Correct use of _WINDOWS_ in pngconf.h
Removed png_mem_ #defines; they are no longer used. Removed png_mem_ #defines; they are no longer used.
Added the sRGB and cHRM chunks to pngtest.png Added the sRGB chunk to pngtest.png
version 1.5.0beta41 [August 11, 2010] version 1.5.0beta41 [August 11, 2010]
Added the cHRM chunk to pngtest.png
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net: Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit (subscription required; visit

View File

@ -2819,9 +2819,12 @@ version 1.5.0beta39 [August 2, 2010]
version 1.5.0beta40 [August 6, 2010] version 1.5.0beta40 [August 6, 2010]
Correct use of _WINDOWS_ in pngconf.h Correct use of _WINDOWS_ in pngconf.h
Removed png_mem_ #defines; they are no longer used. Removed png_mem_ #defines; they are no longer used.
Added the sRGB and cHRM chunks to pngtest.png Added the sRGB chunk to pngtest.png
version 1.5.0beta41 [August 11, 2010] version 1.5.0beta41 [August 11, 2010]
Added the cHRM chunk to pngtest.png
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -283,7 +283,6 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
@ -991,8 +990,7 @@ distdir: $(DISTFILES)
top_distdir="$(top_distdir)" distdir="$(distdir)" \ top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook dist-hook
-test -n "$(am__skip_mode_fix)" \ -test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
@ -1036,17 +1034,17 @@ dist dist-all: distdir
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \ *.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \ *.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac

1656
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -39,11 +39,10 @@ AC_PROG_LD
AC_PROG_CPP AC_PROG_CPP
AC_CHECK_TOOL(SED, sed, :) AC_CHECK_TOOL(SED, sed, :)
AC_CHECK_TOOL(AWK, awk, :) AC_CHECK_TOOL(AWK, awk, :)
AC_LIBTOOL_WIN32_DLL
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_LIBTOOL LT_INIT([win32-dll])
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
@ -65,6 +64,15 @@ LIBPNG_DEFINES=$LIBPNG_DEFINES
AC_SUBST(LIBPNG_DEFINES) AC_SUBST(LIBPNG_DEFINES)
AC_MSG_CHECKING([if libraries can be versioned]) AC_MSG_CHECKING([if libraries can be versioned])
# Special case for PE/COFF platforms: ld reports
# support for version-script, but doesn't actually
# DO anything with it.
case $host in
*cygwin* | *mingw32* )
have_ld_version_script=no
AC_MSG_RESULT(no)
;;
* )
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test "$GLD"; then if test "$GLD"; then
have_ld_version_script=yes have_ld_version_script=yes
@ -74,6 +82,9 @@ else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_WARN(*** You have not enabled versioned symbols.) AC_MSG_WARN(*** You have not enabled versioned symbols.)
fi fi
;;
esac
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
if test "$have_ld_version_script" = "yes"; then if test "$have_ld_version_script" = "yes"; then

View File

@ -165,7 +165,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
rpng is a simple PNG viewer that can display transparent PNGs with a rpng is a simple PNG viewer that can display transparent PNGs with a
specified background color; for example, specified background color; for example,
rpng -bgcolor #ff0000 toucan.png rpng -bgcolor \#ff0000 toucan.png
would display the image with a red background. rpng2 is a progressive would display the image with a red background. rpng2 is a progressive
viewer that simulates a web browser in some respects; it can display viewer that simulates a web browser in some respects; it can display

View File

@ -140,7 +140,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
* version recognizes more chunks, add them to this list. If a * version recognizes more chunks, add them to this list. If a
* future version of readpng2.c recognizes more chunks, delete them * future version of readpng2.c recognizes more chunks, delete them
* from this list. */ * from this list. */
static const png_byte chunks_to_ignore[] = { static /* const */ png_byte chunks_to_ignore[] = {
99, 72, 82, 77, '\0', /* cHRM */ 99, 72, 82, 77, '\0', /* cHRM */
104, 73, 83, 84, '\0', /* hIST */ 104, 73, 83, 84, '\0', /* hIST */
105, 67, 67, 80, '\0', /* iCCP */ 105, 67, 67, 80, '\0', /* iCCP */

View File

@ -85,7 +85,33 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <windows.h> #include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int repl_getch( void )
{
char ch;
int fd = fileno(stdin);
struct termio old_tty, new_tty;
ioctl(fd, TCGETA, &old_tty);
new_tty = old_tty;
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
ioctl(fd, TCSETA, &new_tty);
fread(&ch, 1, sizeof(ch), stdin);
ioctl(fd, TCSETA, &old_tty);
return ch;
}
#define _getch repl_getch
#else
#include <conio.h> /* only for _getch() */ #include <conio.h> /* only for _getch() */
#endif
/* #define DEBUG : this enables the Trace() macros */ /* #define DEBUG : this enables the Trace() macros */
@ -153,7 +179,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename = (char *)NULL; filename = (char *)NULL;
#ifndef __CYGWIN__
/* First reenable console output, which normally goes to the bit bucket /* First reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the * for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical * app. Thanks to David.Geldreich@realviz.com for supplying the magical
@ -162,6 +188,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole(); AllocConsole();
freopen("CONOUT$", "a", stderr); freopen("CONOUT$", "a", stderr);
freopen("CONOUT$", "a", stdout); freopen("CONOUT$", "a", stdout);
#endif
/* Next set the default value for our display-system exponent, i.e., /* Next set the default value for our display-system exponent, i.e.,
@ -279,7 +306,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */ /* print usage screen if any errors up to this point */
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
readpng_version_info(); readpng_version_info();
@ -293,11 +322,15 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n" "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
"\t\t used with transparent images\n" "\t\t used with transparent images\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen.\n" "Press Q or Esc to quit this usage screen.\n"
#endif
"\n", PROGNAME, default_display_exponent); "\n", PROGNAME, default_display_exponent);
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(1); exit(1);
} }
@ -333,18 +366,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, PROGNAME ": aborting.\n"); fprintf(stderr, PROGNAME ": aborting.\n");
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(2); exit(2);
} else { } else {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
#ifndef __CYGWIN__
fprintf(stderr, fprintf(stderr,
"\n [console window: closing this window will terminate %s]\n\n", "\n [console window: closing this window will terminate %s]\n\n",
PROGNAME); PROGNAME);
#endif
} }
@ -417,7 +456,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* wait for the user to tell us when to quit */ /* wait for the user to tell us when to quit */
printf( printf(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); #ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
#else
"Done. Press mouse button 1 (within image window) to quit.\n"
#endif
);
fflush(stdout); fflush(stdout);
while (GetMessage(&msg, NULL, 0, 0)) { while (GetMessage(&msg, NULL, 0, 0)) {

View File

@ -96,7 +96,33 @@
#include <time.h> #include <time.h>
#include <math.h> /* only for PvdM background code */ #include <math.h> /* only for PvdM background code */
#include <windows.h> #include <windows.h>
#ifdef __CYGWIN__
/* getch replacement. Turns out, we don't really need this,
* but leave it here if we ever enable any of the uses of
* _getch in the main code
*/
#include <unistd.h>
#include <termio.h>
#include <sys/ioctl.h>
int repl_getch( void )
{
char ch;
int fd = fileno(stdin);
struct termio old_tty, new_tty;
ioctl(fd, TCGETA, &old_tty);
new_tty = old_tty;
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
ioctl(fd, TCSETA, &new_tty);
fread(&ch, 1, sizeof(ch), stdin);
ioctl(fd, TCSETA, &old_tty);
return ch;
}
#define _getch repl_getch
#else
#include <conio.h> /* only for _getch() */ #include <conio.h> /* only for _getch() */
#endif
/* all for PvdM background code: */ /* all for PvdM background code: */
#ifndef PI #ifndef PI
@ -270,7 +296,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename = (char *)NULL; filename = (char *)NULL;
memset(&rpng2_info, 0, sizeof(mainprog_info)); memset(&rpng2_info, 0, sizeof(mainprog_info));
#ifndef __CYGWIN__
/* Next reenable console output, which normally goes to the bit bucket /* Next reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the * for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical * app. Thanks to David.Geldreich@realviz.com for supplying the magical
@ -279,7 +305,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
AllocConsole(); AllocConsole();
freopen("CONOUT$", "a", stderr); freopen("CONOUT$", "a", stderr);
freopen("CONOUT$", "a", stdout); freopen("CONOUT$", "a", stdout);
#endif
/* Set the default value for our display-system exponent, i.e., the /* Set the default value for our display-system exponent, i.e., the
* product of the CRT exponent and the exponent corresponding to * product of the CRT exponent and the exponent corresponding to
@ -413,7 +439,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* print usage screen if any errors up to this point */ /* print usage screen if any errors up to this point */
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
readpng2_version_info(); readpng2_version_info();
@ -432,16 +460,23 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
" -timing\tenables delay for every block read, to simulate modem\n" " -timing\tenables delay for every block read, to simulate modem\n"
"\t\t download of image (~36 Kbps)\n" "\t\t download of image (~36 Kbps)\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n" "\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
#ifndef __CYGWIN__
"Press Q or Esc to quit this usage screen. ", "Press Q or Esc to quit this usage screen. ",
#else
,
#endif
PROGNAME, PROGNAME,
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) #if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
!(defined(__CYGWIN__) || defined(__MINGW32__))
(int)strlen(PROGNAME), " ", (int)strlen(PROGNAME), " ",
#endif #endif
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat); (int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
fflush(stderr); fflush(stderr);
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(1); exit(1);
} }
@ -478,18 +513,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
if (error) { if (error) {
#ifndef __CYGWIN__
int ch; int ch;
#endif
fprintf(stderr, PROGNAME ": aborting.\n"); fprintf(stderr, PROGNAME ": aborting.\n");
#ifndef __CYGWIN__
do do
ch = _getch(); ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B); while (ch != 'q' && ch != 'Q' && ch != 0x1B);
#endif
exit(2); exit(2);
} else { } else {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname); fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
#ifndef __CYGWIN__
fprintf(stderr, fprintf(stderr,
"\n [console window: closing this window will terminate %s]\n\n", "\n [console window: closing this window will terminate %s]\n\n",
PROGNAME); PROGNAME);
#endif
fflush(stderr); fflush(stderr);
} }
@ -1132,7 +1173,12 @@ static void rpng2_win_finish_display()
rpng2_info.state = kDone; rpng2_info.state = kDone;
printf( printf(
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"); #ifndef __CYGWIN__
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
#else
"Done. Press mouse button 1 (within image window) to quit.\n"
#endif
);
fflush(stdout); fflush(stdout);
} }