Skip to content

Commit

Permalink
Only build static and shared objects on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
Diablo-D3 committed Mar 18, 2012
1 parent 4d6ffbc commit ecf686d
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 30 deletions.
20 changes: 16 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ OPENSSL_INCLUDES
PKG_CONFIG
LIBMOWGLI_STATIC_MODULES
LIBMOWGLI_SHARED_MODULES
LIBMOWGLI_MODULE_BUILD
LIBMOWGLI_OS
PTHREAD_CFLAGS
PTHREAD_LIBS
Expand Down Expand Up @@ -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 :
Expand Down Expand Up @@ -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=""
Expand All @@ -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
Expand All @@ -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
;;
Expand Down Expand Up @@ -4391,6 +4401,8 @@ esac
OPENSSL="no"
found=false
Expand Down
19 changes: 15 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"], [
Expand All @@ -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=""
Expand All @@ -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)
Expand All @@ -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}"
])
;;
*)
Expand All @@ -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([
Expand Down
1 change: 1 addition & 0 deletions extra.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ LIBMOWGLI_OS = @LIBMOWGLI_OS@

EXAMPLES_BUILD = @EXAMPLES_BUILD@

LIBMOWGLI_MODULE_BUILD = @LIBMOWGLI_MODULE_BUILD@
4 changes: 2 additions & 2 deletions src/libmowgli/base/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/container/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/core/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/eventloop/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/ext/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/linebuf/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/module/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/object/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/platform/win32/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/thread/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/libmowgli/vio/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit ecf686d

Please sign in to comment.