#!/bin/bash # # KLayout Layout Viewer # Copyright (C) 2006-2025 Matthias Koefferlein # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # CURR_DIR=`pwd` RUN_MAKE=1 IS_MAC="no" IS_WINDOWS="no" IS_LINUX="no" HAVE_QTBINDINGS=1 HAVE_QT_UITOOLS=1 HAVE_QT_NETWORK=1 HAVE_QT_SQL=1 HAVE_QT_SVG=1 HAVE_QT_PRINTSUPPORT=1 HAVE_QT_MULTIMEDIA=1 HAVE_QT_DESIGNER=1 HAVE_QT_XML=1 HAVE_64BIT_COORD=0 HAVE_QT=1 HAVE_PNG=0 HAVE_CURL=0 HAVE_EXPAT=0 HAVE_GIT2=1 RUBYINCLUDE="" RUBYINCLUDE2="" RUBYLIBFILE="" RUBYVERSIONCODE="" PYTHONINCLUDE="" PYTHONLIBFILE="" PYTHONEXTSUFFIX="" QMAKE="" RUBY="" PYTHON="" BUILD="" BIN="" RPATH="" MAKE_OPT="" CONFIG="release" BUILD_EXPERT=0 # Check if building on Mac OSX Darwin family case `uname` in Linux*) IS_LINUX="yes" ;; MINGW*) IS_WINDOWS="yes" ;; CYGWIN*) IS_WINDOWS="yes" ;; Darwin*) IS_MAC="yes" ;; *) ;; esac # Check, whether build.sh is run from the top level folder if ! [ -e src ] || ! [ -e src/klayout.pro ]; then echo "*** ERROR: run build.sh from the top level folder" exit 1 fi while [ "$*" != "" ]; do a=$1 shift case $a in -without-qt) HAVE_QT=0 ;; -with-qtbinding) HAVE_QTBINDINGS=1 ;; -without-qtbinding) HAVE_QTBINDINGS=0 ;; -without-qt-uitools) HAVE_QT_UITOOLS=0 ;; -without-qt-network) HAVE_QT_NETWORK=0 ;; -without-qt-sql) HAVE_QT_SQL=0 ;; -without-qt-svg) HAVE_QT_SVG=0 ;; -without-qt-printsupport) HAVE_QT_PRINTSUPPORT=0 ;; -without-qt-multimedia) HAVE_QT_MULTIMEDIA=0 ;; -without-qt-designer) HAVE_QT_DESIGNER=0 ;; -without-qt-xml) HAVE_QT_XML=0 ;; -with-64bit-coord) HAVE_64BIT_COORD=1 ;; -without-64bit-coord) HAVE_64BIT_COORD=0 ;; -release) CONFIG="release" ;; -debug) CONFIG="debug" ;; -expert) BUILD_EXPERT=1 ;; -python) PYTHON="$1" shift ;; -nopython) PYTHON="-" ;; -pyinc) PYTHONINCLUDE="$1" shift ;; -pylib) PYTHONLIBFILE="$1" shift ;; -pyextsuffix) PYTHONEXTSUFFIX="$1" shift ;; -qmake) QMAKE="$1" shift ;; -ruby) RUBY="$1" shift ;; -noruby) RUBY="-" ;; -rbvers) RUBYVERSIONCODE="$1" shift ;; -rbinc) RUBYINCLUDE="$1" shift ;; -rbinc2) RUBYINCLUDE2="$1" shift ;; -rblib) RUBYLIBFILE="$1" shift ;; -build) BUILD="$1" shift ;; -bin|-prefix) BIN="$1" shift ;; -rpath) RPATH="$1" shift ;; -dry-run) RUN_MAKE=0 ;; -libpng) HAVE_PNG=1 ;; -libcurl) HAVE_CURL=1 ;; -libexpat) HAVE_EXPAT=1 ;; -nolibgit2) HAVE_GIT2=0 ;; -qt5) echo "*** WARNING: -qt5 option is ignored - Qt version is auto-detected now." ;; -qt4) echo "*** WARNING: -qt4 option is ignored - Qt version is auto-detected now." ;; -option) MAKE_OPT="$MAKE_OPT $1" shift ;; -h|--help|-help) echo "usage: build [options]" echo "" echo "options:" echo "" echo " -debug Run a debug build" echo " -release Run a release build [default]" echo "" echo " -qmake Use qmake 'prog'" echo "" echo " -noruby Don't build with Ruby support" echo " -ruby Use Ruby interpreter 'prog'" echo "" echo " -nopython Don't build with Python support" echo " -python Use Python interpreter 'prog'" echo "" echo " -build Directory where to do the build" echo " -bin|-prefix Directory where to install the binary" echo " -rpath Specifies the RPATH to use (default: same as -bin)" echo " -option