Page 1 of 1

[Porting coreutils] Problem with configure script

Posted: Sat Oct 20, 2012 2:05 pm
by yaucos
Hi,

I am currently trying to port coreutils to my OS, but something is wrong with the configure script. I have encountered the problem with several versions of coreutils (between 7.5 and 8.9). Concretely, the configure script sticks on "checking for a traditional french locale...". I have built an OS-specific toolchain with GCC 4.4.3 and Newlib 1.20.0.

Here is how I invoke the configure script (from directory build-myos) :

Code: Select all

../coreutils-7.5/configure --build=$BUILD --host=$HOST --prefix=$PREFIX --disable-nls

with :
BUILD=i686-linux-gnu (given by gcc -dumpmachine)
HOST=i586-pc-myos
PREFIX=/usr/local/cross
And the output :

Code: Select all

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i586-pc-myos-strip... i586-pc-myos-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for i586-pc-myos-gcc... i586-pc-myos-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i586-pc-myos-gcc accepts -g... yes
checking for i586-pc-myos-gcc option to accept ISO C89... none needed
checking dependency style of i586-pc-myos-gcc... gcc3
checking for i586-pc-myos-gcc option to accept ISO C99... -std=gnu99
checking for i586-pc-myos-gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking whether i586-pc-myos-gcc -std=gnu99 and cc understand -c and -o together... yes
checking how to run the C preprocessor... i586-pc-myos-gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether i586-pc-myos-gcc -std=gnu99 needs -traditional... no
checking for i586-pc-myos-ranlib... i586-pc-myos-ranlib
checking whether ln -s works... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i586-pc-myos
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... no
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
configure: autobuild project... GNU coreutils
configure: autobuild revision... 7.5
configure: autobuild hostname... joe-pc
configure: autobuild timestamp... 20121020T194449Z
checking for inline... inline
checking for working alloca.h... yes
checking for alloca... yes
checking for arpa/inet.h... no
checking for sys/param.h... yes
checking for sys/socket.h... no
checking for dirent.h... yes
checking for errno.h... yes
checking for libgen.h... yes
checking for fcntl.h... yes
checking for float.h... yes
checking for wctype.h... yes
checking for stdio_ext.h... yes
checking for sys/vfs.h... no
checking for sys/fs_types.h... no
checking for netdb.h... no
checking for netinet/in.h... no
checking for termios.h... yes
checking for sys/time.h... yes
checking for iconv.h... yes
checking for stdint.h... (cached) yes
checking for wchar.h... yes
checking for inttypes.h... (cached) yes
checking for math.h... yes
checking for sys/mman.h... no
checking for unistd.h... (cached) yes
checking for sys/statvfs.h... no
checking for sys/select.h... no
checking for utmp.h... no
checking for utmpx.h... no
checking for locale.h... yes
checking for signal.h... yes
checking for stdarg.h... yes
checking for stddef.h... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for time.h... yes
checking for priv.h... no
checking for utime.h... yes
checking for sys/wait.h... yes
checking for sys/ioctl.h... yes
checking for hurd.h... no
checking for paths.h... yes
checking for stropts.h... no
checking for sys/resource.h... yes
checking for sys/systeminfo.h... no
checking for syslog.h... no
checking for grp.h... yes
checking for pwd.h... yes
checking for OS.h... no
checking whether the preprocessor supports include_next... yes
checking for d_ino member in directory struct... no
checking whether system is Windows or MSDOS... no
checking for long file names... yes
checking for pathconf... no
checking for btowc... yes
checking for canonicalize_file_name... no
checking for resolvepath... no
checking for dup2... yes
checking for fchdir... no
checking for mempcpy... yes
checking for isblank... yes
checking for iswctype... yes
checking for mbsrtowcs... yes
checking for wmemchr... yes
checking for wmemcpy... yes
checking for wmempcpy... no
checking for __fpending... no
checking for fpurge... yes
checking for __fpurge... yes
checking for __freading... no
checking for ftruncate... no
checking for lchmod... no
checking for fdopendir... no
checking for fstatfs... no
checking for microuptime... no
checking for nanouptime... no
checking for flockfile... no
checking for funlockfile... no
checking for __fsetlocking... no
checking for tcgetattr... yes
checking for tcsetattr... yes
checking for gettimeofday... yes
checking for nanotime... no
checking for lstat... yes
checking for mbsinit... yes
checking for mbrtowc... yes
checking for mbrlen... yes
checking for isascii... yes
checking for mprotect... no
checking for fchmod... no
checking for alarm... no
checking for readlink... no
checking for utmpname... no
checking for utmpxname... no
checking for wcscoll... yes
checking for setenv... yes
checking for settimeofday... no
checking for stime... no
checking for sigaction... yes
checking for sigaltstack... no
checking for siginterrupt... no
checking for tzset... yes
checking for pipe... yes
checking for futimes... no
checking for futimesat... no
checking for futimens... no
checking for utimensat... no
checking for vasnprintf... yes
checking for wcrtomb... yes
checking for iswcntrl... yes
checking for wcwidth... yes
checking for wctob... yes
checking for strxfrm... yes
checking for directio... no
checking for nl_langinfo... yes
checking for endgrent... no
checking for endpwent... yes
checking for fchown... no
checking for iswspace... yes
checking for mkfifo... no
checking for setgroups... no
checking for sethostname... no
checking for sync... yes
checking for sysctl... no
checking for sysinfo... no
checking for tcgetpgrp... yes
checking for C/C++ restrict keyword... __restrict
checking for nl_langinfo and CODESET... yes
checking for a traditional french locale...
I have already ported other programs (namely that is dash, make and nano), and this is the first time I face such a problem.

