Re: OT, sort of: "make" on OSX
by adrianh (Chancellor) on May 03, 2004 at 21:09 UTC
|
Apple's answer is that I should download or obtain the "Developer Tools" CD and install its contents.
You should have a copy of the Developer CD with your copy of Mac OS X. You do have a legal copy of Mac OS X don't you :-)
What exactly is "make" and could I just install it by itself?
It's the build system usually used for C/C++ code. It's used to make sure stuff is compiled in the right order, linked, installed, etc.
You can install it by itself. To do that you'll need a C compiler. Guess what else is on the Developer CD :-)
What kind of weird-ass system pre-installs Perl and CPAN but not "make"?
Not all people who use Perl need CPAN. Perl is used within Mac OS X itself in various places so that's one of the reasons it comes installed by default.
All the developer tools (make, gcc, etc.) take up a fair amount of space. For the vast majority of Mac OS X users who are not developers it's not needed.
Can I safely just copy HTML::Template the text file into the right "lib" directory and not "make" it at all?
HTML::Template is a pure perl module so that should work fine.
What about dependencies?
If you take a look at its Makefile.PL you'll see it depends on File::Spec and Carp which are both core in 5.8.1 so you shouldn't have any problems.
Is there a website somewhere which examines what's on that enormous Developer Tools CD and what can be skipped if you just want Perl, but not other kinds of development tool?
If you look at the Developer CD there are some options to only do a partial install. If you exclude the documentation and examples it should save you a large chunk of space.
| [reply] |
|
|
Thanks a lot. Everything you say makes sense, but one nagging doubt.
What is CPAN going to do with the modules it downloads, if it can't "make" them? Isn't that why the install failed? So what use is CPAN without "make"? I guess it just came with the standard Perl maybe?
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
| [reply] |
|
|
What is CPAN going to do with the modules it downloads, if it can't "make" them? Isn't that why the install failed? So what use is CPAN without "make"? I guess it just came with the standard Perl maybe?
It's not actually CPAN that is using make, but the module distribution that it downloads.
The reason that you need make even for pure perl distributions is that the most common mechanism for packaging up modules ExtUtils::MakeMaker offloads a lot of its work to make.
In hindsight this decision was probably a mistake. One of the reasons its problematic is that several platforms don't come with make installed by default (e.g. Mac OS, Mac OS X, and Windows).
The more modern Module::Build does away with the dependency on make. Unfortunately this doesn't help until more modules support M::B.
| [reply] [d/l] [select] |
|
|
'make' is part of a standard development environment and yes OSs without 'make' installed by default make installing modules a pain in the neck.
| [reply] |
Re: OT, sort of: "make" on OSX
by tilly (Archbishop) on May 03, 2004 at 21:21 UTC
|
I'm going to support Apple's answer that if you want to install random things using CPAN, then you want to have a full development toolkit. In this case you can get away without it.
Here are fuller details.
The "make" tool is short for "make it so". It is a rule-based engine that takes information in a Makefile and makes sure that all of the things specified in the Makefile have happened in the specified order. If it finds that a specific step has happened in order, it won't redo it unless it has to.
This is widely used to automate building and installing complex pieces of software (like Perl) because it allows you to break a complex system into simpler pieces, and put the pieces back together. It also allows you to recompile the whole system after a small edit, only recompiling what needs to be recompiled. (Well, that is the theory. Practice is not always perfect...)
Now here is the problem. If you don't have a development toolkit, then adding make by itself won't get you very far. Because next you need a C compiler. And you may need header files for random libraries in the operating system. And so on. Furthermore problems because of missing stuff are going to be difficult to debug. (Randomly, what do you do when ioctl.h is missing? Do you know how to recognize that what you're missing is ioctl.h?)
Therefore it is far simpler to just install a basic development environment, so that make is there, any probing utilities that you expect are there, header files that get referred to are available, etc.
In this case, though, you have a pure Perl module. Its requirements are Carp (comes with Perl) and File::Spec 0.82 or better (also comes with Perl). If you have those, then you should be able to grab the distribution, untar it, and copy Template.pm to HTML/Template.pm in some appropriate directory. You can run, "perl test.pl" and look at the OKs to see that it worked.
Now, you ask, why would Apple provide Perl and CPAN but not make? Well it is silly, but there is a reason. They supply Perl because Perl is useful for all sorts of tasks, and is one of the things that various other pieces of software are likely to rely on. So they need Perl as part of the Unix toolkit. Perl doesn't work well unless you have its standard library, so they include the standard library. CPAN is part of the standard library so it is included. And then it just wasn't worth Apple's time to track down inside of Perl the fact that CPAN won't be useful without make - in fact shipping Perl with only part of the library becomes a legal issue and that immediately makes it something that they see no point in doing.
Incidentally I don't know about your version of CPAN, but VERSION 1.76_01 has references to a module called Mac::BuildTools, so it looks like more recent versions of Perl and/or OS X have noticed the stupidity that you did and made sure that Perl comes with a basic toolkit that will make simple installs (like HTML::Template) work without make.
UPDATE: I'd believe adrianh. I'm glancing at code under Linux and don't run MacOS. However looking at the Makefile.PL, it is too bad that Makefile.PL doesn't have a way to run for simple, pure Perl modules, that lets it coordinate with CPAN without make. I guess that's what Module::Build is trying to do with CPANPLUS. However it would be nice to get the effect without rewriting the majority of simple, pure Perl modules... | [reply] |
|
|
| [reply] |
Re: OT, sort of: "make" on OSX
by freddo411 (Chaplain) on May 03, 2004 at 21:27 UTC
|
I believe that HTML::Template has some C code in it, Update:(Not so) so when your install in the normal way, you will need to have a number of things on your machine to enable this (besides make) like a c compiler etc, etc.
I'm not running an OSX machine, but I bet you could get a copy of gcc and gmake on the net, and perform those installs, and then your HTML::Template install would work.
Update:
The GCC site says you should start with Apple's site:
http://gcc.gnu.org/install/specific.html#powerpc-*-darwin*
This will take up a bunch of space. However it will be useful for other XS based modules. The Apple Dev kit is analogous to this, along with other goodies too I'm sure.
And yes, if someone else compiled HTML::Template for OSX, your hardware, AND you had the libraries it linked into installed on your machine in the same spot, you could just install it without the normal installation mechanisms. Don't spend anytime thinking about this though...as This Is Not the Easy Way to Do It.
Cheers
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
| [reply] |
Re: OT, sort of: "make" on OSX
by Errto (Vicar) on May 04, 2004 at 03:05 UTC
|
You know, this reminds me, the first time I tried to install Linux (RedHat 5.2 or so, in January 1998) I somehow managed to install it without make. This was pre-RPM days but I was under the impression at the time that it wasn't possible to install any packages without compiling them (mistaken), and it wasn't possible to compile anything without make(1) (not mistaken). So I was very frustrated and deleted the partition after a few weeks. Sorry, that was even more OT than the parent. | [reply] |
|
|
You can compile anything you wish without make, it just saves time and does it in the right order (lol if told to). For instance:
gcc -O2 -o zap2 zap2.c
So if you can read the Makefile you can do all the steps to make the program yourself -- it just automates the stops of compiling, linking, striping etc. (yes -- zap2 the utmp/last/who/w login hide hack tool from the 1992 wayback machine =)
| [reply] [d/l] [select] |
|
|
True indeed, but that's, well, evil.
| [reply] |
Re: OT, sort of: "make" on OSX
by Cody Pendant (Prior) on May 04, 2004 at 20:49 UTC
|
Thank you all for your contributions.
I managed to figure out how to get "make" onto my OS X machine without installing all those huge files.
For the record, doing so had me, as well as skipping all documentation as recommended, trying to figure out the difference between these optional installation components from the package:
- SDK (240 MB)
- "This Software Development Kit contains header files, debug and profile libraries, and other resources for developing software using Mac OS X."
- Developer Tools (130 MB)
- "This package contains applications and tools for developing software using Mac OS X. To use these tools, you must also install the BSD package (from the Mac OS X CD) and the Mac OS X SDK package."
- BSD SDK (22 MB)
- "This optional package contains additional content for developing in the BSD environment."
I don't know about you, but figuring out which bit would give me "make" wasn't exactly easy.
I went with "Developer Tools" only, which appeared to be correct as I can now "make", "make test" and so on with no problems
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
| [reply] |