Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

packaging tape for protobuf-c.

git-svn-id: http://protobuf-c.googlecode.com/svn/trunk@69 00440858-1255-0410-a3e6-75ea37f81c3a
  • Loading branch information...
commit 7a45dc1692717d06b81ccb7b4b252aaa8e176dea 1 parent b446bbd
lahiker42 authored
12 Makefile.am
View
@@ -1 +1,13 @@
SUBDIRS = src
+
+EXTRA_DIST = scripts pkgwriteinfo.in
+
+# --- packages ---
+DEBARCH = @ARCH@
+deb:
+ test -r protobuf-c-@VERSION@.tar.gz || $(MAKE) dist
+ $(srcdir)/scripts/pkgwrite --format=debian \
+ --tarball=protobuf-c-@VERSION@.tar.gz \
+ --output=protobuf-c-packages \
+ --pkgwriteinfo-file=pkgwriteinfo \
+ --arch=$(DEBARCH)
37 configure.ac
View
@@ -7,5 +7,40 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PATH_PROG(PROTOC, protoc)
+AC_CHECK_HEADERS(inttypes.h)
-AC_OUTPUT( Makefile src/Makefile src/test/Makefile )
+dnl ------ define IS_LITTLE_ENDIAN ------
+knows_endianness=0
+AC_CHECK_HEADERS([endian.h], [has_endian_h=1; knows_endianness=1], [has_endian_h=0])
+if test $knows_endianness = 1 ; then
+ AC_TRY_COMPILE([#include <endian.h>], [
+ switch (1) { case __LITTLE_ENDIAN: break;
+ case __BYTE_ORDER: break; } ],
+ [is_little_endian=0], [is_little_endian=1])
+else
+ AC_CHECK_HEADERS([mach/endian.h], [has_mach_endian_h=1; knows_endianness=1], [has_mach_endian_h=0])
+ AC_TRY_COMPILE([#include <mach/endian.h>],[
+ switch (1) { case __LITTLE_ENDIAN: break;
+ case __BYTE_ORDER: break; }
+ ],
+ [is_little_endian=0], [is_little_endian=1])
+ if test $knows_endianness = 0; then
+ AC_MSG_CHECKING([for little-endianness via runtime check])
+ AC_RUN_IFELSE([#include <inttypes.h>
+ int main() {
+ uint32_t v = 0x01020304;
+ return memcmp (&v, "\4\3\2\1", 4) == 0 ? 0 : 1;
+ }
+ ], [is_little_endian=1; result=yes], [is_little_endian=0; result=no])
+ AC_MSG_RESULT($result)
+ fi
+fi
+
+if test $is_little_endian = 1; then
+ echo "Your system IS little-endian" 1>&2
+else
+ echo "Your system IS NOT little-endian" 1>&2
+fi
+AC_DEFINE_UNQUOTED(IS_LITTLE_ENDIAN, $is_little_endian)
+
+AC_OUTPUT( Makefile src/Makefile src/test/Makefile pkgwriteinfo )
25 pkgwriteinfo.in
View
@@ -0,0 +1,25 @@
+Package: protobuf-c
+Section: libs
+Group: Development/Libraries
+Priority: low
+Author: David Benson <daveb@ffem.org>
+Packager: Dave Benson
+Packager-Email: daveb@ffem.org
+Version: @VERSION@
+Release: 1
+License: private
+Synopsis: C bindings for protocol-buffers
+Description: protobuf or protocol-buffers is google's
+ language for describing extensible binary data formats.
+
+Build: normal
+
+Target: {MAIN}
+Files: /usr/bin/protoc-c
+Files: /usr/include/google/protobuf-c/*.h
+Files: /usr/lib/libprotobuf-c.*
+Which-Build: normal
+Synopsis: C bindings for protocol-buffers
+Description: protobuf or protocol-buffers is google's
+ language for describing extensible binary data formats.
+
3,733 scripts/pkgwrite
View
3,733 additions, 0 deletions not shown
13 src/google/protobuf-c/protobuf-c.c
View
@@ -18,22 +18,9 @@
#include <stdio.h> /* for occasional printf()s */
#include <stdlib.h> /* for abort(), malloc() etc */
#include <string.h> /* for strlen(), memcpy(), memmove() */
-#include <endian.h> /* for __BYTE_ORDER, __LITTLE_ENDIAN */
-#define DO_LITTLE_ENDIAN_OPTIMIZATIONS 0
#define PRINT_UNPACK_ERRORS 1
-#if DO_LITTLE_ENDIAN_OPTIMIZATIONS
-# if (__LITTLE_ENDIAN == __BYTE_ORDER)
-# define IS_LITTLE_ENDIAN 1
-# else
-# define IS_LITTLE_ENDIAN 0
-# endif
-#else
-# define IS_LITTLE_ENDIAN 0
-#endif
-
-
#include "protobuf-c.h"
#define MAX_UINT64_ENCODED_SIZE 10
Please sign in to comment.
Something went wrong with that request. Please try again.