Skip to content
Permalink
Browse files

Added rules to build libSDLmain.a

Reverted Patrice's mint changes - you should fix the source files, not
add include paths to the build process.
  • Loading branch information
slouken committed Feb 20, 2006
1 parent 6268c7a commit 257980a8751593ddfd4264437480e4b38e83f3a6
Showing with 29 additions and 3 deletions.
  1. +17 −1 Makefile.in
  2. +12 −2 configure.in
@@ -30,6 +30,10 @@ TARGET = libSDL.la
SOURCES = @SOURCES@
OBJECTS = @OBJECTS@

SDLMAIN_TARGET = libSDLmain.a
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@

DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in setvars.cmd src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom.mif WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz

LT_AGE = @LT_AGE@
@@ -38,7 +42,7 @@ LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)

all: Makefile $(objects) $(objects)/$(TARGET)
all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(TARGET_SDLMAIN)

Makefile: $(srcdir)/Makefile.in
$(SHELL) config.status $@
@@ -50,12 +54,21 @@ $(objects):
depend:
SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
$(SHELL) $(auxdir)/makedep.sh
for src in $(SDLMAIN_SOURCES); do \
obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
echo "$(objects)/$$obj: $$src" >>$(depend); \
echo " \$$(CC) \$$(CFLAGS) -c $$src -o \$$@" >>$(depend); \
done

include $(depend)

$(objects)/$(TARGET): $(OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)

$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
@AR@ cru $@ $(SDLMAIN_OBJECTS)
@RANLIB@ $@

install: install-bin install-hdrs install-lib install-data install-man
install-bin:
$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
@@ -70,6 +83,7 @@ install-hdrs:
install-lib:
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
install-data:
$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
@@ -91,6 +105,7 @@ uninstall-hdrs:
rm -f $(includedir)/SDL/SDL_config.h
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
rm -f $(libdir)/$(SDLMAIN_TARGET)
uninstall-data:
rm -f $(datadir)/aclocal/sdl.m4
uninstall-man:
@@ -121,6 +136,7 @@ dist $(distfile):
rm -rf `find $(distdir) -name CVS`
rm -f `find $(distdir) -name '.cvsignore'`
rm -f `find $(distdir) -name '.#*'`
rmdir `find $(distdir) -type d -empty`
tar cvf - $(distdir) | gzip --best >$(distfile)
rm -rf $(distdir)

@@ -1175,6 +1175,7 @@ AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [default=no]]),
if test x$video_qtopia = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
BUILD_CFLAGS="$BUILD_CFLAGS $QTOPIA_FLAGS"
SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
@@ -2117,6 +2118,7 @@ case "$target" in
BUILD_LDFLAGS="$BUILD_LDFLAGS -ldxguid"
fi
# The Win32 platform requires special setup
SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
;;
@@ -2219,6 +2221,7 @@ case "$target" in
have_loadso=yes
fi
# The MacOS X platform requires special setup.
SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
AC_DEFINE(TARGET_API_MAC_CARBON)
BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings -DMACOSX"
SDL_LIBS="-lSDLmain $SDL_LIBS"
@@ -2274,13 +2277,11 @@ case "$target" in
else
AC_DEFINE(SDL_TIMER_MINT)
SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
BUILD_CFLAGS="$BUILD_CFLAGS -I$srcdir/src/timer/mint"
fi
have_timers=yes
fi
# MiNT does not define "unix"
BUILD_CFLAGS="$BUILD_CFLAGS -Dunix"
BUILD_CFLAGS="$BUILD_CFLAGS -I$srcdir/src/video/ataricommon"
;;
*-riscos)
ARCH=riscos
@@ -2345,12 +2346,19 @@ if test x$have_loadso != xyes; then
fi
SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
fi
if test x$SDLMAIN_SOURCES = x; then
SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
fi

OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`

SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`

# Set runtime shared library paths as needed

if test "x$enable_rpath" = "xyes"; then
@@ -2434,6 +2442,8 @@ AC_SUBST(ac_aux_dir)
AC_SUBST(INCLUDE)
AC_SUBST(SOURCES)
AC_SUBST(OBJECTS)
AC_SUBST(SDLMAIN_SOURCES)
AC_SUBST(SDLMAIN_OBJECTS)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)

0 comments on commit 257980a

Please sign in to comment.