From 37d59a0c44ecd2b380cf9190cfd7f114d17eb569 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sun, 23 May 2010 23:31:14 +0200 Subject: Distcheck fixes Various small fixes to make distcheck pass --- Makefile.am | 8 ++--- check/Makefile.am | 2 +- findme.c | 90 ------------------------------------------------------- findme.h | 31 ------------------- popt/Makefile.am | 4 ++- popt/findme.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ popt/findme.h | 31 +++++++++++++++++++ 7 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 findme.c delete mode 100644 findme.h create mode 100644 popt/findme.c create mode 100644 popt/findme.h diff --git a/Makefile.am b/Makefile.am index 17a85c1..875e01f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ included_glib_includes = @GLIB_CFLAGS@ pkg_config_LDADD=@GLIB_LIBS@ else GLIB_SUBDIR = glib-1.2.10 -included_glib_includes = -I./glib-1.2.10 +included_glib_includes = -I$(top_srcdir)/glib-1.2.10 -I$(top_builddir)/glib-1.2.10 pkg_config_LDADD=glib-1.2.10/libglib.la endif @@ -11,7 +11,7 @@ if USE_INSTALLED_POPT pkg_config_LDADD += $(POPT_LIBS) else pkg_config_LDADD += popt/libpopt.la -popt_includes = -I./popt +popt_includes = -I$(top_srcdir)/popt POPT_SUBDIR = popt endif @@ -36,6 +36,4 @@ pkg_config_SOURCES= \ pkg.c \ parse.h \ parse.c \ - main.c \ - findme.c \ - findme.h + main.c \ No newline at end of file diff --git a/check/Makefile.am b/check/Makefile.am index 39ba7c8..87888fa 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -5,6 +5,6 @@ TESTS = check-cflags check-libs check-define-variable \ EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \ private-dep.pc includedir.pc missing-requires-private.pc \ - missing-requires.pc idirafter.pc whitespace.pc + missing-requires.pc idirafter.pc conflicts-test.pc whitespace.pc DISTCLEANFILES = config.sh diff --git a/findme.c b/findme.c deleted file mode 100644 index b12e96d..0000000 --- a/findme.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 1998 Red Hat 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 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. - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_ALLOCA_H -# include -#else -# ifdef _AIX -# pragma alloca -# endif -#endif - -#ifdef HAVE_MALLOC_H -# include -#endif - -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef __NeXT -/* access macros are not declared in non posix mode in unistd.h - - don't try to use posix on NeXTstep 3.3 ! */ -#include -#endif - -#include "findme.h" - -#if !defined(X_OK) -#define X_OK 1 -#endif - -char * findProgramPath(char * argv0) { - char * path = getenv("PATH"); - char * pathbuf; - char * start, * chptr; - char * buf; - - /* If there is a / in the argv[0], it has to be an absolute - path */ - if (strchr(argv0, '/')) - return strdup(argv0); - - if (!path) return NULL; - - start = pathbuf = alloca(strlen(path) + 1); - buf = malloc(strlen(path) + strlen(argv0) + 2); - strcpy(pathbuf, path); - - chptr = NULL; - do { - if ((chptr = strchr(start, ':'))) - *chptr = '\0'; - sprintf(buf, "%s/%s", start, argv0); - - if (!access(buf, X_OK)) - return buf; - - if (chptr) - start = chptr + 1; - else - start = NULL; - } while (start && *start); - - free(buf); - - return NULL; -} diff --git a/findme.h b/findme.h deleted file mode 100644 index 006c21c..0000000 --- a/findme.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (c) 1998 Red Hat Software - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. -*/ - -#ifndef H_FINDME -#define H_FINDME - -char * findProgramPath(char * argv0); - -#endif diff --git a/popt/Makefile.am b/popt/Makefile.am index b11c12a..02c0ad9 100644 --- a/popt/Makefile.am +++ b/popt/Makefile.am @@ -5,4 +5,6 @@ libpopt_la_SOURCES = \ poptconfig.c \ popthelp.c \ poptint.h \ - poptparse.c + poptparse.c \ + findme.c \ + findme.h diff --git a/popt/findme.c b/popt/findme.c new file mode 100644 index 0000000..b12e96d --- /dev/null +++ b/popt/findme.c @@ -0,0 +1,90 @@ +/* + * Copyright (C) 1998 Red Hat 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 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. + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_ALLOCA_H +# include +#else +# ifdef _AIX +# pragma alloca +# endif +#endif + +#ifdef HAVE_MALLOC_H +# include +#endif + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef __NeXT +/* access macros are not declared in non posix mode in unistd.h - + don't try to use posix on NeXTstep 3.3 ! */ +#include +#endif + +#include "findme.h" + +#if !defined(X_OK) +#define X_OK 1 +#endif + +char * findProgramPath(char * argv0) { + char * path = getenv("PATH"); + char * pathbuf; + char * start, * chptr; + char * buf; + + /* If there is a / in the argv[0], it has to be an absolute + path */ + if (strchr(argv0, '/')) + return strdup(argv0); + + if (!path) return NULL; + + start = pathbuf = alloca(strlen(path) + 1); + buf = malloc(strlen(path) + strlen(argv0) + 2); + strcpy(pathbuf, path); + + chptr = NULL; + do { + if ((chptr = strchr(start, ':'))) + *chptr = '\0'; + sprintf(buf, "%s/%s", start, argv0); + + if (!access(buf, X_OK)) + return buf; + + if (chptr) + start = chptr + 1; + else + start = NULL; + } while (start && *start); + + free(buf); + + return NULL; +} diff --git a/popt/findme.h b/popt/findme.h new file mode 100644 index 0000000..006c21c --- /dev/null +++ b/popt/findme.h @@ -0,0 +1,31 @@ +/* +Copyright (c) 1998 Red Hat Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. +*/ + +#ifndef H_FINDME +#define H_FINDME + +char * findProgramPath(char * argv0); + +#endif -- cgit v1.2.3