Permalink
Browse files

Only build static and shared objects on demand

  • Loading branch information...
1 parent 4d6ffbc commit ecf686d3cc282475d09a2bbef9a0daf88d217f6e @Diablo-D3 Diablo-D3 committed Mar 18, 2012
View
@@ -620,6 +620,7 @@ OPENSSL_INCLUDES
PKG_CONFIG
LIBMOWGLI_STATIC_MODULES
LIBMOWGLI_SHARED_MODULES
+LIBMOWGLI_MODULE_BUILD
LIBMOWGLI_OS
PTHREAD_CFLAGS
PTHREAD_LIBS
@@ -3878,6 +3879,9 @@ fi
LIBMOWGLI_MODULES="core base container eventloop ext module object thread vio linebuf"
+LIBMOWGLI_MODULE_BUILD="$(echo && echo x)"
+LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
+
LIBMOWGLI_SHARED_MODULES=""
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then :
@@ -4007,11 +4011,12 @@ $as_echo "no" >&6; }
for i in $LIBMOWGLI_MODULES
do
+ UPPER="$(echo $i | tr '[:lower:]' '[:upper:]')"
LIBMOWGLI_SHARED_MODULES="$LIBMOWGLI_SHARED_MODULES $i/mowgli.$i.lib.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_SHARED_$UPPER = mowgli.$i.lib.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
done
- BUILD_SHARED_MODULES="yes"
-
fi
LIBMOWGLI_STATIC_MODULES=""
@@ -4027,11 +4032,12 @@ if test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"; then :
for i in $LIBMOWGLI_MODULES
do
+ UPPER="$(echo $i | tr '[:lower:]' '[:upper:]')"
LIBMOWGLI_STATIC_MODULES="$LIBMOWGLI_STATIC_MODULES $i/mowgli.$i.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_STATIC_$UPPER = mowgli.$i.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
done
- BUILD_STATIC_MODULES="yes"
-
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OS type" >&5
@@ -4047,12 +4053,16 @@ $as_echo "win32" >&6; }
if test x"$LIBMOWGLI_SHARED_MODULES" != x""; then :
LIBMOWGLI_SHARED_MODULES="$LIBMOWGLI_SHARED_MODULES platform/win32/mowgli.platform.win32.lib.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_SHARED_PLATFORM_WIN32 = mowgli.platform.win32.lib.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
fi
if test x"$LIBMOWGLI_STATIC_MODULES" != x""; then :
LIBMOWGLI_STATIC_MODULES="$LIBMOWGLI_STATIC_MODULES platform/win32/mowgli.platform.win32.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_STATIC_PLATFORM_WIN32 = mowgli.platform.win32.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
fi
;;
@@ -4391,6 +4401,8 @@ esac
+
+
OPENSSL="no"
found=false
View
@@ -33,6 +33,9 @@ AC_PATH_PROG(RANLIB, ranlib)
LIBMOWGLI_MODULES="core base container eventloop ext module object thread vio linebuf"
AC_SUBST(LIBMOWGLI_MODULES)
+LIBMOWGLI_MODULE_BUILD="$(echo && echo x)"
+LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
+
LIBMOWGLI_SHARED_MODULES=""
AC_ARG_ENABLE([shared], [AS_HELP_STRING([--disable-shared], [do not build shared library])])
AS_IF([test x"$enable_shared" != x"no"], [
@@ -42,10 +45,11 @@ AS_IF([test x"$enable_shared" != x"no"], [
for i in $LIBMOWGLI_MODULES
do
+ UPPER="[$(echo $i | tr '[:lower:]' '[:upper:]')]"
LIBMOWGLI_SHARED_MODULES="$LIBMOWGLI_SHARED_MODULES $i/mowgli.$i.lib.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_SHARED_$UPPER = mowgli.$i.lib.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
done
-
- BUILD_SHARED_MODULES="yes"
])
LIBMOWGLI_STATIC_MODULES=""
@@ -55,10 +59,11 @@ AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
for i in $LIBMOWGLI_MODULES
do
+ UPPER="[$(echo $i | tr '[:lower:]' '[:upper:]')]"
LIBMOWGLI_STATIC_MODULES="$LIBMOWGLI_STATIC_MODULES $i/mowgli.$i.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_STATIC_$UPPER = mowgli.$i.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
done
-
- BUILD_STATIC_MODULES="yes"
])
AC_MSG_CHECKING(OS type)
@@ -71,10 +76,14 @@ case "$target" in
AS_IF([test x"$LIBMOWGLI_SHARED_MODULES" != x""], [
LIBMOWGLI_SHARED_MODULES="$LIBMOWGLI_SHARED_MODULES platform/win32/mowgli.platform.win32.lib.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_SHARED_PLATFORM_WIN32 = mowgli.platform.win32.lib.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
])
AS_IF([test x"$LIBMOWGLI_STATIC_MODULES" != x""], [
LIBMOWGLI_STATIC_MODULES="$LIBMOWGLI_STATIC_MODULES platform/win32/mowgli.platform.win32.a"
+ LIBMOWGLI_MODULE_BUILD="$LIBMOWGLI_MODULE_BUILD$(echo LIBMOWGLI_STATIC_PLATFORM_WIN32 = mowgli.platform.win32.a && echo x)"
+ LIBMOWGLI_MODULE_BUILD="${LIBMOWGLI_MODULE_BUILD%x}"
])
;;
*)
@@ -88,8 +97,10 @@ case "$target" in
;;
esac
AC_SUBST([LIBMOWGLI_OS])
+AC_SUBST([LIBMOWGLI_MODULE_BUILD])
AC_SUBST([LIBMOWGLI_SHARED_MODULES])
AC_SUBST([LIBMOWGLI_STATIC_MODULES])
+AC_SUBST([LIBMOWGLI_MODULE_BUILD])
OPENSSL="no"
AX_CHECK_OPENSSL([
View
@@ -7,3 +7,4 @@ LIBMOWGLI_OS = @LIBMOWGLI_OS@
EXAMPLES_BUILD = @EXAMPLES_BUILD@
+LIBMOWGLI_MODULE_BUILD = @LIBMOWGLI_MODULE_BUILD@
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.base.lib.a
-STATIC_LIB_NOINST = mowgli.base.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_BASE}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_BASE}
SRCS = argstack.c \
bitvector.c \
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.container.lib.a
-STATIC_LIB_NOINST = mowgli.container.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_CONTAINER}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_CONTAINER}
SRCS = list.c \
queue.c \
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.core.lib.a
-STATIC_LIB_NOINST = mowgli.core.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_CORE}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_CORE}
SRCS = init.c \
alloc.c \
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.eventloop.lib.a
-STATIC_LIB_NOINST = mowgli.eventloop.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_EVENTLOOP}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_EVENTLOOP}
SRCS = eventloop.c helper.c pollable.c timer.c null_pollops.c poll_pollops.c epoll_pollops.c kqueue_pollops.c select_pollops.c
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.ext.lib.a
-STATIC_LIB_NOINST = mowgli.ext.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_EXT}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_EXT}
SRCS = confparse.c \
error_backtrace.c \
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.linebuf.lib.a
-STATIC_LIB_NOINST = mowgli.linebuf.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_LINEBUF}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_LINEBUF}
SRCS = linebuf.c
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.module.lib.a
-STATIC_LIB_NOINST = mowgli.module.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_MODULE}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_MODULE}
SRCS = loader_${LIBMOWGLI_OS}.c
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.object.lib.a
-STATIC_LIB_NOINST = mowgli.object.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_OBJECT}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_OBJECT}
SRCS = object.c \
class.c \
@@ -1,7 +1,7 @@
include ../../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.platform.win32.lib.a
-STATIC_LIB_NOINST = mowgli.platform.win32.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_PLATFORM_WIN32}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_PLATFORM_WIN32}
SRCS = fork.c gettimeofday.c pipe.c setenv.c
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.thread.lib.a
-STATIC_LIB_NOINST = mowgli.thread.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_THREAD}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_THREAD}
SRCS = mutex.c \
null_mutexops.c \
@@ -1,7 +1,7 @@
include ../../../extra.mk
-STATIC_PIC_LIB_NOINST = mowgli.vio.lib.a
-STATIC_LIB_NOINST = mowgli.vio.a
+STATIC_PIC_LIB_NOINST = ${LIBMOWGLI_SHARED_VIO}
+STATIC_LIB_NOINST = ${LIBMOWGLI_STATIC_VIO}
SRCS = vio.c vio-sockets.c vio-openssl.c

0 comments on commit ecf686d

Please sign in to comment.