Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
a4f3d467
Commit
a4f3d467
authored
Aug 05, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid generating some OER object code if not -gen-OER
parent
7268f33f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
52 deletions
+55
-52
examples/sample.makefile.regen
examples/sample.makefile.regen
+5
-5
examples/sample.source.J2735/Makefile
examples/sample.source.J2735/Makefile
+4
-5
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+45
-41
skeletons/file-dependencies
skeletons/file-dependencies
+1
-1
No files found.
examples/sample.makefile.regen
View file @
a4f3d467
...
...
@@ -38,13 +38,13 @@ if test ! -f Makefile.am.sample ; then
exit
1
fi
EXTRA_C
FLAGS
=
"-DJUNKTEST -D_DEFAULT_SOURCE
${
C
FLAGS
}
"
test
-f
config.h
&&
EXTRA_C
FLAGS
=
"-DHAVE_CONFIG_H
${
EXTRA_C
FLAGS
}
"
test
-n
"
$TITLE
"
&&
EXTRA_C
FLAGS
=
"-DASN_CONVERTER_TITLE=
\"
$TITLE
\"
${
EXTRA_C
FLAGS
}
"
EXTRA_C
PPFLAGS
=
"-DJUNKTEST -D_DEFAULT_SOURCE
${
CPP
FLAGS
}
"
test
-f
config.h
&&
EXTRA_C
PPFLAGS
=
"-DHAVE_CONFIG_H
${
EXTRA_CPP
FLAGS
}
"
test
-n
"
$TITLE
"
&&
EXTRA_C
PPFLAGS
=
"-DASN_CONVERTER_TITLE=
\"
$TITLE
\"
${
EXTRA_CPP
FLAGS
}
"
set
-x
cat
Makefile.am.sample
\
|
sed
-e
"s/^C
FLAGS += /CFLAGS +=
${
EXTRA_C
FLAGS
}
/"
\
|
sed
-e
"s/^C
PPFLAGS += /CPPFLAGS +=
${
EXTRA_CPP
FLAGS
}
/"
\
|
sed
-e
"s/^all: /all:
${
ASN1PDU
}
.c /"
\
|
sed
-e
"s/progname/
${
PROGNAME
}
/"
\
>
Makefile.
$$
...
...
@@ -62,7 +62,7 @@ set +x
echo
" ASN1MODULES=
\"
${
ASN1MODULES
}
\"
\\
"
echo
" ASN1PDU=
${
ASN1PDU
}
\\
"
echo
" PROGNAME=
${
PROGNAME
}
\\
"
echo
" C
FLAGS=
\"
${
C
FLAGS
}
\"
\\
"
echo
" C
PPFLAGS=
\"
${
CPP
FLAGS
}
\"
\\
"
echo
"
$0
"
echo
echo
'check: ${TARGET} check-ber check-xer check-per'
...
...
examples/sample.source.J2735/Makefile
View file @
a4f3d467
...
...
@@ -984,7 +984,6 @@ ASN_MODULE_SOURCES+=INTEGER.c
ASN_MODULE_SOURCES
+=
NativeEnumerated.c
ASN_MODULE_HEADERS
+=
NativeInteger.h
ASN_MODULE_SOURCES
+=
NativeInteger.c
ASN_MODULE_SOURCES
+=
NativeInteger_oer.c
ASN_MODULE_HEADERS
+=
asn_SEQUENCE_OF.h
ASN_MODULE_SOURCES
+=
asn_SEQUENCE_OF.c
ASN_MODULE_HEADERS
+=
asn_SET_OF.h
...
...
@@ -1048,19 +1047,19 @@ libsomething_la_SOURCES=$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS)
# This file may be used as an input for make(3)
# Remove the lines below to convert it into a pure .am file
TARGET
=
j2735-dump
C
FLAGS
+=
-DASN_CONVERTER_TITLE
=
"J2735 DSRC decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
-DPDU
=
MessageFrame
-I
.
C
PPFLAGS
+=
-DASN_CONVERTER_TITLE
=
"J2735 DSRC decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
-DASN_DISABLE_OER_SUPPORT
-DPDU
=
MessageFrame
-I
.
OBJS
=
${ASN_MODULE_SOURCES:.c=.o}
${ASN_CONVERTER_SOURCES:.c=.o}
all
:
MessageFrame.c $(TARGET)
$(TARGET)
:
${OBJS}
$(CC)
$(CFLAGS)
-o
$(TARGET)
${OBJS}
$(LDFLAGS)
$(LIBS)
$(CC)
$(C
PP
FLAGS)
-o
$(TARGET)
${OBJS}
$(LDFLAGS)
$(LIBS)
.SUFFIXES
:
.SUFFIXES
:
.c .o
.c.o
:
$(CC)
$(CFLAGS)
-o
$@
-c
$<
$(CC)
$(CFLAGS)
$(CPPFLAGS)
-o
$@
-c
$<
clean
:
rm
-f
$(TARGET)
...
...
@@ -1083,7 +1082,7 @@ regen-makefile:
ASN1MODULES
=
"../j2735.asn1"
\
ASN1PDU
=
MessageFrame
\
PROGNAME
=
j2735-dump
\
CFLAGS
=
""
\
C
PP
FLAGS
=
""
\
../sample.makefile.regen
check
:
${TARGET} check-ber check-xer check-per
...
...
libasn1compiler/asn1c_save.c
View file @
a4f3d467
...
...
@@ -160,7 +160,9 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
return
-
1
;
}
safe_fprintf
(
mkf
,
"
\n\n
"
safe_fprintf
(
mkf
,
"
\n\n
"
"lib_LTLIBRARIES=libsomething.la
\n
"
"libsomething_la_SOURCES="
"$(ASN_MODULE_SOURCES) $(ASN_MODULE_HEADERS)
\n
"
...
...
@@ -168,26 +170,25 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
"# This file may be used as an input for make(3)
\n
"
"# Remove the lines below to convert it into a pure .am file
\n
"
"TARGET = progname
\n
"
"CFLAGS +=%s%s
-I.
\n
"
"CPPFLAGS += %s%s%s%s
-I.
\n
"
"OBJS=${ASN_MODULE_SOURCES:.c=.o}"
" ${ASN_CONVERTER_SOURCES:.c=.o}
\n
"
"
\n
all: $(TARGET)
\n
"
"
\n
$(TARGET): ${OBJS}"
"
\n\t
$(CC) $(C
FLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
\n
"
"
\n\t
$(CC) $(CPP
FLAGS) -o $(TARGET) ${OBJS} $(LDFLAGS) $(LIBS)
\n
"
"
\n
.SUFFIXES:"
"
\n
.SUFFIXES: .c .o
\n
"
"
\n
.c.o:"
"
\n\t
$(CC) $(C
FLAGS) -o $@ -c $<
\n
"
"
\n\t
$(CC) $(CFLAGS) $(CPP
FLAGS) -o $@ -c $<
\n
"
"
\n
clean:"
"
\n\t
rm -f $(TARGET)"
"
\n\t
rm -f $(OBJS)
\n
"
"
\n
regen: regenerate-from-asn1-source
\n
"
"
\n
regenerate-from-asn1-source:
\n\t
"
,
(
arg
->
flags
&
A1C_PDU_TYPE
)
?
generate_pdu_C_definition
()
:
""
,
need_to_generate_pdu_collection
(
arg
)
?
" -DASN_PDU_COLLECTION"
:
""
);
"
\n
regenerate-from-asn1-source:
\n\t
"
,
(
arg
->
flags
&
A1C_GEN_OER
)
?
""
:
"-DASN_DISABLE_OER_SUPPORT "
,
(
arg
->
flags
&
A1C_GEN_PER
)
?
""
:
"-DASN_DISABLE_PER_SUPPORT "
,
(
arg
->
flags
&
A1C_PDU_TYPE
)
?
generate_pdu_C_definition
()
:
""
,
need_to_generate_pdu_collection
(
arg
)
?
"-DASN_PDU_COLLECTION "
:
""
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
safe_fprintf
(
mkf
,
"%s%s"
,
i
?
" "
:
""
,
argv
[
i
]);
...
...
@@ -574,10 +575,13 @@ generate_pdu_C_definition(void) {
if
(
pduTypes
==
0
)
return
""
;
def
=
malloc
(
strlen
(
pduType
[
0
].
typename
)
+
20
);
assert
(
def
);
strcpy
(
def
,
"
-DPDU="
);
for
(
src
=
pduType
[
0
].
typename
,
dst
=
def
+
7
;
*
src
;
src
++
,
dst
++
)
if
((
*
dst
=
*
src
)
==
'-'
)
strcpy
(
def
,
"
-DPDU="
);
for
(
src
=
pduType
[
0
].
typename
,
dst
=
def
+
6
;
*
src
;
src
++
,
dst
++
)
{
if
((
*
dst
=
*
src
)
==
'-'
)
{
*
dst
=
'_'
;
}
}
*
dst
++
=
' '
;
*
dst
=
0
;
return
def
;
}
...
...
skeletons/file-dependencies
View file @
a4f3d467
...
...
@@ -16,7 +16,7 @@ INTEGER.h INTEGER.c
ISO646String.h ISO646String.c
NULL.h NULL.c BOOLEAN.h
NativeEnumerated.h NativeEnumerated.c NativeInteger.h
NativeInteger.h NativeInteger.c INTEGER.h
NativeInteger_oer.c
NativeInteger.h NativeInteger.c INTEGER.h
NativeReal.h NativeReal.c REAL.h
NumericString.h NumericString.c
OBJECT_IDENTIFIER.h OBJECT_IDENTIFIER.c INTEGER.h
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment