LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-19-2015, 11:22 PM   #1
VolumetricSteve
Member
 
Registered: Mar 2011
Posts: 90

Rep: Reputation: 7
make can't find glib library that is installed


I've been chopping up this Makefile to try and get NetRadiant to build. I've installed a number of dependencies - not the least of which is "glib2" which as far as I can tell, includes dev headers and such. The Makefile wants "libglib2.0-dev" which seems to have been merged with "glib2" in Arch linux.
I did a verbose 'make' to see exactly what it's looking for, and it's looking for files that are a part of my glib2 install.

The problem that I'm running into is that I can't figure out how to structure the directories within the Makefile to get it to see my glib2 install.

Note the line:

checkheader glib2 gutils.h "/usr/include/glib-2.0/glib/"; \

which, I think..should be pointing it directly to my glib-2.0 directory.


Below is the Makefile I've tried to modified to get it to point to glib2. I had to cut off a ton of stuff at the bottom to get it to fit into a post, but the bottom chunk I removed doesn't have much, if anything, to do with my issue.


#MAKEFILE_CONF ?= Makefile.conf
#-include $(MAKEFILE_CONF)

## CONFIGURATION SETTINGS
# user customizable stuf
# you may override this in Makefile.conf or the environment
BUILD ?= debug
# or: release, or: extradebug, or: profile
OS ?= $(shell uname)
# or: Linux, Win32, Darwin
LDFLAGS ?=
CFLAGS ?=
CXXFLAGS ?=
CPPFLAGS ?=
LIBS ?=
RADIANT_ABOUTMSG ?= Custom build

# warning: this directory may NOT contain any files other than the ones written by this Makefile!
# NEVER SET THIS TO A SYSTEM WIDE "bin" DIRECTORY!
INSTALLDIR ?= install

CC ?= gcc
CXX ?= g++
RANLIB ?= ranlib
AR ?= ar
LDD ?= ldd # nothing on Win32
OTOOL ?= # only used on OS X
WINDRES ?= windres # only used on Win32

PKGCONFIG ?= pkg-config
PKG_CONFIG_PATH ?=

SH ?= $(SHELL)
ECHO ?= echo
ECHO_NOLF ?= echo -n
CAT ?= cat
MKDIR ?= mkdir -p
CP ?= cp
CP_R ?= $(CP) -r
RM ?= rm
RM_R ?= $(RM) -r
TEE_STDERR ?= | tee /dev/stderr
TR ?= tr
FIND ?= find
DIFF ?= diff
SED ?= sed
GIT ?= git
SVN ?= svn
WGET ?= wget
MV ?= mv
UNZIPPER ?= unzip

FD_TO_DEVNULL ?= >/dev/null
STDOUT_TO_DEVNULL ?= 1$(FD_TO_DEVNULL)
STDERR_TO_DEVNULL ?= 2$(FD_TO_DEVNULL)
STDERR_TO_STDOUT ?= 2>&1
TO_DEVNULL ?= $(STDOUT_TO_DEVNULL) $(STDERR_TO_STDOUT)

CPPFLAGS_GLIB ?= /usr/include/glib-2.0/
LIBS_GLIB ?= /usr/include/glib-2.0/
CPPFLAGS_XML ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_XML ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_PNG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --cflags $(STDERR_TO_DEVNULL))
LIBS_PNG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_GTK ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_GTK ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_PANGOFT2 ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --cflags $(STDERR_TO_DEVNULL))
LIBS_PANGOFT2 ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_GTKGLEXT ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_GTKGLEXT ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_GL ?=
LIBS_GL ?= -lGL # -lopengl32 on Win32
CPPFLAGS_DL ?=
LIBS_DL ?= -ldl # nothing on Win32
CPPFLAGS_ZLIB ?=
LIBS_ZLIB ?= -lz
CPPFLAGS_JPEG ?=
LIBS_JPEG ?= -ljpeg
DEPEND_ON_MAKEFILE ?= yes
DOWNLOAD_GAMEPACKS ?= yes
# set to no to disable gamepack, set to all to even download undistributable gamepacks

