Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Linux system make, make install,. / confiigure

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "Linux system make, make install,. / confiigure", so the editor summarizes the following, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "Linux system make, make install,. / confiigure how to use" article.

To put it simply:. / configure is mainly used to detect the target characteristics of the installation platform. Make is used to compile and make install** is used to install.

1. Configure is generally used to generate Makefile in preparation for the next step of compilation. You can control the installation by adding parameters to the configure, such as code:

. / configure-- prefix=/usr means to install the software under / usr, the executable will be installed in / usr/bin (instead of the default / usr/local/bin), and the resource files will be installed in / usr/share (instead of the default / usr/local/share).

Of course, there are a lot of optional shores that can be specified when executing this script, and we can help by allowing. / configure-help to see detailed instructions. Some common parameters are as follows, not every program is the same, some will be different:

(1)-- prefix = PREFIX installs all files under the directory PREFIX. (2)-- exec-prefix = EXEC-PREFIX you can install system-related files to a different location, EXEC-PREFIX, instead of PREFIX settings. This makes it easier to share system-related files between different hosts. If you omit these Then EXEC-PREFIX will be set to equal to PREFIX and system-related and system-independent files will be installed under the same directory tree, which may also be what you want. (3)-- bindir=DIRECTORY declares the directory for executable programs, and the default is EXEC-PREFIX/bin It is usually / usr/local/pgsql/bin. (4)-- datadir=DIRECTORY sets the directory of read-only files required by the installed program. the default is PREFIX/share. Please note that this directory has nothing to do with where you put the database files. (5)-- the directory used by sysconfdir=DIRECTORY for various configuration files The default is PREFIX/etc. (6)-- directory for libdir=DIRECTORY library files and dynamically loaded modules. Default is EXEC-PREFIX/lib. (7)-- directory for includedir=DIRECTORY C and C++ header files. Default is PREFIX/include. (8)-- docdir=DIRECTORY document file, except for "man (man pages)" Will be installed in this directory. Default is PREFIX/doc. (9)-the man pages that mandir=DIRECTORY comes with PostgreSQL will be installed in this directory. in their corresponding manx subdirectory. the default is PREFIX/man. Second, the make step is to compile Most source code packages are compiled through this step (of course, some software written by perl or python needs to be compiled by calling perl or python).

Make is a control program compiled automatically in the Linux development kit. It automatically calls gcc, ld and runs some required programs with the help of the compilation specifications written in Makefile. In general, the Makefile control code he uses is generated by the configure setup script based on the given parameters and system environment.

If error appears in the make process, you should write down the error code (not just the last line), and then you can submit the bugreport to the developer (usually there is a commit address in INSTALL), or your system lacks some dependent libraries, which require careful study of the error code yourself.

The role of make is to start source code compilation, as well as the provision of some functions, which are provided by his Makefile settings file, such as make install generally means to install, make uninstall is to uninstall, no parameters is the default source code compilation.

Third, make install this command to install (of course, some software need to run make check or make test to do some testing), this step generally requires you to have root permission (because you have to write files to the system)

Some common questions: (1) Overview of the differences between Linux CC and Linux GCC:

In terms of name, the CC program of the old unix system is called C Compiler, which is an ancient Unix compiler dedicated to compiling the C language. But the name GCC is called Gnu Compiler Collection according to GNU. Because gcc contains many compilers (C, Clearing, Objective-C, Ada, Fortran,and Java). So they are different, one is an old C compiler, and the other is a collection of compilers for GNU (the C compiler in Gcc is much more powerful than CC, so you don't have to use CC). When you call gcc, it doesn't have to be the Cmax Candle + compiler that you call, but gcc automatically recognizes and calls the corresponding compiler based on the file extension. For more information, please see $man gcc.

You can't download CC because CC comes from expensive Unix systems. CC is commercial software. To use it, you need to make a phone call and write an order instead of opening your Browser to download.

Cc under linux is a symbolic link to gcc, which can be easily viewed through $ls-l / usr/bin/cc. The console output CC you see at compile time is a variable pointing to gcc, which is a built-in variable of the make program, which exists even if you don't have CC= in Makefile, and points to gcc by default. The significance of the symbolic links and variables of cc lies in the portability of the source code. It is convenient to use GCC to compile the old unix software compiled with cc, even without changing Makefile. It is also convenient for linux programs to be compiled under unix.

A new situation in recent years is that more and more unix users, as far as I know, like solaris,bsd users do not use CC very much, people must install a gcc and use it to compile Cpassword + programs. The reason is obvious: gcc is strong and robust enough. Support is estimated to be the only new feature that it supports so far, ISO cplink +. Of course, you'd better not use the night version of gcc.

(2) explanation of make install

Is mark in make and make install a command that comes with the system or an executable program file? In make install, is it possible to consider install as a parameter of mark?

Note: install is not a parameter to make, but a statement like: install: in makefile (Makefile). If you use make install, execute the following statement of install:.

The above is about the content of this article on "how to use Linux system make, make install,. / confiigure". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report