13
0
Fork 0

Initial mysql-admtools import

This commit is contained in:
Eirik Alderslyst Nygaard 2007-02-13 21:11:55 +00:00
parent 76a482f545
commit 1d81d8820f
28 changed files with 19586 additions and 0 deletions

0
AUTHORS Normal file
View File

340
COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

13
ChangeLog Normal file
View File

@ -0,0 +1,13 @@
Wed Jul 6 00:24:26 2005 Knut Auvor Grythe <knuta@pvv.ntnu.no>
* Added support for changing Alter_priv
Thu Jun 30 15:13:15 2005 Knut Auvor Grythe <knuta@pvv.ntnu.no>
* A few patches to be able to use the mysql bundled with FreeBSD 5.4
Mon Jul 6 11:58:10 1998 Vebjorn Ljosa <ljosa@stud.ntnu.no>
* Initial version.

183
INSTALL Normal file
View File

@ -0,0 +1,183 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

7
Makefile.am Normal file
View File

@ -0,0 +1,7 @@
bin_PROGRAMS = mysql-dbadm mysql-useradm
mysql_dbadm_SOURCES = mysql-dbadm.c common.c mysql-admutils.h
mysql_useradm_SOURCES = mysql-useradm.c common.c mysql-admutils.h
INCLUDES = @MYSQL_INCLUDE@
LDADD = @MYSQL_LIBS@
LDFLAGS = @MYSQL_LFLAGS@

548
Makefile.in Normal file
View File

@ -0,0 +1,548 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(mysql_dbadm_SOURCES) $(mysql_useradm_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = mysql-dbadm$(EXEEXT) mysql-useradm$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
acconfig.h depcomp install-sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_mysql_dbadm_OBJECTS = mysql-dbadm.$(OBJEXT) common.$(OBJEXT)
mysql_dbadm_OBJECTS = $(am_mysql_dbadm_OBJECTS)
mysql_dbadm_LDADD = $(LDADD)
mysql_dbadm_DEPENDENCIES =
am_mysql_useradm_OBJECTS = mysql-useradm.$(OBJEXT) common.$(OBJEXT)
mysql_useradm_OBJECTS = $(am_mysql_useradm_OBJECTS)
mysql_useradm_LDADD = $(LDADD)
mysql_useradm_DEPENDENCIES =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mysql_dbadm_SOURCES) $(mysql_useradm_SOURCES)
DIST_SOURCES = $(mysql_dbadm_SOURCES) $(mysql_useradm_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @MYSQL_LFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MYSQL_INCLUDE = @MYSQL_INCLUDE@
MYSQL_LFLAGS = @MYSQL_LFLAGS@
MYSQL_LIBS = @MYSQL_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
mysql_dbadm_SOURCES = mysql-dbadm.c common.c mysql-admutils.h
mysql_useradm_SOURCES = mysql-useradm.c common.c mysql-admutils.h
INCLUDES = @MYSQL_INCLUDE@
LDADD = @MYSQL_LIBS@
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
mysql-dbadm$(EXEEXT): $(mysql_dbadm_OBJECTS) $(mysql_dbadm_DEPENDENCIES)
@rm -f mysql-dbadm$(EXEEXT)
$(LINK) $(mysql_dbadm_LDFLAGS) $(mysql_dbadm_OBJECTS) $(mysql_dbadm_LDADD) $(LIBS)
mysql-useradm$(EXEEXT): $(mysql_useradm_OBJECTS) $(mysql_useradm_DEPENDENCIES)
@rm -f mysql-useradm$(EXEEXT)
$(LINK) $(mysql_useradm_LDFLAGS) $(mysql_useradm_OBJECTS) $(mysql_useradm_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mysql-dbadm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mysql-useradm.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) config.h
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

0
NEWS Normal file
View File

0
README Normal file
View File

29
acconfig.h Normal file
View File

@ -0,0 +1,29 @@
/*
* acconfig.h
*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/acconfig.h,v 1.1 1998/07/06 12:33:07 ljosa Exp $
*
*/
/* Define the name of the package */
#undef PACKAGE
/* Define the version of the package */
#undef VERSION
/* Define if MySQL is installed */
#undef HAVE_MYSQL
/* Define if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define if libmath is available */
#undef HAVE_LIBM
/* Define if libnsl is available */
#undef HAVE_LIBNSL
/* Define if libsocket is available */
#undef HAVE_LIBSOCKET

862
aclocal.m4 vendored Normal file
View File

@ -0,0 +1,862 @@
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.5])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

716
bin/aclocal Executable file
View File

