[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help with AC_ARG_ENABLE, AC_ARG_WITH
From: |
Tim Post |
Subject: |
Help with AC_ARG_ENABLE, AC_ARG_WITH |
Date: |
Fri, 09 May 2008 13:52:01 +0800 |
Hello to all,
I am a m4 novice and for the first time trying to use custom options
with autoconf. My experience is only the basic autoscan, autoheader,
autoconf which has always fit my needs.
I have added features to one of my programs which some users might want
to toggle on or off, as well as other features that really need input
from the user while configuring.
These options are, enable unsafe operations, and specify a user=[user]
which will specify what user my program runs as once it drops
permissions.
I have been studying how other projects accomplish this, however I'm
horribly stuck and hope that someone can help me.
In my configure.ac, I have added:
# Check for package options
AC_ARG_ENABLE(unsafe, [ --enable-unsafe enable unsafe operation
[[default=no]]],[
if test "$enableval" = no; then
ac_enable_unsafe=no
else
ac_enable_unsafe=yes
fi
],[ ac_enable_unsafe=no])
AC_ARG_WITH(user,[ --with-user specify the system user],[
ac_with_user="$withval"
],[
ac_with_user=""
])
This adds the options to ./configure , however I can't seem to figure
out how I can get the value of these options when compiling.
I am not using automake, only the basics ... my .in files simply contain
the typical @variables@ that are filled with user preferences.
I have searched for tutorials and documentation to explain this, however
being a M4 novice I get hopelessly lost. Can someone point out where I
might be going wrong, or perhaps share a link to a tutorial that might
be helpful to a m4 dummy?
Thanks in advance to anyone who can help.
Regards
--Tim
--
Monkey + Typewriter = Echoreply ( http://echoreply.us )
- Help with AC_ARG_ENABLE, AC_ARG_WITH,
Tim Post <=