Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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).
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.