# Configuration

2024-10-29 화
2026-02-21 토

## 1. Ubuntu, Debian

<https://www.debian.org/distrib/packages>

~~~sh
# Development Tools
apt install -y build-essential gdb | tee ~/apt/apt_install_24102411_build-essential,gdb.txt

# dependencies
apt install -y libexpat1-dev libssl-dev | tee ~/apt/apt_install_24102411_libexpat1-dev,libssl-dev.txt
apt install -y libmariadb-dev-compat | tee ~/apt/apt_install_24112111_libmariadb-dev-compat.txt
apt install -y libpq-dev | tee ~/apt/apt_install_26011512_libpq-dev.txt
apt install -y sqlite3 libsqlite3-dev | tee ~/apt/apt_install_26012010_sqlite3,libsqlite3-dev.txt
apt install -y sqlcipher libsqlcipher-dev | tee ~/apt/apt_install_26012010_sqlcipher,libsqlcipher-dev.txt

# unixODBC
curl -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
dpkg -L packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb | tee ~/apt/apt_install_25112517_dpkg_install_packages-microsoft-prod.txt
rm - packages-microsoft-prod.deb

apt update
ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18 | tee ~/apt/apt_install_25112517_msodbcsql18,mssql-tools18.txt
apt install -y unixodbc-dev | tee ~/apt/apt_install_25112517_unixodbc-dev.txt
apt install -y odbc-postgresql | tee ~/apt/apt_install_25112517_odbc-postgresql.txt

# FIX libaio1t64
ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/x86_64-linux-gnu/libaio.so.1

# build for httpd-2.4
apt install -y libapr1-dev libaprutil1-dev | tee ~/apt/apt_install_24121117_libapr1-dev,libaprutil1-dev.txt
apt install -y libpcre2-dev | tee ~/apt/apt_install_24121117_libpcre2-dev.txt

apt install -y clang | tee ~/apt/apt_install_25060313_clang.txt
~~~

### sshfs

~~~sh
apt install -y sshfs | tee ~/apt/apt_install_24102515_sshfs.txt

# .profile
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
[ -d $(dirname ${SSH_AUTH_SOCK}) ] || mkdir -p $(dirname ${SSH_AUTH_SOCK})

echo
echo 'Hints..'
echo "ssh-agent -a ${SSH_AUTH_SOCK}; ssh-add"
echo 'sshfs daejung@g01r09:/home/daejung/work/dcl /home/daejung/work/dcl'
~~~

## 2. Rocky, RedHat, Fedora

<https://www.rpmfind.net/>

~~~sh
# Development Tools
dnf group info development

dnf group install -y development | tee ~/dnf/dnf_group_install_24102913_development.txt

# dependeicies
dnf install -y expat-devel openssl-devel | tee ~/dnf/dnf_install_24102913_expat-devel,openssl-devel.txt
dnf install -y mariadb-connector-c-devel | tee ~/dnf/dnf_install_24111014_mariadb-connector-c-devel.txt
dnf install -y libpq-devel | tee ~/dnf/dnf_install_26011512_libpq-devel.txt
dnf install -y sqlite sqlite-devel | tee ~/dnf/dnf_install_26012011_sqlite,sqlite-devel.txt
dnf install -y sqlcipher sqlcipher-devel | tee ~/dnf/dnf_install_26012011_sqlcipher,sqlcipher-devel.txt

# unixODBC
dnf install -y https://packages.microsoft.com/config/rhel/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2 | cut -d '.' -f 1)/packages-microsoft-prod.rpm | tee ~/dnf/dnf_install_25112515_packages-microsoft-prod.txt

ACCEPT_EULA=Y dnf install -y msodbcsql18 | tee ~/dnf/dnf_install_25112515_msodbcsql18.txt
dnf install -y unixODBC-devel | tee ~/dnf/dnf_install_25112515_unixODBC-devel.txt
dnf install -y postgresql-odbc | tee ~/dnf/dnf_install_25112515_postgresql-odbc.txt
ACCEPT_EULA=Y dnf install -y mssql-tools18 | tee ~/dnf/dnf_install_25112516_mssql-tools18.txt

# build for httpd-2.4
dnf install -y apr-devel apr-util-devel | tee ~/dnf/dnf_install_24121117_apr-devel,apr-util-devel.txt
dnf install -y pcre2-devel | tee ~/dnf/dnf_install_24121117_pcre2-devel.txt

dnf install -y clang | tee ~/dnf/dnf_install_25062211_clang.txt
~~~

### cifs

~~~sh
dnf install -y cifs-utils | tee ~/dnf/dnf_install_23062009_cifs-utils.txt

mkdir /root/cloud-k8s

vi /etc/fstab
//n0317ud70p/work/cpp/dcl /home/work/cpp/dcl cifs ro,noauto,user   0 0

systemctl daemon-reload
mount -a
df

apt install -y cifs-utils | tee ~/apt/apt_install_24112115_cifs-utils.txt
~~~

## 3. VSCode

[C/C++ Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)

## 4. Predefined macros

- [GCC](https://gcc.gnu.org/onlinedocs/gcc/Option-Index.html)
- [Clang](https://clang.llvm.org/docs/genindex.html)

~~~sh
# clang
clang -dM -E -x c /dev/null
# gcc
cpp -dM -E /dev/null
# msvc
cl /PD /Zc:preprocessor /E a.c
~~~

## 5. Visual Studio

~~~sh
REM 2024-11-14 목, 2025-04-29 화, 2025-12-03

set EXPAT_INCL=D:\Work\sdn\build\expat-win32bin-2.6.3\Source\lib
set APACHE=D:\Opt\Apache24

set FIREBIRD=D:\Opt\Firebird
set INTERBASE=D:\Opt\InterBase
set INFORMIXDIR=D:\Opt\informix
set INSTANTCLIENT=D:\Opt\instantclient_21_19
set MARIADB=D:\Opt\mariadb-connector-c-3.4.3
set MSODBCSQL=C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\180\SDK
set POSTGRESQL=D:\Opt\PostgreSQL17
set SQLITE=D:\Opt\sqlite-amalgamation-3510100
set MEDIAINFO=C:\Program Files\MediaInfo

set Ext_IncludePath=%EXPAT_INCL%
set Ext_LibraryPath=%FIREBIRD%\lib;%INTERBASE%\SDK\lib_ms;%INFORMIXDIR%\lib;%INSTANTCLIENT%\sdk\lib\msvc;%MARIADB%\lib64;%MSODBCSQL%\Lib\x64;%POSTGRESQL%\lib;%APACHE%\lib

set BuildOut=D:\Work\sdn\build\x64\lib
set Path=%Path%;%BuildOut%;%FIREBIRD%;%INTERBASE%\bin;%INFORMIXDIR%\bin;%INSTANTCLIENT%;%MARIADB%\lib64;%POSTGRESQL%\bin;%MEDIAINFO%

cd D:\Work\sdn\build\x64\bin

"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe"
~~~

~~~sh
# 32bit
cd D:\Work\sdn\build\Win32\bin
set BuildOut=D:\Work\sdn\build\Win32\lib
set Path=%Path%;%BuildOut%

set Path=%Path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x86"

set Path=%Path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64"

set Path=%Path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx86\x86"

set Path=%Path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx86\x64"
~~~

## 6. MinGW

Minimalist GNU for Windows

- <https://www.mingw-w64.org/>
- <https://code.visualstudio.com/docs/cpp/config-mingw>
- [MSYS2](https://www.msys2.org/)

~~~sh
curl -LO https://github.com/msys2/msys2-installer/releases/download/2025-12-13/msys2-x86_64-20251213.exe
~~~

~~~sh
################################################################################
# UCRT64
# pacman -S mingw-w64-ucrt-x86_64-toolchain | tee ~/pacman/sync_25121413_mingw-w64-ucrt-x86_64-toolchain.txt

pacman -S make | tee ~/pacman/sync_25121413_make.txt
pacman -S mingw-w64-ucrt-x86_64-gcc \
  | tee ~/pacman/sync_25121413_mingw-w64-ucrt-x86_64-gcc.txt
pacman -S mingw-w64-ucrt-x86_64-tools-git \
  | tee ~/pacman/sync_25121413_mingw-w64-ucrt-x86_64-tools-git.txt

pacman -Q --info mingw-w64-ucrt-x86_64-gcc
pacman -Q --list mingw-w64-ucrt-x86_64-tools-git

pacman -S mingw-w64-ucrt-x86_64-expat \
  mingw-w64-ucrt-x86_64-apr mingw-w64-ucrt-x86_64-apr-util \
  mingw-w64-ucrt-x86_64-libmariadbclient \
  mingw-w64-ucrt-x86_64-postgresql \
  mingw-w64-ucrt-x86_64-unixodbc \
  mingw-w64-ucrt-x86_64-sqlcipher

DCL_SOURCE_ROOT=/D/Work/sdn/dcl
mkdir ucrt64; cd ucrt64; ${DCL_SOURCE_ROOT}/configure.sh; make

export APACHE=/D/opt/Apache24
export FIREBIRD=/D/opt/Firebird
export INTERBASE=/D/opt/InterBase
export INFORMIXDIR=/D/opt/informix
export INSTANTCLIENT=/D/opt/instantclient_21_19
# mingw에서 msodbcsql.h는 UNIX 배포파일을 사용.
export MSODBCSQL=/D/Opt/msodbcsql18
export MEDIAINFO="/C/Program Files/MediaInfo"
export PATH=${PATH}:~/ucrt64/lib:${INFORMIXDIR}/bin:${INSTANTCLIENT}:${MEDIAINFO}
cd ~/ucrt64

cd ~/ucrt64/lib

gendef ${APACHE}/bin/libhttpd.dll
dlltool -D ${APACHE}/bin/libhttpd.dll -d libhttpd.def -l libhttpd.dll.a

cp -a ${FIREBIRD}/fbclient.dll .
gendef fbclient.dll
dlltool -D fbclient.dll -d fbclient.def -l fbclient.dll.a

cp -a ${INTERBASE}/bin/ibclient64.dll .
gendef ibclient64.dll
dlltool -D ibclient64.dll -d ibclient64.def -l ibclient64.dll.a

# cp -a ${INSTANTCLIENT}/oci.dll .
# cp -a ${INSTANTCLIENT}/oraociicus.dll .
gendef ${INSTANTCLIENT}/oci.dll
dlltool -D ${INSTANTCLIENT}/oci.dll -d oci.def -l oci.dll.a

gendef ${INFORMIXDIR}/bin/igl4n304.dll
gendef ${INFORMIXDIR}/bin/iglxn304.dll
gendef ${INFORMIXDIR}/bin/igo4n304.dll
gendef ${INFORMIXDIR}/bin/isqlt09a.dll
dlltool -D ${INFORMIXDIR}/bin/igl4n304.dll -d igl4n304.def -l igl4n304.dll.a
dlltool -D ${INFORMIXDIR}/bin/iglxn304.dll -d iglxn304.def -l iglxn304.dll.a
dlltool -D ${INFORMIXDIR}/bin/igo4n304.dll -d igo4n304.def -l igo4n304.dll.a
dlltool -D ${INFORMIXDIR}/bin/isqlt09a.dll -d isqlt09a.def -l isqlt09a.dll.a

################################################################################
# CLANG64
# pacman -S mingw-w64-clang-x86_64-toolchain | tee ~/pacman/sync_25121413_mingw-w64-clang-x86_64-toolchain.txt

# pacman -S make | tee ~/pacman/sync_25121413_make.txt
pacman -S mingw-w64-clang-x86_64-clang \
  | tee ~/pacman/sync_25121414_mingw-w64-clang-x86_64-clang.txt
pacman -S mingw-w64-clang-x86_64-tools-git \
  | tee ~/pacman/sync_25121413_mingw-w64-clang-x86_64-tools-git.txt

pacman -Q --info mingw-w64-clang-x86_64-clang
pacman -Q --list mingw-w64-clang-x86_64-tools-git

pacman -S mingw-w64-clang-x86_64-expat \
  mingw-w64-clang-x86_64-apr mingw-w64-clang-x86_64-apr-util \
  mingw-w64-clang-x86_64-libmariadbclient \
  mingw-w64-clang-x86_64-postgresql \
  mingw-w64-clang-x86_64-unixodbc \
  mingw-w64-clang-x86_64-sqlcipher

DCL_SOURCE_ROOT=/D/Work/sdn/dcl
mkdir clang64; cd clang64; ${DCL_SOURCE_ROOT}/configure.sh; CC=clang make

export APACHE=/D/opt/Apache24
export FIREBIRD=/D/opt/Firebird
export INTERBASE=/D/opt/InterBase
export INFORMIXDIR=/D/opt/informix
export INSTANTCLIENT=/D/opt/instantclient_21_19
# mingw에서 msodbcsql.h는 UNIX 배포파일을 사용.
export MSODBCSQL=/D/Opt/msodbcsql18
export MEDIAINFO="/C/Program Files/MediaInfo"
export PATH=${PATH}:~/clang64/lib:${INFORMIXDIR}/bin:${INSTANTCLIENT}:${MEDIAINFO}
export CC=clang
cd ~/clang64

cd ~/clang64/lib

gendef ${APACHE}/bin/libhttpd.dll
dlltool -D ${APACHE}/bin/libhttpd.dll -d libhttpd.def -l libhttpd.dll.a

cp -a ${FIREBIRD}/fbclient.dll .
gendef fbclient.dll
dlltool -D fbclient.dll -d fbclient.def -l fbclient.dll.a

cp -a ${INTERBASE}/bin/ibclient64.dll .
gendef ibclient64.dll
dlltool -D ibclient64.dll -d ibclient64.def -l ibclient64.dll.a

gendef ${INFORMIXDIR}/bin/igl4n304.dll
gendef ${INFORMIXDIR}/bin/iglxn304.dll
gendef ${INFORMIXDIR}/bin/igo4n304.dll
gendef ${INFORMIXDIR}/bin/isqlt09a.dll
dlltool -D ${INFORMIXDIR}/bin/igl4n304.dll -d igl4n304.def -l igl4n304.dll.a
dlltool -D ${INFORMIXDIR}/bin/iglxn304.dll -d iglxn304.def -l iglxn304.dll.a
dlltool -D ${INFORMIXDIR}/bin/igo4n304.dll -d igo4n304.def -l igo4n304.dll.a
dlltool -D ${INFORMIXDIR}/bin/isqlt09a.dll -d isqlt09a.def -l isqlt09a.dll.a

# cp -a ${INSTANTCLIENT}/oci.dll .
# cp -a ${INSTANTCLIENT}/oraociicus.dll .
gendef ${INSTANTCLIENT}/oci.dll
dlltool -D ${INSTANTCLIENT}/oci.dll -d oci.def -l oci.dll.a
~~~

## 7. macOS

~~~text
% uname -v
Darwin Kernel Version 20.6.0: Thu Jul  6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64
~~~

~~~zsh
xcode-select --install

# https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install openssl
brew install mariadb-connector-c libpq sqlcipher sqlite

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18

curl -LO https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-macos-x64.pkg
sudo installer -pkg Firebird-5.0.3.1683-0-macos-x64.pkg -target /
FIREBIRD=~/opt/firebird-5.0.3
mkdir -p ${FIREBIRD}
ln -s /Library/Frameworks/Firebird.framework/Headers ${FIREBIRD}/include
ln -s /Library/Frameworks/Firebird.framework/Libraries/ ${FIREBIRD}/lib

curL -LO https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basiclite-macos.x64-19.8.0.0.0dbru.zip
curl -LO https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sdk-macos.x64-19.8.0.0.0dbru.zip
unzip instantclient-basiclite-macos.x64-19.8.0.0.0dbru.zip -d ~/opt
unzip instantclient-sdk-macos.x64-19.8.0.0.0dbru.zip -d ~/opt
unzip oracore-21.zip -d ~/opt/instantclient_19_8

# .zprofile
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'

export FIREBIRD=~/opt/firebird-5.0.3
export INSTANTCLIENT=~/opt/instantclient_19_8
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORA_TZFILE=timezlrg_35.dat
export MSODBCSQL=/usr/local/include/msodbcsql18
export MARIADB=/usr/local/opt/mariadb-connector-c
export POSTGRESQL=/usr/local/opt/libpq
export CC=clang

export PATH=${PATH}:${MARIADB}/bin:${POSTGRESQL}/bin
export DYLD_LIBRARY_PATH=~/work/build/lib:${FIREBIRD}/lib:${INSTANTCLIENT}
~~~

## 8. AIX 7.2

~~~text
# uname -pV
powerpc AIX 7.2
~~~

~~~sh
sh dnf_aixtoolbox.sh -d

/opt/freeware/bin/dnf install -y bash coreutils curl gcc gcc-c++ git make unzip zip
/opt/freeware/bin/dnf install -y expat-devel sqlite-devel

/opt/freeware/bin/curl -LO https://download.oracle.com/otn_software/aix/instantclient/1930000/instantclient-basiclite-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/curl -LO https://download.oracle.com/otn_software/aix/instantclient/1930000/instantclient-sdk-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/curl -LO https://download.oracle.com/otn_software/aix/instantclient/1930000/instantclient-sqlplus-aix.ppc64-19.30.0.0.0dbru.zip

/opt/freeware/bin/unzip -o instantclient-basiclite-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/unzip -o instantclient-sdk-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/unzip -o instantclient-sqlplus-aix.ppc64-19.30.0.0.0dbru.zip

smitty iocp

# .profile
export INSTANTCLIENT=/opt/instantclient_19_30
export NLS_LANG='AMERICAN_AMERICA.UTF8'
export ORA_TZFILE='/opt/instantclient_19_30/oracore/zoneinfo/big/timezlrg_35.dat'

export PATH=/opt/freeware/bin:/usr/bin:${INSTANTCLIENT}
export LIBPATH=~/work/build/lib:${INSTANTCLIENT}
~~~

## 9. Solaris 11.4

~~~text
$ uname -srvo
SunOS 5.11 11.4.81.193.1 Solaris
~~~

~~~sh
pkg install developer/llvm/clang-19
pkg list | /usr/xpg4/bin/grep -i -e expat -e sqlite -e gcc

pkg install developer/versioning/git

curl -LO https://download.oracle.com/otn_software/solaris/instantclient/1930000/instantclient-basiclite-solaris.x64-19.30.0.0.0dbru.zip
curl -LO https://download.oracle.com/otn_software/solaris/instantclient/1930000/instantclient-sdk-solaris.x64-19.30.0.0.0dbru.zip
curl -LO https://download.oracle.com/otn_software/solaris/instantclient/1930000/instantclient-sqlplus-solaris.x64-19.30.0.0.0dbru.zip

ls instantclient-*.zip | xargs -I {} 7z x -aoa "{}" && rm -rf META-INF

export LANG='en_US.UTF-8'
export INSTANTCLIENT=~/opt/instantclient_19_30
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORA_TZFILE=timezlrg_35.dat

export PATH=${PATH}:${INSTANTCLIENT}
export LD_LIBRARY_PATH=~/work/build/lib:${INSTANTCLIENT}
~~~
