Skip to content

Commit

Permalink
top autoconf/make changes to improve build
Browse files Browse the repository at this point in the history
the following helps in doing out of tree builds which helps keep things clearer
The new .in files here are effectively the icecast nsis files moved and made
more like a template. The names match for mingw but similar styles could be done
for other compilers. They only get used in the mingw case as determined by

The conditional compile is done a different way in automake, this seem to be
causing a pic/non-pic builds for those. so worked around that.
  • Loading branch information
karlheyes committed Mar 30, 2023
1 parent d1782ff commit e6ec840
Show file tree
Hide file tree
Showing 12 changed files with 318 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = conf doc web admin src
if WIN32
SUBDIRS += win32
if WINDOWS
SUBDIRS += windows
endif

BUILT_SOURCES = git_hash.h
Expand Down
123 changes: 123 additions & 0 deletions conf/i686-w64-mingw32.nsis.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!Nsis Installer Command Script
#
# This is an NSIS Installer Command Script generated automatically
# by the Fedora nsiswrapper program. For more information see:
#
# http://fedoraproject.org/wiki/MinGW
#
# To build an installer from the script you would normally do:
#
# makensis this_script
#
# which will generate the output file 'installer.exe' which is a Windows
# installer containing your program.

Name "Icecast KH"
OutFile "icecast-@PACKAGE_VERSION@_win32_setup.exe"

InstallDir "$ProgramFiles\Icecast KH"
InstallDirRegKey HKLM SOFTWARE\Icecast "Install_Dir"

LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"

ShowInstDetails hide
ShowUninstDetails hide

# Uncomment this to enable BZip2 compression, which results in
# slightly smaller files but uses more memory at install time.
SetCompressor bzip2

XPStyle on

;Version Information

VIProductVersion "2.4.0.20"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Icecast KH"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "2.4.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Karl Heyes @2000-2023"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Icecast KH streaming media server installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "@PACKAGE_VERSION@"

Page components
Page directory
Page instfiles

ComponentText "Select which optional components you want to install."

DirText "Please select the installation folder."

Function un.onInit
MessageBox MB_YESNO "Uninstall icecast KH from $INSTDIR ?" IDYES NoAbort
Abort ; causes uninstaller to quit.
NoAbort:
FunctionEnd

Section "Icecast Installation"
SectionIn RO

SetOutPath "$INSTDIR"
File /r "x32/*.dll"

WriteUninstaller "$INSTDIR\Uninstall.exe"

File "x32/icecast.exe"
SetOverwrite off
File "x32/icecast.xml"
SetOverwrite on

SetOutPath "$INSTDIR\logs"
File /r "x32/logs/"

SetOutPath "$INSTDIR\admin"
File /r "x32/admin/"

SetOutPath "$INSTDIR\doc"
File /r "x32/doc/"

SetOutPath "$INSTDIR\web"
File /r "x32/web/"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH" \
"DisplayName" "Icecast KH"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
SectionEnd

Section "Install Service"
SetOutPath "$INSTDIR"
ExecWait '"$INSTDIR\icecast.exe" "install" "$INSTDIR"'
SectionEnd

Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Icecast KH"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Icecast KH\Edit Configuration.lnk" "notepad.exe" "$INSTDIR\icecast.xml"
CreateShortCut "$SMPROGRAMS\Icecast KH\Uninstall Icecast.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Icecast KH\Run Icecast.lnk" "$INSTDIR\icecast.exe" '-c "$INSTDIR\icecast.xml"'
SectionEnd

Section "Desktop Icons"
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\Icecast.lnk" "$INSTDIR\icecast.exe" '-c "$INSTDIR\icecast.xml"'
SectionEnd

Section "Uninstall"
ExecWait '"$INSTDIR\icecast.exe" "remove"'
Delete $INSTDIR\Uninstall.exe
Delete /rebootok "$DESKTOP\Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Run Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Uninstall Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Edit Configuration.lnk"
RMDir "$SMPROGRAMS\Icecast KH"

RMDir /r "$INSTDIR\web"
RMDir /r "$INSTDIR\doc"
RMDir /r "$INSTDIR\admin"

Delete /rebootok "$INSTDIR\icecast.exe"

Delete /rebootok "$INSTDIR\*.dll"

RMDir "$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH"
SectionEnd
123 changes: 123 additions & 0 deletions conf/x86_64-w64-mingw32.nsis.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!Nsis Installer Command Script
#
# This is an NSIS Installer Command Script generated automatically
# by the Fedora nsiswrapper program. For more information see:
#
# http://fedoraproject.org/wiki/MinGW
#
# To build an installer from the script you would normally do:
#
# makensis this_script
#
# which will generate the output file 'installer.exe' which is a Windows
# installer containing your program.

Name "Icecast KH"
OutFile "icecast-@PACKAGE_VERSION@_win64_setup.exe"

InstallDir "$ProgramFiles64\Icecast KH"
InstallDirRegKey HKLM SOFTWARE\Icecast "Install_Dir"

LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"

ShowInstDetails hide
ShowUninstDetails hide

# Uncomment this to enable BZip2 compression, which results in
# slightly smaller files but uses more memory at install time.
SetCompressor bzip2

XPStyle on

;Version Information

VIProductVersion "2.4.0.20"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Icecast KH"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "2.4.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Karl Heyes @2000-2023"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Icecast KH streaming media server installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "@PACKAGE_VERSION@"

Page components
Page directory
Page instfiles

ComponentText "Select which optional components you want to install."

DirText "Please select the installation folder."

Function un.onInit
MessageBox MB_YESNO "Uninstall icecast KH from $INSTDIR ?" IDYES NoAbort
Abort ; causes uninstaller to quit.
NoAbort:
FunctionEnd

Section "Icecast Installation"
SectionIn RO

SetOutPath "$INSTDIR"
File /r "x64/*.dll"

WriteUninstaller "$INSTDIR\Uninstall.exe"

File "x64/icecast.exe"
SetOverwrite off
File "x64/icecast.xml"
SetOverwrite on

SetOutPath "$INSTDIR\logs"
File /r "x64/logs/"

SetOutPath "$INSTDIR\admin"
File /r "x64/admin/"

SetOutPath "$INSTDIR\doc"
File /r "x64/doc/"

SetOutPath "$INSTDIR\web"
File /r "x64/web/"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH" \
"DisplayName" "Icecast KH"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
SectionEnd

Section "Install Service"
SetOutPath "$INSTDIR"
ExecWait '"$INSTDIR\icecast.exe" "install" "$INSTDIR"'
SectionEnd

Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Icecast KH"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Icecast KH\Edit Configuration.lnk" "notepad.exe" "$INSTDIR\icecast.xml"
CreateShortCut "$SMPROGRAMS\Icecast KH\Uninstall Icecast.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Icecast KH\Run Icecast.lnk" "$INSTDIR\icecast.exe" '-c "$INSTDIR\icecast.xml"'
SectionEnd

Section "Desktop Icons"
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\Icecast.lnk" "$INSTDIR\icecast.exe" '-c "$INSTDIR\icecast.xml"'
SectionEnd

Section "Uninstall"
ExecWait '"$INSTDIR\icecast.exe" "remove"'
Delete $INSTDIR\Uninstall.exe
Delete /rebootok "$DESKTOP\Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Run Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Uninstall Icecast.lnk"
Delete /rebootok "$SMPROGRAMS\Icecast KH\Edit Configuration.lnk"
RMDir "$SMPROGRAMS\Icecast KH"

RMDir /r "$INSTDIR\web"
RMDir /r "$INSTDIR\doc"
RMDir /r "$INSTDIR\admin"

Delete /rebootok "$INSTDIR\icecast.exe"

Delete /rebootok "$INSTDIR\*.dll"

