Bug 689658

Summary: Can't build Ghostscript on Cygwin
Product: Ghostscript Reporter: leonardo <leonardo>
Component: Build ProcessAssignee: Ralph Giles <ralph.giles>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---
Attachments: autogen.log.sh
stdout.txt
stderr.txt
patch for another Cygwin bug
config.log

Description leonardo 2008-01-17 03:25:41 UTC
"bash autogen.sh" hangs (no further activity, just copies stdin to stdout) 
after the following :


checking for GTK+ 2.x... no
checking for X...no
File not found - *.mak
Comment 1 Ray Johnston 2008-01-17 09:43:43 UTC
Created attachment 3709 [details]
autogen.log.sh
Comment 2 Ray Johnston 2008-01-17 09:44:03 UTC
This works for me (testing with rev 8477.

I've attached the complete log I get from:

    ./autogen.sh > autogen .log 2>&1

Note that I _do_ have X11, but I don't know if that is what allows it to work
for me. You may want to add X support on your Cygwin and see if that works.

Comment 3 Ralph Giles 2008-01-17 10:03:41 UTC
Please attach config.log from the failed build.

It should work whether you have X11 or not.
Comment 4 leonardo 2008-01-17 12:52:58 UTC
Created attachment 3710 [details]
stdout.txt

A log from Cygwin - stdout.
Comment 5 leonardo 2008-01-17 12:55:53 UTC
Created attachment 3711 [details]
stderr.txt

A log from Cygwin - stderr.
At end it hang with no activity. If I type any chars, it echoes them to stdout.
But there is a second delay after echoing. It looks ignoring Ctrl-Z, and
terminates with Ctrl-C.
Comment 6 Alex Cherepanov 2008-01-18 20:39:49 UTC
Created attachment 3715 [details]
patch for another Cygwin bug

An old Cygwin defines only some of C99 types in sys/types.h
My Cygwin compiles Ghostscript fine with this patch.
Comment 7 leonardo 2008-02-22 01:12:59 UTC
Current revision HANGS after printing this :

[beg quote]
Continuing with Ghostscript configuration...
checking for GTK+ 2.x... no
checking for X... no
File not found - *.mak
[end quote]

At this state, when I type anything, it copies all to stdout. It looks ignoring 
Ctrl-Z, Ctrl-C, but Break klss the process.
Comment 8 Ray Johnston 2008-02-22 10:17:59 UTC
Works for me. Note that I _do_ have X11 installed on my Cygwin.

Please attach the tail (last 30 or so lines) of your 'config.log'
   use:   tail -30 config.log

Note that the automatic determination of 'fontconfig' doesn't work for me --
./autogen.sh (configure) sets HAVE_FONTCONFIG and also sets the Makefile
macros for the FONTCONFIG_CFLAGS and FONCONFIG_LOBS related for fontconfig,
but this does _NOT_ exist on my system.

Everything works as expected with:  ./autogen.sh --disable-fontconfig

My software versions are:

   gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

   autoconf (GNU Autoconf) 2.61

   CYGWIN_NT-5.1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin

The area of my 'config.log' that is where Igor's configure hangs is:

configure:8883: checking for X
configure:9118: result: libraries /usr/X11R6/lib, headers /usr/X11R6/include
configure:9140: checking whether -R must be followed by a space
configure:9166: gcc -o conftest.exe    conftest.c -ldl -lm  -liconv -lstdc++
-R/usr/X11R6/lib >&5
gcc: unrecognized option `-R/usr/X11R6/lib'
configure:9172: $? = 0
   ...
configure:9207: gcc -o conftest.exe    conftest.c -ldl -lm  -liconv -lstdc++ -R
/usr/X11R6/lib >&5
gcc: unrecognized option `-R'
/usr/X11R6/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status
configure:9213: $? = 1
   ...
configure:9226: result: neither works
configure:9279: gcc -o conftest.exe    conftest.c -ldl -lm  -liconv -lstdc++ 
-L/usr/X11R6/lib -lX11 >&5
configure:9285: $? = 0

Comment 9 leonardo 2008-02-22 13:31:54 UTC
Created attachment 3807 [details]
config.log

Attaching config.log by Henry's request.
Comment 10 Ray Johnston 2008-02-23 13:26:01 UTC
I tracked my problem with fontconfig to a typo in configure.ac (the library 
argument is "-lfontconfg" instead of "-lfontconfig".

Note that Cygwin gcc is, for some reason, much pickier about needing libraries
to be explicitly stated (not automatic as it seems to be on my linux box) and
also causes an error if a -l library isn't found.

---

This typo would not affect Igor's problem which remains a mystery to me, but
only relates the problem I mentioned in comment #8.
Comment 11 Alex Cherepanov 2008-02-23 17:28:59 UTC
The patch from the comment #6 is committed as a rev. 8541.
It compiles only on old Cygwin and cannot affect anything else.

Re the actual bug, Leonardo can run sshd on his Cygwin box to provide remote
access for more Unix-savvy colleagues. 
Comment 12 Ralph Giles 2008-02-25 19:13:04 UTC
re #10, the Linux ELF format allows link references in shared libraries, so you
can omit dependencies in an application's link line and it will still work. This
isn't a common feature on other systems though, so I'm not surprised it doesn't
work on Cygwin.

Likewise, the order of the -l arguments isn't especially important with GNU ld,
but is with many other linkers.

GNU ld does complain (fatally) about missing libraries. Probably this path was
just never exercised.
Comment 13 Alex Cherepanov 2009-09-14 14:29:43 UTC
Current revision (10068) compiles on 32- and 64-bit windows
under Cygwin. Closing as "Works for me".