Skip to content

Fix build & install on osx #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CC ?= gcc
PKG_CONFIG ?= pkg-config
CFLAGS ?= -ansi -O0 -g3 -Wall -Wextra -Werror -Wconversion \
-Wstrict-prototypes -Wno-unused-parameter -pedantic
CFLAGS += -fPIC -DMPACK_DEBUG_REGISTRY_LEAK
CFLAGS += -fPIC -std=c99 -DMPACK_DEBUG_REGISTRY_LEAK
ifeq ($(MPACK_LUA_VERSION_NOPATCH),5.3)
# Lua 5.3 has integer type, which is not 64 bits for -ansi since c89 doesn't
# have `long long` type.
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@

[![Travis Build Status](https://travis-ci.org/libmpack/libmpack-lua.svg?branch=master)](https://travis-ci.org/libmpack/libmpack-lua)

## Building

```bash
LUA_TARGET=$(PLATFORM) make
```

Where `PLATFORM` is a supported Lua 5.1 platform: linux (default), freebsd, macosx, ...

For the complete list of targets run:
```bash
make; cd .deps/5.1.5/src/lua && make
```
5 changes: 5 additions & 0 deletions lmpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
*/
#define LUA_LIB
/* for snprintf */
#ifdef __APPLE__
// Apple uses C99 source, not XOPEN
#define _C99_SOURCE 1
#else
#define _XOPEN_SOURCE 500
#endif
#include <limits.h>
#include <stdlib.h>
#include <string.h>
Expand Down