bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] feature request: argp()


From: Simon Josefsson
Subject: Re: [Bug-gnulib] feature request: argp()
Date: Sat, 07 Jun 2003 04:34:51 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson writes:
>
>> I think it would be nice to have a argp() implementation in gnulib.
>
> Then go ahead and put it into gnulib :-) We already have some modules
> which consist of several .c files.

To do that I need some help getting CVS to build, I have never been
able to get it to compile.  Compile attempt last in this message.

>> A starting point for a standalone implementation (taken from lsh, but
>> with some bug fixes) is available in:
>> http://savannah.gnu.org/cgi-bin/viewcvs/gsasl/gsasl/argp/
>
> It's a fork from the glibc code. IMO the first step should be to
> resync this code with glibc.

I have no problems starting from scratch with the code in glibc, port
it to gnulib and perhaps feed back patches upstream to glibc
maintainers.  Perhaps it is easier than syncing what I have with
reality.

>> it does use alloca which caused it to fail when I tried tcc instead
>> of gcc.
>
> Modules in gnulib can use alloca; then they simply depend on alloca.
>
> If your compiler (tcc) doesn't support alloca, can you check whether
> the alloca,m4 macro from gnulib detects this correctly?

The compiler does not seem to support alloca, at least

#include <stdlib.h>
main(){ alloca(42); }

fails with

address@hidden:~/src/gsasl/argp$ tcc -o foo foo.c
tcc: undefined symbol 'alloca'

but the problem is that argp does

#ifndef alloca
# ifdef __GNUC__
#  define alloca __builtin_alloca
#  define HAVE_ALLOCA 1
# else
#  if defined HAVE_ALLOCA_H || defined _LIBC
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

and that this alloca() declaration doesn't match the one in stdlib.h
and I get

In file included from argp-help.c:49:
In file included from /usr/include/stdlib.h:576:
/usr/include/alloca.h:33: incompatible types for redefinition of 'alloca'

I don't know if this really is a tcc bug or a stdlib.h bug, but either
way it shouldn't break like this.

address@hidden:~/src/gnulib$ cvsco
cvsco: cleaning up ...
aclocal.m4
autom4te.cache
configure
cvsco: refetching missing files ...
cvsco: done
address@hidden:~/src/gnulib$ cvs upd
cvs server: Updating .
cvs server: Updating config
cvs server: Updating doc
cvs server: Updating gpl
cvs server: Updating lgpl
cvs server: Updating lib
cvs server: Updating m4
cvs server: Updating modules
address@hidden:~/src/gnulib$ autoreconf --verbose --force --install
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal  --output=aclocal.m4t
autoreconf: `aclocal.m4' is created
autoreconf: configure.in: tracing
autoreconf: configure.in: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.in: not using Autoheader
autoreconf: configure.in: not using Automake
autoreconf: Leaving directory `.'
address@hidden:~/src/gnulib$ ./configure
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for AIX... no
checking for getmntent in -lsun... no
checking for getmntent in -lseq... no
checking for getmntent in -lgen... no
checking for getmntent... yes
checking for strerror in -lcposix... no
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... yes
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 for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking for working alloca.h... yes
checking for alloca... yes
checking for an ANSI C-conforming const... yes
checking for prefix by checking for gcc... /usr/bin/gcc
configure: creating ./config.status
config.status: creating Makefile
config.status: creating m4/Makefile
config.status: creating lib/Makefile
address@hidden:~/src/gnulib$ make
gcc -g  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" 
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_GETMNTENT=1 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 
-DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1  -I. -I. -c regex.c
for d in m4 lib; do (cd $d; make  CPPFLAGS='' CFLAGS='-g' CC='gcc' 
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" 
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_GETMNTENT=1 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 
-DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 ' LDFLAGS='' LOADLIBES='' default); done
make[1]: Entering directory `/home/jas/src/gnulib/m4'
Makefile:15: *** missing separator.  Stop.
make[1]: Leaving directory `/home/jas/src/gnulib/m4'
make[1]: Entering directory `/home/jas/src/gnulib/lib'
Makefile:15: *** missing separator.  Stop.
make[1]: Leaving directory `/home/jas/src/gnulib/lib'
make: *** [default] Error 2
address@hidden:~/src/gnulib$ head -20 m4/Makefile
# Makefile.in generated by automake 1.6.2 from Makefile.am.
# m4/Makefile.  Generated from Makefile.in by configure.
 
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
 
@SET_MAKE@
SHELL = /bin/sh
 
srcdir = .
top_srcdir = ..
 
address@hidden:~/src/gnulib$ autoreconf --version
autoreconf (GNU Autoconf) 2.57
Written by David J. MacKenzie and Akim Demaille.
 
Copyright 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
address@hidden:~/src/gnulib$ automake --version
automake (GNU automake) 1.7.5
Written by Tom Tromey <address@hidden>.
 
Copyright 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
address@hidden:~/src/gnulib$ libtoolize --version
libtoolize (GNU libtool) 1.4.3
address@hidden:~/src/gnulib$





reply via email to

[Prev in Thread] Current Thread [Next in Thread]