Skip to content

Commit

Permalink
More on hpixml.
Browse files Browse the repository at this point in the history
Fixed distcheck
  • Loading branch information
avpak committed Jan 10, 2011
1 parent d1a4e7f commit 241e844
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile.mingw32.def
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TOOLCHAIN_PATH := /home/avpak/usr/cross/mingw32

CC := ${TOOLCHAIN_PATH}/bin/i386-mingw32-gcc
CXX := ${TOOLCHAIN_PATH}/bin/i386-mingw32-g++
LD := ${TOOLCHAIN_PATH}/bin/i386-mingw32-ld
AS := ${TOOLCHAIN_PATH}/bin/i386-mingw32-as

GLIB_DIR := /home/avpak/usr/cross/mingw32/i386-mingw32/glib-2.0

Expand Down
3 changes: 1 addition & 2 deletions README.windows
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ Build instructions:
- Get archive with glib2 for windows and unpack it somewhere.
- Enter openhpi source tree root directory.
- Modify Makefile.mingw32.def:
-- TOOLCHAIN_PATH in order that CC and CXX point to C and C++
compilers correspondingly.
-- TOOLCHAIN_PATH in order that CC, CXX and AS point to correct files.
-- GLIB_DIR: in order that GLIB_INCLUDES and GLIB_LIBS
point to valid directories with glib headers and libraries.
- Run "make -f Makefile.mingw32".
Expand Down
8 changes: 3 additions & 5 deletions clients/hpixml/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ MAINTAINERCLEANFILES = Makefile.in
MOSTLYCLEANFILES = @TEST_CLEAN@

AM_CPPFLAGS = -DG_LOG_DOMAIN=\"hpixml\"
AM_CCASFLAGS = -DSCHEMA=\"$(srcdir)/schema.xsd\"

INCLUDES = @OPENHPI_INCLUDES@

EXTRA_DIST = Makefile.mingw32
EXTRA_DIST = Makefile.mingw32 schema.xsd

bin_PROGRAMS = hpixml

Expand All @@ -16,15 +17,12 @@ hpixml_SOURCES = \
hpi_xml_writer.h \
main.cpp \
schema.h \
schema.xsd \
schema.S \
xml_writer.cpp \
xml_writer.h

hpixml_LDADD = $(top_builddir)/baselib/libopenhpi.la

.xsd.o:
${LD} -r -b binary -o $@ $<

clean-local:
rm -f *~ *.o

9 changes: 3 additions & 6 deletions clients/hpixml/Makefile.mingw32
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ TARGET := hpixml.exe
SRC := \
hpi.cpp \
hpi_xml_writer.cpp \
schema.xsd \
schema.S \
main.cpp \
xml_writer.cpp

OBJ := $(patsubst %.xsd, %.o,$(patsubst %.cpp, %.o, ${SRC} ) )
OBJ := $(patsubst %.S, %.o,$(patsubst %.cpp, %.o, ${SRC} ) )

DEFS := -DG_LOG_DOMAIN=\"hpixml\"
DEFS := -DG_LOG_DOMAIN=\"hpixml\" -DSCHEMA=\"schema.xsd\"

INCLUDES := ${GLIB_INCLUDES}
INCLUDES += -I ../../mingw32 -I ../../include -I ../../utils
Expand All @@ -26,9 +26,6 @@ CPPFLAGS += ${DEFS} ${INCLUDES}

all : ${TARGET}

%.o : %.xsd
${LD} -r -b binary -o $@ $^

${TARGET} : ${OBJ}
${CXX} -o $@ $^ ${LIBS}

Expand Down
2 changes: 1 addition & 1 deletion clients/hpixml/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main( int argc, char * argv[] )
return 1;
}
if ( print_xsd ) {
for ( char * p = SCHEMA_START; p < SCHEMA_END; ++p ) {
for ( char * p = &schema_begin; p < &schema_end; ++p ) {
fwrite( p, 1, 1, stdout );
}
return 0;
Expand Down
12 changes: 12 additions & 0 deletions clients/hpixml/schema.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.data

.globl schema_begin
.globl _schema_begin
.globl schema_end
.globl _schema_end
schema_begin:
_schema_begin:
.incbin SCHEMA
schema_end:
_schema_end:

17 changes: 2 additions & 15 deletions clients/hpixml/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,8 @@
extern "C"
{

#ifdef WIN32

extern char binary_schema_xsd_start;
extern char binary_schema_xsd_end;
#define SCHEMA_START (&binary_schema_xsd_start)
#define SCHEMA_END (&binary_schema_xsd_end)

#else

extern char _binary_schema_xsd_start;
extern char _binary_schema_xsd_end;
#define SCHEMA_START (&_binary_schema_xsd_start)
#define SCHEMA_END (&_binary_schema_xsd_end)

#endif
extern char schema_begin;
extern char schema_end;

};

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ AC_SUBST(ac_configure_args)

dnl Checks for programs
AC_PROG_CC
AM_PROG_AS
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PROG_LN_S
Expand Down

0 comments on commit 241e844

Please sign in to comment.