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 script can't identify location of res_mkquery on macOS #229

Open
ryandesign opened this issue Jul 7, 2023 · 1 comment
Open

Comments

@ryandesign
Copy link
Contributor

On macOS 12.6.7 (and other versions), bahamut fails to determine that res_mkquery is in fact located in libresolv:

checking for res_mkquery... no
checking for res_mkquery in -lresolv... no
checking for __res_mkquery... no
checking for __res_mkquery in -lresolv... no

As a result of this failure, the required -lresolv flag is not added when linking.

It can be worked around by adding ac_cv_lib_resolv_res_mkquery=yes as an argument when running ./configure.

This problem was previously reported to MacPorts for version 2.0.7 back in 2014 but the problem remains with version 2.2.2.

The problem seems to be that the configure test compiles and links this program:

char res_mkquery ();
int
main (void)
{
return res_mkquery ();
  ;
  return 0;
}

The config.log shows that the configure test failed because:

Undefined symbols for architecture x86_64:
  "_res_mkquery", referenced from:
      _main in conftest-ddc300.o
ld: symbol(s) not found for architecture x86_64

And this is true: There is no symbol _res_mkquery in libresolv on macOS; the symbol is actually called _res_9_mkquery. You're expected to #include <resolv.h> which contains the #defines that make this work:

#define res_mkquery		res_9_mkquery

It seems like the fix would be for the configure test to #include <resolv.h> rather than declaring a fake res_mkquery function, but I'm not sufficiently well versed in autoconf to make that change myself.

This is not the only fix needed to compile this code on macOS; I'll file additional tickets for the rest.

@ryandesign
Copy link
Contributor Author

It can be worked around by adding ac_cv_lib_resolv_res_mkquery=yes as an argument when running ./configure.

This workaround no longer works in bahamut 2.2.3 due to 42b67ff. Instead, I now use ac_cv_search_res_mkquery=-lresolv.

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

1 participant