From aa4634eb31db5b428f0b6c8527e35c081992dfb5 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 31 Mar 2010 14:50:47 -0700 Subject: [PATCH] Move popt to subdirectory and make a convenience library of it This keeps a cleaner separation of the pkg-config sources and the imported popt sources. --- Makefile.am | 16 ++++++---------- configure.in | 1 + main.c | 2 +- parse.c | 2 +- popt/Makefile.am | 8 ++++++++ popt.c => popt/popt.c | 0 popt.h => popt/popt.h | 0 poptconfig.c => popt/poptconfig.c | 0 popthelp.c => popt/popthelp.c | 0 poptint.h => popt/poptint.h | 0 poptparse.c => popt/poptparse.c | 0 11 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 popt/Makefile.am rename popt.c => popt/popt.c (100%) rename popt.h => popt/popt.h (100%) rename poptconfig.c => popt/poptconfig.c (100%) rename popthelp.c => popt/popthelp.c (100%) rename poptint.h => popt/poptint.h (100%) rename poptparse.c => popt/poptparse.c (100%) diff --git a/Makefile.am b/Makefile.am index b9edccc..7681d2f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,9 @@ GLIB_SUBDIR = glib-1.2.10 included_glib_includes = -I./glib-1.2.10 pkg_config_LDADD=glib-1.2.10/libglib.la endif -SUBDIRS = $(GLIB_SUBDIR) check +pkg_config_LDADD += popt/libpopt.la +popt_includes = -I./popt +SUBDIRS = $(GLIB_SUBDIR) popt check m4dir = $(datadir)/aclocal m4_DATA = pkg.m4 @@ -19,7 +21,8 @@ EXTRA_DIST = $(m4_DATA) $(man_MANS) README.win32 bin_PROGRAMS = pkg-config AM_CFLAGS=@WARN_CFLAGS@ -INCLUDES=-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" $(included_glib_includes) +INCLUDES=-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" $(included_glib_includes) \ + $(popt_includes) pkg_config_SOURCES= \ pkg.h \ @@ -28,11 +31,4 @@ pkg_config_SOURCES= \ parse.c \ main.c \ findme.c \ - findme.h \ - popt.c \ - popt.h \ - poptconfig.c \ - popthelp.c \ - poptint.h \ - poptparse.c - + findme.h diff --git a/configure.in b/configure.in index f7a424c..98712f4 100644 --- a/configure.in +++ b/configure.in @@ -141,5 +141,6 @@ AC_CHECK_FUNCS(setresuid setreuid,break) AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) AC_OUTPUT([Makefile + popt/Makefile check/Makefile check/config.sh]) diff --git a/main.c b/main.c index dba1729..a144d27 100644 --- a/main.c +++ b/main.c @@ -24,7 +24,7 @@ #include "pkg.h" #include "parse.h" -#include "popt.h" +#include #include #include #include diff --git a/parse.c b/parse.c index 0fc242f..01c7878 100644 --- a/parse.c +++ b/parse.c @@ -28,7 +28,7 @@ #include #include #include -#include "popt.h" +#include #ifdef HAVE_SYS_WAIT_H #include #endif diff --git a/popt/Makefile.am b/popt/Makefile.am new file mode 100644 index 0000000..b11c12a --- /dev/null +++ b/popt/Makefile.am @@ -0,0 +1,8 @@ +noinst_LTLIBRARIES = libpopt.la +libpopt_la_SOURCES = \ + popt.c \ + popt.h \ + poptconfig.c \ + popthelp.c \ + poptint.h \ + poptparse.c diff --git a/popt.c b/popt/popt.c similarity index 100% rename from popt.c rename to popt/popt.c diff --git a/popt.h b/popt/popt.h similarity index 100% rename from popt.h rename to popt/popt.h diff --git a/poptconfig.c b/popt/poptconfig.c similarity index 100% rename from poptconfig.c rename to popt/poptconfig.c diff --git a/popthelp.c b/popt/popthelp.c similarity index 100% rename from popthelp.c rename to popt/popthelp.c diff --git a/poptint.h b/popt/poptint.h similarity index 100% rename from poptint.h rename to popt/poptint.h diff --git a/poptparse.c b/popt/poptparse.c similarity index 100% rename from poptparse.c rename to popt/poptparse.c