Skip to content

Commit

Permalink
swars: Build bfsoundlib as static library
Browse files Browse the repository at this point in the history
  • Loading branch information
mefistotelis committed Jul 2, 2024
1 parent d707bdb commit 1c5918a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = --install -I m4

SUBDIRS = bflibrary conf lang src util
SUBDIRS = bflibrary bfsoundlib conf lang src util

# Do not install static libraries.
install installdirs: SUBDIRS = conf lang src util
Expand Down
6 changes: 3 additions & 3 deletions bfsoundlib/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ AC_CHECK_FUNCS([memmove memset])
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
CFLAGS="$CFLAGS -include \"\$(top_builddir)/include/bsndconf.h\""

CFLAGS="$CFLAGS $BFLIBRARY_CFLAGS"
LIBS="$LIBS $BFLIBRARY_LIBS"

CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"

Expand All @@ -77,6 +74,9 @@ LIBS="$LIBS $VORBISFILE_LIBS"
CFLAGS="$CFLAGS $WILDMIDI_CFLAGS"
LIBS="$LIBS $WILDMIDI_LIBS"

CFLAGS="$CFLAGS $BFLIBRARY_CFLAGS"
LIBS="$LIBS $BFLIBRARY_LIBS"

# Final commands

AC_CONFIG_FILES([Makefile])
Expand Down
15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ m4_define([swars_version],

AC_INIT([Syndicate Wars Port], [swars_version], [unavowed@vexillium.org], [swars])

AC_CONFIG_SUBDIRS([bflibrary])
AC_CONFIG_SUBDIRS([bflibrary bfsoundlib])

AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([src/config.h])
Expand Down Expand Up @@ -142,6 +142,13 @@ AC_SUBST(WILDMIDI_LIBS, -lWildMidi)
AC_SUBST(WILDMIDI_CFLAGS, )
AC_DEFINE(ENABLE_WILDMIDI, 1, [Define for wildmidi support])

# libraries from within this project are bot built at this point
AC_SUBST(BFLIBRARY_LIBS, -L\$\(top_builddir\)/bflibrary)
AC_SUBST(BFLIBRARY_CFLAGS, -I\$\(top_srcdir\)/bflibrary/include)

AC_SUBST(BFSOUNDLIB_LIBS, -L\$\(top_builddir\)/bfsoundlib)
AC_SUBST(BFSOUNDLIB_CFLAGS, -I\$\(top_srcdir\)/bfsoundlib/include)

# Arguments

AC_ARG_ENABLE([debug],
Expand Down Expand Up @@ -230,6 +237,12 @@ LIBS="$LIBS $PNG_LIBS"
CFLAGS="$CFLAGS $WILDMIDI_CFLAGS"
LIBS="$LIBS $WILDMIDI_LIBS"

CFLAGS="$CFLAGS $BFLIBRARY_CFLAGS"
LIBS="$LIBS $BFLIBRARY_LIBS"

CFLAGS="$CFLAGS $BFSOUNDLIB_CFLAGS"
LIBS="$LIBS $BFSOUNDLIB_LIBS"


AC_SUBST([MKWFLAGS])
AC_SUBST([WINDRES])
Expand Down
65 changes: 2 additions & 63 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,66 +17,6 @@ swars_SOURCES = \
bflib_vidraw.c \
bflib_vidraw.h \
bflib_vidraw_s.sx \
../bfsoundlib/include/ail.h \
../bfsoundlib/src/ail.c \
../bfsoundlib/include/ailss.h \
../bfsoundlib/src/ailss.c \
../bfsoundlib/src/ailvoc.c \
../bfsoundlib/src/ailwav.c \
../bfsoundlib/include/aila.h \
../bfsoundlib/src/aila.c \
../bfsoundlib/include/aildebug.h \
../bfsoundlib/src/aildebug.c \
../bfsoundlib/include/mssdig.h \
../bfsoundlib/src/mssdig.c \
../bfsoundlib/include/msssys.h \
../bfsoundlib/src/msssys.c \
../bfsoundlib/include/mssxmidi.h \
../bfsoundlib/src/mssxmidi.c \
../bfsoundlib/include/mssxdig.h \
../bfsoundlib/src/mssxdig.c \
../bfsoundlib/include/bfaudio.h \
../bfsoundlib/src/bfaudio.c \
../bfsoundlib/include/bfsvaribl.h \
../bfsoundlib/src/variable.c \
../bfsoundlib/src/dpmi.c \
../bfsoundlib/include/dpmi.h \
../bfsoundlib/src/sb16.c \
../bfsoundlib/include/sb16.h \
../bfsoundlib/src/awe32.c \
../bfsoundlib/src/awe32use.c \
../bfsoundlib/include/awe32.h \
../bfsoundlib/include/ssampfad.h \
../bfsoundlib/src/ssampfad.c \
../bfsoundlib/include/ssamplst.h \
../bfsoundlib/src/ssamplst.c \
../bfsoundlib/include/ssampply.h \
../bfsoundlib/src/ssampply.c \
../bfsoundlib/include/dllload.h \
../bfsoundlib/src/dllload.c \
../bfsoundlib/include/memfile.h \
../bfsoundlib/src/memfile.c \
../bfsoundlib/include/miscutil.h \
../bfsoundlib/src/miscutil.c \
../bfsoundlib/include/snderr.h \
../bfsoundlib/src/snderr.c \
../bfsoundlib/include/bfmusic.h \
../bfsoundlib/src/init_mus.c \
../bfsoundlib/src/mseqnply.c \
../bfsoundlib/src/mseqnfad.c \
../bfsoundlib/src/mseqnlst.c \
../bfsoundlib/include/bfsound.h \
../bfsoundlib/src/init_snd.c \
../bfsoundlib/include/bfscd.h \
../bfsoundlib/src/cd.c \
../bfsoundlib/include/streamfx.h \
../bfsoundlib/src/streamfx.c \
../bfsoundlib/include/sndtimer.h \
../bfsoundlib/src/sndtimer.c \
../bfsoundlib/include/drv_oal.h \
../bfsoundlib/src/drv_oal.c \
../bfsoundlib/include/oggvorbis.h \
../bfsoundlib/src/oggvorbis.c \
../bfsoundlib/src/ailssa.sx \
../bfariadne/include/trfringe.h \
../bfariadne/src/trfringe.c \
Expand Down Expand Up @@ -258,8 +198,6 @@ swars_SOURCES = \
wrcities.h

swars_CPPFLAGS = \
-I"$(top_srcdir)/bflibrary/include" \
-I"$(top_srcdir)/bfsoundlib/include" \
-I"$(top_srcdir)/bfsmacklib/include" \
-I"$(top_srcdir)/bfariadne/include"

Expand All @@ -280,7 +218,8 @@ nodist_EXTRA_swars_SOURCES = dummy.cxx

swars_LDADD = \
$(swars_WRAPPERS) $(swars_RESRCS) \
-L$(builddir)/../bflibrary -lbullfrog
-lbullfrog \
-lbfsound

$(swars_WRAPPERS:.o=.sx): %.sx: $(top_srcdir)/conf/%.conf
$(AM_V_GEN)$(MKW) $(MKWFLAGS) -o $@ $<
Expand Down

0 comments on commit 1c5918a

Please sign in to comment.