@ -0,0 +1,716 @@
#!/usr/bin/perl
# -*- perl -*-
# Generated from aclocal.in; do not edit by hand.
eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
if 0;
# aclocal - create aclocal.m4 by scanning configure.ac
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Written by Tom Tromey <tromey@redhat.com>.
BEGIN
{
my $perllibdir = $ENV{'perllibdir'} || '/usr/local/share/automake19';
unshift @INC, (split ':', $perllibdir);
}
use Automake::Config;
use Automake::General;
use Automake::Configure_ac;
use Automake::Channels;
use Automake::XFile;
use Automake::FileUtils;
use File::Basename;
use File::stat;
use Cwd;
# Note that this isn't pkgdatadir, but a separate directory.
# Note also that the versioned directory is handled later.
$acdir = '/usr/local/share/aclocal19';
$default_acdir = $acdir;
$acdir_x11 = '/usr/X11R6/share/aclocal';
# contains a list of directories, one per line, to be added
# to the dirlist in addition to $acdir, as if -I had been
# added to the command line. If acdir has been redirected,
# we will also check the specified acdir (this is done later).
$default_dirlist = "$default_acdir/dirlist";
# Some globals.
# configure.ac or configure.in.
my $configure_ac;
# Output file name.
$output_file = 'aclocal.m4';
# Modification time of the youngest dependency.
$greatest_mtime = 0;
# Option --force.
$force_output = 0;
# Which macros have been seen.
%macro_seen = ();
# Which files have been seen.
%file_seen = ();
# Remember the order into which we scanned the files.
# It's important to output the contents of aclocal.m4 in the opposite order.
# (Definitions in first files we have scanned should override those from
# later files. So they must appear last in the output.)
@file_order = ();
# Map macro names to file names.
%map = ();
# Ditto, but records the last definition of each macro as returned by --trace.
%map_traced_defs = ();
# Map file names to file contents.
%file_contents = ();
# Map file names to included files (transitively closed).
%file_includes = ();
# How much to say.
$verbose = 0;
# Matches a macro definition.
# AC_DEFUN([macroname], ...)
# or
# AC_DEFUN(macroname, ...)
# When macroname is `['-quoted , we accept any character in the name,
# except `]'. Otherwise macroname stops on the first `]', `,', `)',
# or `\n' encountered.
$ac_defun_rx =
"(?:AU_ALIAS|A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
# Matches an AC_REQUIRE line.
$ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Matches an m4_include line
$m4_include_rx = "(?:m4_)?s?include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
################################################################
# Check macros in acinclude.m4. If one is not used, warn.
sub check_acinclude ()
{
foreach my $key (keys %map)
{
# FIXME: should print line number of acinclude.m4.
warn ("aclocal: warning: macro `$key' defined in "
. "acinclude.m4 but never used\n")
if $map{$key} eq 'acinclude.m4' && ! $macro_seen{$key};
}
}
################################################################
# Scan all the installed m4 files and construct a map.
sub scan_m4_files (@)
{
local (@dirlist) = @_;
# First, scan configure.ac. It may contain macro definitions,
# or may include other files that define macros.
&scan_file ($configure_ac, 'aclocal');
# Then, scan acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
&scan_file ('acinclude.m4', 'aclocal');
}
# Finally, scan all files in our search path.
local ($m4dir);
foreach $m4dir (@dirlist)
{
if (! opendir (DIR, $m4dir))
{
print STDERR "aclocal: couldn't open directory `$m4dir': $!\n";
exit 1;
}
local ($file, $fullfile);
# We reverse the directory contents so that foo2.m4 gets
# used in preference to foo1.m4.
foreach $file (reverse sort grep (! /^\./, readdir (DIR)))
{
# Only examine .m4 files.
next unless $file =~ /\.m4$/;
# Skip some files when running out of srcdir.
next if $file eq 'aclocal.m4';
$fullfile = File::Spec->canonpath ("$m4dir/$file");
&scan_file ($fullfile, 'aclocal');
}
closedir (DIR);
}
# Construct a new function that does the searching. We use a
# function (instead of just evaluating $search in the loop) so that
# "die" is correctly and easily propagated if run.
my $search = "sub search {\nmy \$found = 0;\n";
foreach my $key (reverse sort keys %map)
{
$search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
. '"); $found = 1; }' . "\n");
}
$search .= "return \$found;\n};\n";
eval $search;
die "internal error: $@\n search is $search" if $@;
}
################################################################
# Add a macro to the output.
sub add_macro ($)
{
local ($macro) = @_;
# Ignore unknown required macros. Either they are not really
# needed (e.g., a conditional AC_REQUIRE), in which case aclocal
# should be quiet, or they are needed and Autoconf itself will
# complain when we trace for macro usage later.
return unless defined $map{$macro};
print STDERR "aclocal: saw macro $macro\n" if $verbose;
$macro_seen{$macro} = 1;
&add_file ($map{$macro});
}
# rel2abs ($file, $directory)
# ---------------------------
# Similar to File::Spec->rel2abs ($file, $directory), but
# work with Perl 5.005. (File::Spec->rel2abs is available
# only in Perl 5.6.)
# Remove this once we require 5.6.
sub rel2abs ($$)
{
my ($file, $dir) = @_;
if (! File::Spec->file_name_is_absolute ($file))
{
$dir = cwd () . "/$dir"
unless File::Spec->file_name_is_absolute ($dir);
$file = "$dir/$file";
}
$file = File::Spec->canonpath ($file);
return $file;
}
# scan_configure_dep ($file)
# --------------------------
# Scan a configure dependency (configure.ac, or separate m4 files)
# for uses of know macros and AC_REQUIREs of possibly unknown macros.
# Recursively scan m4_included files.
my %scanned_configure_dep = ();
sub scan_configure_dep ($)
{
my ($file) = @_;
# Do not scan a file twice.
return ()
if exists $scanned_configure_dep{$file};
$scanned_configure_dep{$file} = 1;
my $mtime = mtime $file;
$greatest_mtime = $mtime if $greatest_mtime < $mtime;
my $contents = exists $file_contents{$file} ?
$file_contents{$file} : contents $file;
my $line = 0;
my @rlist = ();
my @ilist = ();
foreach (split ("\n", $contents))
{
++$line;
# Remove comments from current line.
s/\bdnl\b.*$//;
s/\#.*$//;
while (/$m4_include_rx/go)
{
push (@ilist, $1 || $2);
}
while (/$ac_require_rx/go)
{
push (@rlist, $1 || $2);
}
# The search function is constructed dynamically by
# scan_m4_files. The last parenthetical match makes sure we
# don't match things that look like macro assignments or
# AC_SUBSTs.
if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/)
{
# Macro not found, but AM_ prefix found.
# Make this just a warning, because we do not know whether
# the macro is actually used (it could be called conditionally).
warn ("aclocal:$file:$line: warning: "
. "macro `$2' not found in library\n");
}
}
add_macro ($_) foreach (@rlist);
my $dirname = dirname $file;
&scan_configure_dep (rel2abs ($_, $dirname)) foreach (@ilist);
}
# Add a file to output.
sub add_file ($)
{
local ($file) = @_;
# Only add a file once.
return if ($file_seen{$file});
$file_seen{$file} = 1;
scan_configure_dep $file;
}
# Point to the documentation for underquoted AC_DEFUN only once.
my $underquoted_manual_once = 0;
# scan_file ($FILE, $WHERE)
# -------------------------
# Scan a single M4 file ($FILE), and all files it includes.
# Return the list of included files.
# $WHERE is the location to use in the diagnostic if the file
# does not exist.
sub scan_file ($$)
{
my ($file, $where) = @_;
my $base = dirname $file;
# Do not scan the same file twice.
return @$file_includes{$file} if exists $file_includes{$file};
# Prevent potential infinite recursion (if two files include each other).
return () if exists $file_contents{$file};
unshift @file_order, $file;
if (! -e $file)
{
print STDERR "$where: file `$file' does not exist\n";
exit 1;
}
my $fh = new Automake::XFile $file;
my $contents = '';
my @inc_files = ();
my %inc_lines = ();
while ($_ = $fh->getline)
{
# Ignore `##' lines.
next if /^##/;
$contents .= $_;
while (/$ac_defun_rx/go)
{
if (! defined $1)
{
print STDERR "$file:$.: warning: underquoted definition of $2\n";
print STDERR " run info '(automake)Extending aclocal'\n"
. " or see http://sources.redhat.com/automake/"
. "automake.html#Extending-aclocal\n"
unless $underquoted_manual_once;
$underquoted_manual_once = 1;
}
my $macro = $1 || $2;
if (! defined $map{$macro})
{
print STDERR "aclocal: found macro $macro in $file: $.\n"
if $verbose;
$map{$macro} = $file;
}
else
{
# Note: we used to give an error here if we saw a
# duplicated macro. However, this turns out to be
# extremely unpopular. It causes actual problems which
# are hard to work around, especially when you must
# mix-and-match tool versions.
print STDERR "aclocal: ignoring macro $macro in $file: $.\n"
if $verbose;
}
}
while (/$m4_include_rx/go)
{
my $ifile = $1 || $2;
# m4_include is relative to the directory of the file which
# perform the include, but we want paths relative to the
# directory where aclocal is run. Do not use
# File::Spec->rel2abs, because we want to store relative
# paths (they might be used later of aclocal outputs an
# m4_include for this file, or if the user itself includes
# this file).
$ifile = "$base/$ifile"
unless $base eq '.' || File::Spec->file_name_is_absolute ($ifile);
push (@inc_files, $ifile);
$inc_lines{$ifile} = $.;
}
}
$file_contents{$file} = $contents;
# For some reason I don't understand, it does not work
# to do `map { scan_file ($_, ...) } @inc_files' below.
# With Perl 5.8.2 it undefines @inc_files.
my @copy = @inc_files;
my @all_inc_files = (@inc_files,
map { scan_file ($_, "$file:$inc_lines{$_}") } @copy);
$file_includes{$file} = \@all_inc_files;
return @all_inc_files;
}
# strip_redundant_includes (%FILES)
# ---------------------------------
# Each key in %FILES is a file that must be present in the output.
# However some of these files might already include other files in %FILES,
# so there is no point in including them another time.
# This removes items of %FILES which are already included by another file.
sub strip_redundant_includes (%)
{
my %files = @_;
# Files at the end of @file_order should override those at the beginning,
# so it is important to preserve these trailing files. We can remove
# a file A if it is going to be output before a file B that includes
# file A, not the converse.
foreach my $file (reverse @file_order)
{
next unless exists $files{$file};
foreach my $ifile (@{$file_includes{$file}})
{
next unless exists $files{$ifile};
delete $files{$ifile};
print STDERR "$ifile is already included by $file\n"
if $verbose;
}
}
return %files;
}
sub trace_used_macros ()
{
my %files = map { $map{$_} => 1 } keys %macro_seen;
$files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
%files = strip_redundant_includes %files;
# configure.ac is implicitly included.
delete $files{$configure_ac};
my $traces = ($ENV{AUTOM4TE} || 'autom4te259');
$traces .= " --language Autoconf-without-aclocal-m4 ";
# All candidate files.
$traces .= join (' ', grep { exists $files{$_} } @file_order) . " ";
# All candidate macros.
$traces .= join (' ', map { "--trace='$_:\$f:\$n:\$1'" } ('AC_DEFUN',
'AC_DEFUN_ONCE',
'AU_DEFUN',
keys %macro_seen));
print STDERR "aclocal: running $traces $configure_ac\n" if $verbose;
my $tracefh = new Automake::XFile ("$traces $configure_ac |");
my %traced = ();
while ($_ = $tracefh->getline)
{
chomp;
my ($file, $macro, $arg1) = split (/:/);
$traced{$macro} = 1 if $macro_seen{$macro};
$map_traced_defs{$arg1} = $file
if ($macro eq 'AC_DEFUN'
|| $macro eq 'AC_DEFUN_ONCE'
|| $macro eq 'AU_DEFUN');
}
$tracefh->close;
return %traced;
}
sub scan_configure ()
{
# Make sure we include acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
add_file ('acinclude.m4');
}
scan_configure_dep ($configure_ac);
}
################################################################
# Write output.
sub write_aclocal ($@)
{
my ($output_file, @macros) = @_;
my $output = '';
my %files = ();
# Get the list of files containing definitions for the macros used.
# (Filter out unused macro definitions with $map_traced_defs. This
# can happen when an Autoconf macro is conditionally defined:
# aclocal sees the potential definition, but this definition is
# actually never processed and the Autoconf implementation is used
# instead.)
for my $m (@macros)
{
$files{$map{$m}} = 1 if $map{$m} eq $map_traced_defs{$m};
}
$files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
%files = strip_redundant_includes %files;
delete $files{$configure_ac};
for $file (grep { exists $files{$_} } @file_order)
{
# Check the time stamp of this file, and all files it includes.
for my $ifile ($file, @{$file_includes{$file}})
{
my $mtime = mtime $ifile;
$greatest_mtime = $mtime if $greatest_mtime < $mtime;
}
# If the file to add looks like outside the project, copy it
# to the output. The regex catches filenames starting with
# things like `/', `\', or `c:\'.
if ($file =~ m,^(?:\w:)?[\\/],)
{
$output .= $file_contents{$file} . "\n";
}
else
{
# Otherwise, simply include the file.
$output .= "m4_include([$file])\n";
}
}
# Nothing to output?!
# FIXME: Shouldn't we diagnose this?
return if ! length ($output);
# We used to print `# $output_file generated automatically etc.' But
# this creates spurious differences when using autoreconf. Autoreconf
# creates aclocal.m4t and then rename it to aclocal.m4, but the
# rebuild rules generated by Automake create aclocal.m4 directly --
# this would gives two ways to get the same file, with a different
# name in the header.
$output = "# generated automatically by aclocal $VERSION -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
$output";
# We try not to update $output_file unless necessary, because
# doing so invalidate Autom4te's cache and therefore slows down
# tools called after aclocal.
#
# We need to overwrite $output_file in the following situations.
# * The --force option is in use.
# * One of the dependencies is younger.
# (Not updating $output_file in this situation would cause
# make to call aclocal in loop.)
# * The contents of the current file are different from what
# we have computed.
if (!$force_output
&& $greatest_mtime < mtime ($output_file)
&& $output eq contents ($output_file))
{
print STDERR "aclocal: $output_file unchanged\n" if $verbose;
return;
}
print STDERR "aclocal: writing $output_file\n" if $verbose;
my $out = new Automake::XFile "> $output_file";
print $out $output;
return;
}
################################################################
# Print usage and exit.
sub usage ($)
{
local ($status) = @_;
print "Usage: aclocal [OPTIONS] ...\n\n";
print "\
Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
--acdir=DIR directory holding config files
--help print this help, then exit
-I DIR add directory to search list for .m4 files
--force always update output file
--output=FILE put output in FILE (default aclocal.m4)
--print-ac-dir print name of directory holding m4 files
--verbose don't be silent
--version print version number, then exit
Report bugs to <bug-automake\@gnu.org>.\n";
exit $status;
}
# Parse command line.
sub parse_arguments (@)
{
local (@arglist) = @_;
local (@dirlist);
local ($print_and_exit) = 0;
while (@arglist)
{
if ($arglist[0] =~ /^--acdir=(.+)$/)
{
$acdir = $1;
}
elsif ($arglist[0] =~/^--output=(.+)$/)
{
$output_file = $1;
}
elsif ($arglist[0] eq '-I')
{
shift (@arglist);
push (@dirlist, $arglist[0]);
}
elsif ($arglist[0] eq '--print-ac-dir')
{
$print_and_exit = 1;
}
elsif ($arglist[0] eq '--force')
{
$force_output = 1;
}
elsif ($arglist[0] eq '--verbose')
{
++$verbose;
}
elsif ($arglist[0] eq '--version')
{
print "aclocal (GNU $PACKAGE) $VERSION\n";
print "Written by Tom Tromey <tromey\@redhat.com>\n\n";
print "Copyright (C) 2005 Free Software Foundation, Inc.\n";
print "This is free software; see the source for copying conditions. There is NO\n";
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
exit 0;
}
elsif ($arglist[0] eq '--help')
{
&usage (0);
}
else
{
print STDERR "aclocal: unrecognized option -- `$arglist[0]'\nTry `aclocal --help' for more information.\n";
exit 1;
}
shift (@arglist);
}
if ($print_and_exit)
{
print $acdir, "\n";
exit 0;
}
$default_dirlist="$acdir/dirlist"
if $acdir ne $default_acdir;
unshift @dirlist, $acdir_x11 if -d "$acdir_x11/.";
# By default $(datadir)/aclocal doesn't exist. We don't want to
# get an error in the case where we are searching the default
# directory and it hasn't been created.
push (@dirlist, $acdir)
unless $acdir eq $default_acdir && ! -d $acdir;
# Finally, adds any directory listed in the `dirlist' file.
if (open (DEFAULT_DIRLIST, $default_dirlist))
{
while (<DEFAULT_DIRLIST>)
{
# Ignore '#' lines.
next if /^#/;
# strip off newlines and end-of-line comments
s/\s*\#.*$//;
chomp ($contents=$_);
if (-d $contents )
{
push (@dirlist, $contents);
}
}
close (DEFAULT_DIRLIST);
}
return @dirlist;
}
################################################################
local (@dirlist) = parse_arguments (@ARGV);
$configure_ac = require_configure_ac;
scan_m4_files (@dirlist);
scan_configure;
if (! $exit_code)
{
my %macro_traced = trace_used_macros;
write_aclocal ($output_file, keys %macro_traced);
}
check_acinclude;
exit $exit_code;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

