Skip to content
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

Modified Makefile to only use pkg-config, as gdlib-config no longer exists. #12

Merged
merged 1 commit into from
Feb 27, 2020
Merged
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
32 changes: 13 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,37 @@ VERSION=2.0.33r3
# Command used to run Lua code
LUABIN=lua5.1

# Path to the utility 'gdlib-config'. This may be changed to compile the
# module with development versions of libgd.
GDLIBCONFIG=gdlib-config

# Optimization for the brave of heart ;)
OMITFP=-fomit-frame-pointer


# ---------------------------------------------------------------------------
# Automatic configuration using pkgconfig, gd-config and sed. These
# lines should work on most Linux/Unix systems. If your system does not
# have these programs you must comment out these lines and uncomment and
# change the next ones.
# Automatic configuration using pkgconfig. These lines should work on most
# Linux/Unix systems. If your system does not have these programs you must
# comment out these lines and uncomment and change the next ones.

# Name of .pc file. "lua5.1" on Debian/Ubuntu
LUAPKG=lua5.1
OUTFILE=gd.so

CFLAGS=-O3 -Wall -fPIC $(OMITFP)
CFLAGS+=`$(GDLIBCONFIG) --cflags` `pkg-config $(LUAPKG) --cflags`
CFLAGS+=`pkg-config $(LUAPKG) --cflags`
CFLAGS+=-DVERSION=\"$(VERSION)\"

GDFEATURES=`$(GDLIBCONFIG) --features |sed -e "s/GD_/-DGD_/g"`
LFLAGS=-shared `$(GDLIBCONFIG) --ldflags` `$(GDLIBCONFIG) --libs` -lgd

INSTALL_PATH := `$(LUABIN) -e' \
for dir in package.cpath:gmatch("(/[^?;]+)?") do \
io.write(dir) \
os.exit(0) \
end \
os.exit(1) \
'`
GDFEATURES=-DGD_XPM -DGD_JPEG -DGD_FONTCONFIG -DGD_FREETYPE -DGD_PNG -DGD_GIF
LFLAGS=-shared `pkg-config $(LUAPKG) --libs` -lgd

INSTALL_PATH := `pkg-config $(LUAPKG) --variable=INSTALL_CMOD`


# ---------------------------------------------------------------------------
# Manual configuration for systems without pkgconfig.
# WARNING: These instructions will only work on older versions of GD, since
# gdlib-config has been removed in favor of pkg-config.

# Path to the utility 'gdlib-config'. This may be changed to compile the
# module with development versions of libgd.
#GDLIBCONFIG=gdlib-config

#OUTFILE=gd.so
#CFLAGS=-O3 -Wall -fPIC $(OMITFP)
Expand Down