Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Mar 1996 13:51:54 -0600
From:      "Daniel M. Eischen" <deischen@iworks.InterWorks.org>
To:        freebsd-ports@FreeBSD.org
Subject:   Port questions
Message-ID:  <9603171951.AA01814@iworks.InterWorks.org>

next in thread | raw e-mail | index | archive | help

Hi,

I'm attempting a port of xmcd, since it seems it's not a standard
port any longer.  If there is a reason for not having it as a port
or someone else is working on it, please let me know.

This is my first attempt at a port, and I have a couple of questions.

First, what is the general rule for including libraries libcurses
vs. libncurses?  What is the preferred method of making the port
aware to use -lncurses as opposed to -lcurses?  Xmcd currently uses
the following in its Imakefile:

        /*
         * Add needed libraries
         */
        #if (defined(SunArchitecture) && OSMajorVersion == 4)
        LOCAL_LIBRARIES=-L/usr/5lib -lcurses
        #else
        #if defined(LinuxArchitecture)
        LOCAL_LIBRARIES=-lncurses
        #else
        #if defined(FreeBSDArchitecture)
        LOCAL_LIBRARIES=-lncurses -lmytinfo
        #else
        #if defined(ultrix) || defined(__ultrix)
        LOCAL_LIBRARIES=-lcursesX
        #else
        LOCAL_LIBRARIES=-lcurses
        #endif  /* ultrix */
        #endif  /* FreeBsdArchitecture */
        #endif  /* LinuxArchitecture */
        #endif  /* SunArchitecture */

It looks as if -lncurses should be used, but it's not because
FreeBSDArchitecture never ends up getting defined.  The Imake.cf in
/usr/X11R6/lib/X11/config has:

        #ifdef __FreeBSD__
        #define MacroIncludeFile <FreeBSD.cf>
        #define MacroFile FreeBSD.cf
        #undef __FreeBSD__
        #ifdef __i386__
        #define FreeBSDArchitecture
        #define i386BsdArchitecture
        #define i386Architecture
        #endif
        #endif /* __FreeBSD__ */

If I define FreeBSDArchitecture in "#ifdef __FreeBSD__ ..." before the 
"#ifdef __i386__ ...", everything works and -lncurses and -lmytinfo are
correctly brought in.

My next question is regarding 4 malloc warnings that I get when I first
start xmcd.  I get:

        Malloc warning: free(): junk pointer (too high)
        Malloc warning: free(): junk pointer (too high)
        Malloc warning: free(): junk pointer (too high)
        Malloc warning: free(): junk pointer (too high)

which is, I assume, a free being called for an object that may not be
(is not?) allocated.  I am running XFree86312, with -current built just
a few days ago.  I've tracked this down to an XFreePixmap() call in
xmcd, but can't figure out how it wouldn't work.  I've looked at the code
and it seems like there should be a valid pixmap created whenever the
XFreePixmap is called.  My only guess is that it is a problem with XFree86.
Until today I was running XFree311 with the same messages.  I installed
3.12 and rebuilt - still the same.

Anyone else have any problems like this?  Will this warning message be a
problem for submitting the port?

TIA,

Dan Eischen
deischen@iworks.InterWorks.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9603171951.AA01814>