From bf09c76081a461561391dee5f5007dda49c1fc1e Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sun, 4 Jan 2009 09:01:49 +0000 Subject: [PATCH] Remove posix dir and 'libposix' and create 'libresrc' which includes resources from res.rc and and future resources required. Originally committed to SVN as r2631. --- aegisub/Makefile.am | 6 +++--- aegisub/config.h | 2 +- aegisub/libresrc/Makefile.am | 3 +++ aegisub/posix/Makefile.am | 3 --- aegisub/posix/genres.sh | 16 ---------------- autogen.sh | 9 ++++----- configure.in | 2 +- scripts/unix-gen-res.awk | 12 ++++++------ 8 files changed, 18 insertions(+), 35 deletions(-) create mode 100644 aegisub/libresrc/Makefile.am delete mode 100644 aegisub/posix/Makefile.am delete mode 100644 aegisub/posix/genres.sh diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index e9339330b..da1f1e5da 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -8,12 +8,12 @@ libosxutil_lib = libosxutil/libosxutil.a libosxutil_ldflags = -framework CoreFoundation endif -SUBDIRS = bitmaps posix $(libosxutil_subdir) +SUBDIRS = bitmaps libresrc $(libosxutil_subdir) -AM_CXXFLAGS = -DAEGISUB -Iposix -Iinclude @WX_CPPFLAGS@ @OPENMP_CXXFLAGS@ +AM_CXXFLAGS = -DAEGISUB -Iinclude @WX_CPPFLAGS@ @OPENMP_CXXFLAGS@ bin_PROGRAMS = aegisub -aegisub_LDADD = posix/libposix.a $(libosxutil_lib) +aegisub_LDADD = libresrc/libresrc.a $(libosxutil_lib) aegisub_CPPFLAGS = @FREETYPE_CFLAGS@ aegisub_LDFLAGS = @GL_LIBS@ @PTHREAD_LIBS@ @WX_LIBS@ @ICONV_LDFLAGS@ $(libosxutil_ldflags) LIBS += @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ diff --git a/aegisub/config.h b/aegisub/config.h index a687ee086..b7c14716a 100644 --- a/aegisub/config.h +++ b/aegisub/config.h @@ -10,6 +10,6 @@ // Unix specific settings and defines. #include "config/config_unix.h" -#include "posix/res.h" +#include "libresrc/libresrc.h" #endif // __WINDOWS__ diff --git a/aegisub/libresrc/Makefile.am b/aegisub/libresrc/Makefile.am new file mode 100644 index 000000000..c708cfe0d --- /dev/null +++ b/aegisub/libresrc/Makefile.am @@ -0,0 +1,3 @@ +noinst_LIBRARIES = libresrc.a +nodist_libresrc_a_SOURCES = resrc.cpp +noinst_HEADERS = libresrc.h diff --git a/aegisub/posix/Makefile.am b/aegisub/posix/Makefile.am deleted file mode 100644 index 754354a01..000000000 --- a/aegisub/posix/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -noinst_LIBRARIES = libposix.a -nodist_libposix_a_SOURCES = res.cpp -EXTRA_DIST = genres.sh defines.h res.cpp res.h config.h diff --git a/aegisub/posix/genres.sh b/aegisub/posix/genres.sh deleted file mode 100644 index da689438f..000000000 --- a/aegisub/posix/genres.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -RESFILE="$1" - -egrep -v "\.cur|^(#|/|$)" $RESFILE | cut -d ' ' -f 1 | ( - echo "#define static" >&4 - - echo "#ifndef _RES_H" >&5 - echo "#define _RES_H" >&5 - while read NAME - do echo "extern char *${NAME}_xpm[];" >&5 - echo "#include \"../bitmaps/${NAME}_xpm.xpm\"" >&4 - done - echo "#endif /* _RES_H */" >&5 -) 4>res.cpp 5>res.h - diff --git a/autogen.sh b/autogen.sh index a47a169fa..f9804f9f4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -294,11 +294,10 @@ $BIN_AWK '/BITMAP/ { image[count] = $1; ++count} END { printf("EXTRA_DIST= \\\n ${srcdir}/aegisub/res.rc \ > ${srcdir}/aegisub/bitmaps/Makefile.am -echo "--- Generating res.cpp / res.h from res.rc ---" -# XXX: This needs replacing. -cd ${srcdir}/aegisub/posix -sh genres.sh ${srcdir}/aegisub/res.rc -cd ${srcdir} +echo "--- Generating libresrc/resrc.cpp, libresrc/resrc.h from res.rc ---" +$BIN_AWK -f scripts/unix-gen-res.awk ${srcdir}/aegisub/res.rc \ + RESRC_CPP="${srcdir}/aegisub/libresrc/resrc.cpp" \ + RESRC_H="${srcdir}/aegisub/libresrc/resrc.h" rm -rf autom4te.cache diff --git a/configure.in b/configure.in index 250fe9f14..8cfb5c95f 100644 --- a/configure.in +++ b/configure.in @@ -958,7 +958,7 @@ AC_CONFIG_FILES([ Makefile aegisub/Makefile aegisub/bitmaps/Makefile -aegisub/posix/Makefile +aegisub/libresrc/Makefile aegisub/libosxutil/Makefile universalchardet/Makefile FFmpegSource2/Makefile diff --git a/scripts/unix-gen-res.awk b/scripts/unix-gen-res.awk index 67d98875d..ac1653d01 100644 --- a/scripts/unix-gen-res.awk +++ b/scripts/unix-gen-res.awk @@ -5,16 +5,16 @@ } END { - print("#define static") > RES_CPP + print("#define static") > RESRC_CPP for (v in image) { - printf("#include \"../bitmaps/%s_xpm.xpm\"\n", image[v]) >> RES_CPP + printf("#include \"../bitmaps/%s_xpm.xpm\"\n", image[v]) >> RESRC_CPP } - print("#ifndef _RES_H") > RES_H - print("define _RES_H") >> RES_H + print("#ifndef _RES_H") > RESRC_H + print("#define _RES_H") >> RESRC_H for (v in image) { - printf("extern char *%s_xpm[];\n", image[v]) >> RES_H + printf("extern char *%s_xpm[];\n", image[v]) >> RESRC_H } - print("#endif /* _RES_H */") >> RES_H + print("#endif /* _RES_H */") >> RESRC_H }