Permalink
Browse files

Normalize libapriconv-1 for mingw as well as generic-nix:

  * name the shlib libapriconv-1
  * on mingw builds, add win32 objects
  * write the headers to include/apr-1 for aprutil xlate to find
  * name the resulting utility bin/apriconv instead of iconv to avoid
    clobbering system-installed utilities. 

Requires the 1.2.0 designation (already committed)

PR: 41914
Submitted by: Kouhei Sutou <kou cozmixng.org>, wrowe


git-svn-id: https://svn.apache.org/repos/asf/apr/apr-iconv/trunk@543638 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 0d4bb4b commit deffacbe0d38b9b6ecbb8b24174197ba795a22db @wrowe wrowe committed Jun 1, 2007
Showing with 44 additions and 9 deletions.
  1. +12 −2 Makefile.in
  2. +3 −1 buildconf
  3. +21 −0 configure.in
  4. +4 −2 lib/Makefile.in
  5. +4 −4 util/Makefile.in
View
14 Makefile.in
@@ -20,8 +20,13 @@ EXTRACLEAN_TARGETS = configure libtool aclocal.m4
prefix=@prefix@
exec_prefix=@prefix@/bin
lib_prefix=@prefix@/lib
+include_prefix=@prefix@/include/@API_INCPATH@
libdir=@iconv_libdir@
+API_CPPFLAGS=@API_CPPFLAGS@
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS=$(abs_srcdir)/build/mkdir.sh
install:
@@ -34,13 +39,18 @@ install:
fi; \
(cd ccs; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done)
(cd ces; for i in *.la; do $(LIBTOOL) --mode=install cp $$i $(DESTDIR)$(libdir); done)
+ if [ ! -d $(DESTDIR)$(include_prefix) ]; then \
+ $(MKINSTALLDIRS) $(DESTDIR)$(include_prefix); \
+ fi;
+ $(INSTALL_DATA) include/api_version.h $(DESTDIR)$(include_prefix)
+ $(INSTALL_DATA) include/apr_iconv.h $(DESTDIR)$(include_prefix)
if [ ! -d $(DESTDIR)$(exec_prefix) ]; then \
$(MKINSTALLDIRS) $(DESTDIR)$(exec_prefix); \
fi; \
- (cd util; $(LIBTOOL) --mode=install cp iconv $(DESTDIR)$(exec_prefix))
+ (cd util; $(LIBTOOL) --mode=install cp apriconv $(DESTDIR)$(exec_prefix))
all:
- (cd lib; $(MAKE))
+ (cd lib; $(MAKE) CPPFLAGS="$(API_CPPFLAGS) $(CPPFLAGS)")
(cd ccs; $(MAKE))
(cd ces; $(MAKE))
(cd util; $(MAKE))
View
4 buildconf
@@ -36,11 +36,13 @@ fi
# Remove some files, then copy them from apr source tree
rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
build/config.guess build/config.sub build/mkdir.sh \
- build/make_exports.awk build/make_var_export.awk
+ build/make_exports.awk build/make_var_export.awk \
+ build/get-version.sh
cp $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
$apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
$apr_src_dir/build/config.sub $apr_src_dir/build/mkdir.sh \
$apr_src_dir/build/make_exports.awk $apr_src_dir/build/make_var_export.awk \
+ $apr_src_dir/build/get-version.sh \
build
# Remove aclocal.m4 as it'll break some builds...
View
21 configure.in
@@ -15,6 +15,7 @@ sinclude(build/find_apr.m4)
dnl This is required by autoconf!
AC_PROG_AWK
+AC_PROG_INSTALL
dnl compute the top directory of the build
# Absolute source/build directory
@@ -67,6 +68,26 @@ case "$host_alias" in
esac
AC_SUBST(INCLUDE_RULES)
+dnl supportes MinGW
+case "$host_alias" in
+*mingw*)
+ API_CPPFLAGS="-DAPI_DECLARE_EXPORT"
+ ;;
+esac
+AC_SUBST(API_CPPFLAGS)
+
+dnl Absolute source/build directory
+abs_srcdir=`(cd $srcdir && pwd)`
+
+dnl get our version information
+get_version="$abs_srcdir/build/get-version.sh"
+version_hdr="$abs_srcdir/include/api_version.h"
+API_MAJOR_VERSION="`$get_version major $version_hdr API`"
+API_LIBNAME="apriconv-${API_MAJOR_VERSION}"
+AC_SUBST(API_LIBNAME)
+API_INCPATH="apr-${API_MAJOR_VERSION}"
+AC_SUBST(API_INCPATH)
+
dnl
dnl everthing is done.
AC_OUTPUT([
View
6 lib/Makefile.in
@@ -9,7 +9,7 @@ libdir=@libdir@
INCLUDES = @API_INCLUDES@ @APR_INCLUDES@
-TARGET_LIB = libapriconv.la
+TARGET_LIB = lib@API_LIBNAME@.la
SUBDIRS = .
EXPORT_FILES = $(abs_srcdir)/include/*.h $(abs_srcdir)/lib/*.h
@@ -36,6 +36,8 @@ OBJECTS_beos = $(OBJECTS_all)
OBJECTS_os2 = $(OBJECTS_all)
OBJECTS_os390 = $(OBJECTS_all)
+
+OBJECTS_win32 = $(OBJECTS_all)
# end replace
$(TARGET_LIB): $(OBJECTS)
@@ -48,7 +50,7 @@ export_vars.h:
$(AWK) -f $(abs_srcdir)/build/make_var_export.awk $(EXPORT_FILES) > $@
$(TARGET_EXPORTS): exports.c export_vars.h
- @echo "#! lib@APR_LIBNAME@.so" > $@
+ @echo "#! lib@API_LIBNAME@.so" > $@
@echo "* This file was AUTOGENERATED at build time." >> $@
@echo "* Please do not edit by hand." >> $@
$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
View
8 util/Makefile.in
@@ -1,15 +1,15 @@
VPATH = @srcdir@
INCLUDES = @API_INCLUDES@ @APR_INCLUDES@
-PROGRAMS = iconv
+PROGRAMS = apriconv
TARGETS = $(PROGRAMS)
# bring in rules.mk for standard functionality
@INCLUDE_RULES@
iconv_OBJECTS = iconv.lo iconv_stream.lo
-iconv_LDADD = ../lib/libapriconv.la
+iconv_LDADD = ../lib/lib@API_LIBNAME@.la
APR_LIBS = @APR_LIBS@
-iconv: $(iconv_OBJECTS) $(iconv_LDADD)
- $(LINK) $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS) $(APR_LIBS)
+apriconv: $(iconv_OBJECTS) $(iconv_LDADD)
+ $(LINK) -o $@ $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS) $(APR_LIBS)

0 comments on commit deffacb

Please sign in to comment.