From 89564af263d59ea450863cb908f77bf2fe83f62b Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 13 Sep 2005 16:20:02 +0000 Subject: [PATCH] - get rid of libtool - set version to 1.0.3.1 - another attempt to finally fix gensyms.pl git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@749 d2ac09be-c843-0410-8b1f-f8a84130e0ec --- xqf/ChangeLog | 5 +++++ xqf/autogen.sh | 20 +++++++++---------- xqf/configure.in | 25 +++++------------------- xqf/src/Makefile.am | 47 +++++++++++++++++++++++++++++++-------------- xqf/src/gensyms.pl | 46 ++++++++++++++++++++++++++++---------------- xqf/src/rc.c | 4 ---- 6 files changed, 82 insertions(+), 65 deletions(-) diff --git a/xqf/ChangeLog b/xqf/ChangeLog index 7bd3452..7b1eae8 100644 --- a/xqf/ChangeLog +++ b/xqf/ChangeLog @@ -1,3 +1,8 @@ +Sep 13, 2005: +- get rid of libtool +- set version to 1.0.3.1 +- another attempt to finally fix gensyms.pl + Sep 12, 2005: - fix integer overflow in TGA loader diff --git a/xqf/autogen.sh b/xqf/autogen.sh index 671590f..4d0e493 100755 --- a/xqf/autogen.sh +++ b/xqf/autogen.sh @@ -109,16 +109,16 @@ fi rm -f tmpout $GETTEXTIZE_FIXED -# workaround for libtoolize putting files in .. -if [ ! -e install-sh ]; then - removeinstallsh=1 - touch install-sh -fi - -echo "running libtoolize ..." -libtoolize --force || die libtoolize libtool - -[ -n "$removeinstallsh" ] && rm install-sh +## workaround for libtoolize putting files in .. +#if [ ! -e install-sh ]; then +# removeinstallsh=1 +# touch install-sh +#fi +# +#echo "running libtoolize ..." +#libtoolize --force || die libtoolize libtool +# +#[ -n "$removeinstallsh" ] && rm install-sh # Some old version of GNU build tools fail to set error codes. # Check that they generate some of the files they should. diff --git a/xqf/configure.in b/xqf/configure.in index 53eed17..02124d3 100644 --- a/xqf/configure.in +++ b/xqf/configure.in @@ -3,7 +3,7 @@ # Initially written by Markus Fischer # -AC_INIT([XQF],[1.0.3],[xqf-developer@lists.sourceforge.net], [xqf]) +AC_INIT([XQF],[1.0.3.1],[xqf-developer@lists.sourceforge.net], [xqf]) AC_CONFIG_SRCDIR([src/xqf.c]) AC_PREREQ(2.52) @@ -22,9 +22,10 @@ AM_GLIB_GNU_GETTEXT dnl Checks for programs. AC_PROG_CC AC_ISC_POSIX +AC_PROG_LN_S +AC_PROG_RANLIB AC_DISABLE_STATIC -AC_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_STDC @@ -83,16 +84,6 @@ fi AC_SUBST(QSTATEXEC) -case "$qstat_version" in - 2.0*|2.1*|2.3*|2.4a|2.4b|2.4c|2.4d) - qstat_is=tooold - ;; -esac - -QSTAT23="-DQSTAT23 -DQSTAT_HAS_UNREAL_SUPPORT" - -AC_SUBST(QSTAT23) - AC_CHECK_HEADER(zlib.h,,[AC_MSG_ERROR([zlib.h not found, please install zlib development files])]) AC_CHECK_LIB(z, crc32,[AC_DEFINE([HAVE_LIBZ],[],[Whether libz is installed])],[AC_MSG_ERROR([libz not found])]) @@ -142,7 +133,7 @@ if test "x$USE_GEOIP" != "xno"; then DUMMY_LIBGEOIP_SONAME=`objdump -p "$use_geoip_dummy"|awk '$1 == "SONAME" {print $2}'` if test "x$DUMMY_LIBGEOIP_SONAME" != x; then DUMMY_LIBGEOIP_ORIG="$use_geoip_dummy" - GEOIP_LIB="libxqf_dummy_GeoIP.la" + GEOIP_LIB='-L$(top_builddir)/src -lxqf_dummy_GeoIP' AC_SUBST(DUMMY_LIBGEOIP_SONAME) AC_SUBST(DUMMY_LIBGEOIP_ORIG) @@ -174,7 +165,7 @@ if test "x$use_pixbuf_dummy" != "xno"; then DUMMY_LIBGDKPIXBUF_SONAME=`objdump -p "$use_pixbuf_dummy"|awk '$1 == "SONAME" {print $2}'` if test "x$DUMMY_LIBGDKPIXBUF_SONAME" != x; then DUMMY_LIBGDKPIXBUF_ORIG="$use_pixbuf_dummy" - GDK_PIXBUF_LIBS="libxqf_dummy_gdk_pixbuf.la" + GDK_PIXBUF_LIBS="-lxqf_dummy_gdk_pixbuf" AC_SUBST(DUMMY_LIBGDKPIXBUF_SONAME) AC_SUBST(DUMMY_LIBGDKPIXBUF_ORIG) @@ -261,10 +252,4 @@ if test "x$qstat_is" = "xnotfound" ; then *** Get it from http://qstat.org/ *** and put it in your path ]) -elif test "x$qstat_is" = "xtooold" ; then - AC_MSG_RESULT([ -*** You have an old QStat version installed -*** QStat 2.4e is recommended to run XQF -*** Get it from http://qstat.org/ -]) fi diff --git a/xqf/src/Makefile.am b/xqf/src/Makefile.am index 9c56d69..c8c115f 100644 --- a/xqf/src/Makefile.am +++ b/xqf/src/Makefile.am @@ -34,7 +34,12 @@ xqf_LDADD = $(INTLLIBS) \ $(GDK_PIXBUF_LIBS) \ -lz -xqf_LDFLAGS = #-Wl,-rpath,\$$ORIGIN +xqf_LDFLAGS = -Wl,-rpath,$(pkglibdir) + +# we need to specify all deps manually due to dummy libs +xqf_DEPENDENCIES = \ + $(top_builddir)/src/zip/libunzip.a \ + $(top_builddir)/src/tga/libtga.a xqf_rcon_LDADD = @INTLLIBS@ $(GLIB_LIBS) $(XQFRCON_LIBS) @PACKAGE_LIBS@ xqf_rcon_SOURCES = \ @@ -141,34 +146,48 @@ test_utils_LDADD = $(xqf_LDADD) gamesxml2c_LDFLAGS = $(shell xml2-config --libs) gamesxml2c_CFLAGS = $(shell xml2-config --cflags) -pkglib_LTLIBRARIES = +pkglib_PROGRAMS = + if DUMMY_LIBGEOIP -pkglib_LTLIBRARIES += libxqf_dummy_GeoIP.la +pkglib_PROGRAMS += libxqf_dummy_GeoIP.so.0 +xqf_DEPENDENCIES += libxqf_dummy_GeoIP.so endif if DUMMY_LIBGDKPIXBUF -pkglib_LTLIBRARIES += libxqf_dummy_gdk_pixbuf.la +pkglib_PROGRAMS += libxqf_dummy_gdk_pixbuf.so.0 +xqf_DEPENDENCIES += libxqf_dummy_gdk_pixbuf.so endif libxqf_dummy_gdk_pixbuf.c: - $(top_srcdir)/src/gensyms.pl -x gdk_pixbuf_new_from_file,gdk_pixbuf_render_pixmap_and_mask,gdk_pixbuf_unref /opt/gnome/lib/libgdk_pixbuf.so -o $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c || rm $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c + $(top_srcdir)/src/gensyms.pl -x gdk_pixbuf_new_from_file,gdk_pixbuf_render_pixmap_and_mask,gdk_pixbuf_unref $(DUMMY_LIBGDKPIXBUF_ORIG) -o $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c || rm $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c test -s $(top_srcdir)/src/libxqf_dummy_gdk_pixbuf.c -libxqf_dummy_gdk_pixbuf_la_SOURCES = libxqf_dummy_gdk_pixbuf_stubs.c -nodist_libxqf_dummy_gdk_pixbuf_la_SOURCES = libxqf_dummy_gdk_pixbuf.c -libxqf_dummy_gdk_pixbuf_la_LDFLAGS = -nostdlib -shared -Wl,-f,libgdk_pixbuf.so.2 -libxqf_dummy_gdk_pixbuf_la_LIBADD = +nodist_libxqf_dummy_gdk_pixbuf_so_0_SOURCES = libxqf_dummy_gdk_pixbuf.c +libxqf_dummy_gdk_pixbuf_so_0_SOURCES = libxqf_dummy_gdk_pixbuf_stubs.c +libxqf_dummy_gdk_pixbuf_so_0_LDFLAGS = -nostdlib -shared -Wl,-f,$(DUMMY_LIBGDKPIXBUF_SONAME) -Wl,-soname,libxqf_dummy_gdk_pixbuf.so.0 +libxqf_dummy_gdk_pixbuf_so_0_CFLAGS = -fPIC -DPIC + +libxqf_dummy_gdk_pixbuf.so: libxqf_dummy_gdk_pixbuf.so.0 + rm -f $@ + $(LN_S) $< $@ libxqf_dummy_GeoIP.c: $(top_srcdir)/src/gensyms.pl -x GeoIP_new,GeoIP_open $(DUMMY_LIBGEOIP_ORIG) -o $(top_srcdir)/src/libxqf_dummy_GeoIP.c || rm $(top_srcdir)/src/libxqf_dummy_GeoIP.c test -s $(top_srcdir)/src/libxqf_dummy_GeoIP.c -libxqf_dummy_GeoIP_la_SOURCES = libxqf_dummy_GeoIP_stubs.c -nodist_libxqf_dummy_GeoIP_la_SOURCES = libxqf_dummy_GeoIP.c -libxqf_dummy_GeoIP_la_LDFLAGS = -nostdlib -shared -Wl,-f,$(DUMMY_LIBGEOIP_SONAME) -libxqf_dummy_GeoIP_la_LIBADD = +nodist_libxqf_dummy_GeoIP_so_0_SOURCES = libxqf_dummy_GeoIP.c +libxqf_dummy_GeoIP_so_0_SOURCES = libxqf_dummy_GeoIP_stubs.c +libxqf_dummy_GeoIP_so_0_LDFLAGS = -nostdlib -shared -Wl,-f,$(DUMMY_LIBGEOIP_SONAME) -Wl,-soname,libxqf_dummy_GeoIP.so.0 +libxqf_dummy_GeoIP_so_0_CFLAGS = -fPIC -DPIC +libxqf_dummy_GeoIP.so: libxqf_dummy_GeoIP.so.0 + rm -f $@ + $(LN_S) $< $@ -CLEANFILES = $(nodist_libxqf_dummy_gdk_pixbuf_la_SOURCES) $(nodist_libxqf_dummy_GeoIP_la_SOURCES) +CLEANFILES = \ + $(nodist_libxqf_dummy_gdk_pixbuf_so_0_SOURCES) \ + $(nodist_libxqf_dummy_GeoIP_so_0_SOURCES) \ + libxqf_dummy_GeoIP.so \ + libxqf_dummy_gdk_pixbuf.so gamelist: gamesxml2c $(top_builddir)/src/gamesxml2c $(top_srcdir)/src/games.xml > $(top_srcdir)/src/games.c diff --git a/xqf/src/gensyms.pl b/xqf/src/gensyms.pl index 6f87bdd..bdbe609 100755 --- a/xqf/src/gensyms.pl +++ b/xqf/src/gensyms.pl @@ -26,18 +26,37 @@ my $versfile; my $outfile; my $weak; +sub help($) +{ + print < exclude symbols from list + -v write version map into FILE + -o write C code into FILE + --weak generate weak symbols + --help this screen +EOF + exit(shift); +} + Getopt::Long::Configure("no_ignore_case"); GetOptions ( "x=s@" => $except, "v=s" => \$versfile, "o=s" => \$outfile, "weak" => \$weak, + "h|help" => sub { help(0); } ) or exit(1); if(!$outfile) { print STDERR "no output file specified\n"; - exit(1); + help(1); } $except = { map { $_ => 1 } split(/,/,join(',',@{$except}))}; @@ -50,21 +69,9 @@ print OUT "static void segv(void) { char* die = 0; ++*die; }\n"; foreach my $file (@ARGV) { - my %syms; + my %seen; - open (IN, "/usr/bin/nm -D $file|"); - while() - { - my ($addr, $type, $sym) = split(/ +/); - next unless ($type eq 'T' || $type eq 'W'); - chomp $sym; - next if (exists($except->{$sym})); - - $syms{$sym}=1; - } - close IN; - - open (IN, "/usr/bin/readelf -W --symbols $file|"); + open (IN, "/usr/bin/readelf -W --symbols $file|") or die; while() { my ($sym, $ver, $at); @@ -74,7 +81,13 @@ foreach my $file (@ARGV) next unless $#f >= 6; next unless $f[2] eq 'FUNC'; + next unless $f[3] eq 'GLOBAL'; + next unless $f[5] =~ /\d+/; $sym = $f[6]; + + next if exists $seen{$sym}; + $seen{$sym} = 1; + if($sym =~ /(.*?)(\@\@?)(.*)/) { $sym = $1; @@ -82,8 +95,7 @@ foreach my $file (@ARGV) $ver = $3; } - next unless exists $syms{$sym}; - delete $syms{$sym}; + next if exists $except->{$sym}; if($ver) { diff --git a/xqf/src/rc.c b/xqf/src/rc.c index b85ffb3..6034c58 100644 --- a/xqf/src/rc.c +++ b/xqf/src/rc.c @@ -100,9 +100,7 @@ static struct keyword keywords[] = { { "q1_custom_cfg", KEYWORD_STRING,"/" CONFIG_FILE "/Game: QS/custom cfg" }, { "qw_custom_cfg", KEYWORD_STRING,"/" CONFIG_FILE "/Game: QWS/custom cfg" }, { "q2_custom_cfg", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q2S/custom cfg" }, -#ifdef QSTAT23 { "q3_custom_cfg", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q3S/custom cfg" }, -#endif { "q1_dir", KEYWORD_STRING,"/" CONFIG_FILE "/Game: QS/dir" }, { "q1_cmd", KEYWORD_STRING,"/" CONFIG_FILE "/Game: QS/cmd" }, @@ -110,10 +108,8 @@ static struct keyword keywords[] = { { "qw_cmd", KEYWORD_STRING,"/" CONFIG_FILE "/Game: QWS/cmd" }, { "q2_dir", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q2S/dir" }, { "q2_cmd", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q2S/cmd" }, -#ifdef QSTAT23 { "q3_dir", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q3S/dir" }, { "q3_cmd", KEYWORD_STRING,"/" CONFIG_FILE "/Game: Q3S/cmd" }, -#endif { "hl_dir", KEYWORD_STRING,"/" CONFIG_FILE "/Game: HLS/dir" }, { "hl_cmd", KEYWORD_STRING,"/" CONFIG_FILE "/Game: HLS/cmd" },