Commit f935ef83 authored by Sergey Lyubka's avatar Sergey Lyubka

_mongoose.dll -> mongoose.dll, _mongoose.so -> libbmongoose.so

parent 79cdb77e
...@@ -27,14 +27,14 @@ GCC_WARNS = -W -Wall -pedantic ...@@ -27,14 +27,14 @@ GCC_WARNS = -W -Wall -pedantic
CFLAGS = -std=c99 -O2 $(GCC_WARNS) $(COPT) CFLAGS = -std=c99 -O2 $(GCC_WARNS) $(COPT)
MAC_SHARED = -flat_namespace -bundle -undefined suppress MAC_SHARED = -flat_namespace -bundle -undefined suppress
LINFLAGS = -ldl -pthread $(CFLAGS) LINFLAGS = -ldl -pthread $(CFLAGS)
LIB = _$(PROG).so LIB = lib$(PROG).so$(MONGOOSE_LIB_SUFFIX)
# Make sure that the compiler flags come last in the compilation string. # Make sure that the compiler flags come last in the compilation string.
# If not so, this can break some on some Linux distros which use # If not so, this can break some on some Linux distros which use
# "-Wl,--as-needed" turned on by default in cc command. # "-Wl,--as-needed" turned on by default in cc command.
# Also, this is turned in many other distros in static linkage builds. # Also, this is turned in many other distros in static linkage builds.
linux: linux:
$(CC) mongoose.c -shared -fPIC -fpic -o $(LIB) $(LINFLAGS) $(CC) mongoose.c -shared -fPIC -fpic -o $(LIB) -Wl,-soname,$(LIB) $(LINFLAGS)
$(CC) mongoose.c main.c -o $(PROG) $(LINFLAGS) $(CC) mongoose.c main.c -o $(PROG) $(LINFLAGS)
bsd: bsd:
...@@ -121,7 +121,7 @@ MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT ...@@ -121,7 +121,7 @@ MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT
mingw: mingw:
windres win32\res.rc win32\res.o windres win32\res.rc win32\res.o
$(CC) $(MINGWOPT) mongoose.c -lws2_32 \ $(CC) $(MINGWOPT) mongoose.c -lws2_32 \
-shared -Wl,--out-implib=$(PROG).lib -o _$(PROG).dll -shared -Wl,--out-implib=$(PROG).lib -o $(PROG).dll
$(CC) $(MINGWOPT) -Iwin32 mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \ $(CC) $(MINGWOPT) -Iwin32 mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \
-o $(PROG).exe -o $(PROG).exe
......
...@@ -123,9 +123,9 @@ class Mongoose(object): ...@@ -123,9 +123,9 @@ class Mongoose(object):
def __init__(self, callback, **kwargs): def __init__(self, callback, **kwargs):
if os.name == 'nt': if os.name == 'nt':
self.dll = ctypes.WinDLL('_mongoose.dll') self.dll = ctypes.WinDLL('mongoose.dll')
else: else:
self.dll = ctypes.CDLL('_mongoose.so') self.dll = ctypes.CDLL('libmongoose.so')
self.dll.mg_start.restype = ctypes.c_void_p self.dll.mg_start.restype = ctypes.c_void_p
self.dll.mg_modify_passwords_file.restype = ctypes.c_int self.dll.mg_modify_passwords_file.restype = ctypes.c_int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment