[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getting the file extension of a shared object
From: |
David Fang |
Subject: |
Re: getting the file extension of a shared object |
Date: |
Mon, 22 Jun 2009 02:25:19 -0400 (EDT) |
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)
to perform configure-substitution on @SHREXT@ on AC_OUTPUT files.
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.
Fang
David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/