autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting the file extension of a shared object


From: Vincent Torri
Subject: Re: getting the file extension of a shared object
Date: Mon, 22 Jun 2009 09:02:13 +0200 (CEST)


Hey,

On Mon, 22 Jun 2009, David Fang wrote:

when a configure frile is created, shretx_cmds is defined to the file extension of a shared object, wrt the platform (.dll for windows, .so for unix, ...).

What I can do is AC_DEFINE a macro using $shrext_cmds and using that macro in my code.

Is there a better way to achieve that ?

AC_DEFINE works well for anything that preprocesses config.h.
You could also store the result like so:

SHREXT=$shrext_cmds
AC_SUBST(SHREXT)

ok. Then I prefer AC_DEFINE (as we already include config.h, no need to make a specific file just for what I want).

If using shrext_cmds is a good way, then it's fine for me. I was afraid that it was something to not use because the name could change in the future, or something like that.

As as a side question: are you trying to do something that libtool/libltdl could handle? libltdl's lt_dlopenext() loads modules given the base name without the file extension, which takes some pain out of portability.

libltdl is of no use for our purposes. Thanks anyway.

regards

Vincent Torri




reply via email to

[Prev in Thread] Current Thread [Next in Thread]