build FLTK 1.1.7 with gcc 2.95.3 on Fedora7

1.configure,加上CFLAGS是避免gcc用到/usr/include
LDFLAGS="-Wl,-elf2flt=-s65535"\
CFLAGS="-I/sigma/armutils_2.8.0.2/toolchain/include"\
CXXFLAGS="-I/sigma/armutils_2.8.0.2/toolchain/include"\
./configure\
--host=arm-elf\
--prefix=/sigma/nano-x\
--with-x\
--disable-gl\
--disable-shared\
--disable-cygwin\
--x-includes=/usr/include\
--x-libraries=/sigma/nano-x/lib

2.make
CompilingFl_Help_View.cxx...
Fl_Help_View.cxx:In method `void Fl_Help_View::format()':
Fl_Help_View.cxx:1698:internal error--unrecognizable insn:
(insn7905 7902 7901 (set (reg:QI 14 lr)
(mem:QI(plus:SI (reg:SI 12 ip)
(const_int-2712 [0xfffff568])) 0)) -1 (nil)
(nil))
make[1]:*** [Fl_Help_View.o] Error 1

src/Fl_Help_View.cxx
把陣列改小即可,原來為1024
buf[512],// Text buffer
attr[512],// Attribute buffer
wattr[512],// Width attribute buffer
hattr[512],// Height attribute buffer
linkdest[512];// Link destination

3.make again
Fl_GIF_Image.cxx:In method `Fl_GIF_Image::Fl_GIF_Image(const char*)':
Fl_GIF_Image.cxx:379:internal error--unrecognizable insn:
(insn2921 2918 2917 (set (reg:QI 5 r5)
(mem:QI(plus:SI (reg:SI 2 r2)
(const_int-1916 [0xfffff884])) 0)) -1 (nil)
(nil))
make[1]:*** [Fl_GIF_Image.o] Error 1

src/Fl_GIF_Image.cxx
把下面的code移到函數外加上static
//tables used by LZW decompresser:
shortint Prefix[4096];
ucharSuffix[4096];

4.make again again
Linkingfluid...
/sigma/armutils_2.8.0.2/toolchain/arm-elf/bin/ld.real:cannot find -lXext
collect2:ld returned 1 exit status
make[1]:*** [fluid] Error 1
configure
link參數錯誤
LIBS="$LIBS-lXext -lX11 $X_EXTRA_LIBS"
==>
LIBS="$LIBS-lnx11 -lnano-X $X_EXTRA_LIBS"

5.make again again again
Generatingfast_slow.fl...
../fluid/fluid:../fluid/fluid: cannot execute binary file
make[1]:*** [fast_slow.cxx] Error 126
做出來的flarmcode 不能在x86執行是正常的.
test/Makefile相關的src拿掉不要即可.

6.make again agian agian agian
OK,success.

7.make install
===installing fluid ===
InstallingFLUID in /sigma/nano-x/bin...
arm-elf-strip:/sigma/nano-x/bin/fluid: File format not recognized
make[1]:*** [install] Error 1
strip
有問題,拿掉即可.
fluid/Makefile
$(STRIP)$(DESTDIR)$(bindir)/fluid$(EXEEXT)
==>
#$(STRIP) $(DESTDIR)$(bindir)/fluid$(EXEEXT)

8.make install again
OK,success.


你可能感兴趣的:(image,gcc,File,Build,X86)