我有一个项目,使用automake来创建configure和所有相关的文件(我正在使用autoreconf命令来制作所有这些东西).因此,我正在尝试设置一些条件文件,以便在项目编译macOS(OS X),Windows或Linux时进行编译.但它失败了以下内容:
$ autoreconf -i ..
src/Makefile.am:30: error: LINUX does not appear in AM_CONDITIONAL
autoreconf: automake failed with exit status: 1
Run Code Online (Sandbox Code Playgroud)
包含错误的部分Makefile.am如下:
if OSX
butt_SOURCES += CurrentTrackOSX.h CurrentTrackOSX.m
endif
if LINUX
butt_SOURCES += currentTrack.h currentTrackLinux.cpp
endif
if WINDOWS
butt_SOURCES += currentTrack.h currentTrack.cpp
endif
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何检查操作系统是否为Linux?如果有可能,有没有更好的方法来检查automake中的操作系统?