Bakefile, automake how to? Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Bakefile, automake how to?

Post by Jorg » Thu Jan 05, 2006 10:26 am

Hi all,

I am planning to revise my Bakefile for some components, but I got stuck at (auto)make.

What do I need to do to get a proper "configure" executable which also finds wxWidgets on Linux?

I want people to follow the standard sequence;

./configure
make
make install (if needed for my app)

However I only get automake.am (from the top of my head) from generating bakefile, and now I am lost...

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio » Thu Jan 05, 2006 3:50 pm

You should be getting Makefile.in's and a configure.in
Before shipping you should run autoconf, and that's about it - autoconf generates configure out of configure.in or configure.ac (extension used more in the past, but I believe still actually the preferred one - doesn't matter if only one of them exists).

./configure creates Makefile's out of Makefile.in-s in the end. This is its main purpose (Makefile.in -> Makefile; config.h.in -> config.h; etc - based on the results of system tests and selected options)
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Thu Jan 05, 2006 5:26 pm

Thanks!
Does bakefile also include a check for wxWidgets? And ofcourse as last question, what if my dependency is e.g. sqlite or TinyXML? Is there a way to add these dependencies to the automake?

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio » Thu Jan 05, 2006 7:20 pm

Jorg wrote:Thanks!
Does bakefile also include a check for wxWidgets? And ofcourse as last question, what if my dependency is e.g. sqlite or TinyXML? Is there a way to add these dependencies to the automake?
I believe so. I've only baked from wx existing bakefiles, and added files to the files.bkl file before that.
ABX, or someone else who has used bakefiles in their own application, should know more.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Re: Bakefile, automake how to?

Post by ABX » Thu Jan 05, 2006 8:32 pm

Jorg wrote:What do I need to do to get a proper "configure" executable which also finds wxWidgets on Linux?
Sorry, I still don't know 'configure' part of bakefiles but Francesco Montorsi adopted bakefile build system to wxCode and I think he could be of some help for you.

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

DavidHart
Site Admin
Site Admin
Posts: 4005
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Thu Jan 12, 2006 11:09 pm

Hi Jorg,

First a health warning: I barely know what I'm talking about. I finally managed to get the bakefile/autoconf system to work for my project after a week of much trial and even more error: and that was just for linux; I haven't tried cross-compilation or including outside libraries.

The most important message is to use Francesco Montorsi's files from wxCode. In particular grab http://wxcode.cvs.sourceforge.net/wxcod ... toconf.php, and the autoconf manual at http://www.gnu.org/software/autoconf/manual/index.html

Skip this paragraph if you have only 1 version of wxWidgets on your system, and it was 'make install'ed, not just kept locally. If not, you need to make sure that the correct version of wx-config is not only in your PATH, but is the first one found. For me this means using the command PATH=../..:$PATH but you may prefer something like PATH=/path/to/dir/containing/wx-config:$PATH

You can now finally run
autoconf
to create a configure file. Then ./configure as usual to create the makefile. Good luck!

* * * * * * * * * * * * * *


My project's configure.ac file (or call it configure.in if you prefer)

dnl Process this file with autoconf to produce a configure script.
dnl It copies the wxWidgets build debug/release, static/dynamic etc status
dnl Lines beginning with 'dnl' are comments

dnl My version number is 0.5
AC_INIT([MyProject],[0.5])

AC_PREREQ(2.59)


dnl This is just a sanity check: it checks that there is a file MyProject.cpp in the dir
AC_CONFIG_SRCDIR([MyProject.cpp])

dnl These macros do the work. Taken from wxCode, written by Francesco Montorsi
AM_OPTIONS_WXCONFIG
AM_OPTIONS_WXPRESETS
dnl The usual way. This builds with xrc,xml and adv extra libraries. 2.4.1 is the minimum wxWidgets version required.
AM_WXPRESETS_FULL([2.4.1],[xrc,xml,adv])
dnl Use this instead if you want to include gtk files direct e.g. #include <gtk/gtk.h>
dnl AM_WXPRESETS_FULL([2.4.1],[xrc,xml,adv],[1])

AC_BAKEFILE([m4_include(autoconf_inc.m4)])


AC_CONFIG_FILES([
Makefile
])

AC_OUTPUT
Last edited by DavidHart on Sun Oct 22, 2006 5:37 pm, edited 1 time in total.

DavidHart
Site Admin
Site Admin
Posts: 4005
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Thu Jan 12, 2006 11:14 pm

As promised, my project's .bkl.

Code: Select all

<?xml version="1.0" ?>
<!-- $Id: MyProject.bkl,v 0.5 2005/11/23 Me Exp $ -->

<makefile>

    <include file="/path/to/wxGTK-2.6.2/build/bakefiles/wxpresets/presets/wx.bkl"/>

    <exe id="MyProject" template="wx">
        <app-type>gui</app-type>
        <debug-info>on</debug-info>
        <runtime-libs>dynamic</runtime-libs>
        
        <sources>MyProject.cpp MyProject1.cpp MyProject2.cpp MyProject[n].cpp</sources>
        <sources>MoreSources.cpp</sources>

        <wx-lib>core</wx-lib>
        <wx-lib>base</wx-lib>

    </exe>
		
</makefile>
Last edited by DavidHart on Fri Jan 13, 2006 11:08 am, edited 1 time in total.

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Fri Jan 13, 2006 8:05 am

Thanks for all your info David!

I wonder why it was so hard to find that information. I did browse some documents and did not find anything related to aclocal.

I will look into it some later today. I'm experiencing problems with my site which I must seem to fix soon. Since I stepped over to another CMS it will take me a while to get back to development.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Post Reply