Cygwin et zlibc

Cygwin et zlibc - Divers - Programmation

Marsh Posté le 03-06-2011 à 21:02:16    

Bonsoir,
 
Quelqu'un pourrait m'aider à compiler zlibc sous cygwin en gcc /usr/local/cross/gcc-3.3.4_glibc-2.3.2/arm-linux/bin/gcc ?
 
Je ne m'en sort pas, il faut dire que je ne maitrise pas les makefile et cygwin.
 
J'obtiens ceci en compilation :
 
$ make
/usr/local/cross/gcc-3.3.4_glibc-2.3.2/arm-linux/bin/gcc -g -O2 -O4 -Wall -DHAVE
_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Di686 -Dpc -Dcygwin -I. -I. -fpic -c
open.c
In file included from open.c:10:
sysincludes.h:32:23: ansidecl.h: No such file or directory
make: *** [open.o] Error 1
 
 
Et le makefile est celui-ci :
 

Code :
  1. #
  2. #       Makefile for Zlibc
  3. #
  4. # do not edit below this line
  5. # =============================================================================
  6. SHELL = /bin/sh
  7. top_srcdir=.
  8. srcdir=.
  9. prefix      = /usr/local
  10. exec_prefix = ${prefix}
  11. bindir      = ${exec_prefix}/bin
  12. infodir     = ${prefix}/info
  13. mandir      = ${prefix}/man
  14. libdir      = /usr/local/lib
  15. CC  = /usr/local/cross/gcc-3.3.4_glibc-2.3.2/arm-linux/bin/gcc
  16. #CC       = gcc
  17. CPPFLAGS =
  18. DEFS     = -DHAVE_CONFIG_H
  19. HOST_ID  = -Di686 -Dpc -Dcygwin
  20. LDFLAGS  =
  21. LIBS     = -ldl
  22. SHLIB    =
  23. DEFS     = -DHAVE_CONFIG_H -DSYSCONFDIR=\"${prefix}/etc\" $(HOST_ID)
  24. SHAREDCFLAGS = -nostdlib -shared
  25. LN_S     = ln -s
  26. INSTALL         = /usr/bin/install -c
  27. INSTALL_PROGRAM = ${INSTALL}
  28. INSTALL_DATA    = ${INSTALL} -m 644
  29. INSTALL_INFO = /usr/bin/install-info
  30. MAKEINFO = makeinfo
  31. TEXI2DVI = texi2dvi
  32. TEXI2HTML = texi2html
  33. version=0.9k
  34. AIXLDFLAGS = -L. -bI:./syscall.exp  -bnodelcsect -bnso -bI:/lib/syscalls.exp
  35. OBJECTS= open.o altnames.o access.o stat.o \
  36. readdir.o readlink.o \
  37. unlink.o rename.o \
  38. chmod.o chown.o link.o \
  39. symlink.o utime.o \
  40. filetype.o zlibc.conf.o \
  41. parseconfig.o strsep.o \
  42. getxattr.o lgetxattr.o \
  43. setxattr.o lsetxattr.o \
  44. listxattr.o llistxattr.o \
  45. removexattr.o lremovexattr.o
  46. CO_OBJECTS= compile_config.o printconfig.o strsep.o
  47. CFLAGS   =-g -O2 -O4 -Wall $(DEFS) -I. -I. -fpic
  48. MAN3=zlibc.3
  49. MAN5=zlibc.conf.5
  50. MAN1EXT = 1
  51. MAN1DIR = $(mandir)/man${MAN1EXT}
  52. MAN3EXT = 3
  53. MAN3DIR = $(mandir)/man${MAN3EXT}
  54. MAN5EXT = 5
  55. MAN5DIR = $(mandir)/man${MAN5EXT}
  56. all: uncompress.so
  57. zlibc.3 zlibc.conf.5: zlibc.texi
  58. $(top_srcdir)/mkmanpages
  59. man: zlibc.3 zlibc.conf.5
  60. $(OBJECTS) printconfig.o compile_config.o: \
  61. zlibc.h config.h sysincludes.h params.h direct_sys.h
  62. stat.o: \
  63. stat_tmpl.c stat.c
  64. readdir.o: \
  65. readdir.c readdir_tmpl.c
  66. %.o: %.c zlibc.h config.h sysincludes.h params.h
  67. $(CC) $(CFLAGS) -c $<
  68. compile_config: $(CO_OBJECTS)
  69. $(CC) $(CFLAGS) -s -o $@ $(CO_OBJECTS)
  70. %.c: %.sample compile_config
  71. ./compile_config $< >$@
  72. uncompress.so: $(OBJECTS)
  73. $(CC) -o $@ $(CFLAGS) $(SHAREDCFLAGS) $(OBJECTS) $(LIBS) -lc
  74. aix-uncompress.so: $(OBJECTS) aix-syscall.shr.o
  75. $(CC) -o $@ $(CFLAGS) $(SHAREDCFLAGS) $(OBJECTS) -lc $(AIXLDFAGS)
  76. %.exp: %.tmpl
  77. echo "#!`pwd`/aix-syscall.shr.o" > $@
  78. cat $<  >>$@
  79. %.shr.o: %.o aix-syscall.exp
  80. ld -o $@ -bM:SRE -T512 -bE:aix-syscall.exp -bI:/lib/syscalls.exp -bnodelcsect $<
  81. mostlyclean:
  82. rm -f *. *~ image2 libimage jump_map \
  83. subst_map image setaddress inject set_datastart library \
  84. testfile zlibc.conf.c \
  85. compile_config config.c libtype libstart libstart2 $(OBJECTS)
  86. clean: mostlyclean
  87. rm -f  uncompress.so  \
  88. zlibc.so zlibc.dvi *.html *.info*
  89. texclean:
  90. -rm zlibc.aux zlibc.toc zlibc.log
  91. -rm zlibc.cps zlibc.pgs zlibc.vrs
  92. $(OBJECTS): zlibc.h config.h
  93. info: zlibc.info
  94. %.info: %.texi
  95. $(MAKEINFO) -I$(srcdir) $< --no-split --output=$@
  96. dvi: zlibc.dvi
  97. %.dvi: %.texi
  98. $(TEXI2DVI) $<
  99. html: zlibc.html zlibc_toc.html
  100. %.html %_toc.html: %.texi
  101. $(TEXI2HTML) $<
  102. # Don't cd, to avoid breaking install-sh references.
  103. install-info: info
  104. $(top_srcdir)/mkinstalldirs $(infodir)
  105. if test -f zlibc.info; then \
  106.   for i in zlibc.info*; do \
  107.     $(INSTALL_DATA) $$i $(infodir)/$$i; \
  108.   done; \
  109. else \
  110.   for i in $(srcdir)/zlibc.info*; do \
  111.     $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
  112.   done; \
  113. fi; \
  114. if [ -n "$(INSTALL_INFO)" ] ; then \
  115.  if [ -f $(infodir)/dir.info ] ; then \
  116.   $(INSTALL_INFO) $(infodir)/zlibc.info $(infodir)/dir.info; \
  117.  fi; \
  118.  if [ -f $(infodir)/dir ] ; then \
  119.   $(INSTALL_INFO) $(infodir)/zlibc.info $(infodir)/dir; \
  120.  fi; \
  121. fi
  122. uninstall-info:
  123. cd $(infodir) && rm -f zlibc.info*
  124. install: $(libdir)/uncompress.so install-man \
  125.  install-info install-bin
  126. uninstall: uninstall-bin uninstall-man uninstall-links
  127. distclean: clean
  128. rm -f config.cache config.h config.status config.log Makefile
  129. maintainer-clean: distclean
  130. $(libdir)/uncompress.so: uncompress.so
  131. rm $(libdir)/old-uncompress.so || true 2>/dev/null
  132. ln $(libdir)/uncompress.so $(libdir)/old-uncompress.so || true 2>/dev/null
  133. $(top_srcdir)/mkinstalldirs $(libdir)
  134. rm $(libdir)/uncompress-$(version).so || true 2>/dev/null
  135. $(INSTALL_PROGRAM) uncompress.so $(libdir)/uncompress-$(version).so
  136. ln -f $(libdir)/uncompress-$(version).so $(libdir)/uncompress.so
  137. chmod 4755 $(libdir)/uncompress-$(version).so
  138. install-bin: $(libdir)/uncompress.so
  139. install-man:
  140. @$(top_srcdir)/mkinstalldirs $(MAN1DIR)
  141. @for j in $(MAN1); do \
  142.  $(INSTALL_DATA) $(srcdir)/$$j $(MAN1DIR)/$$j ; \
  143.  echo $(MAN1DIR)/$$j ; \
  144. done
  145. @$(top_srcdir)/mkinstalldirs $(MAN3DIR)
  146. @for j in $(MAN3); do \
  147.  $(INSTALL_DATA) $(srcdir)/$$j $(MAN3DIR)/$$j ; \
  148.  echo $(MAN3DIR)/$$j ; \
  149. done
  150. @$(top_srcdir)/mkinstalldirs $(MAN5DIR)
  151. @for j in $(MAN5); do \
  152.  $(INSTALL_DATA) $(srcdir)/$$j $(MAN5DIR)/$$j ; \
  153.  echo $(MAN5DIR)/$$j ; \
  154. done
  155. uninstall-man:
  156. @for j in $(MAN1); do \
  157.  rm -f $(MAN1DIR)/$$j ; \
  158.  echo $(MAN1DIR)/$$j ; \
  159. done
  160. @for j in $(MAN3); do \
  161.  rm -f $(MAN3DIR)/$$j ; \
  162.  echo $(MAN3DIR)/$$j ; \
  163. done
  164. @for j in $(MAN5); do \
  165.  rm -f $(MAN5DIR)/$$j ; \
  166.  echo $(MAN5DIR)/$$j ; \
  167. done
  168. uninstall-links:
  169. @for j in $(LINKS); \
  170.  do rm -f $(bindir)/$$j ; \
  171.  echo $(bindir)/$$j ; \
  172. done
  173. uninstall-lib:
  174. rm $(libdir)/uncompress.so $(libdir)/uncompress-$(version).so
  175. depend: $(SRCS)
  176. makedepend -- $(CFLAGS) -- $^
  177. check:
  178. echo No self tests included
  179. # check target needed even if empty, in order to make life easyer for
  180. # automatic tools to install GNU soft


 
Merci pour le coup de main éventuel.
 

Reply

Marsh Posté le 03-06-2011 à 21:02:16   

Reply

Marsh Posté le 03-06-2011 à 22:03:13    

Hmm, il y a un truc que je ne suis pas sûr de comprendre. Cygwin est un système qui permet d'avoir l'API unix sous Windows. Or tu compiles sous Unix via un cross compilateur arm. Je ne vois vraiment pas ce que Windows vient faire là dedans...
 
Sinon ton erreur est assez banale: ton compilo ne trouve pas le fichier "ansidecl.h" qui semble être un fichier standard (je l'ai sur tous les compilos sur mon système). Tu devrais modifier la ligne:

CPPFLAGS = -I/usr/local/cross/<la racine ou se trouve ansidecl>

Reply

Marsh Posté le 04-06-2011 à 08:01:27    

Merci tpierron pour ton aide, mais j'avais bien précisé que je ne maitrisais pas du tout les makefile.
 
Bon, on a évolué, mais visiblement mon environnement n'est pas bien adapté à cette compilation ET POURTANT je souhaite continuer ainsi, alors que dois encore adapter pour que ça marche ?
J'ai bien modifié le makefile comme proposé et ainsi appris que CPPFLAGS s'intéresse au pre-compilateur (alors que CXXFLAGS au C++, tu parles d'une bonne blague). J'ai aussi modifier le reste de la compilation pour tenir compte de CPPFLAGS, est-ce bon ?
 

Code :
  1. ...
  2. CPPFLAGS = -I/usr/include
  3. ...
  4. %.o: %.c zlibc.h config.h sysincludes.h params.h
  5. $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
  6. compile_config: $(CO_OBJECTS)
  7. $(CC) $(CPPFLAGS) $(CFLAGS) -s -o $@ $(CO_OBJECTS)
  8. %.c: %.sample compile_config
  9. ./compile_config $< >$@
  10. uncompress.so: $(OBJECTS)
  11. $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHAREDCFLAGS) $(OBJECTS) $(LIBS) -lc
  12. aix-uncompress.so: $(OBJECTS) aix-syscall.shr.o
  13. $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHAREDCFLAGS) $(OBJECTS) -lc $(AIXLDFAGS)
  14. ...


 
