Errors building glibc: what is wrong with the make

2019-08-05 23:55发布

问题:

I have been trying to build glibc on Clear Linux, with a previous issue discussed here: How do I build into a specified directory using the "prefix" option of configure?

Now that I have succeeded in running configure, there seems to be something wrong in the makefile:

james@clr ~/Downloads/glibc $ make
Makeconfig:42: *** missing separator.  Stop.

line 42 of Makeconfig:

objdir must be defined by the build-directory Makefile.

and the nakefile up to the point of error:

ifneq (,)
This makefile requires GNU Make.
endif

all: # Make this the default goal

ifneq "$(origin +included-Makeconfig)" "file"

+included-Makeconfig := yes

ifdef subdir
.. := ../
endif

# $(common-objdir) is the place to put objects and
# such that are not specific to a single subdir.
ifdef objdir
objpfx := $(patsubst %//,%/,$(objdir)/$(subdir)/)
common-objpfx = $(objdir)/
common-objdir = $(objdir)
else
objdir must be defined by the build-directory Makefile.
endif

I have GNU Make 4.2.1

回答1:

You're seeing an error because this makefile thinks your environment is wrong. The line in the makefile that you're running is purposefully a syntax error: no amount of editing these lines will change it into a correct line because its entire purpose is to force make to fail when it sees an invalid configuration.

The error it's trying to tell you about is right there in the text:

objdir must be defined by the build-directory Makefile.

The makefile checks to see if the objdir variable is defined and if not, it falls through to this invalid syntax.

I haven't tried to build glibc myself in quite a while so I can't say exactly what that means but I'm sure if you Google that error message you'll find some information that will let you move forward.

It's too bad that this makefile doesn't use more readable ways of specifying errors such as the $(error ...) function (added in GNU make 3.78, released in 1999).