-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Static linking against libpcre? #49
Comments
Assuming you have a libpcre.a somewhere in your LDPATH, shouldn't |
The relevant section of
This seems to be due to the fact that no static version of
So it seems as if I can't flag the entire executable to be static. I'd have to statically link only against Thanks Geoff for taking the time to respond. |
I assumed you were on Linux. You've reached the extent of my knowledge on this subject. I think if you just want to link to .a files, you can add them to the gcc command. So instead of
it would be
(Scroll all the way to the end of that line to see the difference. |
This isn't a bug in Ag and I can't help anymore, so I'm closing this issue. |
Okay... I figured out. Here's my solution:
It looks like the binary is statically linked to PCRE, based on this:
And I |
Comment for anyone looks up ... Came across the 'same' thing on Windows: static link pcre.
Read #if defined(_WIN32) && !defined(PCRE_STATIC)
# ifndef PCRE_EXP_DECL
# define PCRE_EXP_DECL extern __declspec(dllimport)
# endif
# ifdef __cplusplus
# ifndef PCRECPP_EXP_DECL
# define PCRECPP_EXP_DECL extern __declspec(dllimport)
# endif
# ifndef PCRECPP_EXP_DEFN
# define PCRECPP_EXP_DEFN __declspec(dllimport)
# endif
# endif
#endif
/* By default, we use the standard "extern" declarations. */
#ifndef PCRE_EXP_DECL
# ifdef __cplusplus
# define PCRE_EXP_DECL extern "C"
# else
# define PCRE_EXP_DECL extern
# endif
#endif |
Hi Geoff,
We're hoping to embed ag into an application (as it's own binary, that we interact with as a child process when needed). We've noticed it depends on the pcre dynamic library being available on the system. Presumably it's possible to statically link against libpcre.a instead? I'm completely unversed in GNU autotools, but I started reading about it last night. If it's a simple change to statically link, maybe you could just tell me what to change? But otherwise I'll keep studying :-). Are there any other obstacles you can think of that would preclude redistributing a binary that runs on modern versions of OS X? Thanks!
The text was updated successfully, but these errors were encountered: