environ 
Author Message
 environ

I made a Makefile with the command perl Makefile.PL
When I link my extension ext/perlcom with "make dynamic" everything is OK
until ld with an error : Undefined symbol _environ.

environ is referenced in perl.h but I don't know where it's defined.
(it's seems to be used by execv and execl to pass the environment
to a subprogram).

extern char ** environ;

Where's the mistake ?

Makefile
--------

# This Makefile is for the perlcom extension to perl.
#
# It was generated automatically by MakeMaker version 4.086 from the contents
# of Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
#       ANY CHANGES MADE HERE WILL BE LOST!
#
#   MakeMaker Parameters:
#       INC => '-I${GRIFDIR}/include/h -I${GRIFDIR}/include/var -I${GRIFDIR}/include/f -I${GRIFDIR}/api -I${HOME}/perl5.001/ext/perlcom -I${MYGRIFDIR}/perl -I/usr/local/include'
#       LIBS => '-L/udd/opera/grif3.5/bin/SUN4 -lGrifEditor                            -lc -lX11 -lXm -lXt -ltclx -ltcl'
#       NAME => 'perlcom'
#       OBJECT => 'perlcom.o attachattr.o perlprog.o perlmenu.o perlcmd.o EDITORITF.o'
#       PERL_SRC => '/home/didot/d01/opera/bois/perl5.001'
#       VERSION => '1.0'

# --- MakeMaker post_initialize section:

# --- MakeMaker const_config section:

# These definitions are from config.sh (via /home/didot/d01/opera/bois/perl5.001/lib/Config.pm)
CC = acc
LIBC = /usr/lib/libc.so.1.9.2
LDFLAGS =
LDDLFLAGS = -tM
CCDLFLAGS =
CCCDLFLAGS = -fpic
RANLIB = /usr/bin/ranlib
SO = so
DLEXT = so
DLSRC = dl_dlopen.xs
INSTALLPRIVLIB = /home/didot/d01/opera/bois/perl5.001/lib
INSTALLARCHLIB = /home/didot/d01/opera/bois/perl5.001/lib/perl5/sun4-solaris

# --- MakeMaker constants section:

NAME = perlcom
DISTNAME = perlcom
VERSION = 1.0

# In which library should we install this extension?
# This is typically the same as PERL_LIB.
# (also see INST_LIBDIR and relationship to ROOTEXT)
INST_LIB = /home/didot/d01/opera/bois/perl5.001/lib
INST_ARCHLIB = /home/didot/d01/opera/bois/perl5.001/lib
INST_EXE = ./blib

# Perl library to use when building the extension
PERL_LIB = /home/didot/d01/opera/bois/perl5.001/lib
PERL_ARCHLIB = /home/didot/d01/opera/bois/perl5.001/lib
LIBPERL_A = libperl.a
I_PERL_LIBS = -I$(PERL_LIB)

# Where is the perl source code located?
PERL_SRC = /home/didot/d01/opera/bois/perl5.001

# Perl header files (will eventually be under PERL_LIB)
PERL_INC = /home/didot/d01/opera/bois/perl5.001
# Perl binaries
PERL = /home/didot/d01/opera/bois/perl5.001/miniperl
FULLPERL = /home/didot/d01/opera/bois/perl5.001/perl

# FULLEXT = Pathname for extension directory (eg DBD/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
# ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
FULLEXT = perlcom
BASEEXT = perlcom
ROOTEXT =

INC = -I${GRIFDIR}/include/h -I${GRIFDIR}/include/var -I${GRIFDIR}/include/f -I${GRIFDIR}/api -I${HOME}/perl5.001/ext/perlcom -I${MYGRIFDIR}/perl -I/usr/local/include
DEFINE =
OBJECT = perlcom.o attachattr.o perlprog.o perlmenu.o perlcmd.o EDITORITF.o
LDFROM = $(OBJECT)
LINKTYPE = dynamic

# Handy lists of source code files:
XS_FILES= perlcom.xs
C_FILES = EDITORITF.c \
        attachattr.c \
        perlcmd.c \
        perlcom.c \
        perlmenu.c \
        perlprog.c
O_FILES = EDITORITF.o \
        attachattr.o \
        perlcmd.o \
        perlcom.o \
        perlmenu.o \
        perlprog.o
H_FILES = EDITOR.h \
        consttcl.h \
        perl.h \
        tclmsg.h \
        typetcl.h

.SUFFIXES: .xs

.PRECIOUS: Makefile

.PHONY: all config static dynamic test linkext

# This extension may link to it's own library (see SDBM_File)
MYEXTLIB =

# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h

# Where to put things:
INST_LIBDIR     = $(INST_LIB)$(ROOTEXT)
INST_ARCHLIBDIR = $(INST_ARCHLIB)$(ROOTEXT)

INST_AUTODIR      = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR  = $(INST_ARCHLIB)/auto/$(FULLEXT)

INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT).a
INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(BASEEXT).$(DLEXT)
INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
INST_PM = $(INST_LIBDIR)/attach.pl \
        $(INST_LIBDIR)/perlcom.pm

# --- MakeMaker const_loadlibs section:

# perlcom might depend on some other libraries:
# (These comments may need revising:)
#
# Dependent libraries can be linked in one of three ways:
#
#  1.  (For static extensions) by the ld command when the perl binary
#      is linked with the extension library. See EXTRALIBS below.
#
#  2.  (For dynamic extensions) by the ld command when the shared
#      object is built/linked. See LDLOADLIBS below.
#
#  3.  (For dynamic extensions) by the DynaLoader when the shared
#      object is loaded. See BSLOADLIBS below.
#
# EXTRALIBS =   List of libraries that need to be linked with when
#               linking a perl binary which includes this extension
#               Only those libraries that actually exist are included.
#               These are written to a file and used when linking perl.
#
# LDLOADLIBS =  List of those libraries which can or must be linked into
#               the shared library when created using ld. These may be
#               static or dynamic libraries.
#
# BSLOADLIBS =  List of those libraries that are needed but can be
#               linked in dynamically at run time on this platform.
#               SunOS/Solaris does not need this because ld records
#               the information (from LDLOADLIBS) into the object file.
#               This list is used to create a .bs (bootstrap) file.
#
EXTRALIBS  = -L/udd/opera/grif3.5/bin/SUN4 -lGrifEditor -lX11 -lXm -lXt -ltclx -ltcl
LDLOADLIBS = -L/udd/opera/grif3.5/bin/SUN4 -lGrifEditor -lc -lX11 -lXm -lXt -ltclx -ltcl
BSLOADLIBS =

# --- MakeMaker const_cccmd section:
CCCMD = acc -c -g    

# --- MakeMaker tool_autosplit section:

# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERL) $(I_PERL_LIBS) -e 'use AutoSplit;autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'

# --- MakeMaker tool_xsubpp section:

XSUBPPDIR = $(PERL_LIB)/ExtUtils
XSUBPP = $(XSUBPPDIR)/xsubpp
XSUBPPDEPS = $(XSUBPPDIR)/typemap
XSUBPPARGS = -typemap $(XSUBPPDIR)/typemap

# --- MakeMaker tools_other section:

SHELL = /bin/sh
LD = ld
TOUCH = touch
CP = cp
MV = mv
RM_F  = rm -f
RM_RF = rm -rf

# The following is a portable way to say mkdir -p

# --- MakeMaker post_constants section:

# --- MakeMaker c_o section:

.c.o:
        $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c

# --- MakeMaker xs_c section:

.xs.c:

# --- MakeMaker xs_o section:

.xs.o:
        $(PERL) $(XSUBPP) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
        $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c

# --- MakeMaker top_targets section:

all ::  config linkext $(INST_PM)

config :: Makefile

$(O_FILES): $(H_FILES)

# --- MakeMaker linkext section:

linkext :: $(LINKTYPE)

# --- MakeMaker dlsyms section:

# --- MakeMaker dynamic section:

# $(INST_PM) has been moved to the all: target.
# It remains here for awhile to allow for old usage: "make dynamic"
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)

