hi,
finally my patch is documented (almost). you will find the documentation of the patch:
http://home.eversberg.eu/stage1.html
the patch in plain text fromat:
http://home.eversberg.eu/stage1.patch
it also includes the changes i posted here before. if you have questions, ask.
regards,
andreas
On Friday 15 May 2009 12:37:50 Andreas.Eversberg wrote:
hi,
finally my patch is documented (almost). you will find the documentation of the patch:
http://home.eversberg.eu/stage1.html
the patch in plain text fromat:
http://home.eversberg.eu/stage1.patch
it also includes the changes i posted here before. if you have questions, ask.
Hi Andreas,
thank you for the patches. Let me start to review the patches one by one as replies to this one. One general thing with this and the previous patch. I'm quite picky when it comes to commented out code, and left overs from debugging.... please try to avoid leaving that in.
z.
Hi Andreas,
On Fri, 15 May 2009 12:37:50 +0200 "Andreas.Eversberg" Andreas.Eversberg@versatel.de wrote:
it also includes the changes i posted here before. if you have questions, ask.
which revision did you use for patching? We run into some problems over here, e.g. patch complaining about malformed patches.
Or maybe you can provide a tarball of your changed sources?
cheers,
Hi,
attached is a patch for Mac OS X. It fixes #include annoyances; some possibly general.
With this patch, openbsc should compile on OS X (but will not link yet).
- OS X has no malloc.h (malloc is in stdlib.h - as per POSIX/OpenGroup) - vty/buffer.h and vty/command.h need sys/types.h (looks harmless to me) - mISDNif.h explicitly wants <linux/types.h> etc., but the declarations in mISNif.h fairly generic. I have replaced <linux/types.h> with <sys/types.h>, unless "linux" is defined (which is defined by gcc).
Regarding linking:
OS X has no -lcrypt, but the openbsc binaries link without -lcrypt. I'll have to restore my autoconf knowledge from cryogenic storage and then come up with another patch.
- Lars
Index: tests/db/db_test.c =================================================================== --- tests/db/db_test.c (revision 452) +++ tests/db/db_test.c (working copy) @@ -22,7 +22,7 @@
#include <stdio.h> #include <string.h> -#include <malloc.h> +#include <stdlib.h>
#define COMPARE(original, copy) \ if (original->id != copy->id) \ Index: include/mISDNif.h =================================================================== --- include/mISDNif.h (revision 452) +++ include/mISDNif.h (working copy) @@ -19,9 +19,15 @@ #define mISDNIF_H
#include <stdarg.h> -#include <linux/types.h> -#include <linux/errno.h> -#include <linux/socket.h> +#ifdef linux +#include <linux/types.h> +#include <linux/errno.h> +#include <linux/socket.h> +#else +#include <sys/types.h> +#include <sys/errno.h> +#include <sys/socket.h> +#endif
/* * ABI Version 32 bit Index: include/vty/buffer.h =================================================================== --- include/vty/buffer.h (revision 452) +++ include/vty/buffer.h (working copy) @@ -23,6 +23,8 @@ #ifndef _ZEBRA_BUFFER_H #define _ZEBRA_BUFFER_H
+#include <sys/types.h> + /* Create a new buffer. Memory will be allocated in chunks of the given size. If the argument is 0, the library will supply a reasonable default size suitable for buffering socket I/O. */ Index: include/vty/command.h =================================================================== --- include/vty/command.h (revision 452) +++ include/vty/command.h (working copy) @@ -24,6 +24,7 @@ #define _ZEBRA_COMMAND_H
#include <stdio.h> +#include <sys/types.h> #include "vector.h" #include "vty.h"
Index: include/openbsc/paging.h =================================================================== --- include/openbsc/paging.h (revision 452) +++ include/openbsc/paging.h (working copy) @@ -21,7 +21,7 @@ #ifndef PAGING_H #define PAGING_H
-#include <malloc.h> +#include <stdlib.h> #include <string.h>
#include "linuxlist.h" Index: src/gsm_utils.c =================================================================== --- src/gsm_utils.c (revision 452) +++ src/gsm_utils.c (working copy) @@ -22,7 +22,7 @@ */
#include <openbsc/gsm_utils.h> -#include <malloc.h> +#include <stdlib.h> #include <string.h>
/* GSM 03.38 6.2.1 Charachter packing */ Index: src/abis_nm.c =================================================================== --- src/abis_nm.c (revision 452) +++ src/abis_nm.c (working copy) @@ -26,7 +26,7 @@ #include <unistd.h> #include <stdio.h> #include <fcntl.h> -#include <malloc.h> +#include <stdlib.h> #include <libgen.h> #include <time.h> #include <limits.h> Index: src/telnet_interface.c =================================================================== --- src/telnet_interface.c (revision 452) +++ src/telnet_interface.c (working copy) @@ -20,7 +20,7 @@
#include <sys/socket.h> #include <netinet/in.h> -#include <malloc.h> +#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> Index: src/signal.c =================================================================== --- src/signal.c (revision 452) +++ src/signal.c (working copy) @@ -19,7 +19,7 @@ */
#include <openbsc/signal.h> -#include <malloc.h> +#include <stdlib.h> #include <string.h>
On Thu, May 21, 2009 at 01:19:12AM +0200, Lars Immisch wrote:
attached is a patch for Mac OS X. It fixes #include annoyances; some possibly general.
With this patch, openbsc should compile on OS X (but will not link yet).
thanks, patch applied (svn rev 492)
OS X has no -lcrypt, but the openbsc binaries link without -lcrypt. I'll have to restore my autoconf knowledge from cryogenic storage and then come up with another patch.
I wonder why we actually need -lcrypt... oh, the vty password encryption. I think we can live without that, I'll just disable it (svn commit 493)
Hi Harald,
On Thu, May 21, 2009 at 01:19:12AM +0200, Lars Immisch wrote:
attached is a patch for Mac OS X. It fixes #include annoyances; some possibly general.
With this patch, openbsc should compile on OS X (but will not link yet).
thanks, patch applied (svn rev 492)
Thanks.
OS X has no -lcrypt, but the openbsc binaries link without -lcrypt. I'll have to restore my autoconf knowledge from cryogenic storage and then come up with another patch.
I wonder why we actually need -lcrypt... oh, the vty password encryption. I think we can live without that, I'll just disable it (svn commit 493)
Ah, well. I'm was just too tired for autoconf. But there is a simple solution - see the attached patch. It will define -DVTY_CRYPT_PW= if crypt is found. If -lcrypt is needed, $(LIB_CRYPT) will be -lcrypt
Compiles on OS X and Linux and reenables crypt.
- Lars
Index: configure.in =================================================================== --- configure.in (revision 493) +++ configure.in (working copy) @@ -10,6 +10,7 @@ AC_PROG_RANLIB
dnl checks for libraries +AC_SEARCH_LIBS(crypt, crypt, [LIBCRYPT="-lcrypt";AC_DEFINE(VTY_CRYPT_PW)])
dnl checks for header files AC_HEADER_STDC Index: src/Makefile.am =================================================================== --- src/Makefile.am (revision 493) +++ src/Makefile.am (working copy) @@ -14,7 +14,7 @@ libvty_a_SOURCES = vty/buffer.c vty/command.c vty/vector.c vty/vty.c
bsc_hack_SOURCES = bsc_hack.c vty_interface.c -bsc_hack_LDADD = libbsc.a libvty.a -ldl -ldbi +bsc_hack_LDADD = libbsc.a libvty.a -ldl -ldbi $(LIBCRYPT)
bs11_config_SOURCES = bs11_config.c abis_nm.c gsm_data.c msgb.c debug.c \ select.c timer.c rs232.c tlv_parser.c signal.c @@ -22,4 +22,4 @@ ipaccess_find_SOURCES = ipaccess-find.c select.c timer.c
ipaccess_config_SOURCES = ipaccess-config.c -ipaccess_config_LDADD = libbsc.a libvty.a -ldl -ldbi +ipaccess_config_LDADD = libbsc.a libvty.a -ldl -ldbi $(LIBCRYPT)
On Thursday 21 May 2009 12:00:57 Lars Immisch wrote:
Ah, well. I'm was just too tired for autoconf. But there is a simple solution - see the attached patch. It will define -DVTY_CRYPT_PW= if crypt is found. If -lcrypt is needed, $(LIB_CRYPT) will be -lcrypt
Interesting. I'm no autoconf expert but so far I would have added AC_SUBST(LIBCRYPT) after the check statement..... Anybody happens to know if and what difference it makes?
Ah, well. I'm was just too tired for autoconf. But there is a simple solution - see the attached patch. It will define -DVTY_CRYPT_PW= if crypt is found. If -lcrypt is needed, $(LIB_CRYPT) will be -lcrypt
Interesting. I'm no autoconf expert but so far I would have added AC_SUBST(LIBCRYPT) after the check statement..... Anybody happens to know if and what difference it makes?
http://ftp.df.lth.se/pub/gnome/teams/marketing/en/2003/autotools/html/foil26...
With AC_SUBST, we could write @LIB_CRYPT@ in Makefile.am.
It might be a matter of taste.
- Lars