be friendly to non-Linux non-gcc systems
This commit is contained in:
6
Makefile
6
Makefile
@@ -44,7 +44,7 @@ endif
|
||||
ar cru $@ $^
|
||||
|
||||
%: %.c
|
||||
$(DIET) $(CC) $(CFLAGS) -o $@ $^ -lowfat
|
||||
$(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat
|
||||
|
||||
t1 parse: ldif.a storage.a
|
||||
t2: ldap.a asn1.a
|
||||
@@ -54,10 +54,10 @@ bindrequest tinyldap tinyldap_standalone tinyldap_debug ldapclient ldapclient_st
|
||||
idx2ldif: ldap.a
|
||||
|
||||
tinyldap_standalone: tinyldap.c
|
||||
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ -lowfat
|
||||
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat
|
||||
|
||||
tinyldap_debug: tinyldap.c
|
||||
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ -lowfat
|
||||
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat
|
||||
|
||||
.PHONY: clean tar
|
||||
clean:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <alloca.h>
|
||||
#include <buffer.h>
|
||||
#include <scan.h>
|
||||
#include <open.h>
|
||||
@@ -195,8 +196,9 @@ struct ldaprec *first=0;
|
||||
int ldif_parse(const char* filename) {
|
||||
char buf[4096];
|
||||
int fd=open_read(filename);
|
||||
buffer in=BUFFER_INIT(read,fd,buf,sizeof buf);
|
||||
buffer in;
|
||||
if (fd<0) return 1;
|
||||
buffer_init(&in,read,fd,buf,sizeof buf);
|
||||
dn=mduptab_adds(&attributes,"dn");
|
||||
objectClass=mduptab_adds(&attributes,"objectClass");
|
||||
{
|
||||
|
||||
3
t1.c
3
t1.c
@@ -115,8 +115,9 @@ struct ldaprec *first=0;
|
||||
int parse_ldif(const char* filename) {
|
||||
char buf[4096];
|
||||
int fd=open_read(filename);
|
||||
buffer in=BUFFER_INIT(read,fd,buf,sizeof buf);
|
||||
buffer in;
|
||||
if (fd<0) return 1;
|
||||
buffer_init(&in,read,fd,buf,sizeof buf);
|
||||
dn=strduptab_add(&tags,"dn");
|
||||
mail=strduptab_add(&tags,"mail");
|
||||
sn=strduptab_add(&tags,"sn");
|
||||
|
||||
Reference in New Issue
Block a user