# Support CHECK_DEPENDENCIES with DOWNLOAD_GAMEPACKS semantics
ifneq ($(CHECK_DEPENDENCIES),)
DEPENDENCIES_CHECK = $(patsubst yes,quiet,$(patsubst no,off,$(CHECK_DEPENDENCIES)))
else
DEPENDENCIES_CHECK ?= quiet
# or: off, verbose
endif

# these are used on Win32 only
GTKDIR ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --variable=prefix $(STDERR_TO_DEVNULL))
WHICHDLL ?= which

# alias mingw32 OSes
ifeq ($(OS),MINGW32_NT-6.0)
OS = Win32
endif
ifeq ($(OS),Windows_NT)
OS = Win32
endif

CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fno-strict-aliasing
CPPFLAGS_COMMON =
LDFLAGS_COMMON =
LIBS_COMMON =
CXXFLAGS_COMMON = -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti

ifeq ($(BUILD),debug)
ifeq ($(findstring $(CFLAGS),-g),)
CFLAGS_COMMON += -g
# only add -g if no -g flag is in $(CFLAGS)
endif
ifeq ($(findstring $(CFLAGS),-O),)
CFLAGS_COMMON += -O
# only add -O if no -O flag is in $(CFLAGS)
endif
CPPFLAGS_COMMON +=
LDFLAGS_COMMON +=
else

ifeq ($(BUILD),extradebug)
ifeq ($(findstring $(CFLAGS),-g),)
CFLAGS_COMMON += -g3
# only add -g3 if no -g flag is in $(CFLAGS)
endif
CPPFLAGS_COMMON += -D_DEBUG
LDFLAGS_COMMON +=
else

ifeq ($(BUILD),profile)
ifeq ($(findstring $(CFLAGS),-g),)
CFLAGS_COMMON += -g
# only add -g if no -g flag is in $(CFLAGS)
endif
ifeq ($(findstring $(CFLAGS),-O),)
CFLAGS_COMMON += -O
# only add -O if no -O flag is in $(CFLAGS)
endif
CFLAGS_COMMON += -pg
CPPFLAGS_COMMON +=
LDFLAGS_COMMON += -pg
else

ifeq ($(BUILD),release)
ifeq ($(findstring $(CFLAGS),-O),)
CFLAGS_COMMON += -O3
# only add -O3 if no -O flag is in $(CFLAGS)
# to allow overriding the optimizations
endif
CPPFLAGS_COMMON +=
LDFLAGS_COMMON += -s
else

$(error Unsupported build type: $(BUILD))
endif
endif
endif
endif

INSTALLDIR_BASE := $(INSTALLDIR)

ifeq ($(OS),Linux)
CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
CFLAGS_COMMON += -fPIC
LDFLAGS_DLL = -fPIC -ldl
LIBS_COMMON = -lpthread
EXE ?= x86
A = a
DLL = so
MWINDOWS =
else

ifeq ($(OS),Win32)
CPPFLAGS_COMMON += -DWIN32 -D_WIN32 -D_inline=inline
CFLAGS_COMMON += -mms-bitfields
LDFLAGS_DLL = -Wl,--add-stdcall-alias
LIBS_COMMON = -lws2_32 -luser32 -lgdi32 -lole32
EXE ?= exe
A = a
DLL = dll
MWINDOWS = -mwindows

# workaround: we have no "ldd" for Win32, so...
LDD =
# workaround: OpenGL library for Win32 is called opengl32.dll
LIBS_GL = -lopengl32
# workaround: no -ldl on Win32
LIBS_DL =
else

ifeq ($(OS),Darwin)
CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
CFLAGS_COMMON += -fPIC
CXXFLAGS_COMMON += -fno-exceptions -fno-rtti
MACLIBDIR ?= /opt/local/lib
CPPFLAGS_COMMON += -I$(MACLIBDIR)/../include -I/usr/X11R6/include
LDFLAGS_COMMON += -L$(MACLIBDIR) -L/usr/X11R6/lib
LDFLAGS_DLL += -dynamiclib -ldl
EXE ?= ppc
A = a
DLL = dylib
MWINDOWS =
# workaround for weird prints
ECHO_NOLF = /bin/echo -n

