This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

_SOURCES to _OBJECTS transform




Hello.  I'm new to this list and pretty new to automake/autoconf/libtool.
I'm trying to resolve issues with building the gxsnmp package on
Solaris (SPARC) 2.6.

One issue I'm up against is that Solaris does not support the GNU
getopt() functions (getopt_long() specificically).  The GNU
getopt.c and getopt1.c C code is available, but I need to conditionally
add this code to a shared library (libgxsnmp).

The "Makefile.am" in the lib/ directory looks like this:


---Makefile.am---

    ## Process this file with automake to produce Makefile.in

    lib_LTLIBRARIES = libgxsnmp.la

    libgxsnmp_la_SOURCES =	\
	    g_access.h	\
	    g_asn1.c	\
	    g_asn1.h	\
	    g_date.c	\
	    g_date.h	\
	    g_dispatch.c	\
	    g_dispatch.h	\
	    g_md5.c		\
	    g_md5.h		\
	    g_message.c	\
	    g_message.h	\
	    g_security.c	\
	    g_security.h	\
	    g_session.c	\
	    g_session.h	\
	    g_sha.c		\
	    g_sha.h		\
	    g_snmp.c	\
	    g_snmp.h	\
	    g_snmp_table.c	\
	    g_snmp_table.h	\
	    g_sql.c		\
	    g_sql.h		\
	    g_sqldb.c	\
	    g_sqldb.h	\
	    g_transport.c	\
	    g_transport.h	\
	    mib.c		\
	    mib.h		\
	    parse.c		\
	    parse.h

    libgxsnmp_la_LDFLAGS = -version-info 1:1:1

    INCLUDES = $(GLIB_CFLAGS) -DMIBTXTDIR=\"$(sysconfdir)\"

---

From the resulting Makefile, I can see that a libgxsnmp_la_OBJECTS
gets constructed that seems to elimate the header files and converts
the *.c files into *.lo files.

My problem is that I cannot seem to find a way to conditionally insert
the getopt?.c *and* the getopt*.lo files/references into the
Makefile.am -> Makefile.in process.

I have been able to add the getopt?.c files added conditionally to the
Makefile.am.  However, the *.lo objects for getopt*() never seem to
get into the libgxsnmp_la_OBJECTS variable.  It's as if the automatic
transformation that creates libgxsnmp_la_OBJECTS from libgxsnmp_la_SOURCES
does so *before* any variable substition gets done.  That is, if my
libgxsnmp_la_SOURCES looks something like:


    libgxsnmp_la_SOURCES =
	    g_access.h	\
	    ...		\
	    @GETOPT_SRC@

I will find the resulting Makefile has the getopt*.c files listed under
libgxsnmp_la_SOURCES, but not in libgxsnmp_la_OBJECTS.

If I add them manually via

    libgxsnmp_la_SOURCES =
	    g_access.h	\
	    ...		\
	    getopt.c getopt1.c

they do show up in libgxsnmp_la_OBJECTS in the resulting Makefile.

I've tried fiddling with EXTRA_libgxsnmp_la_SOURCES, also no luck.
If I add the getopt*lo references using the "_LIBADD" functionality,
I find that it wants to link the getopt*lo objects, but it never builds
them.

Either I'm seriously confused (a real possibility), or automake just
won't allow me to do this.

Any help you can provide would be greatly appreciated.

Thanks

-- 

-mark frost
 horizon systems inc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]