add windows resource

This commit is contained in:
NishiOwO 2025-04-08 05:06:52 +09:00
parent 74776adb28
commit 8b42f1d5be
No known key found for this signature in database
GPG Key ID: 27EF69B208EB9343
9 changed files with 168 additions and 7 deletions

1
Makefile.in generated
View File

@ -260,6 +260,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@

138
configure generated vendored
View File

@ -647,6 +647,8 @@ NB_CPPFLAGS
NB_BACKEND
NB_DRIVER
NB_THREAD
WINDOWS_FALSE
WINDOWS_TRUE
ODE_LIBS
ODE_CFLAGS
GLU_LIBS
@ -658,6 +660,7 @@ GL_MORE_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
WINDRES
RANLIB
am__fastdepCC_FALSE
am__fastdepCC_TRUE
@ -5582,6 +5585,110 @@ else
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
set dummy ${ac_tool_prefix}windres; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_WINDRES+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) if test -n "$WINDRES"; then
ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi ;;
esac
fi
WINDRES=$ac_cv_prog_WINDRES
if test -n "$WINDRES"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
printf "%s\n" "$WINDRES" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_WINDRES"; then
ac_ct_WINDRES=$WINDRES
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_WINDRES+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) if test -n "$ac_ct_WINDRES"; then
ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_WINDRES="windres"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi ;;
esac
fi
ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
if test -n "$ac_ct_WINDRES"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
printf "%s\n" "$ac_ct_WINDRES" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_WINDRES" = x; then
WINDRES=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
WINDRES=$ac_ct_WINDRES
fi
else
WINDRES="$ac_cv_prog_WINDRES"
fi
@ -6438,9 +6545,28 @@ fi
printf "%s\n" "$ac_cv_lib_ws2_32_socket" >&6; }
if test "x$ac_cv_lib_ws2_32_socket" = xyes
then :
SOCKET_LIBS="-lws2_32"
SOCKET_LIBS="-lws2_32"
if true; then
WINDOWS_TRUE=
WINDOWS_FALSE='#'
else
WINDOWS_TRUE='#'
WINDOWS_FALSE=
fi
else case e in #(
e) : ;;
e)
if false; then
WINDOWS_TRUE=
WINDOWS_FALSE='#'
else
WINDOWS_TRUE='#'
WINDOWS_FALSE=
fi
;;
esac
fi
@ -6899,6 +7025,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then
as_fn_error $? "conditional \"WINDOWS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then
as_fn_error $? "conditional \"WINDOWS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0

View File

@ -6,6 +6,7 @@ AC_ARG_WITH([backend], AS_HELP_STRING([--with-backend=glx|wgl|glfw], [Select bac
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_CC
AC_CHECK_TOOL(WINDRES,windres,:)
PKG_PROG_PKG_CONFIG
@ -45,7 +46,12 @@ AC_CHECK_HEADER(stdarg.h,:,:)
AC_CHECK_LIB(stdc++,main,STDCXX_LIBS="-lstdc++",:)
AC_CHECK_LIB(ws2_32,socket,SOCKET_LIBS="-lws2_32",:)
AC_CHECK_LIB(ws2_32,socket,[
SOCKET_LIBS="-lws2_32"
AM_CONDITIONAL(WINDOWS, true)
],[
AM_CONDITIONAL(WINDOWS, false)
])
AC_CHECK_LIB(socket,socket,SOCKET_LIBS="-lsocket",:)
AC_CHECK_LIB(dl,dlopen,DL_LIBS="-ldl",:)

1
engine/Makefile.in generated
View File

@ -366,6 +366,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@

View File

@ -2,3 +2,11 @@ include $(top_srcdir)/common-automake.mk
bin_PROGRAMS = nishbox
nishbox_SOURCES = main.c
nishbox_LDADD = ../engine/libnishbox.a @NB_LDADD@
if WINDOWS
nishbox_SOURCES += nishbox.rc
.rc.o:
$(WINDRES) $^ -o $@
%.o: %.rc
$(WINDRES) $^ -o $@
endif

16
src/Makefile.in generated
View File

@ -87,6 +87,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = nishbox$(EXEEXT)
@WINDOWS_TRUE@am__append_1 = nishbox.rc
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@ -98,7 +99,9 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_nishbox_OBJECTS = main.$(OBJEXT)
am__nishbox_SOURCES_DIST = main.c nishbox.rc
@WINDOWS_TRUE@am__objects_1 = nishbox.$(OBJEXT)
am_nishbox_OBJECTS = main.$(OBJEXT) $(am__objects_1)
nishbox_OBJECTS = $(am_nishbox_OBJECTS)
nishbox_DEPENDENCIES = ../engine/libnishbox.a
AM_V_P = $(am__v_P_@AM_V@)
@ -131,7 +134,7 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(nishbox_SOURCES)
DIST_SOURCES = $(nishbox_SOURCES)
DIST_SOURCES = $(am__nishbox_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -221,6 +224,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@ -266,12 +270,12 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = @NB_CPPFLAGS@ -DDRV_@NB_DRIVER@ -DUSE_@NB_BACKEND@ -DTHREAD_@NB_THREAD@ -I$(top_srcdir)/engine/include -I$(top_srcdir)/external/lua -I$(top_srcdir)/external/stb -I$(top_srcdir)/external/zlib -I$(top_srcdir)/external/miniaudio -I$(top_srcdir)/deps/include
nishbox_SOURCES = main.c
nishbox_SOURCES = main.c $(am__append_1)
nishbox_LDADD = ../engine/libnishbox.a @NB_LDADD@
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
.SUFFIXES: .c .o .obj .rc
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common-automake.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@ -587,6 +591,10 @@ uninstall-am: uninstall-binPROGRAMS
.PRECIOUS: Makefile
@WINDOWS_TRUE@.rc.o:
@WINDOWS_TRUE@ $(WINDRES) $^ -o $@
@WINDOWS_TRUE@%.o: %.rc
@WINDOWS_TRUE@ $(WINDRES) $^ -o $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

3
src/nishbox.rc Normal file
View File

@ -0,0 +1,3 @@
#include <windows.h>
NISHBOX ICON "../texture/icon.ico"

BIN
texture/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
texture/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB