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

Configure broken on python check #384

Closed
davelab6 opened this issue Mar 5, 2013 · 36 comments · Fixed by #387
Closed

Configure broken on python check #384

davelab6 opened this issue Mar 5, 2013 · 36 comments · Fixed by #387
Assignees
Labels

Comments

@davelab6
Copy link
Member

davelab6 commented Mar 5, 2013

FontForge won't build for me right now, giving a python error:

$ ./configure --disable-python-scripting --disable-python-extension

...

./configure: line 19733: syntax error near unexpected token `PYTHON,python-"${PYTHON_VERSION}",,i_do_have_python_scripting=no'
./configure: line 19733: `   PKG_CHECK_MODULES(PYTHON,python-"${PYTHON_VERSION}",,i_do_have_python_scripting=no; force_off_python_extension=yes)'
make: *** [config.status] Error 2
@ghost ghost assigned monkeyiq Mar 5, 2013
@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

@coolwanglu @JoesCat could this have been caused by your recent merges?

@coolwanglu
Copy link
Contributor

I saw it on ubuntu 12.04, then fixed it by installing pkg-config or something, let me check now.

@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

This is on Fedora 18, and I had build FF last week successfully on this machine.

Package 1:pkgconfig-0.25-4.fc17.x86_64 already installed and latest version

@coolwanglu
Copy link
Contributor

Did you see any error of ./autogen.sh, actually I saw some warning there before this message.

@coolwanglu
Copy link
Contributor

AFAIK, PKG_CHECK_MODULES should appear in configure.ac instead of configure, so I guess you need a reconf

@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

Yes, actually there is an error in autogen.sh:

$ ./autogen.sh 
Preparing the fontforge build system...please wait

Found GNU Autoconf version 2.69
Found GNU Automake version 1.12.6
Found GNU Libtool version 2.4.2

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... 
Warning:  Unsupported macros were found in ./configure.ac

The configure.ac file was scanned in order to determine if any
unsupported macros are used that exceed the minimum version
settings specified within this file.  As such, the following macros
should be removed from configure.ac or the version numbers in this
file should be increased:

AC_FUNC_REALLOC AC_HEADER_STDBOOL

Ignorantly continuing build preparation ... 
Warning: autoconf seems to have succeeded by removing the following options:
    AUTOCONF_OPTIONS="-f"

Removing those options should not be necessary and indicate some other
problem with the build system.  The build preparation is highly suspect
and may result in configuration or compilation errors.  Consider
rerunning the build preparation with verbose output enabled.
    ./autogen.sh --verbose

Continuing build preparation ... done

The fontforge build system is now prepared.  To build here, run:
  ./configure
  make

@coolwanglu
Copy link
Contributor

Yes, that was exactly what I have seen. Not sure what I have done to remove them..

@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

Hmm! https://github.com/fontforge/fontforge/blame/master/autogen.sh says this file was last changed 6 months ago..

@coolwanglu
Copy link
Contributor

I thinks it's about configure.ac, since autogen.sh is roughly a wrapper
of autoreconf

On Wed, Mar 6, 2013 at 12:29 AM, Dave Crossland notifications@github.comwrote:

Hmm! https://github.com/fontforge/fontforge/blob/master/autogen.sh says
this file was last changed 6 months ago..


Reply to this email directly or view it on GitHubhttps://github.com//issues/384#issuecomment-14449312
.

@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

Yes, sorry, https://github.com/fontforge/fontforge/blame/master/configure.ac says these parts of the file were last changed 6 months ago..

@ghost ghost assigned JoesCat Mar 5, 2013
@davelab6
Copy link
Member Author

davelab6 commented Mar 5, 2013

Hmm well I guess it was introduced by @JoesCat - could you take a look? :)

@JoesCat
Copy link
Contributor

JoesCat commented Mar 6, 2013

We can pretty well leave autoconf.sh alone, if you go upstream, it's pretty-close to the identical file.

I don't see this error appear on my machine, perhaps because it is an older Mageia 1 while some of the things mentioned below suggest this is possibly more recent events.

Typing "AC_FUNC_REALLOC" brings-up several things. If it's old, like 2004, it is maybe useful:
http://marc.info/?l=gnulib-bug&m=124788574915484
If it's more recent, it mentions autoscan not being maintained, and best to remove it since we AC_FUNC_MALLOC and AC_FUNC_REALLOC only test for malloc(0) and realloc(x,0)
http://arthur.barton.de/pipermail/ngircd-git-ml/2012-September/001049.html
http://gnu-autoconf.7623.n7.nabble.com/AC-FUNC-MALLOC-AC-FUNC-REALLOC-and-crossbuilding-with-mingw-td10259.html
http://lists.gnu.org/archive/html/autoconf/2012-02/msg00025.html

