summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordevzero2000 <devzero2000>2011-09-05 11:35:53 +0000
committerdevzero2000 <devzero2000>2011-09-05 11:35:53 +0000
commit3bba412d8d708bfc338242581ce3b6369099783a (patch)
tree849e6996102be7923afad015862cde69dd471e9b
parent217bada4e58deff154b285569d584241209b613e (diff)
downloadlibpopt-3bba412d8d708bfc338242581ce3b6369099783a.tar.gz
merge commit aee9f24 from git pull request
https://github.com/devzero2000/POPT/pull/2 "Add makefile for mingw" by asenm (Matt Arsenault). Include these new object in EXTRA_DIST (Makefile.am) by devzero2000 (Elia Pinto)
-rw-r--r--CHANGES5
-rw-r--r--Makefile.am4
-rw-r--r--Makefile.mingw91
-rw-r--r--config.h.mingw151
4 files changed, 250 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 43462bf..41c06a6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
1.17 -> 2.0:
+ - devzero2000: merge commit aee9f24 from git pull request
+ https://github.com/devzero2000/POPT/pull/2
+ "Add makefile for mingw"
+ by asenm (Matt Arsenault). Include these new object
+ in EXTRA_DIST (Makefile.am) by devzero2000 (Elia Pinto)
- devzero2000: merge commit 8396019 from git pull request
https://github.com/devzero2000/POPT/pull/2
"Work around missing format for long long in windows; fix warnings"
diff --git a/Makefile.am b/Makefile.am
index 37d19bb..755e8a8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,7 +78,9 @@ EXTRA_DIST = lookup3.c autogen.sh CHANGES \
test3-data/02.answer \
test3-data/02.input \
test3-data/03.answer \
- test3-data/03.input
+ test3-data/03.input \
+ Makefile.mingw \
+ config.h.mingw
SUBDIRS = po . auto
diff --git a/Makefile.mingw b/Makefile.mingw
new file mode 100644
index 0000000..acdf0a1
--- /dev/null
+++ b/Makefile.mingw
@@ -0,0 +1,91 @@
+# Makefile for building Popt with MinGW (gcc and gnumake)
+
+POPT_PREFIX ?= C:\popt
+POPT_SRC_DIR ?= .
+
+OPT_FLAGS = -Os -DNDEBUG
+WARNINGS = -Wall -Wextra
+INCLUDE_DIRS = -I$(POPT_SRC_DIR)
+DEFINITIONS = -DHAVE_CONFIG_H
+CFLAGS = $(OPT_FLAGS) $(WARNINGS) $(INCLUDE_DIRS) $(DEFINITIONS)
+CXXFLAGS = $(CFLAGS)
+CC = gcc
+CXX = g++
+RM = del
+MKDIR = mkdir
+CP = copy
+
+
+CONFIG_HEADER = config.h
+CONFIG_MINGW_HEADER_NAME = config.h.mingw
+
+#CONFIGMAKE_HEADER = configmake.h
+#CONFIGMAKE_MINGW_HEADER_NAME = configmake.h.mingw
+
+POPT_SRC = $(POPT_SRC_DIR)/lookup3.c \
+ $(POPT_SRC_DIR)/poptconfig.c \
+ $(POPT_SRC_DIR)/popthelp.c \
+ $(POPT_SRC_DIR)/poptint.c \
+ $(POPT_SRC_DIR)/poptparse.c \
+ $(POPT_SRC_DIR)/popt.c
+
+POPT_HEADERS = $(POPT_SRC_DIR)/config.h \
+ $(POPT_SRC_DIR)/configmake.h \
+ $(POPT_SRC_DIR)/popt.h \
+ $(POPT_SRC_DIR)/poptint.h \
+ $(POPT_SRC_DIR)/system.h
+
+POPT_PUBLIC_HEADERS ?= $(POPT_SRC_DIR)\popt.h
+
+LIB_OBJ = lookup3.o poptconfig.o popthelp.o poptint.o poptparse.o popt.o
+
+LIB_BIN = libpopt.a
+TEST_BINS = tdict.exe test1.exe test2.exe
+OBJ = $(LIB_OBJ) $(TEST_OBJ)
+BIN = $(LIB_BIN) $(TEST_BINS)
+
+
+
+all: $(BIN) $(TEST_BINS)
+
+$(CONFIG_HEADER):
+ $(CP) $(CONFIG_MINGW_HEADER_NAME) $(CONFIG_HEADER)
+ $(CP) $(CONFIGMAKE_MINGW_HEADER_NAME) $(CONFIGMAKE_HEADER)
+
+%.o: $(POPT_SRC_DIR)/%.c $(CONFIG_HEADER)
+ $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)
+
+$(LIB_BIN): $(LIB_OBJ)
+ $(AR) rc $@ $^
+
+tdict.exe: tdict.c $(LIB_BIN)
+ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LIB_BIN)
+
+test1.exe: test1.c $(LIB_BIN)
+ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LIB_BIN)
+
+test2.exe: test2.c $(LIB_BIN)
+ $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LIB_BIN)
+
+
+RANLIB ?= ranlib
+
+tests: $(TEST_BINS)
+
+
+install: $(LIB_BIN) $(POPT_PUBLIC_HEADERS)
+ $(MKDIR) $(POPT_PREFIX)\include
+ $(MKDIR) $(POPT_PREFIX)\lib
+ $(CP) $(POPT_PUBLIC_HEADERS) $(POPT_PREFIX)\include
+ $(RANLIB) $(LIB_BIN)
+ $(CP) $(LIB_BIN) $(POPT_PREFIX)\lib
+.PHONY: install
+
+uninstall:
+ rmdir /S /Q $(POPT_PREFIX)
+.PHONY: uninstall
+
+clean:
+ $(RM) $(OBJ) $(BIN) $(CONFIG_HEADER)
+
+.PHONY: clean \ No newline at end of file
diff --git a/config.h.mingw b/config.h.mingw
new file mode 100644
index 0000000..1b39a35
--- /dev/null
+++ b/config.h.mingw
@@ -0,0 +1,151 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+/* #undef HAVE_FNMATCH_H */
+
+/* Define to 1 if you have the `geteuid' function. */
+/* #undef HAVE_GETEUID */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define to 1 if you have the `getuid' function. */
+/* #undef HAVE_GETUID */
+
+/* Define to 1 if you have the <glob.h> header file. */
+/* #undef HAVE_GLOB_H */
+
+/* Define if you have the iconv() function and it works. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define to 1 if you have the <libintl.h> header file. */
+/* #undef HAVE_LIBINTL_H */
+
+/* Define to 1 if you have the <mcheck.h> header file. */
+/* #undef HAVE_MCHECK_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mtrace' function. */
+/* #undef HAVE_MTRACE */
+
+/* Define to 1 if you have the `setregid' function. */
+/* #undef HAVE_SETREGID */
+
+/* Define to 1 if you have the `srandom' function. */
+/* #undef HAVE_SRANDOM */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stpcpy' function. */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if you have the `strerror' function. */
+#ifndef _MSC_VER
+/* The check seems to fail on MSVC, but it actually works */
+#define HAVE_STRERROR
+#else
+#define HAVE_STRERROR 1
+#endif
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef HAVE_VASPRINTF */
+
+/* Define to 1 if you have the `__secure_getenv' function. */
+/* #undef HAVE___SECURE_GETENV */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+/* #undef LT_OBJDIR */
+
+/* Name of package */
+#define 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. */
+#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. */
+/* #undef PACKAGE_TARNAME */
+
+/* Define to the version of this package. */
+/* #undef PACKAGE_VERSION */
+
+/* Full path to popt top_srcdir. */
+/* #undef POPT_SOURCE_PATH */
+
+/* Full path to default POPT configuration directory */
+#define POPT_SYSCONFDIR
+
+/* Define to 1 if the C compiler supports function prototypes. */
+/* #undef PROTOTYPES */
+
+/* Define to 1 if you have the ANSI C header files. */
+/* #undef STDC_HEADERS */
+
+/* Version number of package */
+/* #undef VERSION */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+/* #undef __PROTOTYPES */
+
+