Verified Commit 455dd80f authored by Göran Weinholt's avatar Göran Weinholt
Browse files

Use pkg-config to find libraries

The makefile now uses pkg-config to locate x11, libpng and zvbi-0.2.

The patch was contributed by Ferdinand Thiessen.
parent fba7471e
Pipeline #356744689 failed with stage
in 36 seconds
......@@ -16,26 +16,30 @@ PREFIX=/usr/local
CFLAGS=$(OPT) -DVERSION=\"$(VER)\" $(DEFS) -I$(USR_X11R6)/include
PKGS="x11"
EXPOBJS=export.o exp-txt.o exp-html.o exp-gfx.o font.o
OBJS=main.o ui.o xio.o fdset.o vbi.o cache.o help.o edline.o search.o edit.o misc.o hamm.o lang.o $(EXPOBJS)
TOBJS=alevt-date.o vbi.o fdset.o misc.o hamm.o lang.o
COBJS=alevt-cap.o vbi.o fdset.o misc.o hamm.o lang.o $(EXPOBJS)
ifneq ($(findstring WITH_PNG,$(DEFS)),)
EXPLIBS=-lpng
PKGS+="libpng"
endif
ifneq ($(findstring USE_LIBZVBI,$(DEFS)),)
ZVBILIB=-lzvbi -lpthread
EXPLIBS+=$(ZVBILIB)
PKGS+="zvbi-0.2"
endif
CFLAGS+=$(shell pkg-config --cflags $(PKGS))
EXPLIBS=$(shell pkg-config --libs $(PKGS))
all: alevt alevt-date alevt-cap alevt.1x alevt-date.1 alevt-cap.1
alevt: $(OBJS)
$(CC) $(OPT) $(OBJS) -o alevt -L$(USR_X11R6)/lib -L$(USR_X11R6)/lib64 -lX11 $(EXPLIBS)
$(CC) $(OPT) $(OBJS) -o alevt $(EXPLIBS)
alevt-date: $(TOBJS)
$(CC) $(OPT) $(TOBJS) -o alevt-date $(ZVBILIB)
$(CC) $(OPT) $(TOBJS) -o alevt-date $(EXPLIBS)
alevt-cap: $(COBJS)
$(CC) $(OPT) $(COBJS) -o alevt-cap $(EXPLIBS)
......
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