# workaround: http://developer.apple.com/qa/qa2007/qa1567.html
LIBS_GL += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
LIBS_GTKGLEXT += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
# workaround: we have no "ldd" for OS X, so...
LDD =
OTOOL = otool

INSTALLDIR := $(INSTALLDIR_BASE)/NetRadiant.app/Contents/MacOS/install
else

$(error Unsupported build OS: $(OS))
endif
endif
endif

# VERSION!
RADIANT_VERSION_NUMBER = 1.5.0
RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n
RADIANT_MAJOR_VERSION = 5
RADIANT_MINOR_VERSION = 0
Q3MAP_VERSION = 2.5.17n

# Executable extension
RADIANT_EXECUTABLE := $(EXE)

GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL))
ifneq ($(GIT_VERSION),)
RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION)
Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
endif

CPPFLAGS += -DRADIANT_VERSION=""$(RADIANT_VERSION)"" -DRADIANT_MAJOR_VERSION=""$(RADIANT_MAJOR_VERSION)"" -DRADIANT_MINOR_VERSION=""$(RADIANT_MINOR_VERSION)"" -DRADIANT_ABOUTMSG=""$(RADIANT_ABOUTMSG)"" -DQ3MAP_VERSION=""$(Q3MAP_VERSION)"" -DRADIANT_EXECUTABLE=""$(RADIANT_EXECUTABLE)""

.PHONY: all
all: \
dependencies-check \
binaries \
install-data \
install-dll \

.PHONY: dependencies-check
ifeq ($(findstring $(DEPENDENCIES_CHECK),off),off)
dependencies-check:
@$(ECHO) dependencies checking disabled, good luck...
else
dependencies-check:
@$(ECHO)
@if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
failed=0; \
checkbinary() \
{ \
$(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
$$2 --help >&3 $(STDERR_TO_STDOUT); \
if [ $$? != 127 ]; then \
$(ECHO) "found."; \
else \
$(ECHO) "not found, please install it or set PATH right!"; \
$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
failed=1; \
fi; \
}; \
$(ECHO) checking that the build tools exist; \
checkbinary "bash (or another shell)" "$(SH)"; \
checkbinary coreutils "$(ECHO)"; \
checkbinary coreutils "$(ECHO_NOLF)"; \
checkbinary coreutils "$(CAT)"; \
checkbinary coreutils "$(MKDIR)"; \
checkbinary coreutils "$(CP)"; \
checkbinary coreutils "$(CP_R)"; \
checkbinary coreutils "$(RM)"; \
checkbinary coreutils "$(RM_R)"; \
checkbinary coreutils "$(MV)"; \
checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \
checkbinary sed "$(SED)"; \
checkbinary findutils "$(FIND)"; \
checkbinary diff "$(DIFF)"; \
checkbinary gcc "$(CC)"; \
checkbinary g++ "$(CXX)"; \
checkbinary binutils "$(RANLIB)"; \
checkbinary binutils "$(AR)"; \
checkbinary pkg-config "$(PKGCONFIG)"; \
checkbinary unzip "$(UNZIPPER)"; \
checkbinary git-core "$(GIT)"; \
checkbinary subversion "$(SVN)"; \
checkbinary wget "$(WGET)"; \
[ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
[ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
[ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
[ "$$failed" = "0" ] && $(ECHO) All required tools have been found!
@$(ECHO)
@if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
failed=0; \
checkheader() \
{ \
$(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
if \
$(CXX) conftest.cpp $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS) $(CPPFLAGS_COMMON) $$4 -DCONFTEST_HEADER="<$$2>" -DCONFTEST_SYMBOL="$$3" $(TARGET_ARCH) $(LDFLAGS) -c -o conftest.o >&3 $(STDERR_TO_STDOUT); \
then \
if \
$(CXX) conftest.o $(LDFLAGS) $(LDFLAGS_COMMON) $$5 $(LIBS_COMMON) $(LIBS) -o conftest >&3 $(STDERR_TO_STDOUT); \
then \
$(RM) conftest conftest.o conftest.d; \
$(ECHO) "found and links."; \
else \
$(RM) conftest.o conftest.d; \
$(ECHO) "found but does not link, please install it or set PKG_CONFIG_PATH right!"; \
$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
failed=1; \
fi; \
else \
$(RM) conftest conftest.o conftest.d; \
$(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \
$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
failed=1; \
fi; \
}; \
$(ECHO) checking that the dependencies exist; \
checkheader libjpeg8-dev jpeglib.h jpeg_set_defaults "$(CPPFLAGS_JPEG)" "$(LIBS_JPEG)"; \
checkheader glib2 gutils.h "/usr/include/glib-2.0/glib/"; \
checkheader libxml2-dev libxml/xpath.h xmlXPathInit "$(CPPFLAGS_XML)" "$(LIBS_XML)"; \
checkheader libpng12-dev png.h png_create_read_struct "$(CPPFLAGS_PNG)" "$(LIBS_PNG)"; \
checkheader "mesa-common-dev (or another OpenGL library)" GL/gl.h glClear "$(CPPFLAGS_GL)" "$(LIBS_GL)"; \
checkheader libgtk2.0-dev gtk/gtkdialog.h gtk_dialog_run "$(CPPFLAGS_GTK)" "$(LIBS_GTK)"; \
checkheader libpango1.0-dev pango/pangoft2.h pango_ft2_font_map_new "$(CPPFLAGS_PANGOFT2)" "$(LIBS_PANGOFT2)"; \
checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \
[ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
[ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
@$(ECHO)
endif

.PHONY: binaries
binaries: \
binaries-tools \
binaries-radiant \

.PHONY: binaries-radiant-all
binaries-radiant: \
binaries-radiant-modules \
binaries-radiant-plugins \
binaries-radiant-core \

.PHONY: binaries-radiant-modules
binaries-radiant-modules: \
$(INSTALLDIR)/modules/archivepak.$(DLL) \
$(INSTALLDIR)/modules/archivewad.$(DLL) \
$(INSTALLDIR)/modules/archivezip.$(DLL) \
$(INSTALLDIR)/modules/entity.$(DLL) \
$(INSTALLDIR)/modules/image.$(DLL) \
$(INSTALLDIR)/modules/imagehl.$(DLL) \
$(INSTALLDIR)/modules/imagepng.$(DLL) \
$(INSTALLDIR)/modules/imageq2.$(DLL) \
$(INSTALLDIR)/modules/mapq3.$(DLL) \
$(INSTALLDIR)/modules/mapxml.$(DLL) \
$(INSTALLDIR)/modules/md3model.$(DLL) \
$(INSTALLDIR)/modules/model.$(DLL) \
$(INSTALLDIR)/modules/shaders.$(DLL) \
$(INSTALLDIR)/modules/vfspk3.$(DLL) \

Last edited by VolumetricSteve; 06-19-2015 at 11:25 PM. Reason: fixing post
 
Old 06-20-2015, 12:27 AM   #2
VolumetricSteve
Member
 
Registered: Mar 2011
Posts: 90

Original Poster
Rep: Reputation: 7
Issue fixed, glib2 needs to be called glib-2.0, even though the package name is glib2.
 
Old 06-20-2015, 01:29 AM   #3
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246

Rep: Reputation: 22
Deleted.

Last edited by Arcosanti; 06-20-2015 at 01:58 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
./ configure for midnight commander cannot find glib library Gary Baker Programming 2 12-04-2012 09:00 AM
cant find a library though it is installed lemon09 Linux - Newbie 2 09-18-2011 04:45 AM
install from source - unable to find the libcurl library - but library is installed pulper Linux - Newbie 2 02-23-2009 09:00 PM
I *just installed* glib but pango can't find it Avatar Linux - Software 5 09-14-2005 01:07 PM
Compiled en installed new Glib but Pango won't find it Haiyadragon Linux - Newbie 1 04-03-2004 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration