Skip to content

Commit 18a1d04

Browse files
authored
Merge pull request uniconproject#437 from Jafaral/debugall
config: improve debug options/reporting, strip, musl
2 parents a56f870 + 23135b8 commit 18a1d04

File tree

13 files changed

+135
-85
lines changed

13 files changed

+135
-85
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
uses: actions/checkout@v3
208208

209209
- name: Configure
210-
run: ./configure CFLAGS=-fno-pie LDFLAGS=-no-pie --disable-iconc
210+
run: ./configure --disable-iconc
211211
shell: alpine.sh {0}
212212

213213
- name: Make

Makedefs.in

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ LIBTP=libtp
4040
# Do we want to build iconc? If so, set to Iconc
4141
ICONCTARGET=@ICONCTARGET@
4242

43-
# with strip
44-
DASHX=@DASHX@
45-
4643
# If graphics is enabled
4744
GRAPHICS= @GRAPHICS@
4845
XL= @XL@
@@ -77,6 +74,8 @@ MAKEINFO = makeinfo
7774
TEXI2DVI = texi2dvi
7875
RANLIB = ranlib
7976

77+
STRIP=@STRIP@
78+
8079
UNICONX=@UNICONX@
8180
UNICONWX=@UNICONWX@
8281
UNICONC=@UNICONC@

configure

+54-28
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ GL_LDFLAGS
627627
GL_CFLAGS
628628
JV_LDFLAGS
629629
PLUGINS
630+
STRIP
630631
DASHG
631-
DASHX
632632
DASHS
633633
SLNT
634634
CMNT
@@ -2977,29 +2977,40 @@ unicon_osrel=$OSREL
29772977
case $host_os in
29782978
*linux*)
29792979
unicon_os="linux"
2980-
2981-
# if dist/version are not set, try to guess them
2982-
if test x$unicon_osdist = x ; then
2983-
if test -f /etc/os-release ; then
2984-
. /etc/os-release
2985-
unicon_osdist=$NAME
2986-
unicon_osrel=$VERSION_ID
2987-
elif type lsb_release >/dev/null 2>&1; then
2988-
unicon_osdist=$(lsb_release -si)
2989-
unicon_osrel=$(lsb_release -sr)
2990-
elif test -f /etc/lsb-release ; then
2991-
. /etc/lsb-release
2992-
unicon_osdist=$DISTRIB_ID
2993-
unicon_osrel=$DISTRIB_RELEASE
2994-
elif test -f /etc/debian_version ; then
2995-
unicon_osdist=Debian
2996-
unicon_osrel=$(cat /etc/debian_version)
2997-
fi
2998-
fi
2980+
# if dist/version are not set, try to guess them
2981+
if test x$unicon_osdist = x ; then
2982+
if test -f /etc/os-release ; then
2983+
. /etc/os-release
2984+
unicon_osdist=$NAME
2985+
unicon_osrel=$VERSION_ID
2986+
elif type lsb_release >/dev/null 2>&1; then
2987+
unicon_osdist=$(lsb_release -si)
2988+
unicon_osrel=$(lsb_release -sr)
2989+
elif test -f /etc/lsb-release ; then
2990+
. /etc/lsb-release
2991+
unicon_osdist=$DISTRIB_ID
2992+
unicon_osrel=$DISTRIB_RELEASE
2993+
elif test -f /etc/debian_version ; then
2994+
unicon_osdist=Debian
2995+
unicon_osrel=$(cat /etc/debian_version)
2996+
fi
2997+
fi
29992998

30002999

30013000
$as_echo "#define UNIX 1" >>confdefs.h
30023001

3002+
3003+
case $host_os in
3004+
*musl*)
3005+
3006+
$as_echo "#define __MUSL__ 1" >>confdefs.h
3007+
3008+
MUSLFLG="-D__MUSL__"
3009+
CFLAGS="-fno-pie $CFLAGS"
3010+
LDFLAGS=" -no-pie $LDFLAGS"
3011+
;;
3012+
esac
3013+
30033014
;;
30043015
*solaris*)
30053016
unicon_os="solaris"
@@ -3020,7 +3031,7 @@ $as_echo "#define UNIX 1" >>confdefs.h
30203031

30213032
;;
30223033
*bsd*)
3023-
# freebsd for now
3034+
# freebsd for now
30243035
unicon_os="freebsd"
30253036

30263037
$as_echo "#define UNIX 1" >>confdefs.h
@@ -3200,6 +3211,7 @@ else
32003211
thin=no
32013212
fi
32023213

3214+
32033215
# Check whether --enable-debug was given.
32043216
if test "${enable_debug+set}" = set; then :
32053217
enableval=$enable_debug; debug=yes
@@ -3223,11 +3235,12 @@ fi
32233235

32243236
# Check whether --enable-devmode was given.
32253237
if test "${enable_devmode+set}" = set; then :
3226-
enableval=$enable_devmode; devmode=yes
3238+
enableval=$enable_devmode; devmode=$enableval
32273239
else
32283240
devmode=no
32293241
fi
32303242

3243+
32313244
# Check whether --enable-werror was given.
32323245
if test "${enable_werror+set}" = set; then :
32333246
enableval=$enable_werror; werror=yes
@@ -3242,6 +3255,7 @@ else
32423255
warn=no
32433256
fi
32443257

3258+
32453259
# Check whether --enable-uniconx was given.
32463260
if test "${enable_uniconx+set}" = set; then :
32473261
enableval=$enable_uniconx; uniconx=yes
@@ -4741,24 +4755,30 @@ else
47414755
UNICONWT=wicont
47424756
fi
47434757

4744-
if test x"$devmode" = x"yes" ; then
4758+
if test x"$devmode" = x"yes" || test x"$devmode" = x"all"; then
47454759
debug=yes
47464760
warn=yes
47474761

47484762
$as_echo "#define DEVELOPMODE 1" >>confdefs.h
47494763

4764+
if test x"$devmode" = x"all"; then
4765+
debugheap=yes
4766+
verifyheap=yes
4767+
fi
47504768
fi
47514769

47524770
if test x"$debugheap" = x"yes" ; then
47534771

47544772
$as_echo "#define DebugHeap 1" >>confdefs.h
47554773

4774+
debugheapreport="DebugHeap"
47564775
fi
47574776

47584777
if test x"$verifyheap" = x"yes" ; then
47594778

47604779
$as_echo "#define VerifyHeap 1" >>confdefs.h
47614780

4781+
verifyheapreport="VerifyHeap"
47624782
fi
47634783

47644784
if test x"$udbtools" = x"yes" ; then
@@ -7022,7 +7042,7 @@ esac
70227042

70237043
OBJ=o
70247044
CFUNCTARGET="cfun"
7025-
CFDYN="-fPIC "
7045+
CFDYN="-fPIC $MUSLFLG "
70267046
LDDYN="-shared "
70277047
SO=so
70287048
# OS specific flags go here
@@ -7042,7 +7062,6 @@ case $unicon_host in
70427062
;;
70437063
*macos*)
70447064
LDDYN="-Xlinker -undefined -Xlinker dynamic_lookup -shared "
7045-
DASHX=-x
70467065
RLIBS="-ldl "
70477066
;;
70487067
*windows*)
@@ -7080,11 +7099,16 @@ if test "x$iconc" = "xyes" || test "x$iconc" = "xon" ; then
70807099
ICONCTARGET=Iconc
70817100
fi
70827101

7083-
70847102
if test "x$orig_cflags" != "x" ; then
70857103
CFLAGS="$CFLAGS $orig_cflags"
70867104
fi
70877105

7106+
if test x"$debug" = x"yes" ; then
7107+
STRIP="@\#strip"
7108+
else
7109+
STRIP=strip
7110+
fi
7111+
70887112

70897113

70907114

@@ -17122,9 +17146,11 @@ LDFLAGS :$LDFLAGS
1712217146
LIBS : $LIBS
1712317147
CXX : $CXX (Required only with FTGL and VOIP)
1712417148
CXXFLAGS : $CXXFLAGS
17125-
prefix : $prefix
17149+
CFDYN : $CFDYN
17150+
LDDYN : $LDDYN
17151+
prefix : $prefix
1712617152
Verbose : $verbosebuild
17127-
Debug : $debug
17153+
Debug : $debug $debugheapreport $verifyheapreport
1712817154
Warnings : $warn
1712917155
Werror : $werror
1713017156
Devmode : $devmode

0 commit comments

Comments
 (0)