mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Fix CFLAGS and LDFLAGS options
Remove CFLAGS optimization overrides, add -Wl,-soname option to LDFLAGS for external linking.
This commit is contained in:
parent
26fd89be84
commit
815d6d7f3d
21
src/makefile
21
src/makefile
@ -162,7 +162,7 @@ SO_macosx=so
|
|||||||
O_macosx=o
|
O_macosx=o
|
||||||
CC_macosx=gcc
|
CC_macosx=gcc
|
||||||
DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
|
DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
|
||||||
CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
|
CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
|
||||||
LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
|
LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
|
||||||
LD_macosx=gcc
|
LD_macosx=gcc
|
||||||
SOCKET_macosx=usocket.o
|
SOCKET_macosx=usocket.o
|
||||||
@ -174,8 +174,7 @@ SO_linux=so
|
|||||||
O_linux=o
|
O_linux=o
|
||||||
CC_linux=gcc
|
CC_linux=gcc
|
||||||
DEF_linux=-DLUASOCKET_$(DEBUG)
|
DEF_linux=-DLUASOCKET_$(DEBUG)
|
||||||
CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
|
CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
|
||||||
-Wimplicit -O2 -ggdb3 -fpic
|
|
||||||
LDFLAGS_linux=-O -shared -fpic -o
|
LDFLAGS_linux=-O -shared -fpic -o
|
||||||
LD_linux=gcc
|
LD_linux=gcc
|
||||||
SOCKET_linux=usocket.o
|
SOCKET_linux=usocket.o
|
||||||
@ -187,8 +186,7 @@ SO_freebsd=so
|
|||||||
O_freebsd=o
|
O_freebsd=o
|
||||||
CC_freebsd=gcc
|
CC_freebsd=gcc
|
||||||
DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
|
DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
|
||||||
CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
|
CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
|
||||||
-Wimplicit -O2 -ggdb3 -fpic
|
|
||||||
LDFLAGS_freebsd=-O -shared -fpic -o
|
LDFLAGS_freebsd=-O -shared -fpic -o
|
||||||
LD_freebsd=gcc
|
LD_freebsd=gcc
|
||||||
SOCKET_freebsd=usocket.o
|
SOCKET_freebsd=usocket.o
|
||||||
@ -200,8 +198,7 @@ SO_solaris=so
|
|||||||
O_solaris=o
|
O_solaris=o
|
||||||
CC_solaris=gcc
|
CC_solaris=gcc
|
||||||
DEF_solaris=-DLUASOCKET_$(DEBUG)
|
DEF_solaris=-DLUASOCKET_$(DEBUG)
|
||||||
CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
|
CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
|
||||||
-Wimplicit -O2 -ggdb3 -fpic
|
|
||||||
LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o
|
LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o
|
||||||
LD_solaris=gcc
|
LD_solaris=gcc
|
||||||
SOCKET_solaris=usocket.o
|
SOCKET_solaris=usocket.o
|
||||||
@ -214,7 +211,7 @@ O_mingw=o
|
|||||||
CC_mingw=gcc
|
CC_mingw=gcc
|
||||||
DEF_mingw= -DLUASOCKET_$(DEBUG) \
|
DEF_mingw= -DLUASOCKET_$(DEBUG) \
|
||||||
-DWINVER=0x0501
|
-DWINVER=0x0501
|
||||||
CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
|
CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
|
||||||
LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
|
LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
|
||||||
LD_mingw=gcc
|
LD_mingw=gcc
|
||||||
SOCKET_mingw=wsocket.o
|
SOCKET_mingw=wsocket.o
|
||||||
@ -396,18 +393,18 @@ none:
|
|||||||
all: $(SOCKET_SO) $(MIME_SO)
|
all: $(SOCKET_SO) $(MIME_SO)
|
||||||
|
|
||||||
$(SOCKET_SO): $(SOCKET_OBJS)
|
$(SOCKET_SO): $(SOCKET_OBJS)
|
||||||
$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
|
$(LD) $(SOCKET_OBJS) -Wl,-soname,socket/core.so $(LDFLAGS)$@
|
||||||
|
|
||||||
$(MIME_SO): $(MIME_OBJS)
|
$(MIME_SO): $(MIME_OBJS)
|
||||||
$(LD) $(MIME_OBJS) $(LDFLAGS)$@
|
$(LD) $(MIME_OBJS) -Wl,-soname,mime/core.so $(LDFLAGS)$@
|
||||||
|
|
||||||
all-unix: all $(UNIX_SO) $(SERIAL_SO)
|
all-unix: all $(UNIX_SO) $(SERIAL_SO)
|
||||||
|
|
||||||
$(UNIX_SO): $(UNIX_OBJS)
|
$(UNIX_SO): $(UNIX_OBJS)
|
||||||
$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
|
$(LD) $(UNIX_OBJS) -Wl,-soname,socket/unix.so $(LDFLAGS)$@
|
||||||
|
|
||||||
$(SERIAL_SO): $(SERIAL_OBJS)
|
$(SERIAL_SO): $(SERIAL_OBJS)
|
||||||
$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
|
$(LD) $(SERIAL_OBJS) -Wl,-soname,socket/serial.so $(LDFLAGS)$@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
$(INSTALL_DIR) $(INSTALL_TOP_LDIR)
|
$(INSTALL_DIR) $(INSTALL_TOP_LDIR)
|
||||||
|
Loading…
Reference in New Issue
Block a user