lua-users home
lua-l archive

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


G'Day,

> 	When I compile Lua Socket (v2.0 beta 3) I receive a large number of
> warnings of the pattern ``X is a GCC extension'', before finally
> receiving the following error:
> 		select.c: In function 'return_fd':
> 		select.c:169: error: impossible constraint in 'asm'

	It has taken a lot of messing about, but I have finally worked out what
is going on here.  The ``X is a GCC extension'' are because -I was used
in place of -isystem in CFLAGS: because the directory selected included
system headers, -I should not be used.  The second problem was because
that -I line was there at all! It is a standard directory location for
gcc, and as such is not required, but if you use a crosscompiler then
the location for that directory will be different.  The following line
allows it to work on all GCCs I have on system:
		CFLAGS=-I$(COMPAT) $(PROF) $(OPT) $(DBG) $(DEF) -pedantic -W -Wall 

	There is also a small problem here:
		$(LDYN): $(LOBJS)
			gcc -shared -o $(LDYN) $(LOBJS)

		$(MDYN): $(MOBJS)
			gcc -shared -o $(MDYN) $(MOBJS)
really should have been:
		$(LDYN): $(LOBJS)
			$(CC) -shared -o $(LDYN) $(LOBJS)

		$(MDYN): $(MOBJS)
			$(CC) -shared -o $(MDYN) $(MOBJS)
for anyone who does not use gcc.

	Hopefully this can be of use to anyone else wanting to crosscompile Lua
Socket in future.

	-- Matthew