271
bin/autoconf Executable file
View File

@ -0,0 +1,271 @@
#! /bin/sh
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
# Support unset when possible.
if (as_foo=foo; unset as_foo) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
for as_var in \
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
fi
done
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
# Name of the executable.
as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
/^X\/\(\/\/\)$/{ s//\1/; q; }
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
usage="\
Usage: $0 [OPTION] ... [TEMPLATE-FILE]
Generate a configuration script from a TEMPLATE-FILE if given, or
\`configure.ac' if present, or else \`configure.in'. Output is sent
to the standard output if TEMPLATE-FILE is given, else into
\`configure'.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don't remove temporary files
-f, --force consider all files obsolete
-o, --output=FILE save output in FILE (stdout is the default)
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
Warning categories include:
\`cross' cross compilation issues
\`obsolete' obsolete constructs
\`syntax' dubious syntactic constructs
\`all' all the warnings
\`no-CATEGORY' turn off the warnings on CATEGORY
\`none' turn off all the warnings
\`error' warnings are error
The environment variable \`WARNINGS' is honored.
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Tracing:
-t, --trace=MACRO report the list of calls to MACRO
-i, --initialization also trace Autoconf's initialization process
In tracing mode, no configuration script is created.
Report bugs to <bug-autoconf@gnu.org>."
version="\
autoconf (GNU Autoconf) 2.59
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
me=`$as_basename $0 ||
$as_expr X/$0 : '.*/\([^/][^/]*\)/*$' \| \
X$0 : 'X\(//\)$' \| \
X$0 : 'X\(/\)$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/$0 |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
/^X\/\(\/\/\)$/{ s//\1/; q; }
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
help="\
Try \`$me --help' for more information."
exit_missing_arg="\
echo \"$me: option \\\`\$1' requires an argument\" >&2
echo \"\$help\" >&2
exit 1"
# Variables.
: ${AUTOM4TE='/usr/local/bin/autom4te259'}
dir=`(dirname $0) 2>/dev/null ||
$as_expr X$0 : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$0 : 'X\(//\)[^/]' \| \
X$0 : 'X\(//\)$' \| \
X$0 : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X$0 |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
outfile=
verbose=:
# Parse command line.
while test $# -gt 0 ; do
option=`expr "x$1" : 'x\(--[^=]*\)' \| \
"x$1" : 'x\(-.\)'`
optarg=`expr "x$1" : 'x--[^=]*=\(.*\)' \| \
"x$1" : 'x-.\(.*\)'`
case $1 in
--version | -V )
echo "$version" ; exit 0 ;;
--help | -h )
echo "$usage"; exit 0 ;;
--verbose | -v )
verbose=echo
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Arguments passed as is to autom4te.
--debug | -d | \
--force | -f | \
--include=* | -I?* | \
--prepend-include=* | -B?* | \
--warnings=* | -W?* )
AUTOM4TE="$AUTOM4TE $1"; shift ;;
# Options with separated arg passed as is to autom4te.
--include | -I | \
--prepend-include | -B | \
--warnings | -W )
test $# = 1 && eval "$exit_missing_arg"
AUTOM4TE="$AUTOM4TE $option $2"
shift 2 ;;
--trace=* | -t?* )
traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--trace | -t )
test $# = 1 && eval "$exit_missing_arg"
shift
traces="$traces --trace='"`echo "$1" | sed "s/'/'\\\\\\\\''/g"`"'"
shift ;;
--initialization | -i )
AUTOM4TE="$AUTOM4TE --melt"
shift;;
--output=* | -o?* )
outfile=$optarg
shift ;;
--output | -o )
test $# = 1 && eval "$exit_missing_arg"
shift
outfile=$1
shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
exit 1 ;;
* )
break ;;
esac
done
# Find the input file.
case $# in
0)
if test -f configure.ac; then
if test -f configure.in; then
echo "$me: warning: both \`configure.ac' and \`configure.in' are present." >&2
echo "$me: warning: proceeding with \`configure.ac'." >&2
fi
infile=configure.ac
elif test -f configure.in; then
infile=configure.in
else
echo "$me: no input file" >&2
exit 1
fi
test -z "$traces" && test -z "$outfile" && outfile=configure;;
1) # autom4te doesn't like `-'.
test "x$1" != "x-" && infile=$1 ;;
*) exec >&2
echo "$me: invalid number of arguments."
echo "$help"
(exit 1); exit 1 ;;
esac
# Unless specified, the output is stdout.
test -z "$outfile" && outfile=-
# Run autom4te with expansion.
eval set \$AUTOM4TE --language=autoconf --output=\$outfile "$traces" \$infile
$verbose "$me: running $*" >&2
exec "$@"

296
bin/autoheader Executable file
View File

@ -0,0 +1,296 @@
#! /usr/bin/perl
# -*- Perl -*-
# Generated from autoheader.in; do not edit by hand.
eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
if 0;
# autoheader -- create `config.h.in' from `configure.ac'
# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Written by Roland McGrath.
# Rewritten in Perl by Akim Demaille.
BEGIN
{
my $datadir = $ENV{'autom4te_perllibdir'} || '/usr/local/share/autoconf259';
unshift @INC, "$datadir";
# Override SHELL. On DJGPP SHELL may not be set to a shell
# that can handle redirection and quote arguments correctly,
# e.g.: COMMAND.COM. For DJGPP always use the shell that configure
# has detected.
$ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
}
use Autom4te::ChannelDefs;
use Autom4te::Channels;
use Autom4te::Configure_ac;
use Autom4te::FileUtils;
use Autom4te::General;
use Autom4te::XFile;
use strict;
# Using `do FILE', we need `local' vars.
use vars qw ($config_h %verbatim %symbol);
# Lib files.
my $autom4te = $ENV{'AUTOM4TE'} || '/usr/local/bin/autom4te259';
local $config_h;
my $config_h_in;
my @prepend_include;
my @include;
# $HELP
# -----
$help = "Usage: $0 [OPTION] ... [TEMPLATE-FILE]
Create a template file of C \`\#define\' statements for \`configure\' to
use. To this end, scan TEMPLATE-FILE, or \`configure.ac\' if present,
or else \`configure.in\'.
-h, --help print this help, then exit
-V, --version print version number, then exit
-v, --verbose verbosely report processing
-d, --debug don\'t remove temporary files
-f, --force consider all files obsolete
-W, --warnings=CATEGORY report the warnings falling in CATEGORY
" . Autom4te::ChannelDefs::usage () . "
Library directories:
-B, --prepend-include=DIR prepend directory DIR to search path
-I, --include=DIR append directory DIR to search path
Report bugs to <bug-autoconf\@gnu.org>.
";
# $VERSION
# --------
$version = "autoheader (GNU Autoconf) 2.59
Written by Roland McGrath and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
";
## ---------- ##
## Routines. ##
## ---------- ##
# parse_args ()
# -------------
# Process any command line arguments.
sub parse_args ()
{
my $srcdir;
parse_WARNINGS;
getopt ('I|include=s' => \@include,
'B|prepend-include=s' => \@prepend_include,
'W|warnings=s' => \&parse_warnings);
if (! @ARGV)
{
my $configure_ac = require_configure_ac;
push @ARGV, $configure_ac;
}
}
## -------------- ##
## Main program. ##
## -------------- ##
mktmpdir ('ah');
switch_warning 'obsolete';
parse_args;
# Preach.
my $config_h_top = find_file ("config.h.top?",
reverse (@prepend_include), @include);
my $config_h_bot = find_file ("config.h.bot?",
reverse (@prepend_include), @include);
my $acconfig_h = find_file ("acconfig.h?",
reverse (@prepend_include), @include);
if ($config_h_top || $config_h_bot || $acconfig_h)
{
my $msg = << "END";
Using auxiliary files such as \`acconfig.h\', \`config.h.bot\'
and \`config.h.top\', to define templates for \`config.h.in\'
is deprecated and discouraged.
Using the third argument of \`AC_DEFINE\' and
\`AC_DEFINE_UNQUOTED\' allows to define a template without
\`acconfig.h\':
AC_DEFINE([NEED_FUNC_MAIN], 1,
[Define if a function \`main\' is needed.])
More sophisticated templates can also be produced, see the
documentation.
END
$msg =~ s/^ /WARNING: /gm;
msg 'obsolete', $msg;
}
# Set up autoconf.
my $autoconf = "$autom4te --language=autoconf ";
$autoconf .= join (' ', map { "--include=$_" } @include);
$autoconf .= join (' ', map { "--prepend-include=$_" } @prepend_include);
$autoconf .= ' --debug' if $debug;
$autoconf .= ' --force' if $force;
$autoconf .= ' --verbose' if $verbose;
# ----------------------- #
# Real work starts here. #
# ----------------------- #
# Source what the traces are trying to tell us.
verb "$me: running $autoconf to trace from $ARGV[0]";
xsystem ("$autoconf"
# If you change this list, update the
# `Autoheader-preselections' section of autom4te.in.
. ' --trace AC_CONFIG_HEADERS:\'$$config_h ||= \'"\'"\'$1\'"\'"\';\''
. ' --trace AH_OUTPUT:\'$$verbatim{\'"\'"\'$1\'"\'"\'} = \'"\'"\'$2\'"\'"\';\''
. ' --trace AC_DEFINE_TRACE_LITERAL:\'$$symbol{\'"\'"\'$1\'"\'"\'} = 1;\''
. " $ARGV[0] >$tmp/traces.pl");
local (%verbatim, %symbol);
debug "$me: \`do'ing $tmp/traces.pl:\n" . `sed 's/^/| /' $tmp/traces.pl`;
do "$tmp/traces.pl";
warn "couldn't parse $tmp/traces.pl: $@" if $@;
error "error: AC_CONFIG_HEADERS not found in $ARGV[0]"
unless $config_h;
# We template only the first CONFIG_HEADER.
$config_h =~ s/ .*//;
# Support "outfile[:infile]", defaulting infile="outfile.in".
($config_h, $config_h_in) = split (':', $config_h, 2);
$config_h_in ||= "$config_h.in";
# %SYMBOL might contain things like `F77_FUNC(name,NAME)', but we keep
# only the name of the macro.
%symbol = map { s/\(.*//; $_ => 1 } keys %symbol;
my $out = new Autom4te::XFile (">$tmp/config.hin");
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
print $out "/* $config_h_in. Generated from $ARGV[0] by autoheader. */\n";
# Dump the top.
if ($config_h_top)
{
my $in = new Autom4te::XFile ($config_h_top);
while ($_ = $in->getline)
{
print $out $_;
}
}
# Dump `acconfig.h', except for its bottom portion.
if ($acconfig_h)
{
my $in = new Autom4te::XFile ($acconfig_h);
while ($_ = $in->getline)
{
last if /\@BOTTOM\@/;
next if /\@TOP\@/;
print $out $_;
}
}
# Dump the templates from `configure.ac'.
foreach (sort keys %verbatim)
{
print $out "\n$verbatim{$_}\n";
}
# Dump bottom portion of `acconfig.h'.
if ($acconfig_h)
{
my $in = new Autom4te::XFile ($acconfig_h);
my $dump = 0;
while ($_ = $in->getline)
{
print $out $_ if $dump;
$dump = 1 if /\@BOTTOM\@/;
}
}
# Dump the bottom.
if ($config_h_bot)
{
my $in = new Autom4te::XFile ($config_h_bot);
while ($_ = $in->getline)
{
print $out $_;
}
}
$out->close;
# Check that all the symbols have a template.
{
my $in = new Autom4te::XFile ("$tmp/config.hin");
my $suggest_ac_define = 1;
while ($_ = $in->getline)
{
my ($symbol) = /^\#\s*\w+\s+(\w+)/
or next;
delete $symbol{$symbol};
}
foreach (sort keys %symbol)
{
msg 'syntax', "warning: missing template: $_";
if ($suggest_ac_define)
{
msg 'syntax', "Use AC_DEFINE([$_], [], [Description])";
$suggest_ac_define = 0;
}
}
exit 1
if keys %symbol;
}
update_file ("$tmp/config.hin", "$config_h_in");
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

7523
bin/automake Executable file

File diff suppressed because it is too large Load Diff

106
common.c Normal file
View File

@ -0,0 +1,106 @@
/*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/common.c,v 1.3 1998/07/06 12:33:07 ljosa Exp $
*
* functions used by mysql-dbadm.c and mysql-useradm.c
*
*/
#include <config.h>
#include <stdio.h>
#include <stdarg.h>
#include <mysql.h>
#include <assert.h>
#include <pwd.h>
#include <sys/types.h>
#include "mysql-admutils.h"
char *program_name;
static char *rcsheader = "@(#) " PACKAGE " " VERSION " ljosa@initio.no $Header: /home/nalle/cvsroot/mysql-admutils/common.c,v 1.3 1998/07/06 12:33:07 ljosa Exp $";
int
version()
{
printf("%s %s\n", program_name, rcsheader);
exit(0);
}
int
wrong_use(char *format, ...)
{
va_list ap;
if (format)
{
fprintf(stderr, "%s: ", program_name);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
putchar('\n');
}
fprintf(stderr, "Try `%s --help' for more information.\n", program_name);
return 1;
}
int
dberror(MYSQL *pmysql, char *format, ...)
{
char *errmsg;
va_list ap;
char *p;
char token[1024] = "%";
fprintf(stderr, "%s: ", program_name);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
fprintf(stderr, "\n");
if (pmysql)
{
errmsg = mysql_error(pmysql);
if ((errmsg) && (strcmp(errmsg, "") != 0))
fprintf(stderr, "mysql: %s\n", errmsg);
mysql_close(pmysql);
}
return 1;
}
/* decides if the UNIX user is entitled to the MySQL database or MySQL user. */
int
owner(char *name)
{
struct passwd *p;
p = getpwuid(getuid());
if (!p)
{
dberror(NULL, "Failed to look up your UNIX username.");
exit(1);
}
if (strcmp(name, p->pw_name) == 0)
return 1; /* OK */
if ((strncmp(name, p->pw_name, strlen(p->pw_name)) == 0) &&
(*(name + strlen(p->pw_name)) == '_'))
return 1; /* OK */
return 0; /* not owner if we get as far as this */
}
int
reload(MYSQL *pmysql)
{
return mysql_reload(pmysql);
}

97
config.h Normal file
View File

@ -0,0 +1,97 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/*
* acconfig.h
*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/acconfig.h,v 1.1 1998/07/06 12:33:07 ljosa Exp $
*
*/
/* Define the name of the package */
#define PACKAGE "mysql-admutils"
/* Define the version of the package */
#define VERSION "0.1"
/* Define if MySQL is installed */
#define HAVE_MYSQL 1
/* Define if you have the <math.h> header file. */
/* #undef HAVE_MATH_H */
/* Define if libmath is available */
#define HAVE_LIBM 1
/* Define if libnsl is available */
/* #undef HAVE_LIBNSL */
/* Define if libsocket is available */
/* #undef HAVE_LIBSOCKET */
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <errmsg.h> header file. */
#define HAVE_ERRMSG_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Name of package */
#define PACKAGE "mysql-admutils"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.1"
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */

96
config.h.in Normal file
View File

@ -0,0 +1,96 @@
/* config.h.in. Generated from configure.in by autoheader. */
/*
* acconfig.h
*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/acconfig.h,v 1.1 1998/07/06 12:33:07 ljosa Exp $
*
*/
/* Define the name of the package */
#undef PACKAGE
/* Define the version of the package */
#undef VERSION
/* Define if MySQL is installed */
#undef HAVE_MYSQL
/* Define if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define if libmath is available */
#undef HAVE_LIBM
/* Define if libnsl is available */
#undef HAVE_LIBNSL
/* Define if libsocket is available */
#undef HAVE_LIBSOCKET
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <errmsg.h> header file. */
#undef HAVE_ERRMSG_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t

520
config.log Normal file
View File

@ -0,0 +1,520 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = eirik-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Tue Dec 5 22:28:26 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/games
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/X11R6/bin
PATH: /home/eirik/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1345: checking for a BSD-compatible install
configure:1400: result: /usr/bin/install -c
configure:1411: checking whether build environment is sane
configure:1454: result: yes
configure:1478: WARNING: `missing' script is too old or missing
configure:1519: checking for gawk
configure:1548: result: no
configure:1519: checking for mawk
configure:1535: found /usr/bin/mawk
configure:1545: result: mawk
configure:1555: checking whether make sets $(MAKE)
configure:1575: result: yes
configure:1743: checking whether build environment is sane
configure:1786: result: yes
configure:1835: checking for gcc
configure:1851: found /usr/bin/gcc
configure:1861: result: gcc
configure:2105: checking for C compiler version
configure:2108: gcc --version </dev/null >&5
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2111: $? = 0
configure:2113: gcc -v </dev/null >&5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
configure:2116: $? = 0
configure:2118: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:2121: $? = 1
configure:2144: checking for C compiler default output file name
configure:2147: gcc conftest.c >&5
configure:2150: $? = 0
configure:2196: result: a.out
configure:2201: checking whether the C compiler works
configure:2207: ./a.out
configure:2210: $? = 0
configure:2227: result: yes
configure:2234: checking whether we are cross compiling
configure:2236: result: no
configure:2239: checking for suffix of executables
configure:2241: gcc -o conftest conftest.c >&5
configure:2244: $? = 0
configure:2269: result:
configure:2275: checking for suffix of object files
configure:2296: gcc -c conftest.c >&5
configure:2299: $? = 0
configure:2321: result: o
configure:2325: checking whether we are using the GNU C compiler
configure:2349: gcc -c conftest.c >&5
configure:2355: $? = 0
configure:2359: test -z
|| test ! -s conftest.err
configure:2362: $? = 0
configure:2365: test -s conftest.o
configure:2368: $? = 0
configure:2381: result: yes
configure:2387: checking whether gcc accepts -g
configure:2408: gcc -c -g conftest.c >&5
configure:2414: $? = 0
configure:2418: test -z
|| test ! -s conftest.err
configure:2421: $? = 0
configure:2424: test -s conftest.o
configure:2427: $? = 0
configure:2438: result: yes
configure:2455: checking for gcc option to accept ANSI C
configure:2525: gcc -c -g -O2 conftest.c >&5
configure:2531: $? = 0
configure:2535: test -z
|| test ! -s conftest.err
configure:2538: $? = 0
configure:2541: test -s conftest.o
configure:2544: $? = 0
configure:2562: result: none needed
configure:2580: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:2586: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2730: checking for style of include used by make
configure:2758: result: GNU
configure:2786: checking dependency style of gcc
configure:2876: result: gcc3
configure:2898: checking how to run the C preprocessor
configure:2933: gcc -E conftest.c
configure:2939: $? = 0
configure:2971: gcc -E conftest.c
conftest.c:11:28: error: ac_nonexistent.h: No such file or directory
configure:2977: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "mysql-admutils"
| #define VERSION "0.1"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3016: result: gcc -E
configure:3040: gcc -E conftest.c
configure:3046: $? = 0
configure:3078: gcc -E conftest.c
conftest.c:11:28: error: ac_nonexistent.h: No such file or directory
configure:3084: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "mysql-admutils"
| #define VERSION "0.1"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3129: checking for floor in -lc
configure:3159: gcc -o conftest -g -O2 conftest.c -lc >&5
conftest.c:18: warning: conflicting types for built-in function 'floor'
/tmp/cc03JAry.o: In function `main':
/home/eirik/Projects/PVV/tmp/mysql-admtools/trunk/conftest.c:22: undefined reference to `floor'
collect2: ld returned 1 exit status
configure:3165: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "mysql-admutils"
| #define VERSION "0.1"
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char floor ();
| int
| main ()
| {
| floor ();
| ;
| return 0;
| }
configure:3191: result: no
configure:3197: checking for floor in -lm
configure:3227: gcc -o conftest -g -O2 conftest.c -lm >&5
conftest.c:18: warning: conflicting types for built-in function 'floor'
configure:3233: $? = 0
configure:3237: test -z
|| test ! -s conftest.err
configure:3240: $? = 0
configure:3243: test -s conftest
configure:3246: $? = 0
configure:3259: result: yes
configure:3272: checking for mysql_connect in -lmysqlclient
configure:3302: gcc -o conftest -g -O2 conftest.c -lmysqlclient -lm >&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure:3308: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "mysql-admutils"
| #define VERSION "0.1"
| #define HAVE_LIBM 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char mysql_connect ();
| int
| main ()
| {
| mysql_connect ();
| ;
| return 0;
| }
configure:3334: result: no
configure:3341: checking for gethostbyaddr in -lc
configure:3371: gcc -o conftest -g -O2 conftest.c -lc -lm >&5
configure:3377: $? = 0
configure:3381: test -z
|| test ! -s conftest.err
configure:3384: $? = 0
configure:3387: test -s conftest
configure:3390: $? = 0
configure:3403: result: yes
configure:3484: checking for socket in -lc
configure:3514: gcc -o conftest -g -O2 conftest.c -lc -lm >&5
configure:3520: $? = 0
configure:3524: test -z
|| test ! -s conftest.err
configure:3527: $? = 0
configure:3530: test -s conftest
configure:3533: $? = 0
configure:3546: result: yes
configure:3628: checking for MySQL support
configure:3631: checking for egrep
configure:3641: result: grep -E
configure:3646: checking for ANSI C header files
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3779: gcc -o conftest -g -O2 conftest.c -lm >&5
conftest.c: In function 'main':
conftest.c:29: warning: incompatible implicit declaration of built-in function 'exit'
configure:3782: $? = 0
configure:3784: ./conftest
configure:3787: $? = 0
configure:3802: result: yes
configure:3826: checking for sys/types.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for sys/stat.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for stdlib.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for string.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for memory.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for strings.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for inttypes.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for stdint.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:3826: checking for unistd.h
configure:3842: gcc -c -g -O2 conftest.c >&5
configure:3848: $? = 0
configure:3852: test -z
|| test ! -s conftest.err
configure:3855: $? = 0
configure:3858: test -s conftest.o
configure:3861: $? = 0
configure:3872: result: yes
configure:4079: result: no
configure:4081: result: "Giving up - You need to install MySQL somewhere"
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_lib_c_floor=no
ac_cv_lib_c_gethostbyaddr=yes
ac_cv_lib_c_socket=yes
ac_cv_lib_m_floor=yes
ac_cv_lib_mysqlclient_mysql_connect=no
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=mawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='aclocal-1.9'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='tar'
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.9'
AWK='mawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=' -lm'
LTLIBOBJS=''
MAKEINFO='makeinfo'
MYSQL_INCLUDE=''
MYSQL_LFLAGS=''
MYSQL_LIBS=''
OBJEXT='o'
PACKAGE='mysql-admutils'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
VERSION='0.1'
ac_ct_CC='gcc'
ac_ct_STRIP=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${prefix}/share'
exec_prefix='NONE'
host_alias=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/eirik/Projects/PVV/tmp/mysql-admtools/trunk/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define HAVE_INTTYPES_H 1
#define HAVE_LIBM 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE "mysql-admutils"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define STDC_HEADERS 1
#define VERSION "0.1"
configure: exit 0

6183
configure vendored Executable file

File diff suppressed because it is too large Load Diff

83
configure.in Normal file
View File

@ -0,0 +1,83 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(mysql-dbadm.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mysql-admutils, 0.1)
AM_SANITY_CHECK
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
dnl Checks for libraries.
AC_CHECK_LIB(c, floor, [:], [
AC_CHECK_LIB(m, floor, [
LIBS="$LIBS -lm"
AC_DEFINE(HAVE_LIBM) ], []) ])
AC_CHECK_LIB(mysqlclient, mysql_connect, [
LIBS="$LIBS -lmysqlclient" ], [])
AC_CHECK_LIB(c, gethostbyaddr, [:], [
AC_CHECK_LIB(nsl, gethostbyaddr, [
LIBS="$LIBS -lnsl"
AC_DEFINE(HAVE_LIBNSL) ], []) ])
AC_CHECK_LIB(c, socket, [:], [
AC_CHECK_LIB(socket, socket, [
LIBS="$LIBS -lsocket"
AC_DEFINE(HAVE_LIBSOCKET) ], []) ])
AC_MSG_CHECKING(for MySQL support)
AC_ARG_WITH(mysql,
[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
install directory, defaults to /usr/local.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
MYSQL_INCDIR=/usr/local/include/mysql
MYSQL_LIBDIR=/usr/local/lib/mysql
else
if test -f $withval/include/mysql/mysql.h; then
MYSQL_INCDIR=$withval/include/mysql
MYSQL_LIBDIR=$withval/lib/mysql
elif test -f $withval/include/mysql.h; then
MYSQL_INCDIR=$withval/include
MYSQL_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
fi
fi
MYSQL_INCLUDE=-I$MYSQL_INCDIR
MYSQL_LFLAGS=-L$MYSQL_LIBDIR
MYSQL_LIBS=-lmysqlclient
AC_DEFINE(HAVE_MYSQL)
AC_MSG_RESULT(yes)
dnl check for errmsg.h, which isn't installed by some versions of 3.21
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
AC_CHECK_HEADERS(errmsg.h)
CPPFLAGS="$old_CPPFLAGS"
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
AC_MSG_RESULT("Giving up - You need to install MySQL somewhere"); exit
])
AC_SUBST(MYSQL_LIBS)
AC_SUBST(MYSQL_LFLAGS)
AC_SUBST(MYSQL_INCLUDE)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_OUTPUT(Makefile, [date > stamp-h])

529
depcomp Executable file
View File

@ -0,0 +1,529 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-02-09.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

250
install-sh Executable file
View File

@ -0,0 +1,250 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

134
missing Executable file
View File

@ -0,0 +1,134 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison touch file \`y.tab.c'
makeinfo touch the output file
yacc touch file \`y.tab.c'"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
touch config.h.in
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print \
| sed 's/^\(.*\).am$/touch \1.in/' \
| sh
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
touch y.tab.c
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

40
mkinstalldirs Executable file
View File

@ -0,0 +1,40 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.1.1.1 1998/07/06 10:15:30 ljosa Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

28
mysql-admutils.h Normal file
View File

@ -0,0 +1,28 @@
/*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/mysql-admutils.h,v 1.2 1998/07/06 11:54:56 ljosa Exp $
*
*/
#ifndef MYSQL_ADMUTILS_H
#define MYSQL_ADMUTILS_H
#define DB_SERVER "verden.pvv.ntnu.no"
#define DB_USER "root"
#define DB_PASSWD "somepass"
#define DB_NAME "mysql"
extern char *program_name;
extern int
wrong_use(char *format, ...);
extern int
dberror(MYSQL *pmysql, char *format, ...);
extern int
owner(char *name);
extern int
reload(MYSQL *pmysql);
#endif /* MYSQL_ADMUTILS_H */

427
mysql-dbadm.c Normal file
View File

@ -0,0 +1,427 @@
/*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/mysql-dbadm.c,v 1.3 1998/07/06 12:33:07 ljosa Exp $
*
* mysql-dbadm.c
*
*/
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <mysql.h>
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
#include "mysql-admutils.h"
char *
strchr_whitespace(const char *s)
{
char *sp, *tab;
sp = strchr(s, ' ');
tab = strchr(s, '\t');
if (sp == NULL)
return tab;
if (tab == NULL)
return sp;
return sp < tab ? sp : tab; /* if both are found, return the first one */
}
char *
strtok_whitespace(char *s)
{
static char *cp;
char *r;
r = s ? s : cp;
if (r == NULL)
return NULL;
cp = strchr_whitespace(r);
if (cp == NULL)
return r;
while ((*cp == ' ') || (*cp == '\t'))
{
*cp++ = '\0';
}
return r;
}
int
valid_priv(const char *s)
{
#define ACCEPT(x) if (strcmp(s, x) == 0) return 1
ACCEPT("Y");
ACCEPT("N");
ACCEPT("y");
ACCEPT("n");
#undef ACCEPT
return 0; /* not a valid priv */
}
int
usage()
{
printf("Usage: %s COMMAND [DATABASE]...\n", program_name);
printf("Create, drop og edit permission for the DATABASE(s),\n");
printf("as determined by the COMMAND. Valid COMMANDs:\n");
printf("\n");
printf(" create create the DATABASE(s).\n");
printf(" drop delete the DATABASE(s).\n");
printf(" show give information about the DATABASE(s), or, if\n");
printf(" none are given, all the ones you own.\n");
printf(" editperm change permissions for the DATABASE(s). Your\n");
printf(" favorite editor will be started, allowing you\n");
printf(" to make changes to the permission table.\n");
printf("\n");
printf("Report bugs to ljosa@initio.no\n");
return 0;
}
int
create(MYSQL *pmysql, char *db)
{
char query[1024];
sprintf(query, "create database `%s`", db);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Cannot create database '%s'.", db);
fprintf(stderr, "Database '%s' created.\n", db);
return 0;
}
int
drop(MYSQL *pmysql, char *db)
{
char query[1024];
sprintf(query, "delete from db where db = '%s'", db);
if (mysql_query(pmysql, query))
dberror(pmysql, "Failed to delete permissions for database '%s'.", db);
sprintf(query, "drop database `%s`", db);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Cannot drop database '%s'.", db);
fprintf(stderr, "Database '%s' dropped.\n", db);
return 0;
}
/* return a list of the user's databases */
char **
list(MYSQL *pmysql)
{
char *wild;
MYSQL_RES *res;
int rows;
MYSQL_ROW row;
char **dblist;
int i;
char **t;
struct passwd *p;
p = getpwuid(getuid());
if (!p)
{
dberror(NULL, "Failed to lookup your UNIX username.");
exit(1);
}
wild = malloc(strlen(p->pw_name) + 3);
sprintf(wild, "%s_%%", p->pw_name);
res = mysql_list_dbs(pmysql, wild);
rows = mysql_num_rows(res);
dblist = malloc((rows + 2) * sizeof(char *)); /* one for the username
(might not be used)*/
if (!dblist)
{
dberror(NULL, "Out of memory.\n");
free(wild);
return NULL;
}
for (i = 0; i < rows; i++)
if (row = mysql_fetch_row(res))
{
dblist[i] = strdup(row[0]);
}
res = mysql_list_dbs(pmysql, p->pw_name);
rows = mysql_num_rows(res);
if (rows == 1)
dblist[i++] = strdup(p->pw_name);
dblist[i] = NULL;
return dblist;
}
writeperm(FILE *f, MYSQL *pmysql, const char *db)
{
char query[1024];
MYSQL_RES *res;
int rows, i;
MYSQL_ROW row;
sprintf(query, "select user,select_priv,insert_priv,update_priv,"
"delete_priv,create_priv,alter_priv,drop_priv from db where db='%s'", db);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Query for permissions failed.");
res = mysql_store_result(pmysql);
rows = mysql_num_rows(res);
fprintf(f, "# User "
"Select Insert Update Delete Create Alter Drop\n");
fprintf(f, "# ---------------- "
"------ ------ ------ ------ ------ ------ ------\n");
if (rows == 0)
fprintf(f, "# (no permissions currently granted to any users)\n");
else
for (i = 0; i < rows; i++)
{
row = mysql_fetch_row(res);
fprintf(f, " %-16s %-7s %-7s %-7s %-7s %-7s %-7s %s\n",
row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]);
}
}
/* show information about the database */
int
show(MYSQL *pmysql, const char *db)
{
printf("Database '%s':\n", db);
writeperm(stdout, pmysql, db);
return 0;
}
#define MAX_GRANTS 1024
int
editperm(MYSQL *pmysql, const char *db)
{
char fn[] = "/tmp/mysql-dbadm.tmp.XXXXXX";
FILE *f;
char *editor;
char cmd[1024]; /* shell command for editing the file */
char line[1024]; /* buffer to hold one line */
char *cp; /* used to interate through a line */
char *user, *select_priv, *insert_priv, *update_priv, *delete_priv,
*create_priv, *alter_priv, *drop_priv;
char query[1024]; /* used to build a query */
char *queries[MAX_GRANTS]; /* insert queries */
int lines; /* number of grant lines processed */
int i; /* iterate through lines[] */
mktemp(fn);
if (strcmp(fn, "") == 0)
return dberror(NULL, "Cannot create a unique temporary file name.");
f = fopen(fn, "w");
if (f == NULL)
return dberror(NULL, "Failed to open temporary file %s.", fn);
writeperm(f, pmysql, db);
fclose(f);
editor = getenv("EDITOR");
if (!editor)
editor = "pico"; /* OK since editor won't be freed */
strcpy(cmd, editor);
strcat(cmd, " ");
strcat(cmd, fn);
if (system(cmd) == -1)
{
dberror(NULL, "Failed to execute '%s'\n", cmd);
perror("system");
return 1;
}
/* parse */
f = fopen(fn, "r");
lines = 0;
while (fgets(line, sizeof(line), f))
{
cp = strchr(line, '\n');
if (cp)
*cp = '\0';
cp = line;
while (*cp && ((*cp == ' ') || (*cp == '\t'))) cp++;
if (*cp == '\0') continue;
if (*cp == '#') continue;
if (*cp == '\n') continue;
#define STRTOK_WHITESPACE(res, start) \
{ if (!(res = strtok_whitespace(start))) continue; }
STRTOK_WHITESPACE(user, cp);
if (strlen(user) < 1)
return dberror(NULL, "Invalid user '%s' in grant line %d.", user,
lines + 1);
if (strcmp(user, "%") == 0)
*user = '\0'; /* ugly, but it works... */
#define CHECK_PRIV(PRIV) \
if (!valid_priv(PRIV)) return dberror(NULL, "Invalid value '%s' " \
"in grant line %d.", PRIV, lines + 1)
STRTOK_WHITESPACE(select_priv, NULL);
CHECK_PRIV(select_priv);
STRTOK_WHITESPACE(insert_priv, NULL);
CHECK_PRIV(insert_priv);
STRTOK_WHITESPACE(update_priv, NULL);
CHECK_PRIV(update_priv);
STRTOK_WHITESPACE(delete_priv, NULL);
CHECK_PRIV(delete_priv);
STRTOK_WHITESPACE(create_priv, NULL);
CHECK_PRIV(create_priv);
STRTOK_WHITESPACE(alter_priv, NULL);
CHECK_PRIV(alter_priv);
STRTOK_WHITESPACE(drop_priv, NULL);
CHECK_PRIV(drop_priv);
#undef STRTOK_WHITESPACE
#undef CHECK_PRIV
sprintf(query, "insert into db(Host, Db, User, Select_priv, Insert_priv, "
"Update_priv, Delete_priv, Create_priv, Alter_priv, Drop_priv) "
"values ('%%', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
db, user, select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, drop_priv);
queries[lines] = strdup(query);
lines++;
if (lines >= MAX_GRANTS)
{
dberror(NULL, "Warning: Maximum of %d grants reached.\n",
MAX_GRANTS);
continue;
}
} /* while fgets ... */
unlink(fn);
fclose(f);
/* now that we have checked the input for errors, we can safely
delete the old grants from the database and insert the new ones. */
sprintf(query, "delete from db where db='%s'", db);
if (mysql_query(pmysql, query))
dberror(pmysql, "Failed to delete old grants for '%s'.", db);
for (i = 0; i < lines; i++)
{
#ifdef DEBUG
puts(queries[i]);
putchar('\n');
#endif DEBUG
if (mysql_query(pmysql, queries[i]))
dberror(pmysql, "Failed to insert grant line %d.", i + 1);
}
return 0;
}
int
main(int argc, char *argv[])
{
int i;
enum { c_create, c_drop, c_editperm, c_show } command;
MYSQL mysql;
mysql_init(&mysql);
char **dblist, **p;
program_name = argv[0];
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--help") == 0)
return usage();
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--version") == 0)
return version();
if (argc < 2)
return wrong_use(NULL);
/* check that the supplied command is valid */
if (strcmp(argv[1], "create") == 0)
command = c_create;
else if (strcmp(argv[1], "drop") == 0)
command = c_drop;
else if (strcmp(argv[1], "editperm") == 0)
command = c_editperm;
else if (strcmp(argv[1], "show") == 0)
command = c_show;
else
return wrong_use("unrecognized command"); /* XXX */
/* all other than show requires at lease one DATABASE argument. */
if ((command != c_show) && (argc < 3))
return wrong_use(NULL);
/* connect to the database server and select the mysql database */
if (!mysql_real_connect(&mysql, DB_SERVER, DB_USER, DB_PASSWD, DB_NAME, 0, NULL, 0))
return dberror(&mysql, "Cannot connect to database server '%s'.",
DB_SERVER);
if (mysql_select_db(&mysql, DB_NAME))
return dberror(&mysql, "Cannot select database '%s'.", DB_NAME);
if ((command == c_show) && (argc == 2))
{
dblist = list(&mysql);
p = dblist;
while (*p)
{
show(&mysql, *p);
free(*p);
p++;
}
free(dblist);
}
else
{
/* for each supplied database name, perform the requested action */
for (i = 2; i < argc; i++)
{
if (! owner(argv[i]))
{
dberror(NULL, "You are not the owner of '%s'. Skipping.",
argv[i]);
continue;
}
switch (command)
{
case c_create:
create(&mysql, argv[i]);
break;
case c_drop:
drop(&mysql, argv[i]);
break;
case c_editperm:
editperm(&mysql, argv[i]);
break;
case c_show:
show(&mysql, argv[i]);
break;
default:
return dberror(NULL, "This point should never be reached!");
}
}
}
mysql_reload(&mysql);
mysql_close(&mysql);
return 0;
}

304
mysql-useradm.c Normal file
View File

@ -0,0 +1,304 @@
/*
* @(#) $Header: /home/nalle/cvsroot/mysql-admutils/mysql-useradm.c,v 1.3 1998/07/06 12:33:08 ljosa Exp $
*
* mysql-useradm.c
*
*/
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <mysql.h>
#include "mysql-admutils.h"
int
usage()
{
printf("Usage: %s COMMAND [USER]...\n", program_name);
printf("Create, delete or change password for the USER(s),\n");
printf("as determined by the COMMAND. Valid COMMANDs:\n");
printf("\n");
printf(" create create the USER(s).\n");
printf(" delete delete the USER(s).\n");
printf(" passwd change the MySQL password for the USER(s). You\n");
printf(" will be promptet for the old and the new password.\n");
printf(" show give information about the USERS(s), or, if\n");
printf(" none are given, all the users you have.\n");
printf("\n");
printf("Report bugs to ljosa@initio.no\n");
return 0;
}
int
is_password_set(MYSQL *pmysql, const char *user)
{
char query[1024];
MYSQL_RES *res;
int rows;
MYSQL_ROW row;
sprintf(query, "select password from user where user = '%s'", user);
if (mysql_query(pmysql, query))
dberror(pmysql, "Failed to look up password for user '%s'.", user);
res = mysql_store_result(pmysql);
rows = mysql_num_rows(res);
if (rows == 0)
return -1;
if (rows > 1)
return dberror(NULL, "Query for password for user '%s' gave %d results!",
rows);
row = mysql_fetch_row(res);
return (row[0] && (strlen(row[0]) > 0));
}
int
create(MYSQL *pmysql, const char *user)
{
char query[1024];
sprintf(query, "insert into user (host, user) values ('%%', '%s')", user);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Failed to create user '%s'.", user);
return 0;
}
int
delete(MYSQL *pmysql, const char *user)
{
char query[1024];
sprintf(query, "delete from user where user = '%s'", user);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Failed to delete user '%s'.", user);
return 0;
}
int
passwd(MYSQL *pmysql, const char *user)
{
char prompt[1024];
char query[1024];
char *password, *confirm_password;
MYSQL_RES *res;
int rows;
MYSQL_ROW row;
if (is_password_set(pmysql, user))
{
sprintf(prompt, "(current) MySQL password for user '%s': ", user);
password = getpass(prompt);
sprintf(query, "select password = password('%s') from user "
"where user = '%s'", password, user);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Failed to check old password for user '%s'.",
user);
res = mysql_store_result(pmysql);
rows = mysql_num_rows(res);
if (rows == 0)
return dberror(NULL, "Check for old password for user '%s' "
"returned empty.", user);
if (rows > 1)
return dberror(NULL, "Check for old password for user '%s' "
"returned more than one row!", user);
row = mysql_fetch_row(res);
if (strcmp(row[0], "1") != 0)
{
fprintf(stderr, "%s: Wrong password entered for user '%s'.\n",
program_name, user);
return 1;
}
}
sprintf(prompt, "New MySQL password for user '%s': ", user);
password = getpass(prompt);
confirm_password = strdup(password);
sprintf(prompt, "Retype new MySQL password for user '%s': ", user);
password = getpass(prompt);
if (strcmp(password, confirm_password) != 0)
{
free(confirm_password);
return dberror(NULL, "Sorry, passwords do not match.");
}
free(confirm_password);
sprintf(query, "update user set password = password('%s') "
"where user = '%s'", password, user);
if (mysql_query(pmysql, query))
return dberror(pmysql, "Failed to set new password for user '%s'.", user);
if (mysql_affected_rows(pmysql) > 1)
dberror(NULL, "%d rows affected by password update for user '%s'!",
mysql_affected_rows(pmysql), user);
fprintf(stderr, "Password updated for user '%s'.\n", user);
return 0;
}
int
show(MYSQL *pmysql, const char *user)
{
switch (is_password_set(pmysql, user))
{
case -1:
break;
case 0:
printf("User '%s': ", user);
printf("no password set.\n");
break;
case 1:
printf("User '%s': ", user);
printf("password set.\n");
break;
}
return 0;
}
/* return a list of the user's databases */
char **
list(MYSQL *pmysql)
{
char query[1024];
MYSQL_RES *res;
int rows;
MYSQL_ROW row;
char **userlist;
int i;
struct passwd *p;
p = getpwuid(getuid());
sprintf(query, "select user from user where user='%s' or user like '%s_%%'",
p->pw_name, p->pw_name);
if (mysql_query(pmysql, query))
{
dberror(pmysql, "Failed to look up %s's users.", p->pw_name);
return NULL;
}
res = mysql_store_result(pmysql);
rows = mysql_num_rows(res);
userlist = malloc((rows + 1) * sizeof(char *));
if (!userlist)
{
dberror(NULL, "%s: Out of memory.\n", program_name);
return NULL;
}
for (i = 0; i < rows; i++)
if (row = mysql_fetch_row(res))
{
userlist[i] = strdup(row[0]);
}
userlist[i] = NULL;
return userlist;
}
int
main(int argc, char *argv[])
{
int i;
enum { c_create, c_delete, c_passwd, c_show } command;
MYSQL mysql;
mysql_init(&mysql);
char **dblist, **p;
program_name = argv[0];
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--help") == 0)
return usage();
for (i = 1; i < argc; i++)
if (strcmp(argv[i], "--version") == 0)
return version();
if (argc < 2)
return wrong_use(NULL);
/* check that the supplied command is valid */
if (strcmp(argv[1], "create") == 0)
command = c_create;
else if (strcmp(argv[1], "delete") == 0)
command = c_delete;
else if (strcmp(argv[1], "passwd") == 0)
command = c_passwd;
else if (strcmp(argv[1], "show") == 0)
command = c_show;
else
return wrong_use("unrecognized command '%s'.", argv[1]); /* XXX */
/* all other than show requires at lease one USER argument. */
if ((command != c_show) && (argc < 3))
return wrong_use(NULL);
/* connect to the database server and select the mysql database */
if (!mysql_real_connect(&mysql, DB_SERVER, DB_USER, DB_PASSWD, DB_NAME, 0, NULL, 0))
return dberror(&mysql, "Cannot connect to database server '%s'.",
DB_SERVER);
if (mysql_select_db(&mysql, DB_NAME))
return dberror(&mysql, "Cannot select database '%s'.", DB_NAME);
if ((command == c_show) && (argc == 2))
{
dblist = list(&mysql);
p = dblist;
while (*p)
{
show(&mysql, *p);
free(*p);
p++;
}
free(dblist);
}
else
{
/* for each supplied database name, perform the requested action */
for (i = 2; i < argc; i++)
{
if (! owner(argv[i]))
{
dberror(NULL, "You are not the owner of '%s'. Skipping.",
argv[i]);
continue;
}
switch (command)
{
case c_create:
create(&mysql, argv[i]);
break;
case c_delete:
delete(&mysql, argv[i]);
break;
case c_passwd:
passwd(&mysql, argv[i]);
break;
case c_show:
show(&mysql, argv[i]);
break;
default:
fprintf(stderr, "This point should never be reached.\n");
exit(1);
}
}
}
reload(&mysql);
mysql_close(&mysql);
return 0;
}

1
stamp-h.in Normal file
View File

@ -0,0 +1 @@
timestamp