Use automake to automatically configure the makefile of wxWidgets in Redhat

Source: Internet
Author: User
Tags wxwidgets automake
Premise: assume that this program is called the vso path: \ vso \ src \ vso \ test. The steps below only contain the source code directory. If you create the makefile of test, it is similar. 1. cd \ vsoautoscan2.mvconfigure. scanconfigure. in3.vimconfigure. inas :---------------

Premise: Assume this program is called vso.

Path:

\ Vso

\ Vso \ src

\ Vso \ test

The following steps only contain the source code directory. If you create the makefile for test, it is similar.

1. cd \ vso


Autoscan

2. mv configure. scan configure. in

3. vim configure. in

As:

---------------------------------


AC_PREREQ (2.59)

AC_INIT (vso, 0.0.1, sun.noon@gmail.com)

AC_CONFIG_SRCDIR ([src/PlotWindow. cpp])

AC_CONFIG_HEADER ([config. h])

AM_INIT_AUTOMAKE (vso, 0.0.1)

 


# Checks for programs.

AC_PROG_CXX

AC_PROG_CC

 


# Checks for libraries.

AM_OPTIONS_WXCONFIG

Reqwx = 2.8.10

AM_PATH_WXCONFIG ($ reqwx, wxWin = 1)

 


If test "$ wxWin "! = 1; then

AC_MSG_ERROR ([

WxWidgets must be installed on your system.

 


Please check that wx-config is in path, the directory

Where wxWidgets libraries are installed (returned

'Wx-config -- libs' or 'wx-config -- static -- libs' command)

Is in LD_LIBRARY_PATH or equivalent variable and

WxWidgets version is $ reqwx or above.

])

Fi

 


CPPFLAGS = "$ CPPFLAGS $ WX_CPPFLAGS"

CXXFLAGS = "$ CXXFLAGS $ WX_CXXFLAGS_ONLY"

CFLAGS = "$ CFLAGS $ WX_CFLAGS_ONLY"

LIBS = "$ LIBS $ WX_LIBS"

 


# Checks for header files.

AC_HEADER_STDC

AC_CHECK_HEADERS ([limits. h stdlib. h string. h])

 


# Checks for typedefs, structures, and compiler characteristics.

AC_HEADER_STDBOOL

AC_C_CONST

AC_TYPE_SIZE_T

 


# Checks for library functions.

AC_FUNC_CLOSEDIR_VOID

AC_CHECK_FUNCS ([sqrt])

AC_CONFIG_FILES ([Makefile

Src/Makefile])

AC_OUTPUT


----------------------------------

4. touch news readme ChangeLog AUTHORS

5. cd src

Vim Makefile. am

As:

--------------

Bin_PROGRAMS = vso

Vso_SOURCES = a. h a. cpp B. h B. cpp c. h c. cpp

Vso_LDADD = @ LIBS @

Vso_CXXFLAGS = @ CXXFLAGS @

--------------

6. cd ..

Vim Makefile. am

As:

--------------

AUTOMAKE_OPTIONS = foreign

SUBDIRS = src

--------------

7.

Aclocal

Autoheader

Autoconf

Automake -- add-missing

8. Finished !!

Usage:

./Configure

Make

Enjoy it!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.