LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2012, 09:58 AM   #1
zcnnbb
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Rep: Reputation: Disabled
How to compile a portable emacs for Linux ?


If you compile the emacs source code using default way
(that is "./configure && make && make install"),
once it has been compiled, the program path can no longer be changed.
(i.e. if you move the program and all its data to another directory, it won't run)

But I have specific need: I need to run emacs on multiple computers and the path is not a constant.
So how can I build a portable version of emacs?

For instance, I want to put the program and all its data in a folder named emacs, and this folder may have different path on different computers: /media/disk/emacs or /home/xxx/emacs or ...., and I want to make it run on those computers.
 
Old 09-10-2012, 10:23 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
The configure shell program has multiple options for setting the various path variables. If you execute configure --help (and maybe pipe it into more or redirect the output into a temporary file you'll see the options you can use.

For example, most configure programs include these:
Code:
...
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
			  [PREFIX]
...
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]
  --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]
...and a whole lot more options
Note that the default is to install in the /usr/local tree and you can override that by setting
Code:
configure --prefix=/usr
so that all the software installs in that tree.

It would be worth your time to scan through all the output of configure --help to see what options are available (most of them can, and usually should be, be left at the defaults).

Hope this helps some.
 
Old 09-10-2012, 02:58 PM   #3
zcnnbb
LQ Newbie
 
Registered: Feb 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
You didn't understand my question.
 
Old 09-10-2012, 04:20 PM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Perhaps not; however, if you want to build a portable version of emacs (that does not install in /usr/local -- which is not a bad place to install it in any event), you would need to determine where you want it to go then execute configure, make, and make install separately (not in one go) with appropriate arguments to configure.

"Portable" will only be portable on like distributions of Linux; i.e., you can't build emacs on a 32-bit box and expect it to run on a 64-bit (and vice versa) unless all the appropriate libraries are installed on that distribution. That's not exactly trivial.

So, what's wrong with /usr/local? The make install will create directories in /usr/local, such as bin, lib, etc. and install the editor there; all you'd need to do to is add /usr/local/bin to your /etc/login.defs file and, probably, /usr/local/lib to /etc/ld.so.conf (or LD_LIBRARY_PATH in /etc/profile). You'd have to do that if you choose to put it in some weird location in any event. You ought to be able to copy /usr/local from one machine to another without too much trouble. If you don't like /usr/local, configure the thing with some other prefix and be done with it.

Unless you are extremely familiar with whatever package management system your individual Linux boxes support the above may be your best bet; however, emacs is fairly common as standard equipment in most distributions and, if it's missing in a base install, it ought to be freely available from the distribution software depository; e.g., yum. Have you tried that?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need a portable linux distro to bring on portable usb hard drive... pippo17 Linux - Distributions 3 10-20-2008 06:41 AM
More Emacs-help, interpret/compile from emacs? raskol Programming 2 04-19-2008 01:24 PM
GNU/Emacs Help me Compile Please Richard554 Linux - Desktop 1 04-05-2008 01:00 PM
portable plugins for emacs Four Programming 2 03-07-2007 01:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration