Index: apps/codecs/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/codecs/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- apps/codecs/Makefile	29 Sep 2006 16:15:07 -0000	1.37
+++ apps/codecs/Makefile	29 Sep 2006 19:50:31 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/Makefile,v
retrieving revision 1.77
diff -u -r1.77 Makefile
--- apps/plugins/Makefile	29 Sep 2006 16:15:08 -0000	1.77
+++ apps/plugins/Makefile	29 Sep 2006 19:50:32 -0000
@@ -13,12 +13,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES)	\
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/chessbox/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/chessbox/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- apps/plugins/chessbox/Makefile	29 Sep 2006 16:15:08 -0000	1.7
+++ apps/plugins/chessbox/Makefile	29 Sep 2006 19:50:33 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(GCCOPTS) -O2 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/databox/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/databox/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- apps/plugins/databox/Makefile	29 Sep 2006 16:15:08 -0000	1.8
+++ apps/plugins/databox/Makefile	29 Sep 2006 19:50:33 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/doom/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/doom/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- apps/plugins/doom/Makefile	29 Sep 2006 16:15:08 -0000	1.5
+++ apps/plugins/doom/Makefile	29 Sep 2006 19:50:33 -0000
@@ -26,12 +26,6 @@
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
  -Wno-strict-prototypes -O2 $(PROFILE_OPTS)
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/mpegplayer/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/mpegplayer/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- apps/plugins/mpegplayer/Makefile	29 Sep 2006 16:15:08 -0000	1.2
+++ apps/plugins/mpegplayer/Makefile	29 Sep 2006 19:50:34 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/pacbox/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/pacbox/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- apps/plugins/pacbox/Makefile	29 Sep 2006 16:15:09 -0000	1.4
+++ apps/plugins/pacbox/Makefile	29 Sep 2006 19:50:34 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: apps/plugins/rockboy/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/rockboy/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- apps/plugins/rockboy/Makefile	29 Sep 2006 16:15:09 -0000	1.16
+++ apps/plugins/rockboy/Makefile	29 Sep 2006 19:50:34 -0000
@@ -16,12 +16,6 @@
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 LINKFILE := $(OBJDIR)/link.lds
 DEPFILE = $(OBJDIR)/dep-rockboy
 SRC = cpu.c emu.c events.c exports.c fastmem.c hw.c lcd.c lcdc.c loader.c \
Index: apps/plugins/searchengine/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/searchengine/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- apps/plugins/searchengine/Makefile	29 Sep 2006 16:15:09 -0000	1.11
+++ apps/plugins/searchengine/Makefile	29 Sep 2006 19:50:34 -0000
@@ -16,12 +16,6 @@
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 LINKFILE := $(OBJDIR)/link.lds
 DEPFILE = $(OBJDIR)/dep-searchengine
 SRC = searchengine.c parser.c token.c dbinterface.c
Index: apps/plugins/sudoku/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/sudoku/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- apps/plugins/sudoku/Makefile	29 Sep 2006 16:15:10 -0000	1.4
+++ apps/plugins/sudoku/Makefile	29 Sep 2006 19:50:34 -0000
@@ -17,12 +17,6 @@
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 LINKFILE := $(OBJDIR)/link.lds
 DEPFILE = $(OBJDIR)/dep-sudoku
 
Index: apps/plugins/zxbox/Makefile
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/zxbox/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- apps/plugins/zxbox/Makefile	29 Sep 2006 16:15:10 -0000	1.3
+++ apps/plugins/zxbox/Makefile	29 Sep 2006 19:50:35 -0000
@@ -12,12 +12,6 @@
 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
  -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
 
-ifeq ($(UNAME), Darwin)
-SHARED_FLAG=-dynamiclib -Wl,-single_module
-else
-SHARED_FLAG=-shared
-endif
-
 ifdef APPEXTRA
    INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
 endif
Index: tools/configure
===================================================================
RCS file: /cvsroot/rockbox/tools/configure,v
retrieving revision 1.222
diff -u -r1.222 configure
--- tools/configure	29 Sep 2006 16:15:11 -0000	1.222
+++ tools/configure	29 Sep 2006 19:50:44 -0000
@@ -103,6 +103,7 @@
    CYGWIN*)
    echo "Cygwin host detected"
 
+   SHARED_FLAG="-shared"
    if [ "$simver" = "win32" ]; then
        # win32 version
        GCCOPTS="$GCCOPTS -mno-cygwin -DNOCYGWIN"
@@ -124,6 +125,7 @@
    Linux)
    echo "Linux host detected"
    GCCOPTS="$GCCOPTS"
+   SHARED_FLAG="-shared"
    if [ "$simver" = "win32" ]; then
        LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
        crosswincc # setup cross-compiler
@@ -144,6 +146,7 @@
    FreeBSD)
    echo "FreeBSD host detected"
    LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
+   SHARED_FLAG="-shared"
    if [ "$simver" = "win32" ]; then
      crosswincc # setup cross-compiler
    fi
@@ -154,6 +157,7 @@
    # sdl version
    GCCOPTS="$GCCOPTS `sdl-config --cflags`"
    LDOPTS="`sdl-config --libs`"
+   SHARED_FLAG="-dynamiclib -Wl\,-single_module"
    use_simsound="#define ROCKBOX_HAS_SIMSOUND 1"
    echo "Enabled PCM sound playback in simulator"
    ;;
@@ -1359,6 +1363,7 @@
  -e "s,@PLUGINS@,${plugins},g" \
  -e "s,@CODECS@,${codecs},g" \
  -e "s,@PROFILE_OPTS@,${PROFILE_OPTS},g" \
+ -e "s,@SHARED_FLAG@,${SHARED_FLAG},g" \
  -e "s,@GCCOPTS@,${GCCOPTS},g" \
  -e "s,@TARGET_INC@,${TARGET_INC},g" \
  -e "s!@LDOPTS@!${LDOPTS}!g" \
@@ -1429,6 +1434,7 @@
 export LOADADDRESS=@LOADADDRESS@
 export SIMVER=@SIMVER@
 export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
+export SHARED_FLAG=@SHARED_FLAG@
 export LDOPTS=@LDOPTS@
 export GCCVER=@GCCVER@
 export GCCNUM=@GCCNUM@
