# Solaris Install: Non-standard location

**URL:** <https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409>\
**Category:** Ruby\
**Created:** [May 13, 2006, 5:48am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409 "2006-05-13T05:48:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 13, 2006, 5:48am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/1 "2006-05-13T05:48:06Z")

</div>

Were I able to install at the default location,  
things would be golden. Unfortunately, that’s  
not an option.

My first attempt at installing failed horribly.  
(Couldn’t access GetoptLong, for instance, because  
the site variables are pointing to the default location.)

I’m gearing up to try again.

There seem to be two ways to do it:

- Do things manually
- Specify command lone options when running configure

1. Specify command line options when running configure.

```
 This seems like the right way to go, but there are
 /many/ options (below). The ones I could maybe use
 are:

 --with-sitedir=DIR site libraries in DIR
                     Default: PREFIX/lib/ruby/site_ruby

 (But I set PREFIX when I ran make last time!)

 I tried doing the build without the special instructions,
 and ran into an error when the script tried to do this:

      mkdir -p -m 755 /usr/local/lib

 That fails, here. But there is no option that looks useful.
 (list below) They all default to PREFIX/... and I set that
 on makefile command line.

```

## OPTION 1: Do things manually

The process seems to be  
a) Run configure to create config.h and the Makefile.  
b) Edit config.h to set the environment variables. (??)  
c) Build, specifying the destination options:  
% make install prefix=/foo

I did (a) and © last time, but not (b).

The important values seem to be at the end of config.h:

#define RUBY\_LIB “/usr/local/lib/ruby/1.8”  
#define RUBY\_SITE\_LIB “/usr/local/lib/ruby/site\_ruby”  
#define RUBY\_SITE\_LIB2 “/usr/local/lib/ruby/site\_ruby/1.8”  
#define RUBY\_PLATFORM “sparc-solaris2.9”  
#define RUBY\_ARCHLIB “/usr/local/lib/ruby/1.8/sparc-solaris2.9”  
#define RUBY\_SITE\_ARCHLIB  
“/usr/local/lib/ruby/site\_ruby/1.8/sparc-solaris2.9”

Do I just set change “/usr/local/lib” to my target destination?

## OPTION 2: Specify command line options when running configure

Fine tuning of the installation directories:  
–bindir=DIR user executables [EPREFIX/bin]  
–sbindir=DIR system admin executables [EPREFIX/sbin]  
–libexecdir=DIR program executables [EPREFIX/libexec]  
–datadir=DIR read-only architecture-independent data  
[PREFIX/share]  
–sysconfdir=DIR read-only single-machine data [PREFIX/etc]  
–sharedstatedir=DIR modifiable architecture-independent data  
[PREFIX/com]  
–localstatedir=DIR modifiable single-machine data [PREFIX/var]  
–libdir=DIR object code libraries [EPREFIX/lib]  
–includedir=DIR C header files [PREFIX/include]  
–oldincludedir=DIR C header files for non-gcc [/usr/include]  
–infodir=DIR info documentation [PREFIX/info]  
–mandir=DIR man documentation [PREFIX/man]

Program names:  
–program-prefix=PREFIX prepend PREFIX to installed program names  
–program-suffix=SUFFIX append SUFFIX to installed program names  
–program-transform-name=PROGRAM  
run sed PROGRAM on installed program  
names

System types:  
–build=BUILD configure for building on BUILD [guessed]  
–host=HOST cross-compile to build programs to run on HOST  
[BUILD]  
–target=TARGET configure for building compilers for TARGET [HOST]

Optional Features:  
–disable-FEATURE do not include FEATURE  
(same as --enable-FEATURE=no)  
–enable-FEATURE[=ARG] include FEATURE [ARG=yes]  
–enable-frame-address use GCC \_\_builtin\_frame\_address().  
–disable-largefile omit support for large files  
–enable-pthread use pthread library.  
–enable-setreuid use setreuid()/setregid() according to need  
even if obsolete.  
–disable-rpath embed run path into extension libraries.  
–enable-shared build a shared library for Ruby.  
–enable-install-doc build and install rdoc indexes during install

Optional Packages:  
–with-PACKAGE[=ARG] use PACKAGE [ARG=yes]  
–without-PACKAGE do not use PACKAGE (same as  
–with-PACKAGE=no)  
–without-gcc never use gcc  
–with-default-kcode=CODE specify default value for $KCODE  
(utf8|euc|sjis|none)  
–with-dln-a-out use dln\_a\_out if possible  
–with-static-linked-ext link external modules statically  
–with-sitedir=DIR site libraries in DIR  
PREFIX/lib/ruby/site\_ruby  
–with-search-path=DIR specify the additional search path  
–with-mantype=TYPE specify man page type; TYPE is one of man and doc

Some influential environment variables:  
CC C compiler command  
CFLAGS C compiler flags  
LDFLAGS linker flags, e.g. -L if you have libraries in a  
nonstandard directory   
CPPFLAGS C/C++ preprocessor flags, e.g. -I if you  
have  
headers in a nonstandard directory   
CPP C preprocessor

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 13, 2006, 6:21am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/2 "2006-05-13T06:21:25Z")

</div>

Eric A. wrote:

> Were I able to install at the default location,  
> things would be golden. Unfortunately, that’s  
> not an option.

make distclean  
./configure --prefix=/wherever/you/want  
make  
make install

Add /wherever/you/want to your $PATH.

That should work.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 13, 2006, 2:43pm UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/3 "2006-05-13T14:43:45Z")

</div>

On Sat, 13 May 2006, Daniel B. wrote:

> Add /wherever/you/want to your $PATH.  
> don’t forget to do both both of these before compiling

LD\_LIBRARY\_PATH=/whenever/you/want/lib  
LD\_RUN\_PATH=/whenever/you/want/lib # this one most important!

if you do this all the stuff you compile it will inter-operate nicely -  
eg  
ruby extensions. also, other users will be able to use your ruby  
without  
having their LD\_LIBRARY\_PATH set - they’ll only require PATH.

regards.

-a

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 16, 2006, 12:45am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/4 "2006-05-16T00:45:28Z")

</div>

removed\_email\_address@domain.invalid wrote:

> LD\_LIBRARY\_PATH=/wherever/you/want/lib  
> LD\_RUN\_PATH=/wherever/you/want/lib # this one most important!
> 
> if you do this all the stuff you compile it will inter-operate nicely - eg  
> ruby extensions. also, other users will be able to use your ruby without  
> having their LD\_LIBRARY\_PATH set - they’ll only require PATH.

I don’t see these settings in config.h or the Makefile,  
so they must be environment settings?

But if they’re environment settings, the targets they’e  
pointing to don’t exist yet.

What am I missing?

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 16, 2006, 12:48am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/5 "2006-05-16T00:48:34Z")

</div>

Thanks, Dan!

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 16, 2006, 6:14am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409/6 "2006-05-16T06:14:29Z")

</div>

Many, many thanks for the help, folks.  
I’m beginning to find my way around.  
Now then…

Daniel B. wrote:

> Eric A. needed:
> 
> make distclean  
> ./configure --prefix=/wherever/you/want  
> make  
> make install
> 
> Add /wherever/you/want to your $PATH.

Aha. I need to specify --prefix in the configure  
step. Didn’t see that bit of information anywhere.

The default make target in the next step is “all”,  
which really means “build without installing”.

But I’m not sure how to read the install target.  
I see this in the makefile:

install: install-nodoc $(RDOCTARGET)  
install-all: install-nodoc install-doc

Install-all sounds like the one I want to get the  
documentation. But install seems to be doing  
something similar.

But when I took a deeper look I found that RDOCTARGET  
defaults to null, and it’s not used anywhere else in the  
makefile. So it looks like:

- RDOCSTARGET and the reference to it should be  
removed from the Makefile

- install-all is the target I want

Is that about right?
