mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
Fixes for mingw and cygwin.
This commit is contained in:
parent
56064038a4
commit
be0097b717
5 changed files with 42 additions and 9 deletions
|
|
@ -557,7 +557,7 @@ uint8_t workbook_set_custom_property_integer(lxw_workbook *workbook,
|
|||
* See `workbook_set_custom_property_string()` above for details.
|
||||
*
|
||||
* @code
|
||||
* workbook_set_custom_property_boolean (workbook, "Has Review", 1);
|
||||
* workbook_set_custom_property_boolean(workbook, "Has Review", 1);
|
||||
* @endcode
|
||||
*/
|
||||
uint8_t workbook_set_custom_property_boolean(lxw_workbook *workbook,
|
||||
|
|
|
|||
26
src/Makefile
26
src/Makefile
|
|
@ -32,15 +32,31 @@ LIBXLSXWRITER_TO = libxlsxwriter_test.a
|
|||
ARFLAGS = rc
|
||||
|
||||
# Flags passed to dynamic linker.
|
||||
SOFLAGS = -shared -fPIC
|
||||
FPIC = -fPIC
|
||||
SOFLAGS = -shared $(FPIC)
|
||||
|
||||
# Change shared lib options on OS X.
|
||||
# Get Env/OS name.
|
||||
UNAME := $(shell uname)
|
||||
|
||||
# Change make options on OS X.
|
||||
ifeq ($(UNAME), Darwin)
|
||||
LIBXLSXWRITER_SO = libxlsxwriter.dylib
|
||||
SOFLAGS = -dynamiclib -fPIC -install_name /usr/lib/$(LIBXLSXWRITER_SO)
|
||||
SOFLAGS = -dynamiclib $(FPIC) -install_name /usr/lib/$(LIBXLSXWRITER_SO)
|
||||
endif
|
||||
|
||||
# Change make options on MinGW.
|
||||
ifneq (,$(findstring MINGW, $(UNAME)))
|
||||
LIBXLSXWRITER_SO = libxlsxwriter.dll
|
||||
FPIC =
|
||||
CFLAGS += -Wno-long-long
|
||||
endif
|
||||
|
||||
# Change make options on Cygwin.
|
||||
ifneq (,$(findstring CYGWIN, $(UNAME)))
|
||||
LIBXLSXWRITER_SO = libxlsxwriter.dll
|
||||
FPIC =
|
||||
CFLAGS += -Wno-char-subscripts
|
||||
endif
|
||||
|
||||
# Headers as dependecies.
|
||||
HDRS = $(wildcard ../include/xlsxwriter/*.h)
|
||||
|
|
@ -75,10 +91,10 @@ test_compile : $(OBJS)
|
|||
|
||||
# Targets for the object files.
|
||||
%.o : %.c $(HDRS)
|
||||
$(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $<
|
||||
$(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
%.so : %.c $(HDRS)
|
||||
$(Q)$(CC) -fPIC -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
|
||||
$(Q)$(CC) $(FPIC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
%.to : %.c $(HDRS)
|
||||
$(Q)$(CC) -g -O0 -DTESTING -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ STATIC size_t
|
|||
_generate_hash_key(void *data, size_t data_len, size_t num_buckets)
|
||||
{
|
||||
unsigned char *p = data;
|
||||
size_t hash = 2166136261;
|
||||
size_t hash = 2166136261U;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < data_len; i++)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ STATIC uint8_t _add_file_to_zip(lxw_packager *self, FILE * file,
|
|||
* Private functions.
|
||||
*
|
||||
****************************************************************************/
|
||||
/* Avoid non MSVC definition of _WIN32 in MinGW. */
|
||||
#ifdef __MINGW32__
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
|
|
|||
16
third_party/minizip/Makefile
vendored
16
third_party/minizip/Makefile
vendored
|
|
@ -9,15 +9,27 @@ ifdef V
|
|||
Q=
|
||||
endif
|
||||
|
||||
FPIC = -fPIC
|
||||
CFLAGS = -O3 -DNOCRYPT -DNOUNCRYPT
|
||||
|
||||
# Change make options on MinGW.
|
||||
ifneq (,$(findstring MINGW, $(UNAME)))
|
||||
FPIC =
|
||||
endif
|
||||
|
||||
# Change make options on Cygwin.
|
||||
ifneq (,$(findstring CYGWIN, $(UNAME)))
|
||||
FPIC =
|
||||
CFLAGS += -DUSE_FILE32API
|
||||
endif
|
||||
|
||||
all: ioapi.o zip.o ioapi.so zip.so
|
||||
|
||||
%.o : %.c
|
||||
$(Q)$(CC) -c $(CFLAGS) $<
|
||||
$(Q)$(CC) -c $(CFLAGS) $<
|
||||
|
||||
%.so : %.c
|
||||
$(Q)$(CC) -fPIC -c $(CFLAGS) $< -o $@
|
||||
$(Q)$(CC) $(FPIC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
$(Q)/bin/rm -f *.o *.so
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue