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

Detailed steps of making rpm package in Autoconf

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "the detailed steps of making rpm package in Autoconf". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the detailed steps of making rpm package in Autoconf.

Autoconf rpm*** steps:

Create the directory hello-cxf-1.0 under root, and then create new subdirectories src and doc under that directory (doc holds almost some documents, but it's temporarily empty here).

# mkdirhello-cxf-1.0

# cdhello-cxf-1.0

# mkdirsrc

# mkdirdoc

Step 2 of Autoconf rpm:

Edit the file main.c in the src directory

# cdsrc

# vimain.c

# include

Intmain (void)

{

Printf ("thisishello-cxf-1.0testing!\ n")

Return0

}

Step 3 of Autoconf rpm:

Go back to the hello-cxf-1.0 directory and edit the configure.ac (or configure.in) and Makefile.am files.

An example of configure.ac:

AC_PREREG (2.59)

# AC_INIT (FULL-PACKAGE-NAME,VERSION,BUG-REPORT-ADDRESS)

AC_INIT (hello-cxf,1.0)

AM_INIT_AUTOMAKE ([foreign])

AC_CONFIG_SRCDIR ([src/main.c])

AC_CONFIG_HEADER ([src/config.h])

# Checksforprograms.

AC_PROG_CC

# Checksforlibraries.

# Checksforheaderfiles.

# Checksfortypedefs,structures,andcompilercharacteristics.

# Checksforlibraryfunctions.

AC_CONFIG_FILES ([Makefile]

Src/Makefile

Doc/Makefile

])

AC_OUTPUT

Step 4 of Autoconf rpm:

Run aclocal, which generates a "aclocal.m4" file and a buffer folder autom4te.cache based on configure.ac or configure.in, which mainly deals with local macro definitions.

Run aclocal under the hello-cxf-1.0 directory.

# aclocal

# ls

Step 5 of Autoconf rpm:

Run autoconf to generate configure scripts based on configure.ac and aclocal.m4.

# autoconf

# ls

Step 6 of Autoconf rpm:

Run autoheader, which is responsible for generating the config.h.in file. The tool typically copies the symbol definitions attached by the user from the "acconfig.h" file. That is, autoheader runs M4 according to configure.ac to generate config.h.in (the file name is determined by the definition of AC_CONFIG_HEADER ([src/config.h])).

# autoheader

# ls

Step 7 of Autoconf rpm:

Using automake to generate Makefile.in files from Makefile.am and aclocal.m4, use the option "- adding-missing" here to have automake automatically add some necessary script files, such as depcomp,install-sh,missing, and so on.

# automake-adding-missing

Step 8 of Autoconf rpm:

Run. / configure to generate makefile and config.h (if any config.h.in) files from makefile.in and config.h.in (if any), and config.status,config.log is used to record some of the detected states. That is, by running the automatic configuration settings file configure, Makefile.in is turned into the final Makefile.

#. / configure

# ls

Where autoreconf is equivalent to the continuous execution of aclocalautoconfautoheaderautomake--add-missing.

Step 9:

Run make to test the configuration file Makefile.

# make

... .

# ls

# lssrc/

You can see that the output file hello-cxf of main.c is generated under the src file.

Step 10 of Autoconf rpm:

Run the generated file hello-cxf

#. / src/hello-cxf

Thisishello-cxf-1.0testing!

Makedist- create release package: PACKAGE-VERSION.tar.gz.

At this point, I believe you have a deeper understanding of the "detailed production steps of the rpm package in Autoconf". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report