Skip to content

Commit

Permalink
Fixed bug 3208 - Minor improvements to the configure script
Browse files Browse the repository at this point in the history
Rafal Muzylo

"if we're already using libtool, why aren't we using it ?"; they've been inspired by the fact, that at that mark, neither libSDL2_test.a nor libSDL2main.a were being built correctly (not sure if it's fully broken or just because I've tested the out-of-tree build)
  • Loading branch information
slouken committed Aug 12, 2017
1 parent b5cd11a commit 67bb802
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
16 changes: 6 additions & 10 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ GEN_HEADERS = @GEN_HEADERS@
GEN_OBJECTS = @GEN_OBJECTS@
VERSION_OBJECTS = @VERSION_OBJECTS@

SDLMAIN_TARGET = libSDL2main.a
SDLMAIN_TARGET = libSDL2main.la
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@

SDLTEST_TARGET = libSDL2_test.a
SDLTEST_TARGET = libSDL2_test.la
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@

WAYLAND_SCANNER = @WAYLAND_SCANNER@
Expand Down Expand Up @@ -145,12 +145,10 @@ $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
$(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
$(RUN_CMD_RANLIB)$(RANLIB) $@
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(DESTDIR)$(libdir)

$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
$(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
$(RUN_CMD_RANLIB)$(RANLIB) $@
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(DESTDIR)$(libdir)

install: all install-bin install-hdrs install-lib install-data
install-bin:
Expand All @@ -171,10 +169,8 @@ install-hdrs: update-revision
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
$(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
install-data:
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -24456,16 +24456,16 @@ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.rc,\

SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'`
SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.lo,g'`
SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\
\\$(objects)/\\2.o: \\1/\\2.c\\\\
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`

SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'`
SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.lo,g'`
SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\
\\$(objects)/\\2.o: \\1/\\2.c\\\\
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`

# Set runtime shared library paths as needed
Expand Down
10 changes: 5 additions & 5 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ if test x$enable_libc = xyes; then
AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
AC_CHECK_FUNCS(iconv)

AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [Description])], ,[#include <signal.h>])
AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include <signal.h>])
fi

dnl AC_CHECK_SIZEOF(void*)
Expand Down Expand Up @@ -3877,16 +3877,16 @@ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.

SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
\\$(objects)/\\2.o: \\1/\\2.c\\\\
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`

SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
\\$(objects)/\\2.o: \\1/\\2.c\\\\
\\$(objects)/\\2.lo: \\1/\\2.c\\\\
\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`

# Set runtime shared library paths as needed
Expand Down

0 comments on commit 67bb802

Please sign in to comment.