autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I conditinally make a makefile?


From: Dr. David Kirkby
Subject: How do I conditinally make a makefile?
Date: Fri, 19 Apr 2002 09:07:16 +0100

Hi,
        I've an application that has both a command-line and a version with a 
graphical
user interface (GUI). These are located in directories src/non_gui and src/gui.
The GUI version should only be built if the option --with-gui is added when
running configure. If the user does not add that option, then the GUI version
should not be built and I assume (perhaps incorrectly) that I should not make a
Makefile for it. If this is the case, how do I do this conditionally?? Or how
else do I only build the GUI version when the option is given to configure.

I currently have at the bottom of my configure.in, the following, which despite
being commented out, you can see my intentions. I was intending only creating a
Makefile if the option is given. My idea requited that AC_OUTPUT is called
twice, which I believe is wrong.

Related to this, how do I give a different set of options to CC when building
the GUI version? I've just started to use wXWindows, an example of which says
the following options are required.
g++ hworld.cpp `wx-config --libs` `wx-config --cflags` -o hworld 

Anyway, here is the end of my configure.in. Any suggesions to achieve what I
want? 

AC_OUTPUT([\
Makefile                                        \
src/Makefile                                    \
src/non_gui/Makefile                            \
src/gui/Makefile                                \
man/Makefile                                    \
examples/Makefile                               \
docs/Makefile                                   \
docs/html-docs/Makefile                         \
docs/html-docs/jpgs/Makefile                    \
docs/qex-december-1996/Makefile                 \
docs/theory/Makefile                            \
docs/Makefile                                   ])

dnl if test "x$with_gui" = "xyes"; then
dnl AC_OUTPUT([src/gui/Makefile])
dnl fi

-- 
Dr. David Kirkby PhD,
email: address@hidden 
web page: http://www.david-kirkby.co.uk
Amateur radio callsign: G8WRB



reply via email to

[Prev in Thread] Current Thread [Next in Thread]