RMDir "$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Icecast KH"
SectionEnd
27 changes: 14 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else
PROFILE="-pg -g"
AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
fi
AM_CONDITIONAL([WIN32], [test x$host_os = xmingw32])
AM_CONDITIONAL([WINDOWS], [test x$host_os = xmingw32])
if test x$host_os = xmingw32; then
AC_DEFINE([_POSIX], 1, [Define to use C99 routines on MS])
fi
Expand Down Expand Up @@ -78,9 +78,10 @@ if test "x$ac_cv_func_fnmatch" != "xyes"
then
AC_CHECK_LIB(fnmatch, fnmatch, [XIPH_VAR_APPEND([XIPH_LIBS],["-lfnmatch"])],
[ AC_CHECK_LIB(iberty, fnmatch, [XIPH_VAR_APPEND([XIPH_LIBS],["-liberty"])],
[ICECAST_OPTIONAL="$ICECAST_OPTIONAL fnmatch.o"])])
[])])
AC_DEFINE(HAVE_FNMATCH_H, 1, [Define if using a local fnmatch])
fi
AM_CONDITIONAL([BUILD_FNMATCH], [test "x$ac_cv_func_fnmatch" != "xyes" ])
AC_SEARCH_LIBS(nanosleep, rt posix4,
AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
AC_SEARCH_LIBS(clock_gettime, rt posix4,
Expand All @@ -97,28 +98,31 @@ XIPH_PATH_VORBIS([
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$VORBIS_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$VORBIS_LIBS])
XIPH_VAR_APPEND([XIPH_LDFLAGS],[$VORBIS_LDFLAGS])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_vorbis.o"
build_vorbis="yes"
],
[AC_MSG_ERROR([must have Ogg Vorbis v1.0 or above installed])
])
AM_CONDITIONAL([BUILD_VORBIS], [test "x$build_vorbis" = "xyes" ])

XIPH_PATH_THEORA([
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$THEORA_CFLAGS])
XIPH_VAR_APPEND([XIPH_LDFLAGS],[$THEORA_LDFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$THEORA_LIBS])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_theora.o"
build_theora="yes"
],
[ AC_MSG_WARN([Theora disabled!])
])
AM_CONDITIONAL([BUILD_THEORA], [test "x$build_theora" = "xyes" ])

XIPH_PATH_SPEEX(
[ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$SPEEX_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$SPEEX_LIBS])
XIPH_VAR_APPEND([XIPH_LDFLAGS],[$SPEEX_LDFLAGS])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_speex.o"
build_speex="yes"
],
[ AC_MSG_WARN([Speex support disabled!])
])
AM_CONDITIONAL([BUILD_SPEEX], [test "x$build_speex" = "xyes" ])

AC_CHECK_LIB(kate, kate_decode_init,[have_kate=yes],[have_kate=no], -logg)
if test "x$have_kate" = "xyes"
Expand All @@ -131,7 +135,6 @@ then
fi
fi
dnl we still use format_kate as it doesn't need libkate to work
#ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_kate.o"

ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
XIPH_VAR_APPEND([XIPH_CFLAGS],[$PTHREAD_CFLAGS])
Expand All @@ -158,10 +161,11 @@ AC_ARG_ENABLE([yp],
if test "x$enable_yp" = "xyes" -a "x$enable_curl" = xyes
then
AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
ICECAST_OPTIONAL="$ICECAST_OPTIONAL yp.o"
else
AC_MSG_NOTICE([YP support disabled])
fi
AM_CONDITIONAL([BUILD_YP], [test "x$enable_yp" = "xyes" -a "x$enable_curl" = xyes])

XIPH_PATH_OPENSSL([
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$OPENSSL_CFLAGS])
XIPH_VAR_APPEND([XIPH_LDFLAGS],[$OPENSSL_LDFLAGS])
Expand All @@ -170,10 +174,7 @@ XIPH_PATH_OPENSSL([
[ AC_MSG_NOTICE([SSL disabled!])
])

if test "x$ac_cv_func_fork" = "xyes"
then
ICECAST_OPTIONAL="$ICECAST_OPTIONAL auth_cmd.o"
fi
AM_CONDITIONAL([BUILD_AUTHCMD], [ test "x$ac_cv_func_fork" = "xyes"])

dnl Make substitutions

Expand All @@ -189,7 +190,6 @@ AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
AC_SUBST(ICECAST_OPTIONAL)
AC_SUBST(HAVE_KATE)
AC_SUBST(KATE_LIBS)

Expand All @@ -207,6 +207,7 @@ AC_CONFIG_FILES([
web/Makefile
web/images/Makefile
admin/Makefile
win32/Makefile
windows/Makefile
])
AM_COND_IF([WINDOWS], [AC_CONFIG_FILES([icecast.nsis:conf/$host.nsis.in])])
AC_OUTPUT
Loading

0 comments on commit e6ec840

Please sign in to comment.