# --- MakeMaker dynamic_bs section:

BOOTSTRAP = perlcom.bs

# As MakeMaker mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
$(BOOTSTRAP): Makefile


                -e 'use ExtUtils::MakeMaker; &mkbootstrap("$(BSLOADLIBS)");' \
                INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) PERL_SRC=$(PERL_SRC) NAME=$(NAME)

$(INST_BOOT): $(BOOTSTRAP)

        -cp $(BOOTSTRAP) $(INST_BOOT)

# --- MakeMaker dynamic_lib section:

# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS =

$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP)


# --- MakeMaker static section:

# $(INST_PM) has been moved to the all: target.
# It remains here for awhile to allow for old usage: "make static"
static :: Makefile $(INST_STATIC) $(INST_PM)

# --- MakeMaker static_lib section:

$(INST_STATIC): $(OBJECT) $(MYEXTLIB)




# --- MakeMaker installpm section:

# installpm: attach.pl => $(INST_LIBDIR)/attach.pl, splitlib=$(INST_LIB)

$(INST_LIBDIR)/attach.pl: attach.pl Makefile



# installpm: perlcom.pm => $(INST_LIBDIR)/perlcom.pm, splitlib=$(INST_LIB)

$(INST_LIBDIR)/perlcom.pm: perlcom.pm Makefile




# --- MakeMaker installbin section:

# --- MakeMaker subdirs section:

# none

# --- MakeMaker clean section:

# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.

clean ::
        -rm -rf *~ t/*~ *.o *.a mon.out core so_locations $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).exp perlcom.c ./blib
        -mv Makefile Makefile.old 2>/dev/null

# --- MakeMaker realclean section:

# Delete temporary files (via clean) and also delete installed files
realclean purge ::  clean
        rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
        rm -f $(INST_DYNAMIC) $(INST_BOOT)
        rm -f $(INST_STATIC) $(INST_PM)
        rm -rf Makefile Makefile.old

# --- MakeMaker distclean section:

distclean:     clean

        rm -f ./Makefile ./Makefile.old
        cd ..; tar cvf $(DISTNAME)-$(VERSION).tar $(BASEEXT)
        cd ..; compress $(DISTNAME)-$(VERSION).tar

# --- MakeMaker test section:

TEST_VERBOSE=0

test :: all

# --- MakeMaker install section:

doc_install ::

                -e 'use ExtUtils::MakeMaker; MM->writedoc("Module", "$(NAME)", \
                "LINKTYPE=$(LINKTYPE)", "VERSION=$(VERSION)", "EXE_FILES=$(EXE_FILES)")'

install :: pure_install doc_install

pure_install :: all
        : perl5.000 and MM pre 3.8 autosplit into INST_ARCHLIB, we delete these old files here
        rm -f /home/didot/d01/opera/bois/perl5.001/lib/perl5/sun4-solaris/auto/$(FULLEXT)/*.al
        rm -f /home/didot/d01/opera/bois/perl5.001/lib/perl5/sun4-solaris/auto/$(FULLEXT)/*.ix
        $(MAKE) INST_LIB=/home/didot/d01/opera/bois/perl5.001/lib INST_ARCHLIB=/home/didot/d01/opera/bois/perl5.001/lib/perl5/sun4-solaris INST_EXE=/home/didot/d01/opera/bois/perl5.001/bin

# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:

# --- MakeMaker perldepend section:

PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
    $(PERL_INC)/XSUB.h  $(PERL_INC)/av.h        $(PERL_INC)/cop.h \
    $(PERL_INC)/cv.h    $(PERL_INC)/dosish.h    $(PERL_INC)/embed.h \
    $(PERL_INC)/form.h  $(PERL_INC)/gv.h        $(PERL_INC)/handy.h \
    $(PERL_INC)/hv.h    $(PERL_INC)/keywords.h  $(PERL_INC)/mg.h \
    $(PERL_INC)/op.h    $(PERL_INC)/opcode.h    $(PERL_INC)/patchlevel.h \
    $(PERL_INC)/perl.h  $(PERL_INC)/perly.h     $(PERL_INC)/pp.h \
    $(PERL_INC)/proto.h $(PERL_INC)/regcomp.h   $(PERL_INC)/regexp.h \
    $(PERL_INC)/scope.h $(PERL_INC)/sv.h        $(PERL_INC)/unixish.h \
    $(PERL_INC)/util.h  $(PERL_INC)/config.h

$(OBJECT) : $(PERL_HDRS)

# Check for unpropogated config.sh changes. Should never happen.
# We do NOT just update config.h because that is not sufficient.
# An out of date config.h is not fatal but complains loudly!
$(PERL_INC)/config.h: $(PERL_SRC)/config.sh

$(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh

        cd $(PERL_SRC); $(MAKE) lib/Config.pm

perlcom.c : $(XSUBPPDEPS)

# --- MakeMaker makefile section:

$(OBJECT) : Makefile

# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
Makefile:       Makefile.PL $(CONFIGDEP)



        -$(MAKE) -f Makefile.old clean >/dev/null 2>&1 || true
        $(PERL) $(I_PERL_LIBS) Makefile.PL

# --- MakeMaker postamble section:

# --- MakeMaker staticmake section:

# --- MakeMaker makeaperl section ---
MAP_TARGET    = perl
FULLPERL      = /home/didot/d01/opera/bois/perl5.001/perl
MAP_LINKCMD   = acc
MAP_PERLINC   = -I/home/didot/d01/opera/bois/perl5.001/lib -I/home/didot/d01/opera/bois/perl5.001/lib -I/home/didot/d01/opera/bois/perl5.001/lib -I/home/didot/d01/opera/bois/perl5.001/lib
MAP_STATIC    = /home/didot/d01/opera/bois/perl5.001/lib/auto/perlcom/perlcom.a /tmp_mnt/home/didot/d01/opera/bois/perl5.001/lib/auto/DynaLoader/DynaLoader.a /tmp_mnt/home/didot/d01/opera/bois/perl5.001/lib/auto/perlcom/perlcom.a
MAP_EXTRA     = `cat /home/didot/d01/opera/bois/perl5.001/lib/auto/perlcom/extralibs.ld` `cat /tmp_mnt/home/didot/d01/opera/bois/perl5.001/lib/auto/DynaLoader/extralibs.ld` `cat /tmp_mnt/home/didot/d01/opera/bois/perl5.001/lib/auto/perlcom/extralibs.ld`
MAP_PRELIBS   = -lnsl -lgdbm -ldbm -ldb -ldl -lm -lc -lposix

MAP_LIBPERL = /home/didot/d01/opera/bois/perl5.001/lib/perl5/sun4-solaris/CORE/libperl.a

$(MAP_TARGET): ./perlmain.o $(MAP_LIBPERL) $(MAP_STATIC)





./perlmain.o: ./perlmain.c
        cd . && acc -I/home/didot/d01/opera/bois/perl5.001 -c -g      perlmain.c

./perlmain.c: Makefile



doc_inst_perl:

                "$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)", \

inst_perl: pure_inst_perl doc_inst_perl

pure_inst_perl: $(MAP_TARGET)
        cp $(MAP_TARGET) /home/didot/d01/opera/bois/perl5.001/bin/$(MAP_TARGET)

realclean :: map_clean

map_clean :
        rm -f ./perlmain.o ./perlmain.c Makefile

# End.

Result :
--------

ld -o /home/didot/d01/opera/bois/perl5.001/lib/auto/perlcom/perlcom.so -tM perlcom.o attachattr.o perlprog.o perlmenu.o perlcmd.o   -L/udd/opera/grif3.5/bin/SUN4 -lGrifEditor -lc -lX11 -lXm -lXt -ltclx -ltcl
perlcom.o:
        perlcom.o
perlcom.o
attachattr.o:
        attachattr.o
attachattr.o
perlprog.o:
        perlprog.o
perlprog.o
perlmenu.o:
        perlmenu.o
perlmenu.o
perlcmd.o:
        perlcmd.o
perlcmd.o
-L/udd/opera/grif3.5/bin/SUN4:
-lGrifEditor:
        /udd/opera/grif3.5/bin/SUN4/libGrifEditor.a
/udd/opera/grif3.5/bin/SUN4/libGrifEditor.a
        environ.o
        filesystem.o
        memory.o
        message.o
        storage.o
        application.o
        attribute.o
        content.o
        dialog.o
        image.o
        selection.o
        tree.o
        view.o
        def.o
        option.o
        startup.o
        grifmsg.o
        sysexec.o
        img.o
        lig.o
        pos.o
        rel.o
        sel.o
        visu.o
        attrherit.o
        attribut.o
        page.o
        tableau.o
        imagedrvr.o
        transform.o
        bitmapdrvr.o
        XpmCrPFrData.o
        pixmapdrvr.o
        epsfdrvr.o
        gifdrvr.o
        es.o
        fen.o
        inites.o
        font.o
        document.o
        interface.o
        pres.o
        cmd.o
        creation.o
        edit.o
        modif.o
        select.o
        docvues.o
        indcree.o
        indpres.o
        indtable.o
        indtri.o
        appli.o
        attrmenu.o
        browser.o
        corrmenu.o
        creationmenu.o
        docvuesmenu.o
        editmenu.o
        environmenu.o
        indmenu.o
        initcatal.o
        input.o
        keyboards.o
        modpresmenu.o
        selectmenu.o
        pivlec.o
        schemas.o
        context.o
        language.o
        debug.o
        dofile.o
        msgstruct.o
        arbabs.o
        except.o
        label.o
        ouvre.o
        refelem.o
        structure.o
        textelem.o
        draw.o
        pivecr.o
        refext.o
        rdschprs.o
        rdschstr.o
        crimabs.o
        crpages.o
        imabs.o
        imagepres.o
        modimabs.o
        modpres.o
        res.o
        rescoller.o
        resgenerique.o
        varpres.o
        dictionary.o
        reference.o
        cherche.o
        date.o
        mot.o
        liste.o
        dep.o
        des.o
        hyphen.o
        ecfexec.o
        ecfinit.o
        tableau2.o
        misc.o
        XpmCrIFrData.o
        XpmRdFToI.o
        XpmRdFToP.o
        aff.o
        curs.o
        geom.o
        annote.o
        corrcalcul.o
        cherchemenu.o
        comparedyn.o
        regexp.o
        data.o
        create.o
        parse.o
        hashtable.o
-lc:
/lib/libc.so.1.9.2
/lib/libdl.so.1.0
-lX11:
/usr/local/X11R5/lib/libX11.so.4.10
-lXm:
/usr/local/X11R5/lib/libXm.so.1.2
-lXt:
/usr/local/X11R5/lib/libXt.so.4.10
-ltclx:
        /usr/local/lib/libtclx.a
/usr/local/lib/libtclx.a
-ltcl:
        /usr/local/lib/libtcl.a
/usr/local/lib/libtcl.a
        tclBasic.o
        tclCmdAH.o
        tclCmdIL.o
        tclCmdMZ.o
        tclExpr.o
        tclGet.o
        tclHash.o
        tclHistory.o
        tclLink.o
        tclParse.o
        tclProc.o
        tclUtil.o
        tclVar.o
        panic.o
        tclEnv.o
        tclGlob.o
        tclUnixAZ.o
        tclUnixStr.o
        tclUnixUtil.o
        strtoul.o
        tclMtherr.o
        regexp.o
        tclAsync.o
ld : undefined symbol
        _environ
-o:
-tM:
perlcom.o:
        perlcom.o
attachattr.o:
        attachattr.o
perlprog.o:
        perlprog.o
perlmenu.o:
        perlmenu.o
perlcmd.o:
        perlcmd.o
-L/udd/opera/grif3.5/bin/SUN4:
-lGrifEditor:
        /udd/opera/grif3.5/bin/SUN4/libGrifEditor.a

Thanks.



Sun, 23 Nov 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. help w/userinit() changing environ

2. grabbing timezone withing cgi environ using perl

 

 
Powered by phpBB® Forum Software