Thanks in advance for your help.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 20, 2012 2:42 pm
by jnc100
Have you checked config.log?

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 20, 2012 2:53 pm
by yaucos
Well, I realize it is difficult for me to interpret the content of this file. Anyway, it ends like this :

Code: Select all

#define HAVE_ENDPWENT 1
#define HAVE_ISWSPACE 1
#define HAVE_SYNC 1
#define HAVE_TCGETPGRP 1
#define restrict __restrict
#define HAVE_LANGINFO_CODESET 1

configure: caught signal 2
configure: exit 1
The last 2 lines are due to the fact I stopped the script with Ctrl+C, I suppose.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 20, 2012 11:30 pm
by jnc100
Could you provide the rest of the file, e.g. by uploading it to something like pastebin (rather than including it all in this thread).

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 27, 2012 5:26 am
by yaucos
Here is a link to the config.log file : http://pastebin.com/n3CM19QT.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 27, 2012 6:34 am
by jnc100
Unfortunately I am unable to reproduce this with gcc 4.2.1 and coreutils 8.19 (I get 'checking for a traditional french locale... fr_FR.ISO-8859-1'). Perhaps you could try with this version of coreutils? Otherwise try adding 'gt_cv_locale_fr=fr_FR.ISO-8859-1' to the top of your configure script for a quick but dirty fix.

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 27, 2012 8:36 am
by yaucos
Trying with version 8.19 didn't change anything, so I used the dirty fix you suggested, waiting for a cleaner solution. Now, I get another error:

Code: Select all

could not determine how to read list of mounted file systems
I think it is due to the fact my system doesn't support mouting/unmouting, while mount and unmount are part of coreutils (well, I believe). So I would like to know the following things :
  • Is it possible to ignore this error ?
  • Is it possible to port just part of coreutils ? I have read about --with-PACKAGE and --without-PACKAGE options, but I have not found any example, and I wonder whether they are suitable for this purpose.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 27, 2012 9:46 am
by jnc100
Looking at the m4/ls-mntd-fs.m4 script in the coreutils distribution, towards the bottom they acknowledge that building fails without any means of reading the list of mounted file systems, whereas it should instead just disable some functionality. I suggest you either submit a patch to the coreutils maintainers or implement getmntent(FILE *fp) in your libc (I don't think newlib provides it by default). For the time being, your getmntent() could just return NULL.

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Sat Oct 27, 2012 10:10 am
by yaucos
After implementing getmntent, I still get the same error.

Re: [Porting coreutils] Problem with configure script

Posted: Sun Oct 28, 2012 8:12 am
by jnc100
Do you also provide a "mntent.h" which defines struct mntent and #defines _PATH_MNTTAB to the location of fstab and _PATH_MOUNTED to the location of mtab? If so and it still fails it may be time for another config.log.

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Mon Oct 29, 2012 4:47 am
by yaucos
Well, I had not defined _PATH_MNTTAB and _PATH_MOUNTED. Now I don't get the error any longer. However, the script now stops because socklen_t type is not defined. I guess this type deals with sockets. However, I have not implemented them for the moment. Is it possible to port coreutils without networking support ? Maybe I could use the --without-PACKAGE option, but I ignore which values PACKAGE can take.

Re: [Porting coreutils] Problem with configure script

Posted: Mon Oct 29, 2012 2:58 pm
by jnc100
I doubt it is possible to compile all of GNU coreutils without implementing all the missing functions in newlib, as it was designed to work with the GNU C library instead (which unfortunately is far more difficult to port than newlib). As for whether it is possible to only compile part of coreutils, I don't know, although I would imagine the options you are looking for probably start --enable- or --disable- (--with/without are usually used to compile an application with or without a particular external library, rather than enable or disable parts of the program itself). I suppose you could write the config.h yourself and then only run make in the directories you want to compile in, or you could ask the coreutils maintainers for pointers in this regard. Alternatively, you could use busybox instead of coreutils (which is known to work with newlib).

Regards,
John.

Re: [Porting coreutils] Problem with configure script

Posted: Tue Oct 30, 2012 6:00 am
by yaucos
Using Busybox might indeed be a good idea.