I've added a pullrequest but you need to try it first since I can't see this problem.
#387
Note, this doesn't fix AC_HEADER_STDBOOL, but it is probably going to use the same fix.
Sortsmill went and used boolean, but we aren't using boolean - closest we do is a variable named gboolean
I'll have to read-up on if we really want to keep the check unless someone else already wants to decide on this, but I don't think we need AC_HEADER_STDBOOL - and once again, I'm not seeing an error message for this either.

@JoesCat
Copy link
Contributor

JoesCat commented Mar 6, 2013

refreshed directory - no complaints from sh autogen.sh
I'm currently running:
Found GNU Autoconf version 2.68
Found GNU Automake version 1.11.1
Found GNU Libtool version 2.4

Tried "./configure --disable-python-scripting --disable-python-extension" and no errors.
It appears I will have to load up Mageia3 and try that later if it's due to an updated autoxxxx or libtool.

@coolwanglu
Copy link
Contributor

Note that before the error details, there is
Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

So the later messages should come from individual steps.

What do you get from autoreconf -i -f?

@JoesCat
Copy link
Contributor

JoesCat commented Mar 6, 2013

Nothing appears to stand-out - this is literally what I got now when doing autoreconf -i -f

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, config'. libtoolize: copying fileconfig/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. libtoolize: copying filem4/argz.m4'
libtoolize: copying file m4/libtool.m4' libtoolize: copying filem4/ltdl.m4'
libtoolize: copying file m4/ltoptions.m4' libtoolize: copying filem4/ltsugar.m4'
libtoolize: copying file m4/ltversion.m4' libtoolize: copying filem4/lt~obsolete.m4'
libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, libltdl'. libtoolize: copying filelibltdl/COPYING.LIB'
libtoolize: copying file libltdl/README' libtoolize: copying filelibltdl/argz_.h'
libtoolize: copying file libltdl/argz.c' libtoolize: copying filelibltdl/loaders/dld_link.c'
libtoolize: copying file libltdl/loaders/dlopen.c' libtoolize: copying filelibltdl/loaders/dyld.c'
libtoolize: copying file libltdl/loaders/load_add_on.c' libtoolize: copying filelibltdl/loaders/loadlibrary.c'
libtoolize: copying file libltdl/loaders/shl_load.c' libtoolize: copying filelibltdl/lt__dirent.c'
libtoolize: copying file libltdl/lt__strl.c' libtoolize: copying filelibltdl/libltdl/lt__alloc.h'
libtoolize: copying file libltdl/libltdl/lt__dirent.h' libtoolize: copying filelibltdl/libltdl/lt__glibc.h'
libtoolize: copying file libltdl/libltdl/lt__private.h' libtoolize: copying filelibltdl/libltdl/lt__strl.h'
libtoolize: copying file libltdl/libltdl/lt_dlloader.h' libtoolize: copying filelibltdl/libltdl/lt_error.h'
libtoolize: copying file libltdl/libltdl/lt_system.h' libtoolize: copying filelibltdl/libltdl/slist.h'
libtoolize: copying file libltdl/loaders/preopen.c' libtoolize: copying filelibltdl/lt__alloc.c'
libtoolize: copying file libltdl/lt_dlloader.c' libtoolize: copying filelibltdl/lt_error.c'
libtoolize: copying file libltdl/ltdl.c' libtoolize: copying filelibltdl/ltdl.h'
libtoolize: copying file libltdl/slist.c' libtoolize: creating filelibltdl/Makefile.am'

@coolwanglu
Copy link
Contributor

I guess @davelab may see some error output from this command.

On Wed, Mar 6, 2013 at 10:02 AM, Joe notifications@github.com wrote:

Nothing appears to stand-out - this is literally what I got now when doing
autoreconf -i -f

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, config'.
libtoolize: copying fileconfig/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'.
libtoolize: copying filem4/argz.m4'
libtoolize: copying file m4/libtool.m4'
libtoolize: copying filem4/ltdl.m4'
libtoolize: copying file m4/ltoptions.m4'
libtoolize: copying filem4/ltsugar.m4'
libtoolize: copying file m4/ltversion.m4'
libtoolize: copying filem4/lt~obsolete.m4'
libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, libltdl'.
libtoolize: copying filelibltdl/COPYING.LIB'
libtoolize: copying file libltdl/README'
libtoolize: copying filelibltdl/argz_.h'
libtoolize: copying file libltdl/argz.c'
libtoolize: copying filelibltdl/loaders/dld_link.c'
libtoolize: copying file libltdl/loaders/dlopen.c'
libtoolize: copying filelibltdl/loaders/dyld.c'
libtoolize: copying file libltdl/loaders/load_add_on.c'
libtoolize: copying filelibltdl/loaders/loadlibrary.c'
libtoolize: copying file libltdl/loaders/shl_load.c'
libtoolize: copying filelibltdl/lt__dirent.c'
libtoolize: copying file libltdl/lt__strl.c'
libtoolize: copying filelibltdl/libltdl/lt__alloc.h'
libtoolize: copying file libltdl/libltdl/lt__dirent.h'
libtoolize: copying filelibltdl/libltdl/lt__glibc.h'
libtoolize: copying file libltdl/libltdl/lt__private.h'
libtoolize: copying filelibltdl/libltdl/lt__strl.h'
libtoolize: copying file libltdl/libltdl/lt_dlloader.h'
libtoolize: copying filelibltdl/libltdl/lt_error.h'
libtoolize: copying file libltdl/libltdl/lt_system.h'
libtoolize: copying filelibltdl/libltdl/slist.h'
libtoolize: copying file libltdl/loaders/preopen.c'
libtoolize: copying filelibltdl/lt__alloc.c'
libtoolize: copying file libltdl/lt_dlloader.c'
libtoolize: copying filelibltdl/lt_error.c'
libtoolize: copying file libltdl/ltdl.c'
libtoolize: copying filelibltdl/ltdl.h'
libtoolize: copying file libltdl/slist.c'
libtoolize: creating filelibltdl/Makefile.am'


Reply to this email directly or view it on GitHubhttps://github.com//issues/384#issuecomment-14478011
.

@davelab6
Copy link
Member Author

davelab6 commented Mar 6, 2013

Yep :(

checking for plutil... /usr/bin/plutil
./configure: line 19733: syntax error near unexpected token `PYTHON,python-"${PYTHON_VERSION}",,i_do_have_python_scripting=no'
./configure: line 19733: `   PKG_CHECK_MODULES(PYTHON,python-"${PYTHON_VERSION}",,i_do_have_python_scripting=no; force_off_python_extension=yes)'

$ autoreconf -i -f
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/argz.m4'
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltdl.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `libltdl'.
libtoolize: copying file `libltdl/COPYING.LIB'
libtoolize: copying file `libltdl/README'
libtoolize: copying file `libltdl/argz_.h'
libtoolize: copying file `libltdl/argz.c'
libtoolize: copying file `libltdl/loaders/dld_link.c'
libtoolize: copying file `libltdl/loaders/dlopen.c'
libtoolize: copying file `libltdl/loaders/dyld.c'
libtoolize: copying file `libltdl/loaders/load_add_on.c'
libtoolize: copying file `libltdl/loaders/loadlibrary.c'
libtoolize: copying file `libltdl/loaders/shl_load.c'
libtoolize: copying file `libltdl/lt__dirent.c'
libtoolize: copying file `libltdl/lt__strl.c'
libtoolize: copying file `libltdl/libltdl/lt__alloc.h'
libtoolize: copying file `libltdl/libltdl/lt__dirent.h'
libtoolize: copying file `libltdl/libltdl/lt__glibc.h'
libtoolize: copying file `libltdl/libltdl/lt__private.h'
libtoolize: copying file `libltdl/libltdl/lt__strl.h'
libtoolize: copying file `libltdl/libltdl/lt_dlloader.h'
libtoolize: copying file `libltdl/libltdl/lt_error.h'
libtoolize: copying file `libltdl/libltdl/lt_system.h'
libtoolize: copying file `libltdl/libltdl/slist.h'
libtoolize: copying file `libltdl/loaders/preopen.c'
libtoolize: copying file `libltdl/lt__alloc.c'
libtoolize: copying file `libltdl/lt_dlloader.c'
libtoolize: copying file `libltdl/lt_error.c'
libtoolize: copying file `libltdl/ltdl.c'
libtoolize: copying file `libltdl/ltdl.h'
libtoolize: copying file `libltdl/slist.c'
libtoolize: creating file `libltdl/Makefile.am'
configure.ac:65: error: possibly undefined macro: AC_SUBST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:20231: error: possibly undefined macro: AS_TR_SH
autoreconf: /usr/local/bin/autoconf failed with exit status: 1
$

@coolwanglu
Copy link
Contributor

@davelab6
I can reproduce this message by removing /usr/share/aclocal/pkg.m4 from the pkg-config package. Not sure if this is your case.

@davelab6
Copy link
Member Author

davelab6 commented Mar 6, 2013

I have it.

$ head /usr/share/aclocal/pkg.m4 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
# 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#

@coolwanglu
Copy link
Contributor

My suggestion is to run git clean -d - f (or maybe just remove aclocal.m4 ?)
And run autoreconf -I m4 -i -f

@davelab6
Copy link
Member Author

davelab6 commented Mar 6, 2013

$ autoreconf -I m4 -i -f
configure.ac:65: error: possibly undefined macro: AC_SUBST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:8634: error: possibly undefined macro: AS_TR_SH
autoreconf: /usr/local/bin/autoconf failed with exit status: 1
$

@coolwanglu
Copy link
Contributor

I've no idea right now :(

Probably #245 is related?

@coolwanglu
Copy link
Contributor

On a fresh Fedora 18 LXDE 64bit, with the fix in #245
./autogen.sh and ./configure work fine
So maybe you need newer version of autotools ?

Found GNU Autoconf version 2.69
Found GNU Automake version 1.12.2
Found GNU Libtool version 2.4.2

@JoesCat
Copy link
Contributor

JoesCat commented Mar 6, 2013

@coolwanglu Thanks for figuring this out - will need to wait for Dave to confirm if it's #245 that needs to be included.

@davelab6
Copy link
Member Author

davelab6 commented Mar 6, 2013

As you can see above, I have the same versions of autotools (or higher) than you:

Found GNU Autoconf version 2.69
Found GNU Automake version 1.12.6
Found GNU Libtool version 2.4.2

I have that package installed:

Package libtool-ltdl-devel-2.4.2-3.1.fc17.x86_64 already installed and latest version

I will try with a fresh install.

@coolwanglu
Copy link
Contributor

oops, I was looking at @JoesCat 's log...

@coolwanglu
Copy link
Contributor

how about a clean git clone first

@JoesCat
Copy link
Contributor

JoesCat commented Mar 6, 2013

Hi Dave, I tried a live Mageia3 seems to work okay. However, I did preload several libraries before starting since I was not about to install it yet, therefore I did not actually exercise the possibility of "something not found" causing an error.

In your error, if you notice the "...syntax error near unexpected token..." in your error message and reading a variety of other people's messages seems to suggest PKG_CHECK_MODULES() has an issue in not finding something if it is not in an expected location and then borking. Here's one example, but there are more:
stlink-org/stlink#83

Simply typing PKG_CHECK_MODULES into google seems to bring up problems and issues instead of a definition, so it may be suspect.

Use a fresh git clone
When you try a clean install, and it fails (it may be due to the autotool system not checking for everything it needs), then preload some required libraries and try a new fresh git clone again just to be sure.

My suggested preload...libpangox libcairo autogen automake autoconf make libtool gcc libltdl gettext (note, choose developer versions if you get a choice of packages since you need header info to build FF).

@coolwanglu
Copy link
Contributor

I simply use apt-get build-dep or yum-builddep

On Thursday, March 7, 2013, Joe wrote:

Hi Dave, I tried a live Mageia3 seems to work okay. However, I did preload
several libraries before starting since I was not about to install it yet,
therefore I did not actually exercise the possibility of "something not
found" causing an error.

In your error, if you notice the "...syntax error near unexpected
token..." in your error message and reading a variety of other people's
messages seems to suggest PKG_CHECK_MODULES() has an issue in not finding
something if it is not in an expected location and then borking. Here's one
example, but there are more:
stlink-org/stlink#83 stlink-org/stlink#83

Simply typing PKG_CHECK_MODULES into google seems to bring up problems and
issues instead of a definition, so it may be suspect.

Use a fresh git clone
When you try a clean install, and it fails (it may be due to the autotool
system not checking for everything it needs), then preload some required
libraries and try a new fresh git clone again just to be sure.

My suggested preload...libpangox libcairo autogen automake autoconf make
libtool gcc libltdl gettext (note, choose developer versions if you get a
choice of packages since you need header info to build FF).


Reply to this email directly or view it on GitHubhttps://github.com//issues/384#issuecomment-14525176
.

@coolwanglu
Copy link
Contributor

@JoesCat From the error message you can see that PKG_CHECK_MODULES appears in configure, which should have been substituted by autoreconf. I guess you cannot see this macro in your configure

@arne-strout-icrossing
Copy link

I am getting the same build error
configure.ac:66: error: possibly undefined macro: AC_SUBST
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:264: error: possibly undefined macro: AC_DEFINE
configure.ac:351: error: possibly undefined macro: AC_CHECK_FUNC
configure:20228: error: possibly undefined macro: AS_TR_SH

@arne-strout-icrossing
Copy link

My autoconf,automake,libtool versions:
Found GNU Autoconf version 2.69
Found GNU Automake version 1.13.1
Found GNU Libtool version 2.4

@Rameshv
Copy link

Rameshv commented May 22, 2013

I am also having the same issue

configure.ac:66: error: possibly undefined macro: AC_SUBST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:260: error: possibly undefined macro: AC_DEFINE
configure.ac:361: error: possibly undefined macro: AC_CHECK_FUNC
configure:19864: error: possibly undefined macro: AS_TR_SH
autoreconf: /usr/local/bin/autoconf failed with exit status: 1

My code base is latest. @davelab6 are you still facing the issue or is it resolved?

@JoesCat
Copy link
Contributor

JoesCat commented May 22, 2013

On May 22, 2013 04:33:21 AM Ramesh Vel wrote:

I am also having the same issue

My code base is latest. @davelab6 are you still facing the issue or is
it resolved?

Apparently not resolved if you have this issue.

Which distro are you using?
version?
32bit or 64bit?

I'm guessing autoconf 2.69 instead of 2.68 or lower.

Did you run sh autogen.sh first? I think it takes care of a few deficiencies
before you get to "autoconf -i" or "autoreconf -i"

@Rameshv
Copy link

Rameshv commented May 23, 2013

@JoesCat
My environment is 64 bit ubuntu 12.10.

with autoconf 2.68 and automake 1.11.3 - I got the exception

Then I have compiled & installed autoconf 2.69 - and tried fontforge, got the same exception.
And installed automake 1.11.4 from source. Now this time I got the weird exception in fonforge compilation,

 Autoconf requires automake 1.6 or later

But when i checked, automake 1.11.4 is the latest. So i removed automake by make uninstall and got my old 1.11.3 version back.

And tried fontforge again. It worked. I really dont understand how install & uninstall of automake 1.11.4 solved this issue.

@codeberg
Copy link

codeberg commented Nov 6, 2013

Is "got the old 1.11.3 version back" the actual solution to solve this problem? I bumped into the same issue and tried to install/uninstall automake 1.11.3 but it still failed. Couldn't figure out how to move on. Any advice would be really really appreciated .

blipvert pushed a commit to blipvert/fontforge that referenced this issue Dec 12, 2013
This should fix fontforge#384 in terms
of AC_FUNC_MALLOC and AC_FUNC_REALLOC so if someone runs autoscan it won't
get re-inserted to test for this again.
blipvert pushed a commit to blipvert/fontforge that referenced this issue Dec 12, 2013
This should fix fontforge#384 in terms
of AC_FUNC_MALLOC and AC_FUNC_REALLOC so if someone runs autoscan it won't
get re-inserted to test for this again.
JoesCat added a commit to JoesCat/fontforge that referenced this issue Aug 2, 2016
The "python" program to build these files contributed to a headache
worth of problems earlier between 2012 and 2014 when Fontforge built
python as an "optional" choice and not a "forced" dependency. Removing
the python program allowed us to continue onto 20140101 and onwards...
Example problems/issues fontforge#384, fontforge#387, fontforge#229, fontforge#565, fontforge#382, fontforge#241, fontforge#249, fontforge#233

makeutype.c already uses the Unicode list, so it can do this here too.
Omnikron13 pushed a commit to Omnikron13/fontforge that referenced this issue May 31, 2022
The "python" program to build these files contributed to a headache
worth of problems earlier between 2012 and 2014 when Fontforge built
python as an "optional" choice and not a "forced" dependency. Removing
the python program allowed us to continue onto 20140101 and onwards...
Example problems/issues fontforge#384, fontforge#387, fontforge#229, fontforge#565, fontforge#382, fontforge#241, fontforge#249, fontforge#233

makeutype.c already uses the Unicode list, so it can do this here too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants