1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
This package requires at least perl5.005. You're on your own before
then.
1) Make sure perl has been built.
2) Chdir into the Curses source directory (which you unpacked from the
.tgz file you downloaded from CPAN)
3) Want to see if maybe the package can autoconfigure itself? It's
pretty dumb about it, but give it a try and skip to (4.5).
4) Configure the build for your system.
4.1)
Look in the "hints" directory to see if any of the hint files are
appropriate to your machine's OS. If so, symlink or copy it to the
file "c-config.h" in the current ("Curses") directory. If not,
copy "hints/c-none.h" to "c-config.h" in the current directory.
Then edit "c-config.h" and follow the directions. If you have to
"roll your own", be sure and save a copy. A "make clean" will
delete "c-config.h". If you "rolled your own", please send me a
copy so I can include it in future distributions (see
"hints/c-isc.h" for an example of a user-contributed "c-config.h").
4.2)
Set environment variables telling the compiler and linker where your
Curses C libraries are:
CURSES_CFLAGS: -I and -D options needed at compile time for access to
the basic Curses library (libcurses).
CURSES_LDFLAGS: -L and -l options needed at link time for access to
the basic Curses library (libcurses). (this really
must be only -L and -l options; Makefile.PL parses it).
CURSES_PANEL_CFLAGS
CURSES_PANEL_LDFLAGS
CURSES_MENU_CFLAGS
CURSES_MENU_LDFLAGS
CURSES_FORM_CFLAGS
CURSES_FORM_LDFLAGS
These are analogous, but for the panel, menu, and form specialty
Curses libraries, respectively.
You can set these in your shell and export them, e.g.
export CURSES_CFLAGS="-I /usr/include/curses"
export CURSES_LDFLAGS="-L /usr/lib/ncurses -lcurses"
Or you can set them right on the 'perl Makefile.PL' command.
5) perl Makefile.PL [PANELS] [MENUS] [FORMS] [options]
PANELS means to include Curses panel function.
MENUS means to include Curses menu functions.
FORMS means to include Curses form function.
For PANELS, MENUS, and FORMS, you must have the associated C library on
your system (libpanel, libmenu, libform). Choosing one of these options
without having the library will prevent this package from compiling.
Currently, PANELS, MENUS, and FORMS don't work for the BSD
hints files (c-*.bsd.h), because I'm not aware of any panel, menu,
or form libraries for BSD curses.
This package needs the perl header files. If you've already
installed perl, the "Makefile.PL" will magically know where they
are. If you haven't installed perl, you may need to tell the
"Makefile.PL" where the header files are. You can do this with the
"PERL_SRC=<source directory>" option.
perl Makefile.PL PERL_SRC=/local/src/perl
The "Makefile.PL", along with just about every other perl module,
uses the "ExtUtils::MakeMaker" package to generate the "Makefile".
I highly recommend reading the "ExtUtils::MakeMaker" man page, as
there are lots of neat options you can specify.
If the "Makefile.PL" tells you that it can't do something (it
prints out "I'm sorry" and some more stuff), then you'll need to go
back to step (4) and try configuring by hand.
6) make
`make' will first run a perl script called `test.syms' that investigates
what the Curses libraries are like on your system and records the
results in the file "CursesDef.h".
test.syms is very brittle -- it works via test compiles, and if any
number of things goes wrong with the test compile, it makes bad
assumptions, usually that you don't have a certain function in your
Curses library. If test.syms tells you it can't find functions that
you think you have, run test.syms manually with the -v (verbose) option.
That will show you the error messages from the test compiles and you
can figure out what's going wrong and fix it. Typically, you'll find
that you need to do better on your CURSES_* environment variables
(see above).
Alternatively, if you see that test.syms is picking the wrong
values, you can edit "CursesDef.h" by hand and follow the
directions. If you have to "roll your own", be sure and save a
copy. A "make clean" will delete "CursesDef.h".
`make' will then try to compile "Curses.c". If you get any
undefined curses symbols, it means that your curses really doesn't
have those functions, and you should edit "CursesDef.h" and/or
"c-config.h" and change the #define to #undef for that function.
If you get other compile errors, it is probably because the curses
include file and the perl include files are conflicting. You'll
have to figure out what's wrong and add proper C code to
"c-config.h". See "hints/c-sunos.sysv.h" for an example of how to
do this.
7) Optionally test the distribution:
perl demo
perl gdc
perl demo2 [stuff that has a 50/50 chance of showing up right]
perl demo.panel [if you enabled panel support]
perl demo.menu [if you enabled menu support]
perl demo.form [if you enabled form support]
"gdc" is a digital clock ported from the "ncurses" distribution.
As mentioned in the "README", the demo is not intended to be an
exhaustive test of all the possible Curses functions. If it
doesn't do all the functions correctly, it may be a Curses bug or
it may be a problem with your system's "libcurses.a". There's no
getting around the fact that you need to be conversant in how your
system's "libcurses.a" works to be able to use Curses most
effectively.
For "demo", you can try:
make cdemo
This will try to compile a pure-C version of the "demo". If you
see the same errors in it that you see in "demo", it means there's
a bug in your libcurses.
8) Doing a :
make install
will install everything in the "standard" perl places, just like
stuff from the base perl distribution.
9) Enjoy!
If your enjoyment is ruined (:-) because the module doesn't work
right, peruse the Curses pod document (located at the end of
"Curses.pm") for incompatibilities with other Perl programs. Also
check the end of the "README" for problems that may exist for your
particular libcurses.a or operating system.
|