Résultat :

Code :
  1. $ make
  2. /usr/local/cross/gcc-3.3.4_glibc-2.3.2/arm-linux/bin/gcc  -I/usr/include -g -O2
  3. -O4 -Wall -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Di686 -Dpc -Dcygwin -
  4. I. -I. -fpic -c open.c
  5. In file included from sysincludes.h:45,
  6.                  from open.c:10:
  7. /usr/include/stdlib.h:110: warning: `__warning__' attribute directive ignored
  8. /usr/include/stdlib.h:117: warning: `__warning__' attribute directive ignored
  9. In file included from sysincludes.h:62,
  10.                  from open.c:10:
  11. /usr/include/sys/param.h:33:1: warning: "MAXPATHLEN" redefined
  12. In file included from /usr/include/unistd.h:4,
  13.                  from sysincludes.h:42,
  14.                  from open.c:10:
  15. /usr/include/sys/unistd.h:497:1: warning: this is the location of the previous d
  16. efinition
  17. In file included from /usr/include/dirent.h:6,
  18.                  from sysincludes.h:107,
  19.                  from open.c:10:
  20. /usr/include/sys/dirent.h:19: warning: #pragma pack(push[, id], <n> ) is not supp
  21. orted on this target
  22. /usr/include/sys/dirent.h:24: error: syntax error before "__ino64_t"
  23. /usr/include/sys/dirent.h:24: warning: no semicolon at end of struct or union
  24. /usr/include/sys/dirent.h:29: error: syntax error before '}' token
  25. /usr/include/sys/dirent.h:30: warning: #pragma pack(pop[, id], <n> ) is not suppo
  26. rted on this target
  27. /usr/include/sys/dirent.h:36: warning: #pragma pack(push[, id], <n> ) is not supp
  28. orted on this target
  29. /usr/include/sys/dirent.h:50: warning: #pragma pack(pop[, id], <n> ) is not supp
  30. rted on this target
  31. In file included from /usr/include/sys/wait.h:15,
  32.                  from sysincludes.h:140,
  33.                  from open.c:10:
  34. /usr/include/sys/resource.h:76: error: syntax error before "id_t"
  35. /usr/include/sys/resource.h:77: error: syntax error before "id_t"
  36. open.c: In function `open64':
  37. open.c:32: error: `O_LARGEFILE' undeclared (first use in this function)
  38. open.c:32: error: (Each undeclared identifier is reported only once
  39. open.c:32: error: for each function it appears in.)
  40. open.c: In function `open':
  41. open.c:91: warning: implicit declaration of function `syscall'
  42. open.c:91: error: `SYS_open' undeclared (first use in this function)
  43. open.c:264: error: `SYS_unlink' undeclared (first use in this function)
  44. open.c:309: error: `SYS_chmod' undeclared (first use in this function)
  45. open.c: In function `fopen':
  46. open.c:358: warning: implicit declaration of function `zlib_real_fopen'
  47. open.c:358: warning: assignment makes pointer from integer without a cast
  48. open.c: In function `fopen64':
  49. open.c:383: warning: implicit declaration of function `zlib_real_fopen64'
  50. open.c:383: warning: assignment makes pointer from integer without a cast
  51. make: *** [open.o] Error 1

Reply

Marsh Posté le 04-06-2011 à 13:31:29    

Hmmm, non, ton compilo ARM semble installé dans "/usr/local/cross/...", tu devrais y regarder s'il n'y a pas un répertoire d'include spécifique. En tous les cas, "/usr/include" n'est pas du tout le bon répertoire pour ton compilo ARM.

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed