Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
Use the right compiler to compile C constants files
Browse files Browse the repository at this point in the history
gcc had been kept hardcoded in constants.sh, while it should have
been replaced by the right compiler.
  • Loading branch information
samueltardieu committed Dec 8, 2012
1 parent 565065f commit e7834a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ constants_nodef: constants.c config.h

sockets-constants.ads: $(srcdir)/constants.sh split constants_nodef
$(SHELL) $(srcdir)/constants.sh Sockets.Constants $(srcdir) \
sockets-constants.ads
sockets-constants.ads "$(CC)"

split: $(srcdir)/split.adb
$(GNATMAKE) -g -O2 $(srcdir)/split.adb
Expand Down
7 changes: 4 additions & 3 deletions src/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
name=$1
srcdir=$2
fname=$3
CC="$4"

# List of constants we need to know

Expand Down Expand Up @@ -67,17 +68,17 @@ for c in ${constants}; do
*-*)
OIFS=${IFS}; IFS="-"; set ${c}; IFS=${OIFS}; \
echo "Checking value of $1 (or $2 as a substitute)"; \
(gcc -DCONSTANT_NAME=$1 -I. -o ${tmpe} ${srcdir}/constants.c \
(${CC} -DCONSTANT_NAME=$1 -I. -o ${tmpe} ${srcdir}/constants.c \
2>/dev/null &&
${tmpe} $1 >> ${fname}) ||
(gcc -DCONSTANT_NAME=$2 -I. -o ${tmpe} ${srcdir}/constants.c \
(${CC} -DCONSTANT_NAME=$2 -I. -o ${tmpe} ${srcdir}/constants.c \
2>/dev/null &&
${tmpe} $1 >> ${fname}) ||
./constants_nodef $1 >> ${fname}
;;
*)
echo "Checking value of $c"; \
(gcc -DCONSTANT_NAME=${c} -I. -o ${tmpe} ${srcdir}/constants.c \
(${CC} -DCONSTANT_NAME=${c} -I. -o ${tmpe} ${srcdir}/constants.c \
2>/dev/null && \
${tmpe} ${c} >> ${fname}) || \
./constants_nodef ${c} >> ${fname}
Expand Down

0 comments on commit e7834a6

Please sign in to comment.