apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.85k stars 453 forks source link

cannot build ghostscript, compile error #1154

Closed michaelrsweet closed 18 years ago

michaelrsweet commented 19 years ago

Version: 8.15rc3 CUPS.org User: tombork

Cannot build ghostscript:

if [ x != x ]; then LD_RUN_PATH=; export LD_RUN_PATH; fi; \ XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \ FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \ DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \ DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \ DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \ DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \ /bin/sh <./obj/ldt.tr ./obj/gdevopvp.o(.text+0x676): In function opvp_to_utf8': : undefined reference tolibiconv_open' ./obj/gdevopvp.o(.text+0x69f): In function opvp_to_utf8': : undefined reference tolibiconv' ./obj/gdevopvp.o(.text+0x6bd): In function opvp_to_utf8': : undefined reference tolibiconv_close' collect2: ld returned 1 exit status make: *\ [bin/gs] Error 1

libiconv is installed.

Configured with

export CFLAGS='-O2' ./configure \ --target=i486-pc-linux-gnu \ --prefix=/usr/local \ --enable-compiled-inits \ --with-fontpath=/usr/local/share/ghostscript/fonts \ --with-ijs \ --with-gimp-print \ --without-omni \ --without-x

From config.log:

configure:5870: checking for iconv_open configure:5920: gcc -o conftest -O2 conftest.c -lm >&5 configure:5923: $? = 0 configure:5926: test -s conftest configure:5929: $? = 0 configure:5940: result: yes [...] ac_cv_func_iconv_open=yes

Please give me an advice, how I can avoid this error.

der tom

michaelrsweet commented 19 years ago

CUPS.org User: tombork

Solved with

export LDFLAGS="-L/usr/lib -liconv"

But: Install isn't working :(

cp ./lib/../examples/ridt91.eps /usr/local/share/ghostscript/8.15/examples/#inst.28110# trap rm -f /usr/local/share/ghostscript/8.15/examples/#inst.28110# 0 chmod 644 /usr/local/share/ghostscript/8.15/examples/#inst.28110# rm -f /usr/local/share/ghostscript/8.15/examples/ridt91.eps mv /usr/local/share/ghostscript/8.15/examples/#inst.28110# /usr/local/share/ghostscript/8.15/examples/ridt91.eps mkdir -p /usr/local/lib/ghostscript/8.15 /bin/sh -c 'for obj in ; do \ ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done' /bin/sh: -c: line 1: syntax error near unexpected token ;' /bin/sh: -c: line 1:for obj in ; do ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done' make: *\ [install-shared] Error 2

Is it really the rc3? ;)

michaelrsweet commented 19 years ago

CUPS.org User: toshi

I've made a patch for avoid this problem, but I have no enviroment for testing it.Could you please try the attached patch?

You should need autoconf >= 2.52 to try it. $ bzip2 -dc espgs-8.15rc3-source.tar.bz2 | tar xvf - $ cd espgs-8.15rc3/ $ patch -p1 < espgs-r103-configure.ac-iconv.patch $ rm -rf autom4te.cache/ $ ./autogen.sh

Thanks.

michaelrsweet commented 19 years ago

CUPS.org User: tombork

Sorry, the same problem:

./obj/gdevopvp.o(.text+0x676): In function opvp_to_utf8': : undefined reference tolibiconv_open' ./obj/gdevopvp.o(.text+0x69f): In function opvp_to_utf8': : undefined reference tolibiconv' ./obj/gdevopvp.o(.text+0x6bd): In function opvp_to_utf8': : undefined reference tolibiconv_close' collect2: ld returned 1 exit status make: *\ [bin/gs] Error 1

Configure options:

export CFLAGS='-O2' ./configure \ --target=i486-pc-linux-gnu \ --prefix=/usr/local \ --enable-compiled-inits \ --with-fontpath=/usr/local/share/ghostscript/fonts \ --with-ijs \ --with-gimp-print \ --without-omni \ --without-x

If configuring with (--with-libiconv=gnu)

export CFLAGS='-O2' ./configure \ --target=i486-pc-linux-gnu \ --prefix=/usr/local \ --enable-compiled-inits \ --with-fontpath=/usr/local/share/ghostscript/fonts \ --with-ijs \ --with-gimp-print \ --without-omni \ --with-libiconv=gnu \ --without-x

the make is ok.

'make install' is broken like before:

mkdir -p /usr/local/share/ghostscript/8.15/examples for f in \ alphabet.ps chess.ps colorcir.ps doretree.ps escher.ps \ golfer.eps grayalph.ps snowflak.ps tiger.eps vasarely.ps waterfal.ps \ ridt91.eps ;\ do ./src/instcopy -c -m 644 ./lib/../examples/$f /usr/local/share/ghostscript/8.15/examples ;\ done mkdir -p /usr/local/lib/ghostscript/8.15 /bin/sh -c 'for obj in ; do \ ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done' /bin/sh: -c: line 1: syntax error near unexpected token ;' /bin/sh: -c: line 1:for obj in ; do ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done' make: *\ [install-shared] Error 2

Thanks for your help!

der tom

michaelrsweet commented 19 years ago

CUPS.org User: toshi

'make install' is broken like before: Sorry, I have not reproduced such a error with my enviroment. Perhaps, I think that you are using old bash/shell? Please try the attached patch(espgs-r103-unixinst.patch)

Thanks

michaelrsweet commented 19 years ago

CUPS.org User: htl10

regarding bug 1151 (build problem on tru64), while I can install libiconv, I really have no need of opvp, and I should not need to install a new library for something I don't need, so it is still a problem with the autoconf script - building opvp should be optional.

(I am happy to install libconv for testing the validity of the patch, but I don't agree it is the right approach - autoconf should detect the absence of libiconv and disable opvp since it is optional, instead of requiring libconv to be there).

michaelrsweet commented 19 years ago

CUPS.org User: tombork

Patch espgs-r103-unixinst.patch is not enough to correct the install problem:

/bin/sh -c 'if test -n "" ; then for obj in ; do \ ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done ; fi' /bin/sh: -c: line 1: syntax error near unexpected token ;' /bin/sh: -c: line 1:if test -n "" ; then for obj in ; do ./src/instcopy -c -m 755 $obj /usr/local/lib/ghostscript/8.15/; done ; fi' make: *\ [install-shared] Error 2

For libiconv: Do you know configure.in from samba? Samba compiles fine here with libiconv without the need to use special configure switches.

der tom

michaelrsweet commented 19 years ago

CUPS.org User: toshi

Patch espgs-r103-unixinst.patch is not enough to correct the install problem: Sorry for unsatisfied patch.I've made a patch again and put as "espgs-r103-unixinst-2.patch".Could you test this again?

For libiconv: Do you know configure.in from samba? Samba compiles fine here with >libiconv without the need to use special configure switches.

Thanks for suggestion.I'm reading the code of samba now.It seems complicatedly to me...

Thanks.

michaelrsweet commented 19 years ago

CUPS.org User: toshi

I've update the configure.ac-iconv.patch as "espgs-r103-configure.ac-iconv-2.patch" which improved iconv detection. Do not include opvp/oprp driver if no iconv/libiconv in the system. Thanks

michaelrsweet commented 19 years ago

CUPS.org User: toshi

I correct the following comments written last time.

Do not include opvp/oprp driver if no iconv/libiconv in the system. The right comment is as follows. "This patch do not include opvp/oprp driver if no iconv/libiconv in the system." Sorry...

Anyway, has anyone tried this patch?

michaelrsweet commented 18 years ago

CUPS.org User: picobyte

nope, it still breaks.

./obj/echogs -w ./obj/ldt.tr -n - gcc -L/usr/X11R6/lib -L/usr/X11R6/lib -o ./bin/gs ./obj/echogs -a ./obj/ldt.tr -n -s ./obj/gs.o -s cat ./obj/ld.tr >>./obj/ldt.tr ./obj/echogs -a ./obj/ldt.tr -s - -Wl,-rpath,/usr/lib -lcupsimage -ltiff -ljpeg -lpng -lm -lz -lcups -lssl -lcrypto -lnsl -ldl -lm -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lstdc++ -lm if [ x != x ]; then LD_RUN_PATH=; export LD_RUN_PATH; fi; \ XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \ FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \ DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \ DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \ DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \ DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \ /bin/sh <./obj/ldt.tr ./obj/gdevopvp.o(.text+0x4a16): In function opvp_to_utf8': : undefined reference tolibiconv_open' ./obj/gdevopvp.o(.text+0x4a55): In function opvp_to_utf8': : undefined reference tolibiconv' ./obj/gdevopvp.o(.text+0x4a6f): In function opvp_to_utf8': : undefined reference tolibiconv_close' collect2: ld returned 1 exit status make: *\ [bin/gs] Error 1

I'm only a bit of a programmer, but aren't the flags and DEVICE_DEVS## supposed to have a value assigned? they have normal values when other .o files are created.

michaelrsweet commented 18 years ago

CUPS.org User: picobyte

Oh, I patched it with the espgs-r103-configure.ac-iconv-2.patch file only. Thats what I was supposed to do, wasn't it?

michaelrsweet commented 18 years ago

CUPS.org User: toshi

Thats what I was supposed to do, wasn't it? You should apply only a patch of espgs-r103-configure.ac-iconv-2.patch.The test result of iconv/libiconv is stored in config.log file.Please check it and let me know. Anyway, please let me know what kind of OS you use.

michaelrsweet commented 18 years ago

CUPS.org User: toshi

I've updated the patch as "espgs-r106-configure.ac-iconv-3.patch".If you got any problem with this patch, please let me know. Thanks.

michaelrsweet commented 18 years ago

CUPS.org User: mike

Fixed the priority on this - compilation problems should be priority 3...

michaelrsweet commented 18 years ago

CUPS.org User: bootsy52

I have the same problem in compiling espgs (Are these patches in espgs-8.15-rc4 ?)

I have libiconv installed in /usr/local/lib however I can successfully build espgs-8.15-rc4 with

LDFLAGS="-L/usr/local/lib -liconv"

michaelrsweet commented 18 years ago

CUPS.org User: bootsy52

BTW, OS: OpenBSD-3.7 Shell: Bash-3.0

michaelrsweet commented 18 years ago

CUPS.org User: mike

These changes are in the Subversion repository. Please test against rc4 and let us know if the problems persist...

michaelrsweet commented 18 years ago

CUPS.org User: bootsy52

Of course I have tested this with 8.15-rc4 before I posted the message. So the error is still present in 8.15-rc4

michaelrsweet commented 18 years ago

CUPS.org User: toshi

The patches that I made(espgs-r103-unixinst-2.patch,espgs-r106-configure.ac-iconv-3.patch) has not been included to RC4 yet. Could you please apply these patches with RC4 and test again? Thanks.

michaelrsweet commented 18 years ago

CUPS.org User: mike

Fixed in Subversion repository.

michaelrsweet commented 18 years ago

"espgs-r103-configure.ac-iconv.patch":

--- espgs/src/configure.ac.orig 2005-05-11 00:53:11.000000000 +0900 +++ espgs/src/configure.ac 2005-05-11 14:35:33.000000000 +0900 @@ -179,7 +179,48 @@ dnl ------------------------------------

AC_CHECK_LIB(m, cos) dnl AC_CHECK_LIB(pthread, pthread_create) -AC_CHECK_FUNC(iconv_open) +dnl * Tests for iconv * +AC_ARG_WITH(libiconv,

michaelrsweet commented 18 years ago

"espgs-r103-unixinst.patch":

--- espgs/src/unixinst.mak.orig 2005-05-14 02:58:51.000000000 +0900 +++ espgs/src/unixinst.mak 2005-05-14 03:08:11.000000000 +0900 @@ -168,6 +168,5 @@ ridt91.eps ;\

install-shared: $(GS_SHARED_OBJS) -mkdir -p $(gssharedir)

- $(INSTALL_PROGRAM) $$obj $(gssharedir)/; done'

michaelrsweet commented 18 years ago

"espgs-r103-unixinst-2.patch":

--- espgs/src/unixinst.mak.orig 2005-05-14 02:58:51.000000000 +0900 +++ espgs/src/unixinst.mak 2005-05-17 13:24:56.000000000 +0900 @@ -168,6 +168,5 @@ ridt91.eps ;\

install-shared: $(GS_SHARED_OBJS) -mkdir -p $(gssharedir)

- $(INSTALL_PROGRAM) $$obj $(gssharedir)/; done'

michaelrsweet commented 18 years ago

"espgs-r103-configure.ac-iconv-2.patch":

--- espgs/src/configure.ac.orig 2005-05-11 00:53:11.000000000 +0900 +++ espgs/src/configure.ac 2005-05-17 16:19:04.000000000 +0900 @@ -179,7 +179,48 @@ dnl ------------------------------------

AC_CHECK_LIB(m, cos) dnl AC_CHECK_LIB(pthread, pthread_create) -AC_CHECK_FUNC(iconv_open) +dnl * Tests for iconv * +AC_ARG_WITH(libiconv,

michaelrsweet commented 18 years ago

"espgs-r106-configure.ac-iconv-3.patch":

--- espgs/src/configure.ac.orig 2005-08-01 13:36:20.000000000 +0900 +++ espgs/src/configure.ac 2005-08-01 13:30:53.000000000 +0900 @@ -179,7 +179,48 @@ dnl ------------------------------------

AC_CHECK_LIB(m, cos) dnl AC_CHECK_LIB(pthread, pthread_create) -AC_CHECK_FUNC(iconv_open) +dnl * Tests for iconv * +AC_ARG_WITH(libiconv,