# Configuration

2024-10-29 화
2026-03-11 수

## 1. sshfs, cifs, smbfs

~~~sh
# Alpine
apk add cifs-utils sshfs

# Debian, Ubuntu
apt install -y cifs-utils sshfs

# RHEL
dnf install -y cifs-utils sshfs

# FreeBSD
pkg install -y fusefs-smbnetfs fusefs-sshfs

# macOS
# mount_smbfs
~~~

## 2. 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
~~~

## 3. 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"
~~~

## 4. 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
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-ucrt-x86_64-tools-git

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
pacman -S mingw-w64-clang-x86_64-tools-git

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
~~~

## 5. 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

 % clang --version
Apple clang version 13.0.0 (clang-1300.0.29.30)
~~~

~~~zsh
xcode-select --install

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

brew install p7zip
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

URL=https://download.oracle.com/otn_software/mac/instantclient/198000
curL -LO ${URL}/instantclient-basiclite-macos.x64-19.8.0.0.0dbru.zip
curL -LO ${URL}/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.zip
curL -LO ${URL}/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
ln -s ~/opt/oracore ~/opt/instantclient_19_8/oracore

# .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=timezone_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}
~~~

## 6. 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

URL=https://download.oracle.com/otn_software/aix/instantclient/1930000
/opt/freeware/bin/curl -LO ${URL}/instantclient-basiclite-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/curl -LO ${URL}/instantclient-sdk-aix.ppc64-19.30.0.0.0dbru.zip
/opt/freeware/bin/curl -LO ${URL}/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=timezone_35.dat

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

## 7. Solaris 11.4

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

$ gcc --version
gcc (GCC) 14.2.0

$ clang --version
clang version 19.1.7
Target: x86_64-pc-solaris2.11
~~~

~~~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

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

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

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

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

## 8. FreeBSD 15.0

~~~text
$ uname -vm
FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64
FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC arm64

$ clang --version
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
~~~

~~~sh
pkg install git gmake mariadb-connector-c postgresql18-client sqlcipher sqlite3

# .profile
export LD_LIBRARY_PATH=~/build/lib
~~~

## 9. Debian, Ubuntu

~~~text
$ uname -srvm
Linux 6.12.73+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.73-1 (2026-02-17) x86_64
Linux 6.12.73+deb13-arm64 #1 SMP Debian 6.12.73-1 (2026-02-17) aarch64

$ gcc --version
gcc (Debian 14.2.0-19) 14.2.0

$ clang --version
Debian clang version 19.1.7 (3+b1)

$ uname -srvm
Linux 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb  9 10:15:05 UTC 2026 x86_64
Linux 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  6 20:07:40 UTC 2026 aarch64

$ gcc --version
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0

$ clang --version
Ubuntu clang version 18.1.3 (1ubuntu1)
~~~

~~~sh
apt install -y build-essential
apt install -y clang git
apt install -y libexpat1-dev libssl-dev
apt install -y libmariadb-dev postgresql-server-dev-all libsqlite3-dev libsqlcipher-dev
# apt install -y libexpat1 libmariadb3 libpq5 libsqlite3-0 libsqlcipher1
# apt install -y sqlite3 sqlcipher

# Firebird
apt install -y libtomcrypt1 libtommath1
# See. https://firebirdsql.org/en/firebird-5-0

# Oracle Instant Client
apt install -y libaio1t64
# FIX libaio1t64
ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/x86_64-linux-gnu/libaio.so.1
ln -s /usr/lib/aarch64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/aarch64-linux-gnu/libaio.so.1
# See. https://www.oracle.com/database/technologies/instant-client/downloads.html

# MSODBC
# See. https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
apt update
ACCEPT_EULA=Y apt install -y msodbcsql18
apt install -y unixodbc-dev

# .profile
export FIREBIRD=/opt/firebird-5.0.3
export INSTANTCLIENT=/opt/instantclient_21_20
export NLS_LANG=AMERICAN_AMERICA.UTF8
# export INSTANTCLIENT=/opt/instantclient_19_30
# export ORA_TZFILE=timezone_35.dat
export MSODBCSQL=/opt/microsoft/msodbcsql18

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

## 10. RHEL, RedHat, AlmaLinux Rocky Linux, Oracle Linux, Fedora

~~~text
$ uname -srvm
Linux 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_6
Linux 5.14.0-611.38.1.el9_7.aarch64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:22:46 EDT 2026 aarch64

$ gcc --version
gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-11)

$ clang --version
clang version 20.1.8 (AlmaLinux OS Foundation 20.1.8-3.el9)

$ uname -srvm
Linux 6.12.0-124.40.1.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Mar  4 07:39:03 EST 2026 x86_64
Linux 6.12.0-124.43.1.el10_1.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Mar 11 15:50:21 UTC 2026 aarch64

$ gcc --version
gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2)

$ clang --version
clang version 20.1.8 (AlmaLinux OS Foundation 20.1.8-1.el10.alma.1)
~~~

~~~sh
dnf group install -y development

dnf install -y clang git-core
dnf install -y expat-devel openssl-devel
dnf install -y mariadb-connector-c-devel libpq-devel sqlite-devel
[ $(sh -c '. /etc/os-release; echo ${VERSION_ID} | cut -d . -f 1') -lt 10 ] \
  && dnf install -y sqlcipher-devel
# dnf install -y expat mariadb-connector-c libpq sqlite-devel sqlcipher-devel
# dnf install -y sqlite3 sqlcipher

# scp -p $(pg_config --includedir-server)/catalog/pg_type_d.h g00e09x64e10:./
mkdir -p $(pg_config --includedir-server)/catalog/ && chown root:root pg_type_d.h && mv pg_type_d.h $(pg_config --includedir-server)/catalog/

# Firebird
dnf install -y libtomcrypt libtommath
# See. https://firebirdsql.org/en/firebird-5-0

# Oracle Instant Client
dnf install -y libaio
# See. https://www.oracle.com/database/technologies/instant-client/downloads.html

# MSODBC
# See. https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

ACCEPT_EULA=Y dnf install -y msodbcsql18 mssql-tools18
dnf install -y unixODBC-devel

# .profile
export FIREBIRD=/opt/firebird-5.0.3
export INSTANTCLIENT=/opt/instantclient_21_20
export NLS_LANG=AMERICAN_AMERICA.UTF8
# export INSTANTCLIENT=/opt/instantclient_19_30
# export ORA_TZFILE=timezone_35.dat
export MSODBCSQL=/opt/microsoft/msodbcsql18

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

## 11. Alpine

~~~text
$ uname -srvm
Linux 6.18.16-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2026-03-06 16:18:20 x86_64
Linux 6.18.7-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2026-01-26 18:22:53 aarch64

$ gcc --version
gcc (Alpine 15.2.0) 15.2.0

$ clang --version
Alpine clang version 21.1.2
~~~

~~~sh
apk add clang git
apk add expat-dev openssl-dev
apk add mariadb-connector-c-dev postgresql18-dev sqlite-dev sqlcipher-dev
# apk add expat openssl mariadb-connector-c libpq sqlite-libs sqlcipher-libs
# apk add sqlite sqlcipher

# MSODBC
architecture="amd64"
architecture="arm64"
curl -O https://download.microsoft.com/download/9dcab408-e0d4-4571-a81a-5a0951e3445f/msodbcsql18_18.6.1.1-1_$architecture.apk
apk add --allow-untrusted msodbcsql18_18.6.1.1-1_$architecture.apk
rm -f msodbcsql18_18.6.1.1-1_$architecture.apk

apk add unixodbc-dev

# .profile
export MSODBCSQL=/opt/microsoft/msodbcsql18
export LD_LIBRARY_PATH=~/work/build/lib
~~~
