Skip to content

Commit

Permalink
Support for debug builds on all platforms. Reference: #80
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Jul 12, 2020
1 parent bbb6be5 commit a180a72
Show file tree
Hide file tree
Showing 14 changed files with 254 additions and 4 deletions.
2 changes: 2 additions & 0 deletions build_linux_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if [ ! -d "build/units_v7_x64" ]; then
fi
fpc -Px86_64 @src/v7/linux-x64.cfg -B src/v7/dss_capi_v7.lpr
bash custom_link.sh lib/linux_x64
fpc -Px86_64 @src/v7/linux-x64-dbg.cfg -B src/v7/dss_capi_v7d.lpr
bash custom_link.sh lib/linux_x64

# if [ ! -d "build/units_v8_x64" ]; then
# mkdir build/units_v8_x64
Expand Down
2 changes: 2 additions & 0 deletions build_linux_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if [ ! -d "build/units_v7_x86" ]; then
fi
fpc -Pi386 @src/v7/linux-x86.cfg -B src/v7/dss_capi_v7.lpr
bash custom_link.sh lib/linux_x86
fpc -Pi386 @src/v7/linux-x86-dbg.cfg -B src/v7/dss_capi_v7d.lpr
bash custom_link.sh lib/linux_x86

# if [ ! -d "build/units_v8_x86" ]; then
# mkdir build/units_v8_x86
Expand Down
10 changes: 10 additions & 0 deletions build_macos_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ NEW_LIBKLUSOLVE="@loader_path/./libklusolve.dylib"
install_name_tool -change "$CURRENT_LIBKLUSOLVE" "$NEW_LIBKLUSOLVE" "$DSS_CAPI_LIB"
install_name_tool -id "@loader_path/./libdss_capi_v7.dylib" "$DSS_CAPI_LIB"

fpc -Px86_64 @src/v7/darwin-x64-dbg.cfg -B src/v7/dss_capi_v7d.lpr
bash custom_link.sh lib/darwin_x64

# Make the lib look in the same folder for KLUSolve
DSS_CAPI_LIB="lib/darwin_x64/libdss_capi_v7d.dylib"
CURRENT_LIBKLUSOLVE=`otool -L "$DSS_CAPI_LIB" | grep libklusolve | cut -f 1 -d ' ' | sed $'s/^[ \t]*//'`
NEW_LIBKLUSOLVE="@loader_path/./libklusolve.dylib"
install_name_tool -change "$CURRENT_LIBKLUSOLVE" "$NEW_LIBKLUSOLVE" "$DSS_CAPI_LIB"
install_name_tool -id "@loader_path/./libdss_capi_v7.dylib" "$DSS_CAPI_LIB"

# if [ ! -d "build/units_v8_x64" ]; then
# mkdir build/units_v8_x64
# fi
Expand Down
27 changes: 26 additions & 1 deletion build_win_x64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if exist lib\win_x64\dss_capi_v7.dll (
where /q dumpbin
if errorlevel 1 (
echo WARNING: dumpbin.exe is not in your path. Be sure to run this script on
echo the "x64 Native Tools Command Prompt for VS 2017" or the
echo the "Developer Command Prompt for VS 2019" or the
echo equivalent for your Visual Studio version.
exit /B 1
)
Expand All @@ -45,6 +45,31 @@ if exist lib\win_x64\dss_capi_v7.dll (
exit /B 1
)

fpc -Px86_64 @src\v7\windows-x64-dbg.cfg -B src\v7\dss_capi_v7d.lpr
if errorlevel 1 exit /B 1
if exist lib\win_x64\dss_capi_v7d.dll (
where /q dumpbin
if errorlevel 1 (
echo WARNING: dumpbin.exe is not in your path. Be sure to run this script on
echo the "Developer Command Prompt for VS 2019" or the
echo equivalent for your Visual Studio version.
exit /B 1
)
dumpbin /exports "lib\win_x64\dss_capi_v7d.dll" > lib\win_x64\exports.txt
echo LIBRARY DSS_CAPI_V7D > lib\win_x64\dss_capi_v7d.def
echo EXPORTS >> lib\win_x64\dss_capi_v7d.def
for /f "skip=19 tokens=4" %%A in (lib\win_x64\exports.txt) do echo %%A >> lib\win_x64\dss_capi_v7d.def
lib /def:lib\win_x64\dss_capi_v7d.def /out:lib\win_x64\dss_capi_v7d.lib /machine:X64
dlltool --as-flags=--64 -d lib\win_x64\dss_capi_v7d.def -m i386:x86-64 -l lib\win_x64\dss_capi_v7d.dll.a

del /s lib\win_x64\dss_capi_v7d.exp
del /s lib\win_x64\dss_capi_v7d.def
del /s lib\win_x64\exports.txt
) else (
echo ERROR: DSS_CAPI_V7D.DLL file not found. Check previous messages for possible causes.
exit /B 1
)

REM fpc -Px86_64 @src\v8\windows-x64.cfg -B src\v8\dss_capi_v8.lpr
REM if errorlevel 1 exit /B 1
REM if exist lib\win_x64\dss_capi_v8.dll (
Expand Down
27 changes: 26 additions & 1 deletion build_win_x86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if exist lib\win_x86\dss_capi_v7.dll (
where /q dumpbin
if errorlevel 1 (
echo WARNING: dumpbin.exe is not in your path. Be sure to run this script on
echo the "x86 Native Tools Command Prompt for VS 2017" or the
echo the "Developer Command Prompt for VS 2019" or the
echo equivalent for your Visual Studio version.
exit /B 1
)
Expand All @@ -44,6 +44,31 @@ if exist lib\win_x86\dss_capi_v7.dll (
exit /B 1
)

fpc -Pi386 @src\v7\windows-x86-dbg.cfg -B src\v7\dss_capi_v7d.lpr
if errorlevel 1 exit /B 1
if exist lib\win_x86\dss_capi_v7d.dll (
where /q dumpbin
if errorlevel 1 (
echo WARNING: dumpbin.exe is not in your path. Be sure to run this script on
echo the "Developer Command Prompt for VS 2019" or the
echo equivalent for your Visual Studio version.
exit /B 1
)
dumpbin /exports "lib\win_x86\dss_capi_v7d.dll" > lib\win_x86\exports.txt
echo LIBRARY DSS_CAPI_V7D > lib\win_x86\dss_capi_v7d.def
echo EXPORTS >> lib\win_x86\dss_capi_v7d.def
for /f "skip=19 tokens=4" %%A in (lib\win_x86\exports.txt) do echo %%A >> lib\win_x86\dss_capi_v7d.def
lib /def:lib\win_x86\dss_capi_v7d.def /out:lib\win_x86\dss_capi_v7d.lib /machine:X86
dlltool -d lib\win_x86\dss_capi_v7d.def -m i386 -l lib\win_x86\dss_capi_v7d.dll.a

del /s lib\win_x86\dss_capi_v7d.exp
del /s lib\win_x86\dss_capi_v7d.def
del /s lib\win_x86\exports.txt
) else (
echo ERROR: DSS_CAPI_V7D.DLL file not found. Check previous messages for possible causes.
exit /B 1
)

REM fpc -Pi386 @src\v8\windows-x86.cfg -B src\v8\dss_capi_v8.lpr
REM if errorlevel 1 exit /B 1
REM if exist lib\win_x86\dss_capi_v8.dll (
Expand Down
38 changes: 38 additions & 0 deletions src/v7/darwin-x64-dbg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#DEFINE DSS_CAPI
#DEFINE DSS_CAPI_MVMULT
#DEFINE DSS_CAPI_HASHLIST
-Mdelphi
-Px86_64
-FUbuild/units_v7_x64
-Fd
-Fi./Version7/Source/CMD
-Fu./Version7/Source/Controls
-Fu./Version7/Source/Executive
-Fu./Version7/Source/General
-Fu./Version7/Source/Meters
-Fu./Version7/Source/Parser
-Fu./Version7/Source/PCElements
-Fu./Version7/Source/PDElements
-Fu./Version7/Source/Shared
-Fu./Version7/Source/Common
-Fu./Version7/Source/CMD
-Fu./src
-Fllib/darwin_x64
-k-Llib/darwin_x64
-FElib/darwin_x64
-Scghi
-CF64
-Cg
-O1
-g
-gw3
-gostabsabsincludes
-godwarfmethodclassprefix
-l
-vew
-vm5025,5027,5029,9001
-Tdarwin
-k-lc
-k-lm
-k-lklusolve
-sh
3 changes: 3 additions & 0 deletions src/v7/dss_capi_v7.lpr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{$IFNDEF DSS_CAPI_DEBUG_BUILD}
library dss_capi_v7;
{$ENDIF}

{$MODE Delphi}
{$APPTYPE CONSOLE}

Expand Down
3 changes: 3 additions & 0 deletions src/v7/dss_capi_v7d.lpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{$DEFINE DSS_CAPI_DEBUG_BUILD}
library dss_capi_v7d;
{$I './dss_capi_v7.lpr'}
39 changes: 39 additions & 0 deletions src/v7/linux-x64-dbg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#DEFINE DSS_CAPI
#DEFINE DSS_CAPI_MVMULT
#DEFINE DSS_CAPI_HASHLIST
-Mdelphi
-Px86_64
-FUbuild/units_v7_x64
-Fd
-Fi./Version7/Source/CMD
-Fu./Version7/Source/Controls
-Fu./Version7/Source/Executive
-Fu./Version7/Source/General
-Fu./Version7/Source/Meters
-Fu./Version7/Source/Parser
-Fu./Version7/Source/PCElements
-Fu./Version7/Source/PDElements
-Fu./Version7/Source/Shared
-Fu./Version7/Source/Common
-Fu./Version7/Source/CMD
-Fu./src
-Fllib/linux_x64
-FElib/linux_x64
-Scghi
-CF64
-Cg
-O1
-g
-gw3
-gostabsabsincludes
-godwarfmethodclassprefix
-l
-vew
-vm5025,5027,5029,9001
-Tlinux
-k-lc
-k-lm
-k-Llib/linux_x64
-k-lklusolve
-k-R$ORIGIN/.
-sh
39 changes: 39 additions & 0 deletions src/v7/linux-x86-dbg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#DEFINE DSS_CAPI
#DEFINE DSS_CAPI_MVMULT
#DEFINE DSS_CAPI_HASHLIST
-Mdelphi
-Pi386
-FUbuild/units_v7_x86
-Fd
-Fi./Version7/Source/CMD
-Fu./Version7/Source/Controls
-Fu./Version7/Source/Executive
-Fu./Version7/Source/General
-Fu./Version7/Source/Meters
-Fu./Version7/Source/Parser
-Fu./Version7/Source/PCElements
-Fu./Version7/Source/PDElements
-Fu./Version7/Source/Shared
-Fu./Version7/Source/Common
-Fu./Version7/Source/CMD
-Fu./src
-Fllib/linux_x86
-FElib/linux_x86
-Scghi
-CF64
-Cg
-O1
-g
-gw3
-gostabsabsincludes
-godwarfmethodclassprefix
-l
-vew
-vm5025,5027,5029,9001
-Tlinux
-k-lc
-k-lm
-k-Llib/linux_x86
-k-lklusolve
-k-R$ORIGIN/.
-sh
33 changes: 33 additions & 0 deletions src/v7/windows-x64-dbg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#DEFINE DSS_CAPI
#DEFINE DSS_CAPI_MVMULT
#DEFINE DSS_CAPI_HASHLIST
-Mdelphi
-Px86_64
-FUbuild/units_v7_x64
-Fd
-Fi./Version7/Source/CMD
-Fu./Version7/Source/Controls
-Fu./Version7/Source/Executive
-Fu./Version7/Source/General
-Fu./Version7/Source/Meters
-Fu./Version7/Source/Parser
-Fu./Version7/Source/PCElements
-Fu./Version7/Source/PDElements
-Fu./Version7/Source/Shared
-Fu./Version7/Source/Common
-Fu./Version7/Source/CMD
-Fu./src
-Fllib/win_x64
-FElib/win_x64
-Scghi
-CF64
-Si
-O1
-g
-gw3
-gostabsabsincludes
-godwarfmethodclassprefix
-l
-vew
-WB
-vm5025,5027,5029,9001
1 change: 0 additions & 1 deletion src/v7/windows-x64.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
-FElib/win_x64
-Scghi
-CF64
-Ct
-O3
-l
-vew
Expand Down
33 changes: 33 additions & 0 deletions src/v7/windows-x86-dbg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#DEFINE DSS_CAPI
#DEFINE DSS_CAPI_MVMULT
#DEFINE DSS_CAPI_HASHLIST
-Mdelphi
-Pi386
-FUbuild/units_v7_x86
-Fd
-Fi./Version7/Source/CMD
-Fu./Version7/Source/Controls
-Fu./Version7/Source/Executive
-Fu./Version7/Source/General
-Fu./Version7/Source/Meters
-Fu./Version7/Source/Parser
-Fu./Version7/Source/PCElements
-Fu./Version7/Source/PDElements
-Fu./Version7/Source/Shared
-Fu./Version7/Source/Common
-Fu./Version7/Source/CMD
-Fu./src
-Fllib/win_x86
-FElib/win_x86
-Scghi
-CF64
-Si
-O1
-g
-gw3
-gostabsabsincludes
-godwarfmethodclassprefix
-l
-vew
-WB
-vm5025,5027,5029,9001
1 change: 0 additions & 1 deletion src/v7/windows-x86.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
-FElib/win_x86
-Scghi
-CF64
-Ct
-O3
-l
-vew
Expand Down

0 comments on commit a180a72

Please sign in to comment.