Mercurial > controlcenter
changeset 68:a62d7bc36b2c
Fix building with BSD make by moving the resource logic into configure.
This also allows us to skip compiling the resource object on Mac.
author | Brian Smith <brian@dbsoft.org> |
---|---|
date | Sun, 29 Nov 2020 16:38:07 -0600 |
parents | 222c028a785b |
children | d149b8e7aea1 |
files | Makefile.in configure configure.in |
diffstat | 3 files changed, 34 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.in Sun Nov 29 03:54:01 2020 -0600 +++ b/Makefile.in Sun Nov 29 16:38:07 2020 -0600 @@ -9,7 +9,7 @@ MAKE = @MAKE@ MKDIR = @MKDIR@ INSTALL = @INSTALL@ -GRESOURCE = @GRESOURCE@ +RESOURCE = @RESOURCE@ LIBS = @LIBS@ INCLUDES = @INCLUDES@ @@ -32,21 +32,20 @@ $(OBJECTS): $(SOURCES) $(CC) $(CFLAGS) $(INCLUDES) -c $< -resources.o: -ifeq ($(GRESOURCE),enabled) +gresources.o: -chmod +x gtk/resources.sh -gtk/resources.sh $(GRC) --generate-source --target=gresources.c gtk/cc.gresource.xml - $(CC) $(CFLAGS) $(INCLUDES) -c gresources.c -o resources.o -else + $(CC) $(CFLAGS) $(INCLUDES) -c gresources.c + +resources.o: $(CC) $(CFLAGS) $(INCLUDES) -c gtk/resources.c -endif statsunx.o: $(CC) $(CFLAGS) $(INCLUDES) -c statsunx.c -$(TARGET): $(OBJECTS) resources.o - $(CC) $(CFLAGS) $(INCLUDES) -o $(TARGET) $(OBJECTS) resources.o $(LDFLAGS) $(LIBS) +$(TARGET): $(OBJECTS) $(RESOURCE) + $(CC) $(CFLAGS) $(INCLUDES) -o $(TARGET) $(OBJECTS) $(RESOURCE) $(LDFLAGS) $(LIBS) -mac/finishup.sh "$(DISPLAYNAME)" "$(TARGET)" installer: $(TARGET) @@ -54,7 +53,7 @@ -mac/installer.sh "$(DISPLAYNAME)" "$(TARGET)" clean: - $(RM) $(OBJECTS) resources.o gresources.c $(TARGET) + $(RM) $(OBJECTS) resources.o gresources.c gresources.o $(TARGET) $(RM) -rf resources/ distclean: clean @@ -65,6 +64,7 @@ install: FORCE $(INSTALL) $(TARGET) /usr/local/bin -resources.o: gtk/resources.c gtk/cc.gresource.xml +resources.o: gtk/resources.c +gresources.o: gtk/cc.gresource.xml cc.o: cc.c cc.h config.h statsunx.o: statsunx.c
--- a/configure Sun Nov 29 03:54:01 2020 -0600 +++ b/configure Sun Nov 29 16:38:07 2020 -0600 @@ -621,7 +621,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS -GRESOURCE +RESOURCE ARCH MKDIR MV @@ -4064,6 +4064,17 @@ LIBS=`dwindows-config --libs` CFLAGS=`dwindows-config --cflags` GRESOURCE=`dwindows-config --gresource` +PLATFORM=`uname -s` + +if test x"$GRESOURCE" = x"enabled"; then + RESOURCE="gresources.o" +else + RESOURCE="resources.o" +fi + +if test x"$PLATFORM" = x"Darwin"; then + RESOURCE="" +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dw_main in -ldwindows" >&5 $as_echo_n "checking for dw_main in -ldwindows... " >&6; }
--- a/configure.in Sun Nov 29 03:54:01 2020 -0600 +++ b/configure.in Sun Nov 29 16:38:07 2020 -0600 @@ -61,6 +61,17 @@ LIBS=`dwindows-config --libs` CFLAGS=`dwindows-config --cflags` GRESOURCE=`dwindows-config --gresource` +PLATFORM=`uname -s` + +if test x"$GRESOURCE" = x"enabled"; then + RESOURCE="gresources.o" +else + RESOURCE="resources.o" +fi + +if test x"$PLATFORM" = x"Darwin"; then + RESOURCE="" +fi AC_CHECK_LIB(dwindows, dw_main,LIBS="$LIBS",AC_MSG_ERROR(Dynamic Windows library not found. Control Center cannot build without it.)) @@ -124,6 +135,6 @@ AC_SUBST(ARCH) -AC_SUBST(GRESOURCE) +AC_SUBST(RESOURCE) AC_OUTPUT(Makefile:Makefile.in)