axel-download-accelerator / axel

Lightweight CLI download accelerator
GNU General Public License v2.0
2.87k stars 258 forks source link

Issue with compile in OS X El Capitan 10.11.3 #9

Closed sijad closed 8 years ago

sijad commented 8 years ago

tried make after ./configure command and got this:

Undefined symbols for architecture x86_64:
  "_libintl_bindtextdomain", referenced from:
      _main in text.o
  "_libintl_gettext", referenced from:
      _axel_new in axel.o
      _axel_open in axel.o
      _axel_start in axel.o
      _axel_do in axel.o
      _conf_loadfile in conf.o
      _conn_info in conn.o
      _ftp_connect in ftp.o
      ...
  "_libintl_setlocale", referenced from:
      _main in text.o
  "_libintl_textdomain", referenced from:
      _main in text.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [axel] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

installed gettext via homebrew:

brew install gettext --universal; brew link gettext --force 

any idea?

sdt commented 8 years ago

Something's broken in the autotools stuff.

If I configure like so: ./configure --with-libintl-prefix=/usr/local/opt/gettext

I see this near the end of the configure run: checking how to link with libintl... -L/usr/local/opt/gettext/lib -lintl -Wl,-framework -Wl,CoreFoundation

Compiles seem to get the correct flags: gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\""/usr/local/share/locale"\" -I/usr/local/opt/gettext/include -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -MT text.o -MD -MP -MF .deps/text.Tpo -c -o text.o text.c

But linking misses out: gcc -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -pthread -o axel axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o

If I manually edit src/Makefile and add ${LIBINTL} to the LDFLAGS line then it successfully links.

I don't really know anything about autotools, so I have not idea of how to properly fix this.

eribertomota commented 8 years ago

I think it is a local issue.

To test axel, I uploaded to experimental in Debian yesterday and axel was built in all archs[1].

I will upload to unstable[2] in some minutes.

[1] https://buildd.debian.org/status/package.php?p=axel&suite=experimental [2] https://buildd.debian.org/status/package.php?p=axel&suite=sid

Please, tell me about any test that compiles axel in your machine.

Regards,

Eriberto

2016-03-20 20:06 GMT-03:00 Stephen Thirlwall notifications@github.com:

Something's broken in the autotools stuff.

If I configure like so: ./configure --with-libintl-prefix=/usr/local/opt/gettext

I see this near the end of the configure run: checking how to link with libintl... -L/usr/local/opt/gettext/lib -lintl -Wl,-framework -Wl,CoreFoundation

Compiles seem to get the correct flags: gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\""/usr/local/share/locale"\" -I/usr/local/opt/gettext/include -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -MT text.o -MD -MP -MF .deps/text.Tpo -c -o text.o text.c

But linking misses out: gcc -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -pthread -o axel axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o

If I manually edit src/Makefile and add ${LIBINTL} to the LDFLAGS line then it successfully links.

I don't really know anything about autotools, so I have not idea of how to properly fix this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/eribertomota/axel/issues/9#issuecomment-199056631

eribertomota commented 8 years ago

Please, do a test:

  1. Edit configure.ac
  2. Change from

LDFLAGS="$LDFLAGS -pthread"

to

LDFLAGS="$LDFLAGS -lintl -pthread"

  1. Run $ autoreconf
  2. Run $ configure, make etc.

I will wait a reply.

sijad commented 8 years ago

@sdt @eribertomota yes adding -lintl and run autoreconf fixed this thanks

eribertomota commented 8 years ago

Please, can you test the current commit in GitHub? Download here:

https://github.com/eribertomota/axel/archive/master.zip

Thanks a lot in advance!

sdt commented 8 years ago

I can confirm LDFLAGS="$LDFLAGS -lintl -pthread" works for me

eribertomota commented 8 years ago

Stephen, please, test the last commit...

sdt commented 8 years ago

Current master works for me.

Additionally, I've got gettext installed via homebrew like @sijad, except I haven't force-linked it like he has.

I need to specify the include and library paths when running configure like this:

CFLAGS=-I/usr/local/opt/gettext/include LDFLAGS=-L/usr/local/opt/gettext/lib ./configure

The CFLAGS and LDFLAGS options now get passed through to the Makefile as expected.

eribertomota commented 8 years ago

Good, thanks! So this issue is solved.

I will wait for @sijad and close.

Cheers,

Eriberto

2016-03-21 21:17 GMT-03:00 Stephen Thirlwall notifications@github.com:

Current master works for me.

Additionally, I've got gettext installed via homebrew like @sijad https://github.com/sijad, except I haven't force-linked it like he has.

I need to specify the include and library paths when running configure like this:

CFLAGS=-I/usr/local/opt/gettext/include LDFLAGS=-L/usr/local/opt/gettext/lib ./configure

The CFLAGS and LDFLAGS options now get passed through to the Makefile as expected.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/eribertomota/axel/issues/9#issuecomment-199553279

douglascamata commented 8 years ago

@eribertomota @sijad I think instructions for OS X compilation should be included in the README as it is not pretty straightforward.

sdt commented 8 years ago

This commit https://github.com/eribertomota/axel/pull/10/commits/655ccc60570d638d35964418bd07a75c147ddd44 in pr #10 adds some OS X build instructions.

@douglascamata could you try following those directions and see if it works for you?

eribertomota commented 8 years ago

Hi Douglas,

Not needed. I already adjusted the autotools to install 'magically'.

Regards,

Eriberto

2016-03-28 18:31 GMT-03:00 Douglas Camata notifications@github.com:

@eribertomota https://github.com/eribertomota @sijad https://github.com/sijad I think instructions for OS X compilation should be included in the README as it is not pretty straightforward.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/eribertomota/axel/issues/9#issuecomment-202588075

douglascamata commented 8 years ago

@eribertomota trying the direction in this issue I could build, but not automatically (at the time I commented). I'll try again with the instructions in that commit and report here.

douglascamata commented 8 years ago

@eribertomota it worked, but I changed ./autogen.sh -I$GETTEXT/share/aclocal/ to autoreconf -I$GETTEXT/share/aclocal/ (there was no autogen.sh in the axel folder neither in my path).

sdt commented 8 years ago

Sorry - I forgot about that part. autogen.sh is added in that pull request. The source branch is here:

https://github.com/sdt/axel/tree/autotools-cleanup

eribertomota commented 8 years ago

Yeap, you are right. I need to accept some changes sent to Axel. However, I am very busy now. I think that I will work over these changes in 2 weeks.

2016-03-28 20:42 GMT-03:00 Douglas Camata notifications@github.com:

@eribertomota https://github.com/eribertomota it worked, but I changed ./autogen.sh -I$GETTEXT/share/aclocal/ to autoreconf -I$GETTEXT/share/aclocal/ (there was no autogen.sh in the axel folder neither in my path).

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/eribertomota/axel/issues/9#issuecomment-202628676

eribertomota commented 8 years ago

Hi Stephen, I don't forgot your pull requests. Thanks!

2016-03-28 20:44 GMT-03:00 Stephen Thirlwall notifications@github.com:

Sorry - I forgot about that part. autogen.sh is added in that pull request. The source branch is here:

https://github.com/sdt/axel/tree/autotools-cleanup

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/eribertomota/axel/issues/9#issuecomment-202629646

sdt commented 8 years ago

@eribertomota - on OS X, if you install gettext via homebrew using the recommended method (ie. not force linking), then configure needs to know where to find the gettext header and library files. These custom paths are specified on the configure command line using CFLAGS and LDFLAGS environment variables.

Your fix earlier means that when you specify those paths to configure, then they are honoured in the makefile. Before your fix, configure would see the provided custom paths, but not pass them on the the makefile. configure would succeed, but make would fail.

@eribertomota - I just saw your comments as I was typing this. No worries - I assumed you were busy with other things.