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

syntax error near unexpected token `jp2a' #7

Closed
eribertomota opened this issue Oct 10, 2020 · 12 comments
Closed

syntax error near unexpected token `jp2a' #7

eribertomota opened this issue Oct 10, 2020 · 12 comments

Comments

@eribertomota
Copy link

Dear Christoph,

When trying to build jp2a from source on Debian, I got an error. Please, see below:

$ autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal 
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
autoreconf: Leaving directory `.'

$ ./configure
./configure: line 2249: syntax error near unexpected token `jp2a'
./configure: line 2249: `DX_INIT_DOXYGEN(jp2a)'

Note that the macro DX_INIT_DOXYGEN wasn't expanded and it is now inside configure file:

$ grep DX_INIT_DOXYGEN configure -C2

DX_INIT_DOXYGEN(jp2a)
am__api_version='1.16'

Consequently, I can't package the current version.

Cheers,

Eriberto

@ehaupt
Copy link

ehaupt commented Oct 10, 2020

Same here for FreeBSD.

I was trying to update the FreeBSD port with the same result as @eribertomota.

# autoreconf -vi
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: configure.ac: not using Gettext
autoreconf-2.69: running: aclocal
autoreconf-2.69: configure.ac: tracing
autoreconf-2.69: configure.ac: not using Libtool
autoreconf-2.69: running: /usr/local/bin/autoconf-2.69
autoreconf-2.69: running: /usr/local/bin/autoheader-2.69
autoreconf-2.69: running: automake --add-missing --copy --no-force
configure.ac:13: installing './compile'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
autoreconf-2.69: Leaving directory `.'
# ./configure --with-jpeg-prefix=/usr/local --with-curl-config=/usr/local/bin/curl-config
./configure: 2241: Syntax error: word unexpected (expecting ")")

Tinkering with it I run into further Doxygen unrelated issues:

# diff -uN configure.ac.orig configure.ac
--- configure.ac.orig   2020-10-06 13:45:32.000000000 +0200
+++ configure.ac        2020-10-10 15:27:06.426108000 +0200
@@ -3,7 +3,6 @@
 
 AC_PREREQ([2.69])
 AC_INIT([jp2a],[1.1.0],[chris-r@posteo.net], [jp2a], [https://github.com/Talinx/jp2a])
-DX_INIT_DOXYGEN([jp2a])
 AM_INIT_AUTOMAKE(dist-bzip2 dist-zip)
 AC_CONFIG_SRCDIR(src/jp2a.c)
 AC_CONFIG_HEADERS([config.h])
# diff -uN Makefile.am.orig Makefile.am
--- Makefile.am.orig    2020-10-06 13:45:32.000000000 +0200
+++ Makefile.am 2020-10-10 15:28:43.355526000 +0200
@@ -12,8 +12,6 @@
 check: all
        $(MAKE) -C tests check
 
-@DX_RULES@
-
 editdx = sed -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' -e 's|@top_srcdir[@]|$(top_srcdir)|g'
 Doxyfile: Doxyfile.in
        $(editdx) $(srcdir)/$@.in > $@.tmp

cc  -g -O2  -L/usr/local/lib -o jp2a aspect_ratio.o html.o  terminal.o curl.o jp2a.o  options.o image.o  -ljpeg -lcurl  -lncurses
ld: error: undefined symbol: __isfinitef
>>> referenced by options.c:427
>>>               options.o:(parse_options)

ld: error: undefined symbol: __isfinitef
>>> referenced by options.c:427
>>>               options.o:(parse_options)

ld: error: undefined symbol: __isfinitef
>>> referenced by options.c:427
>>>               options.o:(parse_options)

ld: error: undefined symbol: png_get_image_width
>>> referenced by image.c:410
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_get_image_height
>>> referenced by image.c:411
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_get_channels
>>> referenced by image.c:412
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_get_color_type
>>> referenced by image.c:413
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_get_interlace_type
>>> referenced by image.c:430
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_get_bit_depth
>>> referenced by image.c:438
>>>               image.o:(print_info_png)

ld: error: undefined symbol: png_sig_cmp
>>> referenced by image.c:730
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_create_read_struct
>>> referenced by image.c:737
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_create_info_struct
>>> referenced by image.c:742
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_set_longjmp_fn
>>> referenced by image.c:748
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_destroy_read_struct
>>> referenced by image.c:751
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_init_io
>>> referenced by image.c:756
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_set_sig_bytes
>>> referenced by image.c:757
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_read_info
>>> referenced by image.c:758
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_get_image_width
>>> referenced by image.c:760
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_get_image_height
>>> referenced by image.c:761
>>>               image.o:(decompress_png)

ld: error: undefined symbol: png_get_color_type
>>> referenced by image.c:771
>>>               image.o:(decompress_png)

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

In the meantime I've marked this release broken for FreeBSD ports.

@Talinx
Copy link
Owner

Talinx commented Oct 10, 2020

Running autoreconf -vi requires autoconf-archive because the DX_INIT_DOXYGEN macro is in autoconf-archive.

Since 1.1.0 adds support for PNG images libpng is also required.

@ehaupt
Copy link

ehaupt commented Oct 10, 2020

Interesting, pulling in autoconf-archive solves the macro error.

png-1.6.37 is installed and available:

# ldconfig -r | grep -i png
        203:-lpng16.16 => /usr/local/lib/libpng16.so.16

Maybe there is a version incompatibility. Here is a typescript.txt of the build process along with the config.log.

@ehaupt
Copy link

ehaupt commented Oct 10, 2020

I just solved it. Turns out the linker needs -lm for FreeBSD. I'll be able to patch that.

@Talinx
Copy link
Owner

Talinx commented Oct 10, 2020

Adding AC_SEARCH_LIBS([floor], [m]) to configure.ac (and then running autoreconf -vi and ./configure) results in -lm being added.
I don't have a FreeBSD install at the moment and therefore don't know if that works for FreeBSD, but I'd like to know what your solution is.

@ehaupt
Copy link

ehaupt commented Oct 10, 2020

For the ports framework I could just add -lm to LDFLAGS in the build env. However, adding AC_SEARCH_LIBS([floor], [m]) does work and would be my preferred solution. Could you include this upstream?

Talinx added a commit that referenced this issue Oct 10, 2020
@Talinx
Copy link
Owner

Talinx commented Oct 10, 2020

For the ports framework I could just add -lm to LDFLAGS in the build env. However, adding AC_SEARCH_LIBS([floor], [m]) does work and would be my preferred solution. Could you include this upstream?

Here you go.
Do you need a new release because of this change? I don't know if a small change to a configuration file justifies that, after all the generated binary doesn't change.

@ehaupt
Copy link

ehaupt commented Oct 10, 2020

Thank you @Talinx. I won't need a new release. I'll just remove the additional LDFLAGS whenever there is a new version.

@Talinx
Copy link
Owner

Talinx commented Oct 10, 2020

Good. Thank you @ehaupt for packaging jp2a.

@eribertomota
Copy link
Author

Hi @Talinx,

With autoconf-archive the jp2a builds fine. Can you add to README.md all build dependencies needed by jp2a? It is very important for all users.

Cheers,

Eriberto

Talinx added a commit that referenced this issue Oct 11, 2020
@Talinx
Copy link
Owner

Talinx commented Oct 11, 2020

Can you add to README.md all build dependencies needed by jp2a? It is very important for all users.

Hello @eribertomota,

good idea, I added an overview of all dependencies.

Best regards,
Christoph

@eribertomota
Copy link
Author

Sent to Debian. Feel free to close this issue. Thanks!

@Talinx Talinx closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants